Simulation Code Generation for Fluid Systems using Large Language Models: Benchmarking Models and Prompting Strategies
Jan Marius Stürmer, Jascha Knack, Tobias Koch, Andreas Weinmann
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.
Create a lesson
Related papers
Benchmarking Frontier Large Language Models Against Official Crash Database Coding Using Police Crash Narratives
Shared title terminology · Sudhir Bharati, Rajendra K C Khatri, Sudip Bharati
OceanCoder: A Verification-Guided Large Language Model for Automated Simulation Modelling in Ocean Engineering
Shared title terminology · Can Xue, Changhong He, Ziyi Sun et al.
Quality-Diversity Red-Teaming: Automated Generation of High-Quality and Diverse Attackers for Large Language Models
Shared title terminology · Ren-Jian Wang, Ke Xue, Zeyu Qin et al.
Do Prompt-Elicited Trajectories Reflect Training-Time Reward Hacking? A Systematic Study on Monitoring Training-Time Reward Hacking in Code Generation
Shared title terminology · Lichen Li, Hengguang Zhou, Yijun Liang et al.
HyperODE: Zero-Shot Surrogate for Simulation and Inference of Dynamical Systems
Shared title terminology · Ajitesh Srivastava
Unleashing the Potential of Large Language Models: A Blueprint for Real-Time, Enterprise-Ready Deployments
Shared title terminology · Muhammad Faizan Raza, Shuo, Yang et al.