arXiv:2610.10320physics.chem-phOct 2026

Manuscript Offprint

arXiv:2610.10320

LLM-Assisted Generation of Transparent, Open-Source Multiphysics Models of Electrochemical Devices

Sebastian Castro, Maya F. Schuchert, Spencer A. McCluskey, Eric W. Lees, Justin C. Bui

Abstract

Multiphysics continuum models are powerful tools for studying electrochemical devices, enabling in silico reactor design and resolution of local pH, potential, and concentration fields that govern device performance but are difficult to measure experimentally. However, constructing such models requires substantial numerical expertise or reliance on proprietary software. Here, we show that frontier large language model agents can remove this implementation burden while keeping the underlying physics under researcher control. Using one-dimensional electrochemical CO2CO_{2} reduction to CO in a porous gas diffusion electrode as a test case, we develop a machine-readable, human-specified modeling harness containing governing equations, parameters, numerical methods, logical build stages, and human-verifiable checkpoints. From this specification, the agent reproducibly constructs complete multiphysics models in open-source Julia. Independently built models, including fully autonomous agent-built models, agree with an equivalent COMSOL implementation to within 0.7% of the peak CO partial current density, and with one another to within 0.04%. Systematically planted errors demonstrate the importance of explicit specifications for reproducibility and reveal the agent's capabilities and limitations in debugging model physics. This framework establishes a more transparent approach to multiphysics modeling in which physical descriptions and governing equations, rather than specialized code, become the primary inputs for computational model development.

Bui ab NYU

Electrochemical reactors sit at the center of the energy transition: electrolyzers use renewable electricity to drive the synthesis of fuels and chemicals, while fuel cells and batteries store that renewable electricity in chemical form 1,2^{1,2}. Each of these devices is a coupled, multi-component system for which performance is an emergent property of the interactions between material components (electrodes, membranes, and electrolytes) and operating conditions (temperature, pressure, flow rate). The spatially heterogeneous pH, potential, and reactant concentration profiles within these reactors directly govern selectivity, throughput, and durability, but these local chemical environments are largely inaccessible to direct measurement under realistic operating conditions 3,4^{3,4}. Consequently, rational reactor design and optimization are difficult to achieve through experimentation alone.

Continuum modeling can accelerate the optimization of electrochemical devices by translating their coupled physics (i.e., multiphysics) into a system of governing equations that can be solved numerically 5,6^{5,6}. Conservation equations for mass, charge, and momentum, expressed with models of ion transport, electrochemical kinetics, and fluid flow in porous media, capture the relationship between local chemical environments and experimental observables. For instance, multiphysics models can resolve how competing reactions distribute current across an electrode 7^{7}, how membrane chemistry impacts voltage losses 8^{8}, and how spectator ions tune reaction selectivity 9^{9}. Once parameterized and validated against experimental data, they also enable large design spaces to be explored at a fraction of the cost of experiments.

The history of electrochemical continuum modeling is a history of shifting barriers. In the 1960s, building a model required simultaneous mastery of the physics of electrochemistry and the numerical methods needed to solve the resulting stiff, coupled partial differential equations (PDEs), often using Fortran 10,11^{10,11}, which confined serious modeling to a small community. Commercial simulation platforms, principally COMSOL Multiphysics, placed those algorithms behind a graphical interface and a proprietary solver 12^{12}, allowing practitioners to focus more effort on defining the physical equations and less on implementation. Physical intuition remained essential to choosing and evaluating the governing equations, constitutive relationships, and boundary conditions; the numerical machinery, however, receded into the background, and with it direct engagement with how models are solved. When a solver fails, diagnosing whether the failure originates from the governing equations, discretization, or numerical implementation can therefore be difficult. Generic messages such as “maximum iterations reached” rarely indicate which equation, term, or mesh element is responsible, leaving debugging to heuristic experience with mesh refinement, relaxation factors, and initial guesses. Commercial solvers are also less accessible and more expensive than open-source alternatives 13,14^{13,14}, and proprietary formats complicate reproducibility, as model files are often tied to specific software versions and inaccessible to collaborators without licenses 15^{15}.

We contend that the emergence of large language model (LLM) agents is the next chapter in electrochemical continuum modeling. A researcher with deep domain knowledge but limited numerical training can instruct an artificial intelligence (AI) agent to implement a fully open-source continuum model in which every equation, solver step, and line of code is visible, modifiable, and explainable. The agent does not replace the physics expertise of the researcher but rather replaces the implementation burden. The researcher must still specify the

Build ab NYU

governing equations precisely, anticipate which physical mechanisms are relevant, design staged verification checks that catch errors before they propagate, and recognize when a converged solution is unphysical. Domain knowledge remains critical; what changes is that the auxiliary technical burden shifts from Fortran subroutines and COMSOL debugging toward specification and verification. Because the resulting model is open-source and every step of its numerics is inspectable, the practical barrier to continuum multiphysics modeling becomes the ability to state the physics precisely rather than access to a solver license or extensive training in numerical methods.

Agentic AI has already shown potential for integration into the scientific process, including autonomy in designing experiments, executing code, and discovering new pathways for chemical synthesis 16,17^{16,17}. LLM agents have been shown to autonomously write, execute, and debug finite-element code for continuum mechanics problems 18^{18}, collaborate as multi-agent teams across a range of physics domains 19,20^{19,20}, and generate PDE solvers that match expert-written code on benchmarks including compressible Navier–Stokes 21^{21}. Nonetheless, this work has largely targeted weakly coupled or single-physics problems, leaving strongly coupled multiphysics systems comparatively unexplored. A recent multi-agent framework, for instance, runs finite-element simulations from natural language by retrieving domain knowledge from a curated knowledge graph and verifying the solver against closed-form analytical solutions 22^{22}. Neither approach transfers directly here: a nonlinear, strongly coupled system of this kind generally possesses no analytical reference solution, while its governing physics must be specified through researcher-authored modeling choices specific to the simulated device rather than retrieved as a fixed set of facts. Electrochemical reactors are a particularly demanding case, with acid–base equilibria, interfacial kinetics, migration, and multicomponent gas transport entering one another's source terms and transport coefficients. The equations must be solved simultaneously as a single nonlinear system, with buffer equilibria that relax orders of magnitude faster than species diffuse, making that system stiff and difficult to solve robustly.

To demonstrate the validity of our approach, we developed a detailed, machine-readable implementation guide for a one-dimensional (1D) continuum model (Fig. 1) of silver-catalyzed CO2CO_{2} reduction ( CO2RCO_{2}R) in a gas diffusion electrode (GDE). This implementation guide served as a harness that directed the AI agent through construction of the multiphysics model in open-source Julia 23^{23}. Researchers of varying experience levels used the guide to instruct AI agents to build the model, without writing a line of code themselves. Because the complex numerical system has no analytical solution, validation of the approach was demonstrated against an equivalent model developed in COMSOL. Reproducibility was assessed by comparing independently generated model implementations across users. Beyond accuracy and reproducibility, the agentic workflow provides a transparent interface to the numerical implementation: the agent that built the code can inspect the Jacobian, trace convergence failures, and explain the numerical behavior in the language of physics directly to a human operator. Collectively, this framework establishes an approach to multiphysics modeling in which human-specified equation sets and natural-language instructions, rather than specialized code and numerical implementations, become the primary inputs for model development. In this paradigm, the specification harness—rather than any individual implementation—becomes the central scientific artifact that other practitioners can audit, reproduce, modify, and build upon.

Bui ab NYU

(a)

Figure

(b)

Fig. 1. (a) Schematic of the agentic multiphysics modeling workflow employed here with a human-in-the-loop. (b) Schematic of the CO2CO_{2} reduction porous electrode model case study, along with the 5-stage implementation approach in Julia, with the primary physics additions/changes included in each stage. Elyte, electrolyte; CL, catalyst layer; GDL, gas diffusion layer; DOFs, degrees of freedom; BC, boundary condition; HER, hydrogen evolution reaction.

Results