Paper deep dive
Agentic Scientific Simulation: Execution-Grounded Model Construction and Reconstruction
Knut-Andreas Lie, Olav MĂžyner, Elling Svee, Jakob Torben
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 91%
Last extracted: 7/20/2026, 6:47:34 AM
Summary
This paper introduces JutulGPT, an agentic framework for scientific simulation that uses Large Language Models (LLMs) to construct and validate physics-based simulation models. The system employs an 'interpret-act-validate' loop where an LLM agent mediates between natural language descriptions and executable Julia code using the JutulDarcy simulator. The simulator acts as an authoritative arbiter of physical validity, detecting underspecified modeling choices and resolving ambiguities through autonomous assumption logging or user queries. The study highlights that while this approach ensures physical consistency, tacit defaults in simulators can obscure reproducibility, necessitating explicit reconstruction audits.
Entities (7)
Relation Signals (6)
JutulGPT â builton â JutulDarcy
confidence 95% · We present JutulGPT, a reference implementation built on the fully differentiable Julia-based reservoir simulator JutulDarcy.
JutulGPT â implements â Interpret-Act-Validate Loop
confidence 93% · The framework operationalizes the interpretâactâvalidate loop and provides a controlled environment for studying ambiguity resolution...
JutulDarcy â partof â Jutul
confidence 90% · JutulDarcy implements single-phase, multiphase, and compositional flow in porous media... The same abstractions support multiple domain-specific simulators.
JutulGPT â developedby â SINTEF Digital
confidence 88% · KnutâAndreas Lie 1 , Olav MĂžyner 1 ... 1 SINTEF Digital, Oslo, Norway... github.com/SINTEF-agentlab/JutulGPT
LLM Agent â resolves â Underspecified Modeling Choices
confidence 87% · Underspecified modelling choices are detected explicitly and resolved either autonomously... or through targeted user queries.
LLM Agent â mediates â Natural Language Description
confidence 85% · The agent mediates between high-level modelling intent and executable specifications...
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:LLM agents are increasingly used for code generation, but physics-based simulation poses a deeper challenge: natural-language descriptions of simulation models are inherently underspecified, and different admissible resolutions of implicit choices produce physically valid but scientifically distinct configurations. Without explicit detection and resolution of these ambiguities, neither the correctness of the result nor its reproducibility from the original description can be assured. This paper investigates agentic scientific simulation, where model construction is organized as an execution-grounded interpret-act-validate loop and the simulator serves as the authoritative arbiter of physical validity rather than merely a runtime. We present JutulGPT, a reference implementation built on the fully differentiable Julia-based reservoir simulator JutulDarcy. The agent combines structured retrieval of documentation and examples with code synthesis, static analysis, execution, and systematic interpretation of solver diagnostics. Underspecified modelling choices are detected explicitly and resolved either autonomously (with logged assumptions) or through targeted user queries. The results demonstrate that agent-mediated model construction can be grounded in simulator validation, while also revealing a structural limitation: choices resolved tacitly through simulator defaults are invisible to the assumption log and to any downstream representation. A secondary experiment with autonomous reconstruction of a reference model from progressively abstract textual descriptions shows that reconstruction variability exposes latent degrees of freedom in simulation descriptions and provides a practical methodology for auditing reproducibility. All code, prompts, and agent logs are publicly available.
Tags
Links
- Source: https://arxiv.org/abs/2603.00214v1
- Canonical: https://arxiv.org/abs/2603.00214v1
Trouble viewing inline? Open PDF directly â
Full Text
77,579 characters extracted from source content.
Expand or collapse full text
Agentic Scientific Simulation: Execution-Grounded Model Construction and Reconstruction KnutâAndreas Lie 1 , Olav MĂžyner 1 , Elling Svee 2 , and Jakob Torben 1 1 SINTEF Digital, Oslo, Norway 2 Department of Mathematical Sciences, NTNU, Trondheim, Norway We ask whether an LLM agent can serve as a genuine scientific assistant for physics-based simulation: given a natural-language description of a model, can it produce an executable, physically valid simulation configuration that faithfully represents the userâs intent, navi- gating API contracts, unit conventions, and global constraints in the way a knowledgeable research assistant would? The challenge is not merely generating code that runs or even satisfies physical consistency tests. Natural-language descriptions of simulation models are inherently underspecified, and different admissible resolutions of implicit choices produce physically valid but scientifically distinct configurations. Without explicit detection and res- olution of these ambiguities, neither the correctness of the result nor its reproducibility from the original description can be assured. This paper investigates agentic scientific simulation, where model construction is organized as an execution-grounded interpretâactâvalidate loop, and the simulator serves as the au- thoritative arbiter of physical validity rather than merely a runtime. We present JutulGPT, a reference implementation built on the fully differentiable Julia-based reservoir simulator JutulDarcy. The agent combines structured retrieval of documentation and examples with code synthesis, static analysis, code execution, and systematic interpretation of solver di- agnostics. Underspecified modelling choices are detected explicitly and resolved either au- tonomously (with logged assumptions) or through targeted user queries. The results demonstrate that agent-mediated model construction can be grounded in sim- ulator validation while also revealing a structural limitation: choices resolved tacitly through simulator defaults are invisible to the assumption log and therefore to any downstream rep- resentation. A secondary experiment, autonomous reconstruction of a reference model from progressively abstract textual descriptions, shows that reconstruction variability exposes la- tent degrees of freedom in simulation descriptions and provides a practical methodology for auditing reproducibility. All code, prompts, and agent logs are publicly available. 1 Introduction: Execution-Grounded Agents in Scientific Simulation Recent progress in large language models (LLMs) and agentic orchestration has enabled tool-using code assistants and long-horizon coding agents that can iteratively generate, execute, and repair nontrivial 1 arXiv:2603.00214v1 [cs.SE] 27 Feb 2026 software artifacts. These systems can inspect entire repositories, modify files, run commands, and refine implementations through repeated interaction, substantially reducing the effort required to prototype and explore simulation scripts. Two paradigms have emerged for LLM-assisted software development [19]. Vibe coding emphasizes intuitive, human-in-the-loop interaction: the user states intent conversationally and the model generates code, with successful execution as the primary correctness criterion. Agentic coding goes further, enabling autonomous multi-step planning, tool use, and iterative self-repair with minimal human intervention per cycle. Capable agentic systems can already construct meaningful correctness tests autonomously, such as conservation checks and patch tests for physics-based components, and iterate until these are satisfied. For scientific simulation, however, a deeper challenge remains: natural-language descriptions of simulation models are inherently underspecified, and different admissible resolutions of implicit choices produce physically valid but scientifically distinct configurations. The question of whether a completed simulation faithfully represents the userâs intent, and whether it can be reproduced from its description, is not resolved by execution success alone. Translating a conceptual description of a physical scenario into an executable simulation model is thus not merely a programming exercise. It involves selecting governing equations, specifying constitutive relations, defining boundary and initial conditions, choosing discretizations and solver settings, and resolving underspecified modeling assumptions. Even within modern modular simulator frameworks, this process typically proceeds through iterative refinement, inspection of solver diagnostics, and clarification of implicit choices. These considerations motivate the emerging direction of agentic scientific simulation. The key insight is that a physics-based simulator, by virtue of its internal enforcement of governing equations, constitu- tive consistency, and solver convergence, is already equipped to act as an authoritative arbiter of physical validity. Embedding an LLM within a structured interpretâactâvalidate loop around such a simulator allows this enforcement capability to be exploited directly: the agent mediates between high-level mod- elling intent and executable specifications, while the simulator determines what is physically admissible. In this work, we explore this direction through a concrete reference implementation, JutulGPT, built on top of the fully differentiable Julia-based simulator JutulDarcy [12]. The objective is not to demonstrate LLMsâ capability of writing simulation code, but to investigate how an agent can mediate scientific model construction under underspecification, solver feedback, and reproducibility requirements. To assess this perspective systematically, we evaluate the framework along four dimensions. First, we examine semantic navigation of simulator documentation: whether the agent can retrieve, organize, and synthesize distributed documentation into coherent representations of available functionality. Second, we study execution-grounded model construction and repair: whether the agent can converge to executable, physically consistent models through iterative interaction with simulator execution and solver diagnos- tics. Third, we analyze structured ambiguity detection and resolution, investigating how underspecified modeling choices are surfaced, logged, and resolved through the interpretâactâvalidate loop. Fourth, we study reconstruction fidelity under representational compression, where executable models are regener- ated from progressively abstract textual descriptions. Together, these probes are intended to clarify both the capabilities and the limitations of execution-grounded agentic workflows in scientific simulation. Recent conceptual work has emphasized artificial intelligence (AI) systems as scientific collaborators rather than passive tools, integrating reasoning, execution, and interpretation in closed loops that mirror aspects of scientific practice [21], ranging from autonomous experiment execution and validation [17] to end-to-end scientific discovery including manuscript authorship [23]. In parallel, benchmark efforts such as SciCode [20] have highlighted both the potential and the limitations of LLMs in generating scientific code, underscoring the importance of correctness, interpretability, and domain grounding. 2 A growing number of domain-specific systems couple large language models directly to established solver ecosystems. For multiphysics problems based on MOOSE, MooseAgent [26] combines an LLM with structured retrieval of annotated input files and iterative verification against solver feedback. In computational mechanics and finite-element modeling, systems such as AutoFEA [6], MechAgents [13], and FeaGPT [18] demonstrate that conversational or multi-agent workflows can coordinate meshing, boundary-condition specification, solver execution, and error correction. Similar developments have emerged in computational fluid dynamics, where OpenFOAM-based agents integrate retrieval-augmented generation with solver execution to support interactive case construction and modification [16, 2, 1, 25, 22], with recent systems additionally accepting multimodal inputs that parse geometry directly from images [24]. Dataset-oriented efforts such as NL2FOAM [4] and interactive systems such as ChatCFD [5] further illustrate the feasibility of mapping natural-language descriptions to executable solver config- urations. Li et al. [10] target PDE solver generation more broadly, using LLMs to produce numerical method code directly from problem statements. These systems demonstrate that LLMs can be embedded in end-to-end simulation workflows when tightly coupled to well-documented simulator architectures. However, much of the existing work empha- sizes translation from text to solver input or iterative correction of syntactic and configuration errors. The present work differs in focusing explicitly on execution-grounded scientific model construction, where ambiguity detection, assumption logging, and simulator-enforced physical validation are treated as key components of the workflow. Rather than centering on the generation of valid input files, we investi- gate how the interpretâactâvalidate loop can mediate underspecified modeling tasks and how executable simulator state relates to its textual representations. 2 Simulation Workflows and Agentic Interfaces Modern scientific simulators typically expose modular abstractions for grids, discretizations, physical properties, and linear and nonlinear solvers, enabling complex models to be assembled from reusable components. Nevertheless, translating a conceptual modeling objective into a consistent and executable solver configuration remains a nontrivial task. An agentic interface supports this process by mediating between high-level modeling intent and simulator specifications through an execution-grounded loop of construction, execution, and revision. Success still depends on aligning governing equations, constitu- tive closures, boundary and initial conditions, and solver controls in a manner that is both physically admissible and numerically stable. Many multiphysics applications involve coupled physical mechanisms operating across scales. Ex- amples relevant to the present work include subsurface energy systems, which couple flow and heat transport, and electrochemical models, which couple ionic transport, charge conservation, and thermal effects. These examples reflect domains represented within the Jutul ecosystem and the authorsâ re- search context, but the underlying challenges are common to PDE-based simulation frameworks more broadly. In such settings, model construction involves selecting and assembling compatible balance laws and closure relations while respecting solver-specific constraints. An agentic interface operating in this environment must therefore reason not only about syntax but also about dependencies among physical components and admissible combinations of constitutive models. Embedding an agent within a scientific simulation workflow introduces additional requirements. Gen- erated configurations must be traceable and versioned to ensure reproducibility. Numerical stability and convergence behavior must be respected, and solver diagnostics must be interpreted in a structured man- ner. Constitutive assumptions and default closures must be surfaced explicitly to avoid silent changes in the governing model. These constraints motivate architectures in which the simulator enforces physical and numerical admissibility while the agent mediates interpretation and refinement. 3 3 The Jutul Ecosystem Jutul 1 is an open, modular framework for composable and fully differentiable simulation of systems governed by partial differential equations (PDEs). It provides the computational substrate on which JutulGPT operates. The framework is designed around explicit abstractions for balance laws, consti- tutive closures, discretization operators, and nonlinear solvers, enabling models to be assembled from interoperable components while preserving transparency of the resulting executable state. Jutul is designed from the ground up around equations expressed in residual form, which allows auto- matic differentiation to permeate the entire computational stack. This serves two purposes. First, it au- tomates linearisation and Jacobian assembly for the Newton solver, eliminating the need for hand-coded derivatives of physical operators. Second, and more distinctively, it enables computation of sensitivities with respect to essentially any parameter in the systemânot only physical model parameters such as constitutive closure coefficients, but also parameters that govern the construction of the numerical model itself, such as grid spacing and timestep sizes. The latter capability goes substantially beyond what is available in most simulators, where discretisation parameters are treated as fixed infrastructure outside the reach of the differentiation machinery. 3.1 Balanceâclosure formulation Across all branches of the ecosystem, models are expressed as coupled systems of balance equations and closure relations. In continuous form, âA(U) ât +â· F(U,W,x,t) = Q(U,W,x,t),(1) C(U,W,x,t;Ξ) = 0,(2) where U denotes primary state variables, W secondary variables and parameters, A accumulation terms, F fluxes, Q sources, and C constitutive or algebraic closure relations parameterized by Ξ. This decom- position provides a common structural template for diverse physical models while keeping balance laws and constitutive assumptions explicitly separated. In practice, these equations are discretized using finite-volume methods in space and implicit time integration. The resulting nonlinear residual equations are assembled from modular balance and closure contributions and solved using Newton-type methods with sparse linear solvers. Because each physical mechanism contributes explicitly to the residual and Jacobian, new processes or constitutive models can be introduced without restructuring the surrounding solver infrastructure. 3.2 Domain branches in Jutul The same abstractions support multiple domain-specific simulators. JutulDarcy implements single- phase, multiphase, and compositional flow in porous media. Fimbul extends this framework to geother- mal applications that include energy conservation [7]. BattMo targets electrochemical systems, coupling ionic transport and charge conservation [3]. VOCSim and Mocca address gas emissions and adsorption pro- cesses, respectively. Although these branches target different application domains, they share common data structures, discretization operators, solver strategies, and differentiation mechanisms. 3.3 Properties relevant to agentic mediation Several characteristics of Jutul are particularly relevant for execution-grounded agentic interaction. The framework exposes explicit type structures, well-defined constructor interfaces, and structured error 1 Source code available at github.com/sintefmath/Jutul.jl 4 messages. All components are open source and documented, allowing documentation, docstrings, and example scripts to be indexed and retrieved systematically. Because balance laws and closures are represented explicitly in code, constitutive assumptions and parameterizations are inspectable rather than implicit in opaque input formats. In addition, the residual-based architecture and structured diagnostics enable precise interpretation of runtime failures. Constructor mismatches, inconsistent parameterizations, and convergence issues are surfaced through explicit error objects and solver logs, which can be parsed and fed back into the interpretâactâvalidate loop. Together, these properties make Jutul a suitable substrate for studying execution-grounded agentic workflows: the simulator enforces physical and numerical admissibility, while its modular and intro- spectable design allows the agent to retrieve, construct, execute, and revise models in a controlled and reproducible manner. 4 The JutulGPT Framework To investigate execution-grounded agentic model construction in a concrete setting, we implemented JutulGPT, a reference implementation that couples an LLM to JutulDarcy. Full source code, prompts, and example logs are publicly available at github.com/SINTEF-agentlab/JutulGPT. The framework operationalizes the interpretâactâvalidate loop and provides a controlled environment for studying am- biguity resolution, solver-mediated refinement, and reconstruction under underspecification. 4.1 Execution-grounded workflow At a high level, JutulGPT organizes model construction as an iterative loop consisting of three phases: âą Interpret: Parse user intent, identify underspecified modeling choices, and determine required simulator components. âą Act: Retrieve relevant documentation and examples, generate or modify Julia code, and perform static checks. âą Validate: Execute the generated code in a local Julia environment, analyze solver diagnostics and runtime errors, and determine whether physical and numerical admissibility criteria are satisfied. If validation fails, the agent revises the implementation and re-enters the loop. Ambiguities detected during interpretation are either resolved autonomously (with explicit logging of assumptions) or esca- lated to the user through targeted clarification queries. Termination occurs when the simulator runs to completion and no outstanding ambiguity remains. Because JutulDarcy enforces conservation toler- ances, closure consistency, and solver convergence internally, a completed run is a simulator-grounded validation: the simulation would not have run to completion had these conditions not been met. This is a strictly stronger criterion than the absence of a runtime error. This structure distinguishes the workflow from one-shot text-to-code generation and from generic coding assistants that optimize primarily for syntactic correctness. The simulator acts as an authoritative truth engine: execution feedback, convergence diagnostics, and error messages directly constrain the space of admissible implementations. 4.2 System architecture The JutulGPT framework comprises three interacting layers: âą The conversational layer, which manages dialogue state, intent parsing, and ambiguity detection. 5 Interpret Act Validate User intent (natural language) i Interpret & plan parse intent; detect ambiguity Í Intent clear? Query user request clarification Ë Reason plan implementation Í Retrieve docs + examples Ï» Implement code generate or edit Ë Static checks lint, type/syntax/functions Ï» Valid? Execute simulator run + diagnostics Ï» Valid? Results present/analyze Ë Agent log all steps and output logged for audit Æ yes yes yes no no no Figure 1: Typical iterative interpretâactâvalidate loop used by JutulGPT. The agent incrementally in- terprets user intent, detects ambiguities, and resolves them either autonomously (with explicit assumption logging) or via targeted user queries. Code generation is grounded in retrieved doc- umentation and validated through static analysis, execution and simulator diagnostics, with failures triggering revision cycles. The loop terminates when the simulator runs to completion; an event that constitutes a validity certificate by virtue of JutulDarcyâs internal enforcement of conservation tolerances, closure consistency, and solver convergence. âą The tool layer, which exposes structured capabilities for documentation retrieval, code analysis, file manipulation, and execution. âą The runtime layer, which interfaces directly with JutulDarcy, executes generated scripts, and returns structured diagnostics. Communication between these layers implements the loop described above. Retrieval operations are grounded in indexed simulator documentation, docstrings, and curated example scripts. Generated code is first subjected to static analysis before execution in a local Julia environment. Runtime errors and solver diagnostics are captured, parsed, and returned to the agent, enabling targeted revision rather than repeated trial-and-error re-generation. All prompts, tool invocations, generated code fragments, and execution outputs are logged. This logging discipline supports traceability of assumptions and reproducibility of the modeling workflow. Figure 1 illustrates the operational behavior of the framework as an iterative cycle. The interpret phase extracts modeling intent and identifies missing specifications. The act phase performs retrieval and code synthesis grounded in simulator documentation and examples. The validate phase executes the 6 Table 1: Overview of tools available to JutulGPT. Documentation Retrieval Keyword searchRetrieves documentation using keyword matching. Docstring lookupDisplays function, class, or module docstrings. Example searchFinds examples related to a query. Code Analysis LinterAnalyzes code for errors, style issues, and common pitfalls. Code runnerExecutes code snippets in a controlled environment. Terminal commands Runs shell commands and returns their output. Input and Output Read fileReads the contents of a file. Write fileWrites data to a file. List filesShows the directory structure and available files. generated configuration and evaluates solver diagnostics and runtime errors. Execution feedback directly constrains subsequent revisions, and the loop continues until a physically and numerically admissible configuration is obtained. In this mapping, the interpret phase primarily engages the conversational layer, where intent is parsed and missing specifications are identified. The act phase spans the conversational and tool layers, combin- ing retrieval with code synthesis and modification. The validate phase interfaces with the runtime layer, where generated configurations are executed and assessed using structured solver diagnostics. Validation outcomes may trigger implementation-level revisions or renewed clarification of modeling assumptions. This three-phase abstraction thus enforces a clean separation of responsibilities across layers, with each phase having a well-defined scope and a defined interface to the next, The agent grounds its reasoning through retrieval over simulator documentation, docstrings, and example scripts, using two complementary retrieval modes. Semantic retrieval-augmented generation (RAG) helps the agent map user intent to relevant working configurations, even when the userâs wording does not match simulator terminology exactly, and exposes common modeling patterns and component combinations in the Jutul ecosystem. Keyword-based search over the same indexed sources supports targeted lookup of API usage and documentation details, and is also useful for discovery of relevant files, examples, and implementation patterns. Together, these retrieval pathways condition the language model prior to code generation and improve alignment with the current simulator API and software version. Generated code is first subjected to static analysis before execution. Execution occurs in a local Julia environment, and all runtime errors and solver diagnostics are captured. These diagnostics include constructor mismatches, convergence failures, timestep reductions, and other solver-level signals relevant to physical and numerical admissibility. The agent interprets this feedback to determine whether revisions are required at the level of implementation, parameterization, or missing specification. In contrast to systems that supplement execution success with heuristic monitoring of physical indi- cators at runtime [17], JutulGPT relies on the simulatorâs own internal enforcement: in JutulDarcy, a simulation does not run to completion unless local and global mass-conservation errors have been reduced below prescribed tolerances and the nonlinear solver has converged, which typically is ensured through the simulators internal timestep control. Simulator completion is therefore itself a certificate of physical validity in the sense of the governing equations, not merely a signal that the code executed without crashing. For reservoir simulation [11], interventions such as mesh adaptation or timestep heuristics are strongly problem-dependent and are therefore not abstracted into a generic agent-level policy. The sim- ulator remains the authoritative source of validation, and the agent responds to structured diagnostics rather than duplicating solver-internal logic. 7 5 Case Studies: Evaluating Agentic Model Construction The case studies probe the capabilities and limitations of JutulGPT as an agentic interface to scien- tific simulation. Rather than serving as tutorials or classical benchmarks, they examine how the agent interprets underspecified intent, resolves ambiguity, and converges toward executable, physically consis- tent models under varying degrees of autonomy. Each case isolates a distinct aspect of agentic model construction, from documentation retrieval to autonomous configuration of heterogeneous multiphysics simulations. While all examples are drawn from porous-media flow, the mechanisms under examina- tion are characteristic of PDE-based simulation more broadly: semantic navigation of documentation, ambiguity detection and resolution, execution-grounded validation, and iterative refinement. All experiments reported in this section were conducted using Julia 1.12.4, Jutul 0.4.16, and Jutul- Darcy 0.3.3. In all runs, JutulGPT used OpenAI GPT-5.2 with reasoning enabled and greedy decoding (temperature=0.0). Retrieval was performed over searchable indexes built from the locally installed JutulDarcy documentation, docstrings, and example scripts for the active simulator version. Complete agent logs are provided as supplementary material to ensure full transparency and reproducibility. These include tool calls, retrieved context, generated code, execution traces, and repair iterations. 5.1 Example: Retrieving and exploring documentation We first probe the agentâs ability to navigate and synthesize simulator documentation. In this mode, the agent does not generate executable models, but retrieves and organizes information from documentation, source files, and example scripts into a coherent summary. To evaluate this behavior, we issue the following query: Human (query) What kind of well models can I use in the simulator? In response, the agent performs a keyword-based search across documentation and source code, re- trieves relevant function signatures, and inspects example scripts involving wells: Tool calls Made a keyword based search for well. Retrieved documentation for 6 functions. Read example âIntroduction to wellsâ. The agent organizes the retrieved material into a taxonomy of available well models (Figure 2), in- cluding vertical wells, multi-segment wells, friction and pressure-drop formulations, and customizable segment-level physics. In addition to listing available constructors, the response explains relationships among model types and indicates typical usage scenarios. This example demonstrates that structured retrieval combined with example inspection enables the agent to synthesize distributed documentation into a unified representation. In particular, the agent surfaces default parameterizations and structural relationships that are not always immediately apparent from isolated docstrings. At the same time, the example exposes limitations. Many Jutul functions rely on multiple dispatch, where behavior depends on combinations of argument types that are not always explicit in documenta- tion. In such cases, the agent must infer intent from method tables, default keyword arguments, and usage patterns in example scripts. When documentation is sparse or inconsistent, this inference process becomes fragile. The experiment therefore illustrates that documentation structure and example quality directly influence the reliability of agent-mediated exploration. 8 Ă JutulGPT (response) Strategy & Findings I searched the API and documentation for well models in JutulDarcy. Hereâs a summary of the well modeling options available in the simulator: 1. Simple Well Model âą Use setup_well for a simple well (single cell or trajectory of cells). âą Supports basic well parameters: skin, radius, well index (WI), direction, etc. âą Suitable for standard well modeling without detailed wellbore flow. 2. Multi-Segment Well Model âą Use MultiSegmentWell or setup_vertical_well for a more detailed well representation. âą Models the well as a series of connected segments and nodes (multi-segment). âą Allows specification of well topology, perforations, and segment models. âą Can include a surface node to represent the wellhead. 3. Wellbore Flow and Friction Models âą SegmentWellBoreFrictionHB: Hagedorn and Brown friction model for wellbore segments. âą MixedWellSegmentFlow: Two-point approximation for well fluxes. âą PotentialDropBalanceWell: Models pressure drop across well segments, including hydrostatic and frictional effects. 4. Customization âą You can specify custom segment models for each segment in a multi-segment well. âą The setup_well and setup_vertical_well functions allow for extensive keyword customization (skin, Kh, WI, radius, direction, roughness, etc.). Figure 2: Taxonomy of well models produced by JutulGPT in response to a documentation query. 5.2 Example: Interpreting and executing a canonical two-phase test case We next consider a deliberately simple but physically meaningful test case to establish a baseline for execution-grounded model construction. The quarter five-spot configuration for immiscible two-phase flow in porous media is a canonical problem, with well-known governing equations and qualitative behav- ior. While the single-phase incompressible version resembles a standard introductory problem in many PDE contexts, the two-phase formulation requires explicit modeling choices, correct use of simulator- specific APIs, and internal consistency across geometry, physical parameters, and numerical controls. This example therefore isolates the core mechanism in a setting with limited structural ambiguity. We issue the following modeling request, which specifies the physical scenario and qualitative objective without prescribing implementation details: Human (query) I want to create two quarter five-spot simulations to illustrate the difference between favourable and unfavourable displace- ments. Use two-phase immiscible fluids with quadratic relative permeabilities, and inject one pore volume. Please ask for clarifications if you are missing any information. Do not plot the result but run both simulations for the total time. The agent parses the request into modeling components: (i) quarter five-spot geometry, (i) immiscible two-phase flow, (i) quadratic relative permeabilities, and (iv) contrasting mobility ratios corresponding to favourable and unfavourable displacement. The difference between the two regimes is implemented through viscosity assignment, while other components are held fixed to ensure comparability. 9 j Agent interpretation Creating Julia Simulations I need to write Julia code using JutulDarcy and am ready to clarify anything thatâs missing. (. . . ) Thereâs the need to compare favorable versus unfavorable displacement, which usually means looking at the mobility ratio based on the viscosities. So, Iâm pondering how to set the viscosity ratio correctly for these cases. Setting Up a Five-Spot Grid I need to create a quarter five-spot grid, which means Iâl design a 2D square where the injector is located at one corner and the producer at the opposite corner, incorporating symmetry boundaries. I plan to set up a Cartesian grid with Nx and Ny dimensions and implement no-flow boundaries. Iâl need to add wells, likely using JutulDarcy. My next steps include consulting examples and utilizing retrieval tools for guidance. (. . . ) To align implementation with the simulatorâs API, the agent invokes retrieval tools to locate relevant examples and documentation: Tool calls retrieve_examples(query = "quarter five-spot two-phase immiscible JutulDarcy well corner producer injector") Using the retrieved material, the agent refines modeling decisions related to geometry, fluid properties, and relative permeability models. j Agent interpretation Simulating fluid displacements Iâm creating two simulations (. . . ) For favorable displacement, the viscosity ratio should show less viscous water displacing more viscous oil, making M < 1. Conversely, if water is more viscous, it creates an unfavorable situation with M > 1. (. . . ) Setting up quarter five-spot geometry Iâm working on a quarter five-spot geometry with a square domain. The injector is placed at one corner and the producer at the opposite corner, representing a quarter of a full pattern. Iâl use CartesianMesh and set nx and ny to 50. Then, Iâl set up the wells with the setup_vertical_well function using the correct coordinates. There are also quadratic relative permeabilities to consider, so I need to look up the JutulDarcy relperm API and check the documentation for QuadraticRelativePermeability. After several retrieval and refinement iterations, the agent generates an initial implementation: Ă JutulGPT (response) function quarter_fivespot(; nx=50, L=1000.0, H=10.0, phi=0.3, K=0.1, p0_bar=150.0, mu_w=5e-3, mu_o=1e-3, rhow=1000.0, rhoo=850.0, c_w=1e-10, c_o=1e-10, p_bhp_bar=50.0, info_level=-1 ) bar, darcy, kg, meter, day = si_units(:bar, :darcy, :kilogram, :meter, :day) mesh = CartesianMesh((nx, nx, 1), (L, L, H)) domain = reservoir_domain(mesh, permeability = K*darcy, porosity = phi) : Static analysis using a Julia linter reports no issues: Tool calls Linter: No issues found. 10 Figure 3: Saturation profiles extracted at fixed fractions of injected pore volume (PVI), providing a normalized basis for comparison independent of injection rate or grid resolution. However, execution produces a runtime error: Tool calls Code failed! ERROR: MethodError: no method matching ConstantCompressibilityDensities(::ImmiscibleSystemTupleAqueousPhase, LiquidPhase, TupleFloat64, Float64; reference_pressure::Float64, reference_density::VectorFloat64, compressibil- ity::VectorFloat64) : Although syntactically valid as Julia code, the constructor invocation does not match the expected API signature. The simulator therefore rejects the configuration. The problematic code rho = ConstantCompressibilityDensities(sys, reference_pressure = p0_bar*bar, reference_density = rhoS, compressibility = [c_w, c_o]) is revised to rho = ConstantCompressibilityDensities(sys, p0_bar*bar, rhoS, [c_w, c_o]) and the corrected script executes successfully: Tool calls Code succeeded in 33.2 seconds. The agent has thus constructed and executed two comparable simulations differing only in mobility ratio. Convergence to a valid configuration occurs through iterative generation, validation, and repair, rather than one-shot code synthesis. Visualization of the resulting saturation fields (Figure 3) is per- formed using a separate script, as plotting capabilities are not included in the current JutulGPT toolset. Only after obtaining an executable and validated configuration do we request a formal explanation of the governing equations and physical interpretation (Figure 4). This ordering emphasizes that explana- tory elaboration follows, rather than precedes, executable correctness in the workflow. 5.3 Example: Interactive construction of a heterogeneous 3D reservoir model To examine the agentâs capabilities under substantially greater structural complexity, we posed a mod- eling task defined only at a high conceptual level. The specification includes geometric deformation, 11 Physical problem: quarter five-spot immiscible displacement Afive-spotpattern is a canonical waterflood layout with injectors and producers arranged on a square pattern. Thequarter five-spotmodels one quadrant of that pattern: aninjector in one corner and aproducer in the opposite cornerof a square domain. The flow is (approximately) symmetric across the two midlines of the full pattern, so simulating only a quarter captures the essential physics at lower cost. In your simulations, the reservoir is initially filled with the displaced phase (oil), and the injected phase (water) is injected untilone pore volume injected (1 PVI): PVI(t) = â« t 0 q inj (Ï)dÏ PV ,with PV= ⫠⊠ÏdV. Assumptions and constitutive laws âą Two-phase,immiscibleflow (no mass transfer between phases). âą Slightly compressible fluids (optional; often used for numerical robustness). âą Darcy flow in a porous medium with porosityÏand absolute permeability tensorK. âą No capillary pressure in the simplest form (p w =p o ) unless explicitly added. âą Relative permeabilities arequadratic(Corey/BrooksâCorey-type): k r,w (S w ) =S 2 w ,k r,o (S o ) =S 2 o ,S o = 1âS w , (or, more generally, quadratic ineffectivesaturations if residual saturations are included). Thephase mobilitiesare λ α (S α ) = k r,α (S α ) ÎŒ α ,αâw,o, whereÎŒ α is phase viscosity. Governing equations (model equations) Mass conservation for each phase For phaseαâw,o, â ât (ÏÏ Î± S α ) +â·(Ï Î± u α ) =Ï Î± q α , whereS α is saturation,Ï Î± is phase density,u α is Darcy (volumetric) flux, andq α represents sources/sinks (wells). Darcyâs law for each phase u α =âKλ α (S α ) (âp α âÏ Î± g). In many horizontal five-spot tests, gravity effects are small or neglected, giving u α =âKλ α âp α . Saturation constraint S w +S o = 1. (Optional) closure for slight compressibility A common closure (used in your script) is exponential compressibility: Ï Î± (p) =Ï Î±,ref exp(c α (pâp ref )), with compressibilityc α . 1 Fractional flow form and the mobility ratio For two-phase flow without capillarity and (approximately) equal phase pressuresp w âp o =p, one can rewrite the transport in terms offractional flowof water (here with quadratic relperms) f w (S w ) = λ w (S w ) λ w (S w ) +λ o (S w ) = S 2 w /ÎŒ w S 2 w /ÎŒ w + (1âS w ) 2 /ÎŒ o . A key nondimensional parameter is themobility ratio(often evaluated near the flood front): M= λ w λ o â k r,w /ÎŒ w k r,o /ÎŒ o . âąFavourable displacement:M<1(injectant is less mobile than the displaced phase, e.g. ÎŒ w >ÎŒ o for similar relperms). âąUnfavourable displacement:M>1(injectant is more mobile, e.g.ÎŒ w <ÎŒ o ). Even with identical geometry, rates, and relperms, changingÎŒ w /ÎŒ o changesMand therefore the nature of the displacement. What âfavourable vs unfavourableâ means physically Favourable (stable) displacement:WhenM<1, the injected phase doesnotoutrun the displaced phase as easily. The front tends to be âbroaderâ and the sweep is more uniform. In idealized settings this corresponds to a more stable shock/rarefaction structure in the saturation equation, later breakthrough, and better areal sweep. Unfavourable (unstable) displacement:WhenM>1, the injected phase can preferentially flow through the easiest pathways, effectively âfingeringâ or channeling in heterogeneous media. Even in homogeneous media, the flood tends to be more peaked toward streamlines connecting injector and producer, giving earlier breakthrough and poorer sweep. Your two runs isolate this effect by keepingeverything the sameexcept the viscosities (and thusM). Why the quarter five-spot is an interesting test case 1.Canonical benchmark geometry:The corner-to-corner flow creates strong spatial gradients and a wide range of streamline lengths, exercising the solver and discretization in a realistic well pattern. 2.Coupled pressureâtransport physics:Pressure is elliptic-like (fast propagation), while sat- uration transport is hyperbolic-like (fronts/shocks). This combination is central to reservoir simulation diïŹiculty. 3.Clear sensitivity to mobility ratio:The difference betweenM<1andM>1is a funda- mental concept in waterflooding and EOR. Injecting 1 PVI makes differences visible in: âą breakthrough time, âą production/injection well responses, âą spatial sweep at the final time. 4.Standard stress test for numerical methods:The problem is widely used to compare: âą upwinding/flux discretizations, âą timestep control and nonlinear convergence, âą well modeling and coupling to the reservoir. 5.Simple enough to interpret, rich enough to matter:With quadratic relperms and im- miscible fluids, itâs conceptually clean, yet still captures the core competition between viscosity, relperm nonlinearity, and well-driven flow. 1 Figure 4: Explanation generated by the agent when asked to provide a formal description of the simu- lated problem, including assumptions, governing equations, constitutive laws, introduction of fractional form and mobility ratio, physical explanation of favorable versus unfavorable flow, and brief discussion of the importance of the quarter-five-spot problem. stratified heterogeneity, stochastic property assignment, multiple well controls, and a global pore-volume injection constraint, while intentionally leaving several modeling decisions underspecified. Human (query) Set up a 100x100x30 Cartesian mesh covering a 1000x1000x50 m domain. Immiscible two-phase unfavorable waterflooding with four rate-controlled injectors in the corners and three bhp-controlled producers located inside the domain. Stratigraphy: three equally thick layers with lognormal permeability and arithmetic mean 100,200,900 mD and std 30,60,90 mD. Introduce slight undulating variation in layer thickness. Deform the mesh into an anticline dome shape. Inject in total one pore volume over ten years, equally distributed across all injectors. Consult me for important decisions, and explicitly state all assumptions. Interpret phase: structured clarification. Rather than generating code immediately, the agent identi- fied modeling choices that materially influence physical admissibility or the macroscopic injection con- straint. Clarifications were requested for porosity specification, phase viscosities and densities, relative permeability parameters, initial conditions, well configuration details, and deformation amplitudes. For each underspecified component, the agent proposed explicit defaults together with concise physical justification. Proposed closures included BrooksâCorey relative permeabilities with quadratic exponents and moderate residual saturations, constant phase viscosities yielding an unfavorable mobility ratio, vertical wells perforating all layers, and closed outer boundaries. Stratigraphic undulation and dome deformation were parameterized using smooth sinusoidal and Gaussian functions. Constant porosity was initially proposed, consistent with typical JutulDarcy examples, but later replaced after user override. Both permeability and porosity were ultimately prescribed as lognormal distributions specified via arithmetic mean and standard deviation. To obtain statistically consistent samples, the agent trans- 12 Figure 5: 3D reservoir model generated by JutulGPT. The front half uses semi-transparent colors to distinguish the three stratigraphic layers (each with ten grid layers of different average perme- ability and porosity), while the back half shows log 1 0 of permeability to reveal the stochastic heterogeneity correctly produced within each layer. Four corner injectors (red, I1âI4) and three interior producers (blue, P1âP3) are placed for a peripheral waterflood. In this classic setup, water is injected to displace more viscous oil toward the producers; the anticlinal trap and layered heterogeneity together control sweep efficiency. formed these descriptors into log-space parameters using moment matching before sampling. This step reconciles user-level statistical inputs with the simulatorâs parameterization. Act phase: geometric deformation and model assembly. The structured grid was mapped to undu- lating stratigraphic interfaces and subsequently deformed into a dome-shaped anticline with zero dis- placement at the basal boundary. Petrophysical properties were assigned layer-wise using independent lognormal realizations generated with a fixed random seed to ensure reproducibility. After assembling wells, fluid models, and controls, the total pore volume of the deformed grid was computed explicitly. Injection rates were then derived to ensure that exactly one pore volume would be injected over the ten-year schedule, equally distributed among the four injectors. All wells were implemented as vertical wells perforating the full thickness. Validate phase: execution-grounded refinement. Execution required multiple refinement cycles. Al- though static analysis reported no syntactic errors, runtime failures arose from constructor mismatches and parameter-placement inconsistencies. These were resolved by inspecting simulator diagnostics and revising the implementation accordingly. The loop terminated only after successful completion of the full ten-year simulation on the 300,000-cell grid, with verification that the global injection target of one pore volume was satisfied exactly. 5.4 Example: Autonomous reconstruction from progressively abstract representations We use the executable configuration constructed in the previous subsection, together with the associated agent context, as a fully instantiated reference state. In this state, grid topology, geometric deformation, stochastic realizations of petrophysical parameters, fluid closures, well placement and controls, time discretization, and solver settings are all concretely specified. From this reference configuration, three textual artifacts were generated: (i) a simulator-specific re- production prompt intended to recreate the model exactly, (i) a formal technical report expressed in simulator-agnostic terms, and (i) a compact journal-style description. 13 Human (query) After the code, using the final setup as reference: 1. Write a formal report-style markdown explanation with LaTeX equations (inline $...$, display $$...$$), using flowing prose (no bullet lists except for equation/boundary condition sequences). 2. Produce a detailed âreproduction promptâ that would recreate the exact same simulation from scratch. 3. Provide a shorter journal-style description with key details. These artifacts encode the same physical scenario at progressively increasing levels of abstraction. To examine how representational compression affects executable reconstruction, three independent agents were initialized in fully autonomous mode, each provided with one artifact as the sole input. In all three cases, the agent produced an executable simulation script that ran successfully and gener- ated physically plausible flow behavior. Each reconstruction yielded a coherent grid, statistically consis- tent heterogeneous fields, well definitions and control schedules compatible with our initial specification, and stable time integration without runtime failure. Successful execution under simulator validation therefore serves as the minimal admissibility criterion for reconstruction. Deviations from the reference configuration were nevertheless observed. Because the agents had access only to the textual artifacts and not to the original code or simulation outputs, such deviations reflect admissible interpretations within the degrees of freedom left unspecified by the representation, rather than implementation errors. In standard human workflows, discrepancies of this type would be detected through comparative analysis of geometry, state fields, well responses, and solver diagnostics, followed by iterative refinement. The present framework does not yet automate such multimodal comparison, and systematic reconciliation of reconstructed executable states therefore remains future work. Reproduction prompt: simulator-specific operational specification. The reproduction prompt (Fig- ure 6) was itself generated by the agent in response to the instruction to produce an exact restart spec- ification of the reference configuration. It encodes the model as an operational specification intended to reproduce the simulation exactly, including geometric deformation formulas, statistical parameters, well definitions, time discretization, and a fixed random seed. The prompt explicitly enumerates most numer- ical degrees of freedom in the executable model, although certain simulator-level closures remain implicit. You are to reproduce *exactly* the same simulation, including all random realizations, geometry deformation, wells, controls, and schedule. 1. Use Julia with packages âJutulâ and âJutulDarcyâ available. 2. Set a fixed RNG seed âseed = 12345â using âMersenneTwister(seed)â. 3. Create a Cartesian mesh with dimensions â(100, 100, 30)â covering â(Lx, Ly, Lz) = (1000.0, 1000.0, 50.0)â meters, with origin â(0.0, 0.0, z_top0)â where âz_top0 = 1000.0â meters (depth positive downward). Convert it to an unstructured mesh using âUnstructuredMeshâ. 4. Deform the mesh nodes: â Define stratigraphic reference interfaces in relative depth as âzmean = (0, Lz/3, 2Lz/3, Lz)â. â Define undulation with amplitude âA_und = 2.0 mâ and wavelength âλ_und = 500.0 mâ: âÎŽ(x,y)= A_und*sin(2Ï*x/λ_und)*sin(2Ï*y/λ_und)â. â Define two internal interfaces as âz1=zmean[2]+ÎŽâ, âz2=zmean[3]-ÎŽâ and map each nodeâs original relative depth piecewise-linearly from the reference intervals to the undulated intervals. â Apply an anticline dome with amplitude âA_dome = 30.0 mâ and Gaussian radius âR_dome = 400.0 mâ: âD(x,y)=A_dome*exp(-((x-Lx/2)^2+(y-Ly/2)^2)/(2R_dome^2))â. Shift node depth by âshift=D(x,y)*(1 - z_rel/Lz)â so the bottom is unchanged Figure 6: Excerpts from the reproduction prompt for the 3D waterflooding case generated by the agent. 14 Under this representation, reconstruction fidelity was correspondingly high. Grid geometry, well place- ment, injection schedule, and deformation parameters were reproduced without structural deviation. Differences arose primarily from the procedure used to sample and assign heterogeneous properties. Although an identical random seed was specified, deterministic reproduction of a particular spatial realization requires that sampling order and assignment order coincide exactly. In the reference im- plementation, permeability and porosity were sampled in layer-wise batches, whereas the reconstructed model sampled them cell-by-cell with interleaved draws. The following abridged excerpts illustrate the difference in realization strategy; variable names and surrounding context have been simplified for clarity. for l in 1:3 lognormal!(rng, tmpK, meanK[l], stdK[l]) lognormal!(rng, tmpPhi, meanPhi[l], stdPhi[l]) @inbounds for (ix, c) in enumerate(layer_cells) K[c] = tmpK[ix] phi[c] = tmpPhi[ix] end end @inbounds for c in 1:nc assign_by_layer(c, mK, sK, mPhi, sPhi) Ks = lognormal_sample(rng, mK, sK) phis = lognormal_sample(rng, mPhi, sPhi) K[c] = (1e-3*Ks)*Darcy phi[c] = phis end Both procedures are statistically consistent with the specified distributions. However, because random numbers are consumed in a different order, the resulting realizations differ under the same seed. In this case, the permeability and porosity fields are i.i.d. with no spatial correlation, so the large-scale pressure field and displacement dynamics are governed primarily by geometry, boundary conditions, mobility ratio, and the global injection constraint rather than by coherent preferential pathways. Differences between realizations therefore tend to average out at the scale of the advancing front, even though the local flux partitioning at wells may change. For spatially correlated fields, altered realizations could generate connected high- or low-permeability structures, and reconstruction differences would be expected to have a more pronounced impact on interwell connectivity and the evolution of fluid fronts. Despite these realization-level differences, the reproduction prompt remains close to an operational specification of the executable state. The remaining degrees of freedom are confined primarily to simulator-level defaults and implementation conventions. In programmatic simulation frameworks such as JutulDarcy, executable state may inherit implicit behavior from library-level closures, multiple dis- patch, and constructor defaults. Unless these conventions are explicitly specified, they remain part of the executable configuration without being part of the textual representation. Comparable effects occur in keyword-driven simulators, where defaulted keywords and ordering con- ventions introduce implicit state. However, in programmatic interfaces, these dependencies become espe- cially visible when reconstruction is performed via code generation rather than direct reuse of input files. Technical report: formal model specification in simulator-agnostic form. The formal report, similar in structure to Figure 4, preserved governing equations, geometric definitions, statistical parameterizations, grid dimensions, well controls, and global injection constraints, but did not specify the densityâpressure relationship. The reason it was absent is instructive. In the reference implementation, compressibility was never a decision the agent made explicitly: it wrote code that invoked a simulator default, and that default was outside the assumption space the agent was reasoning over. A choice that was never made cannot appear in an assumption log, and a choice that was never logged cannot appear in any representation derived from that log. The reconstruction agent therefore encountered a genuinely underspecified closure and resolved it explicitly by setting zero compressibility, whereas the reference had silently inherited a compressible model. This resulted in significantly different fluid behavior, as shown in Figure 7. The divergence thus illustrates two compounding effects: latent under-specification in the representa- tion, and a structural gap in the current architecture whereby tacit assumptionsâchoices inherited from 15 Figure 7: Water saturation for the compressible reference case (left) and the incompressible reproduction from the technical report (right). Densities are specified at surface conditions (1 bar), but the simulation runs at reservoir pressures (88â90 bar). In the reference case, higher oil compress- ibility substantially reduces the effective density contrast and weakens buoyancy; the diffusive pressure response slows vertical redistribution, allowing viscous fingering to produce a mixed, voxelated pattern. In contrast, the incompressible case maintains the full surface density con- trast, enabling rapid buoyancy segregation: denser water quickly underrides lighter oil and channels along the high-permeability bottom layer, forming sharp, bottom-conformant fronts. simulator defaults, rather than made explicitly by the agentâare invisible to the assumption log and therefore to any downstream representation. Fortunately, this divergence can be corrected by modifying a localized constitutive definition in the reconstruction script. In the report-based reconstruction, the incompressible formulation was introduced explicitly through the following readily identifiable statements: # Constant densities (no compressibility) rho = ConstantCompressibilityDensities(sys, 1.0*bar, rhoS, [0.0, 0.0]) replace_variables!(model, PhaseMassDensities = rho) Restoring the reference behavior therefore requires only removal (or modification) of this closure assign- ment. The discrepancy is thus confined to a single constitutive component and does not affect geometry, discretization, or structural model assembly. It is worth noting that this particular tacit assumption is unusually easy to detect: the reconstruction agent happened to make its choice explicitly, leaving a visible two-line signature in the code. The reference agentâs compressible default, by contrast, leaves no corresponding signature; it is simply absent from the code. In general, tacit assumptions originating from simulator defaults are harder to audit precisely because they produce no code to inspect. As for the reproduction prompt, permeability and porosity were sampled cell-by-cell with interleaved random draws. This differs from the layer-batched sampling strategy used in the reference implemen- tation and produces a distinct spatial realization despite identical statistical descriptors and seed. In addition, the reconstructed model explicitly selected a CSR linear-algebra backend and a BiCGStab solver with CPR-type preconditioning, whereas the reference relied on simulator defaults. These choices are numerically consistent with the problem formulation but introduce implementation-level differences that may affect convergence behavior and, consequently, transient solution details. Journal-style description: compact conceptual specification. The journal-style description (Figure 8) encodes the physical scenario at a higher level of abstraction, summarizing geometry, stratigraphy, het- erogeneity statistics, fluid properties, and injection strategy without specifying all detail. It preserves the conceptual intent of a three-layer stratigraphy, lognormal heterogeneity, anticline deformation, and injection of one pore volume over ten years, but omits several operational and procedural parameters. In contrast to the report-based reconstruction, where divergence primarily arose from a localized constitutive choice, the journal-based reconstruction exhibits three first-order differences relative to the 16 We simulate an immiscible, two-phase unfavorable waterflood in a deformed 3D 1000Ă 1000Ă 50 m reservoir discretized by a 100Ă 100Ă 30 grid (300k cells). Stratigraphy comprises three units (10 layers each) with i.i.d. lognormal permeability fields having arithmetic means of 100, 200, and 900 mD and standard deviations of 30, 60, and 90 mD, respectively; porosity is i.i.d. lognormal with means 0.18/0.20/0.22 and standard deviations equal to one quarter of the mean. Layer interfaces are laterally undulated (2 m amplitude) and the grid is further deformed into a dome-shaped anticline (30 m top uplift). Waterâoil flow uses constant densities (1000/800 kg·m â3 ), constant viscosities (0.5/5 cP), and BrooksâCorey relative permeability with exponents 2 and residual saturations 0.2/0.2. Four corner injectors are rate-controlled to inject one pore volume over 10 years (equal split), while three interior producers are BHP-controlled at 50 bar; the initial state is uniform at 150 bar and S w = 0.2. Figure 8: Journal-style description of the 3D waterflooding case generated by the agent. 0250500 750 1000 y(m) -30 -20 -10 0 10 20 30 40 50 Relative depth (m) Reference Dome:A d = 30m,R= 400m (Gaussian) Undulation:A u = 2m,λ= 500m (remapped to layers) VEâ10Ă 0250500 750 1000 y(m) From journal description Dome:A d = 30m,R= 500m (cos 2 , truncated) Undulation:A u = 2m,λ= 1000m (added to interfaces) VEâ10Ă Layer 1 (top)Layer 2 (middle)Layer 3 (bottom) Domain boundary Stratigraphic interface Figure 9: Comparison of vertical cross-sections through x = 400 for the reference model and the model reconstructed from the journal-style description. reference configuration: (i) adoption of an incompressible density closure, (i) reinterpretation of interior well placement, and (i) altered geometric deformation, which changes the total bulk and pore volume of the model. First, the reconstruction again selected a constant-density formulation. As discussed for the report case, this choice is admissible under the representation but modifies the governing model and directly affects pressure evolution and rate decay behavior. However, as shown above, it can be corrected through a localized closure modification. Second, the interior producer locations were reinterpreted into a symmetric configuration that differs from the original coordinates. Under BHP control, well placement directly influences drainage geometry and rate partitioning among producers. Even with statistically identical i.i.d. permeability fields, such changes can produce a substantially different distribution of production rates. Third, the dome deformation and stratigraphic undulation were reconstructed using different func- tional forms (Figure 9). While property assignment and pore-volume computation algorithms remain unchanged, the altered geometry changes the total pore volume of the reservoir. This directly changes both the amount of fluid initially contained in the system and the total amount injected over the simu- lation period to satisfy the one-pore-volume requirement. At the implementation level, sampling order and solver configuration again differed, but these represent secondary procedural variations relative to the first-order effects described above. 17 At this level of abstraction, reconstruction variability shifts from constitutive detail to architectural interpretation, producing executable models that remain conceptually consistent yet structurally distinct from the reference configuration. Synthesis: representational compression and executable state. Across all three reconstruction ex- periments, the agent produced simulation scripts that executed successfully and generated physically plausible flow behavior. The deviations relative to the reference configuration therefore reflect variability among admissible reconstructions rather than failures of model construction. The experiments demonstrate that an executable simulator configuration contains more information than is typically conveyed by textual representations. The reproduction prompt approaches an op- erational specification and therefore tightly constrains reconstruction, although certain simulator-level defaults and procedural conventions remain implicit. The technical report preserves governing equations, parameter values, and geometric definitions but abstracts away implementation context, leaving implicit constitutive closures and procedural details underdetermined. The journal-style description further com- presses the representation, omitting structural, configurational, and discretization details and thereby enlarging the admissible reconstruction space. Importantly, some ambiguities, such as the density closure, were already present in the original speci- fication and could have manifested under repeated reconstructions even from the reproduction prompt. Differences across reconstructions therefore expose latent degrees of freedom in the model rather than errors in interpretation. Reconstruction variability makes implicit modeling assumptions visible. In all cases, the interpretâactâvalidate loop grounds reconstruction in executable feedback, but it can- not resolve ambiguities that are not encoded in the representation itself. Deterministic reproducibility therefore requires explicit specification not only of governing equations and parameter values, but also of constitutive closures, stochastic realization procedures, and discretization choices. When these ele- ments (and possible variability) are documented explicitly and illustrated consistently, the admissible reconstruction space narrows and variability is reduced. The difficulty of reproducing computational results from textual descriptions alone is a long-recognized challenge in scientific computing [8, 9]: parameter values, function invocation sequences, and other computational details are typically omitted from published descriptions but are critical for replicating results. A related phenomenon has been observed in large community benchmarks. For example, the 11th Society of Petroleum Engineers Comparative Solution Project (SPE11) for geological CO 2 storage [15] was defined with an unusually detailed problem description and supporting input resources intended to minimize ambiguity. Nevertheless, subsequent intercomparison revealed that variations in results from the 18 contributing teams were strongly influenced by factors not documented in the technical responses, and that unreported human setup choices were at least as impactful as the documented computational choices [14]. The reconstruction experiments above demonstrate the same phenomenon in the context of agent- mediated model construction: even carefully controlled textual specifications do not fully determine executable simulator state, and variability in interpretation and reconstruction remains intrinsic to com- putational modeling workflows. More broadly, this highlights a general limitation of text-only reporting in simulation studies: without accompanying code and input artifacts, published descriptions seldom determine the computational experiment setup uniquely, making reliable reconstruction difficult. 6 Discussion and Outlook: Designing Agentic Simulation Environments The experiments demonstrate that execution-grounded agentic workflows can mediate interaction with high-fidelity simulators while preserving physical and numerical admissibility. At the same time, they 18 expose two structural limitations that constrain reliability: the invisibility of tacit assumptions inherited from simulator defaults, and the irreducible information loss between executable state and its textual representations. The subsections below examine these limitations and their implications for workflow design, reproducibility, and the architecture of future systems. 6.1 Current limitations Although JutulGPT can autonomously construct and execute multiphase models from high-level spec- ifications, its reasoning depth is constrained by context length and prompt budget. As simulation complexity increases, maintaining coherence across geometry, properties, well configuration, and solver setup becomes increasingly demanding. Reconstruction reliability depends strongly on documentation structure. Functions lacking explicit docstrings, typed signatures, or illustrative examples are effectively opaque to the agent. Conversely, well-structured documentation narrows the admissible reconstruction space. The experiments therefore indicate that documentation quality directly influences agent-mediated reproducibility. A related limitation concerns tacit assumptions introduced through simulator defaults. The assump- tion log records choices the agent makes explicitly: selecting a value, resolving an ambiguity, responding to a clarification query. It does not capture choices the agent makes tacitly, by writing code that invokes simulator defaults without those defaults ever being considered as modelling decisions. The compressibil- ity divergence in the reconstruction experiments is an instance of this: the agent wrote a density-model constructor whose default was compressible, and that default was never part of the agentâs assumption space. Closing this gap would require the agent to maintain a checklist of choices that a given simulator configuration leaves to defaults, and to either log each default explicitly or prompt the user to confirm it. A further limitation concerns output analysis. While the agent can construct and execute models, it does not yet perform structured comparison of simulation outputs. In conventional workflows, dis- crepancies in physical quantities of interest trigger iterative refinement. Enabling systematic multimodal output comparison, both human-guided and automated, remains an important development direction. 6.2 Implications for workflow design Agentic interfaces alter the structure of simulation workflows. Rather than manually encoding config- urations, users specify intent in natural language, while the agent performs retrieval, translation, and validation. The simulator remains the authoritative computational core, and executable feedback con- strains the agentâs reasoning. This shift requires deliberate redesign of simulator outputs and documentation. Logs and diagnostics must be structured and machine-readable. Documentation must expose semantic relationships rather than isolated function descriptions. Decisions regarding fully autonomous execution versus supervised interaction affect transparency and reproducibility and must be matched to task criticality. 6.3 Reproducibility and executable state The reconstruction experiments underscore that reproducibility of a simulation requires preservation of its executable state: the generated code together with all its necessary parameters and pinned versions of the simulator and its dependencies. Natural-language descriptions alone do not uniquely determine this state, as the reconstruction experiments demonstrate. Separately, reproducibility of the agentâs construction process, i.e., understanding which choices were made, why, and from what retrieved context, requires the broader traceability record: prompts, retrieved documentation fragments, assumption logs, and repair iterations. This record allows divergences arising 19 from explicit modeling choices to be diagnosed and corrected, but it cannot surface choices that were never part of the agentâs assumption space. JutulGPT maintains this traceability record by construction as an audit trail. However, as demon- strated in Section 5.4, the record cannot compensate for ambiguities in the executable state itself: when constitutive closures or structural assumptions are left unspecified, different agents will make different ad- missible choices, and the resulting simulations will diverge regardless of how thoroughly the construction process is logged. 6.4 Simulatorâagent interaction Effective deployment of agentic interfaces requires structured communication between the simulator, agent, and user. The experiments demonstrate that LLMs can interpret unstructured simulator diag- nostics directly, one of their genuine strengths, but this parsing is inherently fragile when error messages are terse, version-dependent, or domain-specific. Structured, machine-readable diagnostic formats would make the validate phase more robust and less dependent on the LLMâs natural-language parsing capa- bility, and represent a worthwhile design investment for simulators targeting agent-assisted workflows. The appropriate level of autonomy depends on context. Exploratory modeling may tolerate greater independence, whereas safety-critical simulations demand human oversight. The simulator remains the authoritative source of physical truth; the agent functions as translator and orchestrator; and the human retains conceptual responsibility. 7 Conclusions The results demonstrate that execution-grounded agentic interfaces can mediate interaction with high- fidelity simulators without replacing them. The central principle is that the simulator remains the authoritative computational engine, while the agent manages interpretation, retrieval, and orchestration. Several directions are natural extensions of the present work. Because Jutul is designed around residual-form equations with automatic differentiation permeating the entire computational stack, sen- sitivities of simulation outputs with respect to any model parameter (including constitutive closure coefficients, grid spacing, and timestep sizes) are available without hand-coded adjoint interfaces. This means that the same agent that constructs a forward model could formulate and solve inverse problems (history matching, parameter estimation, sensitivity analysis) within a unified execution-grounded loop. More broadly, the modular architecture of Jutul positions the agent as an orchestration layer across cou- pled physical processes, where differentiability provides access to cross-module sensitivities that would otherwise require bespoke derivation. A complementary direction is to expose simulator functionality through standardized tool interfaces, allowing general-purpose agents to interact with domain-specific simulation capabilities without requiring a fully custom implementation. In such a setup, documentation retrieval, execution environments, and structured diagnostic parsing could coexist with general reasoning models, lowering adoption barriers while retaining the depth of integration that execution-grounded validation requires. The central open problem is closing the tacit-assumption gap: ensuring that modeling choices inherited implicitly through constructor defaults and library conventions become as visible and auditable as the choices the agent makes explicitly. Acknowledgments This research was conducted within SINTEF Digitalâs Agent Lab. 20 References [1] Y. Chen et al. MetaOpenFOAM 2.0: Large Language Model Driven Chain of Thought for Automat- ing CFD Simulation and Post-Processing. 2025. doi: 10.48550/ARXIV.2502.00498. [2] Y. Chen et al. MetaOpenFOAM: an LLM-based multi-agent framework for CFD. 2024. doi: 10. 48550/ARXIV.2407.21320. [3] S. Clark et al. âAdvanced Coupled Electrochemical-Thermal Simulations of 4680 Cylindrical Cells on a Pseudo-Four-Dimensional Gridâ. In: Journal of The Electrochemical Society (Feb. 2026). issn: 1945-7111. doi: 10.1149/1945-7111/ae4896. [4] Z. Dong, Z. Lu, and Y. Yang. âFine-tuning a large language model for automating computa- tional fluid dynamics simulationsâ. In: Theoretical and Applied Mechanics Letters 15.3 (May 2025), p. 100594. issn: 2095-0349. doi: 10.1016/j.taml.2025.100594. [5] E. Fan et al. ChatCFD: An LLM-driven agent for end-to-end CFD automation with domain-specific structured reasoning. 2025. doi: 10.48550/arXiv.2506.02019. [6] S. Hou et al. âAutoFEA: Enhancing AI Copilot by Integrating Finite Element Analysis Using Large Language Models with Graph Neural Networksâ. In: Proceedings of the AAAI Conference on Artificial Intelligence 39.22 (Apr. 2025), p. 24078â24085. issn: 2159-5399. doi: 10.1609/aaai. v39i22.34582. [7] Ă. Klemetsdal, O. Andersen, and O. MĂžyner. âFimbul.jl â Fast, Flexible, Robust, and Differentiable Geothermal Energy Simulation in Juliaâ. In: Sixth EAGE Global Energy Transition Conference & Exhibition (GET 2025). European Association of Geoscientists & Engineers, 2025, p. 1â5. doi: 10.3997/2214-4609.202521164. [8] R. J. LeVeque. âWave propagation software, computational science, and reproducible researchâ. In: Proceedings of the International Congress of Mathematicians Madrid, August 22â30, 2006. EMS Press, May 2007, p. 1227â1253. isbn: 9783985475384. doi: 10.4171/022-3/59. [9] R. J. LeVeque, I. M. Mitchell, and V. Stodden. âReproducible research for scientific computing: Tools and strategies for changing the cultureâ. In: Computing in Science & Engineering 14.4 (2012), p. 13â17. [10] S. Li et al. CodePDE: An Inference Framework for LLM-driven PDE Solver Generation. 2025. doi: 10.48550/ARXIV.2505.08783. [11] K.-A. Lie. An Introduction to Reservoir Simulation Using MATLAB/GNU Octave: User Guide for the MATLAB Reservoir Simulation Toolbox (MRST). Cambridge: Cambridge University Press, 2019. isbn: 9781108492430. doi: 10.1017/9781108591416. [12] O. MĂžyner. âJutulDarcy.jl â a fully differentiable high-performance reservoir simulator based on automatic differentiationâ. In: Computational Geosciences 29.4 (July 2025). issn: 1573-1499. doi: 10.1007/s10596-025-10366-6. [13] B. Ni and M. J. Buehler. âMechAgents: Large language model multi-agent collaborations can solve mechanics problems, generate new data, and integrate knowledgeâ. In: Extreme Mechanics Letters 67 (Mar. 2024), p. 102131. issn: 2352-4316. doi: 10.1016/j.eml.2024.102131. [14] J. M. Nordbotten et al. âBenchmarking CO 2 storage simulations: Results from the 11th Society of Petroleum Engineers Comparative Solution Projectâ. In: International Journal of Greenhouse Gas Control 148 (Dec. 2025), p. 104519. issn: 1750-5836. doi: 10.1016/j.ijggc.2025.104519. 21 [15] J. M. Nordbotten et al. âThe 11th Society of Petroleum Engineers Comparative Solution Project: Problem Definitionâ. In: SPE Journal 29.05 (Jan. 2024), p. 2507â2524. issn: 1930-0220. doi: 10.2118/218015-pa. [16] S. Pandey et al. âOpenFOAMGPT: A retrieval-augmented large language model (LLM) agent for OpenFOAM-based computational fluid dynamicsâ. In: Physics of Fluids 37.3 (Mar. 2025). issn: 1089-7666. doi: 10.1063/5.0257555. [17] D. Park, H. Moon, and S. Ryu. âA self-correcting multi-agent LLM framework for language-based physics simulation and explanationâ. In: npj Artificial Intelligence 2.1 (Jan. 2026). issn: 3005-1460. doi: 10.1038/s44387-025-00057-z. [18] Y. Qi, R. Xu, and X. Chu. FeaGPT: an End-to-End Agentic-AI for Finite Element Analysis. 2025. doi: 10.48550/ARXIV.2510.21993. [19] R. Sapkota, K. I. Roumeliotis, and M. Karkee. Vibe Coding vs. Agentic Coding: Fundamentals and Practical Implications of Agentic AI. 2025. url: https://arxiv.org/abs/2505.19443. [20] M. Tian et al. SciCode: A Research Coding Benchmark Curated by Scientists. 2024. doi: 10.48550/ ARXIV.2407.13168. [21] J. Wei et al. From AI for Science to Agentic Science: A Survey on Autonomous Scientific Discovery. 2025. doi: 10.48550/ARXIV.2508.14111. [22] L. Xu, D. Mohaddes, and Y. Wang. LLM Agent for Fire Dynamics Simulations. 2024. doi: 10. 48550/ARXIV.2412.17146. [23] Y. Yamada et al. The AI Scientist-v2: Workshop-Level Automated Scientific Discovery via Agentic Tree Search. 2025. doi: 10.48550/ARXIV.2504.08066. [24] C. Yang et al. SwarmFoam: An OpenFOAM Multi-Agent System Based on Multiple Types of Large Language Models. 2026. doi: 10.48550/ARXIV.2601.07252. [25] C. Yuxuan et al. âLarge language model-assisted sensitivity analysis and parameter optimiza- tion in computational fluid dynamicsâ. In: Theoretical and Applied Mechanics Letters (Jan. 2026), p. 100660. issn: 2095-0349. doi: 10.1016/j.taml.2026.100660. [26] T. Zhang et al. MooseAgent: A LLM Based Multi-agent Framework for Automating Moose Simu- lation. 2025. doi: 10.48550/ARXIV.2504.08621. 22