Automated Code Development for PDE Solvers Using Large Language Models
Preprint
- 18 August 2025
- preprint
- Published by Springer Nature in Research Square
Abstract
Foundation models---large language models (LLMs) in particular---have become ubiquitous, shaping daily life and driving breakthroughs across science, engineering, and technology. Harnessing their broad cross-domain knowledge, text-processing, and reasoning abilities for software development, e.g., numerical libraries for solving partial differential equations (PDEs), is therefore attracting growing interest. Yet existing studies mainly automate case setup and execution for end users. We introduce LLM-PDEveloper, a zero-shot, multi-agent LLM framework that automates code development for PDE libraries, specifically targeting secondary developers. By translating mathematical and algorithmic descriptions directly into source code, LLM-PDEveloper generates new solvers/modules and adapts existing ones. This end-to-end math-to-code approach enables a self-augmenting pipeline that continuously expands the codebase of a library, extends its capacities, and broadens its scope. We demonstrate LLM-PDEveloper on three tasks: 1) build a solver for a new PDE, 2) implement new BCs for a given PDE, and 3) modify an existing solver to incorporate additional terms, achieving moderate success rates. Failures due to syntactic errors made by LLMs are analyzed and we propose effective fixes. We also identify the mechanisms underlying certain semantic errors, guiding future research.Keywords
All Related Versions
Funding Information
- Ministry of Education - Singapore (MOE-T2EP50221-0012)
This publication has 16 references indexed in Scilit:
- OpenFOAMGPT 2.0: End-to-end, trustworthy automation for computational fluid dynamicsInternational Journal of Heat and Fluid Flow, 2026
- Using large language models for parametric shape optimizationPhysics of Fluids, 2025
- Training microrobots to swim by a large language modelPhysical Review Applied, 2025
- Physics simulation capabilities of LLMsPhysica Scripta, 2024
- XLB: A differentiable massively parallel lattice Boltzmann library in PythonComputer Physics Communications, 2024
- A ChatGPT-MATLAB framework for numerical modeling in geotechnical engineering applicationsComputers and Geotechnics, 2024
- MechAgents: Large language model multi-agent collaborations can solve mechanics problems, generate new data, and integrate knowledgeExtreme Mechanics Letters, 2024
- Highly accurate protein structure prediction with AlphaFoldNature, 2021
- Lattice Boltzmann model for high-order nonlinear partial differential equationsPhysical Review E, 2018
- An immersed boundary method based on discrete stream function formulation for two- and three-dimensional incompressible flowsJournal of Computational Physics, 2011