From Natural-Language to Simulation: An Intermediate Representation for Computational Fluid Dynamics
Abstract
Large language models (LLMs) have recently shown promise for assisting with scientific programming from natural-language descriptions. However, direct free-form code generation remains unreliable for complex applications that impose strict semantic, structural, or numerical constraints, particularly in scientific simulation settings. In such environments, silent errors, implicit assumptions, and non-deterministic behavior limit the reliability of language-driven execution. In this work, we introduce a natural-language-to-intermediate-representation (IR) compilation framework that reframes language-driven simulation setup as a deterministic compilation problem rather than a code generation task. Instead of emitting executable code, the language model produces a structured IR that encodes high-level intent, which is then explicitly validated and deterministically compiled into backend-specific configurations. We demonstrate the framework using computational fluid dynamics as a representative case study, instantiating the IR and compiler for a two-dimensional flow solver. The system supports complex geometries, parametric obstacle placement, boundary condition synthesis, and time-scheduled actuation from free-form natural-language, while enforcing validation and reproducibility prior to execution. Although evaluated in the context of simulation setup, the proposed architecture reflects a broader design pattern for integrating language models with systems that impose strict semantic or structural constraints on execution. By introducing an explicit intermediate representation and compiler boundary between language understanding and execution, the framework provides a principled basis for reliable and auditable workflows in such settings.
Fields of Study & Subjects
Software Engineering Research
Scientific Computing and Data Management
Natural Language Processing Techniques
Publication details
- Publication date
- 29 January 2026
- Document type
- Preprint