cs.LGJul 31, 2026

Simulation Code Generation for Fluid Systems using Large Language Models: Benchmarking Models and Prompting Strategies

Authors: Jan Marius StürmerJascha KnackTobias KochAndreas Weinmann

Organizations: German Aerospace Centre (DLR), Institute for the Protection of Terrestrial Infrastructures, Rathausallee 12, 53757, Sankt Augustin, Germany · Algorithms for Computer Vision, Imaging and Data Analysis, Technische Hochschule Würzburg-Schweinfurt, Ignaz-Schön-Straße 11, Schweinfurt, 97421, Germany

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 graph representation of fluid system models into executable code for two widely adopted simulation environments: the Python library WNTR and the Modelica Standard Library. We conduct a systematic comparison of ten state-of-the-art LLMs and six prompting strategies that differ in the contextual information supplied (e.g., code or documentation). For each configuration we assess the generated code using a suite of software-quality metrics and we validate the functional fidelity of the resulting simulation models by reproducing benchmark fluid system scenarios. Our findings offer concrete guidance for researchers and engineers seeking to integrate LLM-driven code synthesis into model-based design pipelines. While the best-performing configurations achieve acceptable syntactic quality, we observe substantial gaps remain in simulation fidelity.

Explore similar work

CardsList
  1. Benchmarking LLMs for Verilog Design Flows

    Jul 23, 2026Angshuman Chakravertty, Rahul Koshti, Buddhi Prakash Sharma +1VhdlHigh-Level Synthesis