LLMs Generate Simulation Code for Fluid Systems: Benchmarking Performance

Jan Marius St\"urmer, Jascha Knack, Tobias Koch, Andreas Weinmann· August 3, 2026 View original

Key takeaways

  • LLMs can generate syntactically correct simulation code for fluid systems from natural language.
  • Prompting strategies significantly influence the quality of generated code.
  • While syntactic quality is achievable, significant gaps remain in simulation fidelity.
  • Integrating LLM-driven code synthesis can accelerate model-based design pipelines.

Who benefits

EngineeringManufacturingUtilitiesAerospaceAutomotive

Summary

This study explores using large language models to translate fluid system models from a graph representation into executable code for WNTR and Modelica. It benchmarks ten LLMs and six prompting strategies, assessing code quality and simulation fidelity.

Researchers investigated the capability of large language models (LLMs) to automate the generation of simulation code for complex fluid systems. The goal was to convert a neutral graph representation of these systems into functional code compatible with established simulation environments like the Python library WNTR and the Modelica Standard Library. The study conducted a comprehensive comparison, evaluating ten different state-of-the-art LLMs alongside six distinct prompting strategies. These strategies varied in the amount and type of contextual information provided to the models, such as code examples or documentation snippets. The generated code was then assessed based on standard software quality metrics, and the functional accuracy of the resulting simulation models was validated by replicating benchmark fluid system scenarios. While the top-performing LLM configurations achieved satisfactory syntactic code quality, the research highlighted significant remaining challenges in ensuring high simulation fidelity. The findings offer practical guidance for engineers and researchers looking to integrate LLM-driven code synthesis into their model-based design workflows, emphasizing areas where further improvement is needed.

Why it matters

Professionals in engineering and design can leverage LLMs to accelerate the creation of simulation models, potentially reducing manual coding effort and speeding up design iterations for complex systems.

How to implement this in your domain

  1. 1Experiment with various LLMs and prompting techniques to generate initial simulation code from system specifications.
  2. 2Integrate LLM-generated code into existing simulation environments like WNTR or Modelica for rapid prototyping.
  3. 3Develop robust validation pipelines to rigorously test the functional fidelity of LLM-generated simulation models.
  4. 4Focus on refining prompts with specific documentation or code examples to improve syntactic quality and reduce errors.
  5. 5Identify specific simulation fidelity gaps and implement human-in-the-loop corrections or post-processing steps.

Original post by Jan Marius St\"urmer, Jascha Knack, Tobias Koch, Andreas Weinmann

"arXiv:2607.29389v1 Announce Type: new Abstract: Large language models (LLMs) have demonstrated a strong ability to generate syntactically correct code from natural-language specifications. In this study, we explore how LLMs can be harnessed to automatically translate a neutral gr…"

View on X

Originally posted by Jan Marius St\"urmer, Jascha Knack, Tobias Koch, Andreas Weinmann on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses