The Last Solver You'll Never Build: An AI-First CFD Architecture
tldr: Stop building monolithic CFD solvers. Instead, let AI assemble a disposable, case-specific solver from pre-verified atomic building blocks — distilled from OpenFOAM, SU2, FEniCS, and beyond — and deliver it as a zero-friction Web app the client can use without ever knowing what CFD stands for.
Document Version: v0.3 Created: March 17, 2026 Last Updated: March 17, 2026 Author: ZDSJTU Document Nature: Invention Disclosure & Technical Architecture Vision
Table of Contents
- Core Philosophy
- Design Philosophy: First Principles Without Shackles
- Overall System Architecture
- The Grand Unified Vocabulary
- Atomic Operation Library
- Pattern Library
- Knowledge Encoding System: From Knowledge Graphs to Skills + Documentation
- AI Orchestrator
- Execution Graph Generation
- JIT Assembly & Code Generation
- Self-Healing Loop
- Interface Protocol
- Cross-Ecosystem Knowledge Distillation
- Detailed Open-Source Codebase Inventory & Extraction Strategy
- Verification Framework
- Client Requirements as First Directive
- Product Delivery Layer: Begin with the End in Mind
- Dual Delivery Paths: Local .exe and Cloud Web
- Moat Analysis & Competitive Strategy
- Technology Stack & Toolchain
- Case Study: 2D Lid-Driven Cavity Flow
- Roadmap & MVP Planning
- Intellectual Property Protection Strategy
- Open Questions & Future Directions
- Metaphysical Framework: Four-Layer Ontological Architecture
1. Core Philosophy
1.1 One-Sentence Description
Rather than building general-purpose CFD software, let AI assemble a “just enough” frontend + solver + post-processing from a pre-verified building block library on demand for each client’s specific case, delivering a customized product the client can use directly.
1.2 Paradigm Shift
The traditional CFD software model is:
- Developers spend years building a general-purpose solver
- Then spend more years on verification
- Sell it to users via licenses
- Users require extensive training to use it
- 99% of the software’s features are irrelevant to the user’s current case
The new model proposed by this system is:
- Extract verified atomic-level building blocks from global open-source CFD codebases
- The client describes their specific problem
- AI automatically selects building blocks, assembles code, and generates the interface
- Delivers a minimal Web application customized solely for that case
- The client needs no CFD knowledge, no software installation, and no pre/post-processing tools to learn
1.3 Philosophical Foundation
The foundation of this system rests on one insight: The essence of CFD software is the process of discretizing physical laws and solving them, and this process can be decomposed into a finite number of physically meaningful atomic operations. Any CFD problem, no matter how complex, is some permutation and combination of these atomic operations.
Traditional software pre-encodes all possible permutations in a massive codebase; our system has AI select the correct permutation in real-time for each specific problem.
This is analogous to: traditional software is an encyclopedia containing all chapters; our system is an author who can instantly write a precise answer based on your question—an author whose knowledge comes from having read all encyclopedias, but who writes only the page you need each time.
1.4 Key Assumptions
This vision is based on the following assumptions, which are being continuously validated as AI technology advances:
- AI code generation capabilities will continue to improve: LLMs’ ability to understand and generate code will keep strengthening, making “assembling complete programs from building blocks” increasingly reliable.
- Context windows will continue to expand: Larger contexts mean AI can reference more building blocks and domain knowledge in a single interaction.
- Agent capabilities will continue to mature: Enhanced multi-step reasoning, tool calling, and self-correction capabilities make automated code assembly and debugging possible.
- Open-source CFD codebases will remain active: Projects like OpenFOAM, SU2, and FEniCS will continue to develop, providing continuously updated knowledge sources for building block extraction.
2. Design Philosophy: First Principles Without Shackles
2.1 Core Mantra: Don’t Over-Constrain the AI
The design philosophy of this system originates from the underlying logic of deep learning’s evolution. In early computer vision, experts painstakingly hand-designed feature extractors—these were “shackles.” The real breakthrough came from feeding raw pixels directly to neural networks and letting them find patterns on their own—this is “first principles.”
Similarly, when building an AI-driven CFD system, there are two fundamentally different architectural paradigms:
The Old Paradigm Full of Shackles (Hardcoded Pipeline): Using traditional software engineering thinking, treating AI as a glorified if-else trigger. To run a computation, the developer writes countless highly customized interfaces—a specific function to regex-match and modify the time step in controlDict, another function specifically to extract residual data from a particular line. Such systems are extremely brittle: an extra space in the underlying software’s log format, or a version change, and the entire workflow collapses. This isn’t an intelligent agent; it’s an automation script with a thin veneer of intelligence.
The New Paradigm from First Principles (First-Principles Agent): Treating AI as a “virtual engineer” with genuine perception and manipulation capabilities. Instead of writing trivial wrappers, give it the most fundamental, most generalizable “atomic-level” tools:
- The ability to observe the world: Read the file system, view directory structures
- The ability to change the world: Write text (code/configuration files), execute terminal commands
- Injection of core laws: Tell it the most fundamental physical constraints (e.g., ensure the Courant number is below 1, residuals must converge)
Hand the complexity back to the large model, rather than piling it into your middleware code.
2.2 Implications for System Architecture
This philosophy provides the following concrete guidance for the system:
-
The building block library provides capabilities, not workflows: Building blocks are independent functions, not steps hardcoded into some pipeline. AI autonomously decides the calling order and combination.
-
Skills files provide knowledge and constraints, not instructions: Tell the AI “central differencing for the convection term oscillates at high Peclet numbers,” not “if Pe > 2 then call function_switch_to_upwind().” The former is knowledge; the latter is a shackle.
-
Self-healing relies on AI reasoning, not preset error-handling branches: When a computation diverges, instead of
if error_code == 42 then do_fix_42(), let the AI read the logs, analyze residual patterns, consult diagnostic knowledge in Skills files, and decide on a repair strategy. -
System expansion doesn’t require writing more code, but writing better knowledge documents: Adding a new physics domain (e.g., expanding from fluids to solid mechanics) primarily involves writing Skills files and adding building blocks, not modifying the orchestrator’s code.
2.3 Distinction from Traditional Agent Frameworks
Many AI Agent frameworks on the market (such as LangChain) are still essentially “chain-of-calls” thinking—predefining steps A → B → C → D. Our system’s Agent is closer to a human engineer with a toolbox and professional knowledge: give them a goal (“solve this fluid problem”), and they decide how to do it.
This means that as the underlying LLM capabilities improve, the system’s capabilities will automatically enhance—because the bottleneck isn’t in hardcoded workflows, but in AI’s reasoning and judgment capabilities.
3. Overall System Architecture
3.1 Three-Layer Architecture
The entire system is divided into three layers, from bottom to top:
Bottom Layer: Core Technical Assets (Not Visible to Clients)
- Atomic Operation Library: Verified code building blocks
- Pattern Library: Algorithm skeletons and combination rules
- Verification Database: Validation records for each building block and combination
- Domain Knowledge Documents (Skills Files): Encoded expert judgment
Middle Layer: AI Delivery Engine (Not Visible to Clients)
- AI Orchestrator: Understands requirements, selects building blocks, generates execution graphs
- JIT Assembler: Transforms execution graphs into runnable code
- Self-Healing Loop: Automatically diagnoses and fixes runtime issues
- Frontend Generator: Generates customized UI based on case requirements
Top Layer: Client Product (The Only Thing the Client Sees)
- A customized Web application
- A minimal parameter input interface (containing only parameters relevant to the case)
- Embedded result visualization (contour plots, curves, key metrics)
- No installation required, no training needed, ready to use upon opening
3.2 Data Flow
Client Requirements (natural language / structured form)
↓
AI Orchestrator (requirement parsing → pattern matching → building block selection)
↓
Execution Graph (DAG: pre-processing → solving → post-processing)
↓
JIT Assembler (code generation: solver + frontend + post-processing)
↓
Compile / Run / Verify
↓ (if failed)
Self-Healing Loop (diagnose → swap building blocks → reassemble → rerun)
↓ (if successful)
Customized Web Application → Delivered to Client
4. The Grand Unified Vocabulary
If we discard all existing frameworks (OpenFOAM, React, FastAPI) and reduce a “computational fluid dynamics product” to its most fundamental “LEGO bricks,” it is composed of four dimensions of primitive vocabulary. This vocabulary is the foundational language for the AI Orchestrator’s reasoning.
4.1 Underlying Physics (The Physics) — Laws of the Universe
There is no code here, only the inviolable laws of nature.
Conservation: The ancestor of all physical equations. Conservation of mass (fluid cannot appear or disappear from nothing), conservation of momentum (the fluid version of Newton’s second law), conservation of energy. Representative equation: the Navier-Stokes equations.
Spacetime Domain: The stage where physical phenomena occur. Includes the spatial boundary (Space Domain, Ω) and time span (Time Domain, t).
State Variables: Scalars or vectors describing the current state of the fluid. The three most fundamental: pressure (p), velocity (u), temperature (T). Extended to other physical scenarios: stress tensor (σ), concentration (c), electric field (E), etc.
Constraints:
- Initial Conditions (IC): The state of the system at t=0
- Boundary Conditions (BC): Rules on the domain boundaries. The two most fundamental abstractions: Dirichlet (prescribing boundary values) and Neumann (prescribing boundary gradients/fluxes). All complex engineering boundary conditions (wall functions, inlet turbulence profiles, etc.) are variants or combinations of these two.
4.2 Solver & Computational Mathematics (The Solver & Math) — Bridge from Physics to Numbers
Computers don’t understand continuous calculus; they only understand discrete arithmetic. The solver’s primitive vocabulary is all about “chopping up” and “approximating.”
Discretization: The act of “chopping up” the continuous spacetime domain.
Mesh/Grid: The skeleton after chopping. The smallest digital containers carrying physical state variables include: Cells, Nodes, and Faces.
Linear System: No matter how complex the partial differential equation, it ultimately reduces to an algebraic system Ax=b. A is the coefficient matrix, x is the unknown state variable, b is the known conditions.
Iteration: Because equations are usually nonlinear, the computer can only start from an initial value and repeatedly loop to approximate the true solution.
Residual: A measure of the gap between the current approximate solution and the true solution (the difference between the left and right sides of the equation). When the residual approaches zero, convergence has been achieved.
Time Stepping: The discrete time increment (Δt) that drives the virtual system forward in time. Its magnitude is constrained by the CFL condition (Courant Number).
4.3 Backend Infrastructure (The Backend Infrastructure) — Resource Scheduling Steward
The backend’s essence is managing input/output (I/O) and allocating computational resources.
Contract/Schema: The language specification for communication between frontend and solver. A pure JSON or struct defining what parameters go in and what results come out.
State Machine: Describes the lifecycle of a computational task: Pending → Running → Failed → Completed.
Job/Task: A single independent computational request. It must be asynchronous, because physical simulations take time, and the entire system cannot block waiting.
Compute Resource: Hardware executing the task. At the lowest level: Thread, Process, or GPU Kernel.
I/O Stream: The channel for moving data between disk and memory. Input is geometry and parameter configuration; output is field data.
4.4 Frontend Interaction & Visualization (The Frontend & Projection) — Mapping & Projection
The frontend’s foundation isn’t buttons and menus, but the “projection” of “data” onto the human eye.
State Store: Client-side cached data. The user entered a velocity of 2 m/s—this data is temporarily stored here before being sent to the backend.
Component: A function. It takes State as input and outputs corresponding visual pixels/DOM elements (UI = f(State)).
Event: An action that breaks the static state. Mouse clicks, keyboard input from the user, or “computation complete” signals pushed from the backend. Events trigger State updates.
Renderer: Maps numerical matrices (coordinates and corresponding physical quantity values) into geometric shapes and color spectra that humans can understand (WebGL/Canvas).
4.5 The Grand Unified Flow
The vocabulary across four dimensions, linked together, describes a complete computational process:
User triggers an Event in the Frontend → updates the State Store → packages parameters into a Contract and sends it to the Backend → Backend creates an async Job and allocates Compute Resources → launches the Solver → Solver Discretizes the parameters to build an Ax=b Linear System → follows Conservation laws to perform Iteration → upon reaching Convergence, writes State Variables to the I/O Stream → Backend updates the state machine to Completed → Frontend receives the signal, uses the Renderer to project data onto the screen.
What the AI Orchestrator should be thinking about isn’t “how to write React code” or “how to configure OpenFOAM,” but directly manipulating these most fundamental primitives.
5. Atomic Operation Library
5.1 What Is “Atomic”? — Philosophical Definition of Atomic Boundaries
In this system, the definition of “atomic operations” follows a core principle: The boundary of an atomic operation is the dividing line between “physical meaning” and “pure computation.”
The gradient operator has physical meaning—it describes the rate of change of a physical quantity in space. Array traversal has no physical meaning—it merely iterates through data in memory. Our building blocks stop at the layer with physical meaning and don’t decompose further.
This principle ensures:
- Each building block has clear physical semantics, allowing AI to perform physics-level correctness checks during assembly
- Building blocks are fine-grained enough for flexible combination
- Building blocks are not so fine-grained that assembly complexity explodes
5.2 Five Atomic Categories
For the CFD domain, all computations can ultimately be decomposed into five categories of atomic operations:
5.2.1 Field Operations
Per-point operations on scalar or vector fields over a discrete mesh.
- Field initialization (uniform, read from file, defined by function)
- Field arithmetic (addition, subtraction, multiplication, division, linear combination)
- Field copy and swap
- Field norm computation (L1, L2, Linf)
- Field boundary value extraction and assignment
5.2.2 Discrete Differential Operators
The core of PDE discretization. Three basic operators cover the vast majority of CFD equations:
- Gradient: Scalar field → Vector field
- Variants: Gauss gradient, least-squares gradient, Green-Gauss node gradient
- Divergence: Vector field/flux → Scalar field
- Variants: Central differencing, first-order upwind, second-order upwind, TVD (vanLeer, Superbee, MUSCL), QUICK
- Laplacian: Scalar field → Scalar field
- Variants: Orthogonal correction, non-orthogonal correction (minimum correction, over-relaxation correction)
Each operator’s “semantics” is identical (input a field, output another field), but there are multiple implementation variants. Semantics are fixed; variants are swappable.
5.2.3 Linear Algebra Operations
The heart of the solver.
- Sparse matrix assembly (from discrete equations to Ax=b)
- Matrix-vector multiplication
- Linear system solution: direct methods (LU), iterative methods (Jacobi, Gauss-Seidel, SOR, CG, BiCGSTAB, GMRES)
- Preconditioners (ILU, AMG, Diagonal)
- Residual computation
5.2.4 Mesh Queries
The geometric foundation for all discrete operators.
- Cell neighbor queries
- Face area and normal vectors
- Cell volumes
- Face interpolation weights
- Boundary face identification
- Mesh quality metrics (skewness, non-orthogonality, aspect ratio)
- Structured mesh index mapping
5.2.5 Boundary Condition Injection
Mathematically, these are constraints; in code, they are modifications to the matrix and right-hand-side vector.
- Dirichlet (fixed value)
- Neumann (fixed gradient)
- Robin (mixed type)
- Periodic boundary
- Symmetry boundary
- Inlet/outlet specific conditions (velocity inlet, pressure outlet, free outflow)
- Wall conditions (no-slip, slip, wall functions)
5.3 Building Block Metadata Structure
Each building block, in addition to the code itself, must carry the following metadata:
id: divergence_upwind_v1
name: "First-Order Upwind Convective Divergence Operator"
category: discrete_differential_operator
subcategory: divergence
# Physical semantics
description: "Computes div(F * phi) using first-order upwind scheme"
input:
- name: flux_field
type: face_scalar_field
description: "Mass flux on faces"
- name: phi_field
type: cell_scalar_field
description: "The scalar field being transported"
- name: mesh
type: mesh_object
description: "Mesh object providing topology and geometry information"
output:
type: cell_scalar_field
description: "Divergence field, defined at cell centers"
# Provenance
source:
software: "OpenFOAM"
version: "v2312"
file: "src/finiteVolume/interpolation/surfaceInterpolation/schemes/upwind/upwind.H"
extraction_date: "2026-03-17"
extraction_method: "AI-assisted extraction + human review"
# Applicability conditions & constraints
applicability:
- "Applicable to any Peclet number"
- "Unconditionally stable (bounded)"
- "First-order accuracy, exhibits numerical diffusion"
- "Not suitable for high-accuracy academic computations; appropriate for industrial preliminary assessments"
known_limitations:
- "Numerical diffusion is significant at low Peclet numbers, results may be over-smoothed"
- "Performs well for convection-dominated problems"
# Compatibility
compatibility:
mesh_types: ["structured", "unstructured", "polyhedral"]
time_schemes: ["steady", "transient_euler", "transient_bdf2"]
incompatible_with: []
# Validation records
validation:
- case: "lid_driven_cavity_Re100"
reference: "Ghia et al. 1982"
max_deviation: "2.1% (centerline u-velocity)"
date: "2026-03-20"
- case: "backward_facing_step_Re389"
reference: "OpenFOAM tutorial pitzDaily"
max_deviation: "1.8% (reattachment point location)"
date: "2026-03-22"
5.4 Multi-Source Variant Management
Multiple variants from different software are retained for the same physical operation:
divergence_upwind_v1 # Source: OpenFOAM/finiteVolume
divergence_upwind_v2 # Source: SU2/numerics
divergence_upwind_v3 # Source: In-house/based on textbook (LeVeque)
divergence_tvd_vanLeer_v1 # Source: OpenFOAM
divergence_tvd_vanLeer_v2 # Source: SU2
divergence_central_v1 # Source: FEniCS (weak form conversion)
Each variant independently maintains provenance and validation records. During assembly, AI selects the most appropriate variant based on the current case’s conditions and validation records.
6. Pattern Library
6.1 The Essence of Patterns
Patterns are not human-prescribed flowcharts. Patterns are the “projections” of physical laws into the discrete world.
The mathematical structure of the Navier-Stokes equations dictates that you must handle pressure-velocity coupling; the elliptic nature of the continuity equation dictates that you need a global pressure solve step. These are not design choices—they are mathematical necessities.
Therefore, the Pattern Library encodes: For each class of PDE system, record its mathematical properties (elliptic/parabolic/hyperbolic, coupling relationships), and the reasonable algorithm skeletons derived from them.
6.2 Pattern Structure Definition
Each pattern contains:
- Applicable physical scenarios: What types of problems belong to this pattern
- Governing equations: The PDE system corresponding to this pattern
- Algorithm skeleton: Pseudocode of the solving steps, where specific atomic operations are left as “slots”
- Slot constraints: Which atomic operations can fill each slot, and under what conditions each should be selected
- Parameter heuristics: Experience-based recommendations for mesh density, relaxation factors, convergence criteria, etc.
6.3 Core Pattern Examples
Pattern A: Incompressible Steady Laminar Flow (SIMPLE Family)
Applicable scenarios:
- Incompressible flow (Ma < 0.3)
- Steady or quasi-steady state
- Laminar (low Re) or RANS turbulence
Governing equations:
- Continuity equation: ∇·u = 0
- Momentum equation: ∇·(uu) = -∇p + ∇·(ν∇u)
- (Optional) Energy equation: ∇·(uT) = ∇·(α∇T)
Algorithm skeleton:
Initialize u, p fields (and T field, if energy equation is included)
LOOP:
1. Assemble momentum equation: [convection operator](u, u) + [diffusion operator](ν, u) = -[gradient operator](p)
2. Solve momentum equation → u* (intermediate velocity)
3. Assemble pressure correction equation: [Laplacian operator](1/A, p') = [divergence operator](u*)
4. Solve pressure correction equation → p'
5. Correct velocity: u = u* - (1/A) * [gradient operator](p')
6. Correct pressure: p = p + α_p * p'
7. (If applicable) Solve energy equation
8. Check residuals; exit if converged
END LOOP
Slot constraints:
- [Convection operator]:
- Re < 100: central differencing is viable
- Re > 100: upwind or TVD recommended
- Re > 1000: TVD or upwind strongly recommended
- [Diffusion operator]:
- Orthogonal mesh: standard Gauss is sufficient
- Non-orthogonal mesh: non-orthogonal correction required
- [Linear solver]:
- Momentum equation: smoothSolver + GaussSeidel is usually sufficient
- Pressure equation: PCG + AMG preconditioner (elliptic equation, convergence is critical)
Parameter heuristics:
- Relaxation factor α_U: 0.7 (default), can reduce to 0.3-0.5 for high Re
- Relaxation factor α_p: 0.3 (default)
- Mesh density: run with a coarse mesh first, then refine to verify mesh independence
- Convergence criteria: residuals drop to 1e-4 ~ 1e-6
Pattern B: Compressible Inviscid Flow (Euler Equations)
Applicable scenarios:
- Compressible flow (Ma > 0.3)
- Inviscid or viscous effects negligible
- Shocks, expansion waves, and other compressibility effects
Governing equations:
- ∂ρ/∂t + ∇·(ρu) = 0
- ∂(ρu)/∂t + ∇·(ρuu) + ∇p = 0
- ∂(ρE)/∂t + ∇·((ρE+p)u) = 0
- Equation of state: p = ρRT
Algorithm skeleton:
Initialize conserved variables Q = [ρ, ρu, ρE]
TIME LOOP:
1. Compute face fluxes: [Riemann solver](Q_L, Q_R)
2. (If higher order needed) [Reconstruction operator] from cell centers to faces
3. Flux integration: [divergence operator](F)
4. Time advancement: [time integrator](Q, dQ/dt)
5. Apply boundary conditions
6. Check CFL / residuals
END TIME LOOP
Slot constraints:
- [Riemann solver]: Roe, HLL, HLLC, Rusanov
- Strong shocks: HLLC or Roe + entropy fix
- Simple problems: Rusanov (simplest, most dissipative)
- [Reconstruction operator]: first-order (no reconstruction), MUSCL, WENO
- [Time integrator]: explicit Euler, RK2, RK4, implicit BDF
Pattern C: Steady Heat Conduction
Applicable scenarios:
- Pure heat conduction, no flow
- Steady state
Governing equations:
- ∇·(k∇T) = Q (heat source term)
Algorithm skeleton:
1. Generate mesh
2. Assemble: [Laplacian operator](k, T) = Q
3. Apply boundary conditions (Dirichlet temperature / Neumann heat flux)
4. Solve linear system
5. Post-processing: temperature contour plot, heat flux computation
6.4 Pattern Combination & Extension
Complex problems are handled through pattern combination. For example:
- Conjugate heat transfer = Pattern A (fluid domain flow and convective heat transfer) + Pattern C (solid domain heat conduction) + interface coupling conditions
- Fluid-structure interaction = Pattern A (fluid) + solid mechanics pattern + interface force/displacement transfer
The Pattern Library should be composable—complex patterns are composed by nesting or parallelizing simple patterns, rather than defining a new pattern for every complex scenario.
7. Knowledge Encoding System: From Knowledge Graphs to Skills + Documentation
7.1 Why Not Traditional Knowledge Graphs
The problems with traditional knowledge graphs (e.g., Neo4j graph databases):
- Extremely high maintenance cost; every rule needs manual addition
- Rigid structure, difficult to express fuzzy experiential judgments
- Querying requires a specific graph query language
- Integration with modern AI toolchains (LLMs, Agents) is unnatural
7.2 New Paradigm: Skills Files + Code Repository + Validation Cases
In the context of modern AI programming tools like Claude Code and Codex, “knowledge graphs” are effectively replaced by three things:
(1) Skills Files (Domain Knowledge Encoded in Natural Language)
Markdown or text files stored in the code repository, clearly stating in natural language:
- Under what conditions to use which building blocks
- Compatibility constraints between building blocks
- Common pitfalls and countermeasures
- Heuristic rules for parameter selection
AI reads these files directly, gaining domain knowledge far more flexibly than querying a graph database.
(2) The Code Repository Structure Itself
The organization of building blocks, naming conventions, and directory structure are themselves a form of knowledge expression. AI can browse the repository structure to understand “what building blocks are available and how they are categorized.”
(3) Validation Case Library
Each validation case comes with input conditions, the building block combinations used, run results, and comparisons with reference data. This is implicit knowledge—AI guides current case building block selection by examining which building block combinations have been successfully validated under similar conditions.
7.3 The Philosophical Essence of Knowledge Encoding
Knowledge graphs (regardless of form) don’t encode facts—they encode judgment.
Anyone can look up the steps of the SIMPLE algorithm, but “under these specific conditions, what scheme to choose, what mesh density, what parameters”—this judgment is the real knowledge.
An expert with over a decade of CFD experience has a vast amount of tacit knowledge in their head. One of this system’s core goals is to transform this tacit knowledge into explicit knowledge and encode it in a machine-operable form.
This is isomorphic to CFD tutorials on Bilibili—videos transform tacit knowledge into human-understandable language; Skills files transform tacit knowledge into machine-understandable structure.
8. AI Orchestrator
8.1 The Orchestrator’s Role
What the orchestrator does is essentially the same as what an experienced CFD engineer does: make decisions.
Facing a specific case, a veteran engineer’s decision process is:
- What type of flow is this? → Select pattern
- How complex is the geometry? → Select mesh strategy
- What’s the Re number? → Select convection scheme
- What accuracy is needed? → Select mesh density and convergence criteria
- What results does the client want to see? → Select post-processing methods
The orchestrator replicates this decision chain. Skills files are the basis supporting these decisions.
The orchestrator’s philosophical role is: it is a search algorithm over the knowledge system. Given the user’s constraints, find a reasonable path through the space of possible building block combinations.
8.2 Technical Implementation
In modern AI toolchains, the orchestrator naturally maps to:
- Main Agent: Understands user requirements, selects patterns, generates execution graphs
- Subagents: Each responsible for specific tasks
- Mesh generation Subagent
- Solver assembly Subagent
- Post-processing and frontend generation Subagent
- Tools / MCP: The building block library, validation database, and compilation/runtime environment are connected as tools
8.3 Orchestrator Mapping to Claude Code / Skills
| Traditional Concept | Modern AI Toolchain Mapping |
|---|---|
| Knowledge graph query | AI reads Skills files and Validation Case Library |
| Rules engine | LLM reasons based on natural language rules in Skills |
| Workflow engine | Agent’s multi-step reasoning and tool calling |
| Subsystem invocation | Subagents with division of labor |
| Configuration file generation | AI directly generates code |
9. Execution Graph Generation
9.1 From Natural Language to DAG
User input: “Help me compute a 2D lid-driven cavity flow at Re=1000. I want to see velocity streamlines and centerline velocity distribution.”
AI translates this into a Directed Acyclic Graph (DAG):
[Generate 128×128 structured mesh]
↓
[Initialize u, v, p fields = 0]
↓
[Set boundary conditions: top u=1, remaining walls u=0, v=0]
↓
[SIMPLE loop]
├─ Convection term: upwind (Re=1000, stability needed)
├─ Diffusion term: Gauss linear (structured mesh, orthogonal)
├─ Pressure solver: CG + DIC preconditioner
├─ Relaxation factors: α_U=0.7, α_p=0.3
└─ Convergence criterion: 1e-6
↓
[Extract centerline u(y) distribution] + [Compute streamlines]
↓
[Generate Web page: streamline plot + centerline curve + comparison with Ghia 1982]
9.2 Why DAG Instead of Linear Flow
The reasons for using a DAG instead of a linear workflow are:
- Some operations have no dependencies and can run in parallel (e.g., multiple post-processing operations)
- The DAG structure itself represents an understanding of the problem—which steps depend on which prerequisites
- During self-healing, only the affected subgraph of the DAG needs to be re-executed, rather than rerunning from scratch
9.3 Decision Basis for Execution Graph Parameters
Each node’s parameter choices are traceable:
- 128×128 mesh: because Ghia 1982’s classic validation used this resolution
- Upwind scheme: at Re=1000, Pe > 2, central differencing would oscillate
- SIMPLE over PISO: steady-state problem
- Convergence criterion 1e-6: engineering-grade accuracy requirement
These decision rationales are recorded in the execution graph, serving both as diagnostic information during self-healing and as explanations for reviewers about “why this was chosen.”
10. JIT Assembly & Code Generation
10.1 Core Principle: Transparency Over Abstraction
The generated code must follow a core design principle: Human readability first.
This is a deliberate philosophical choice:
- OpenFOAM chose high abstraction—one line of code expresses an equation, with implementation details hidden. This is good for human engineers because human working memory is limited.
- Our system faces a different scenario: AI is the code generator, and humans (developers, client technical advisors) are the code reviewers. In this scenario, transparency is more important than abstraction.
The code should be written so that “one glance tells you what it’s doing,” not “one glance looks elegant but you don’t know what’s happening underneath.”
10.2 Characteristics of Generated Code
- Completely self-contained: No dependence on any external framework or runtime. One file (or a few files) is everything.
- Human-readable: Every critical step is commented, explaining the physical meaning and rationale for the choice.
- Extremely minimal: Contains only the code needed to solve the current case. No “just in case” generic interfaces.
- Directly runnable: When the client (or their technical staff) receives the code, they can run it without configuring any environment.
10.3 The Meaning of “Disposable”
The generated code is one-time-use—it serves only this one case. If the client’s requirements change (e.g., they want to add a new boundary condition), instead of modifying this code, they re-describe their requirements and let AI reassemble a fresh set of code.
This sounds wasteful, but in reality:
- The marginal cost of AI code generation approaches zero
- Each regeneration can leverage the latest building block library and validation data
- Avoids code rot from “patching and band-aiding”
- The client doesn’t need to maintain any code
10.4 No Need for a Custom DSL
We don’t need to design a new Domain-Specific Language (DSL).
OpenFOAM’s DSL was designed to let human engineers express equations in a near-mathematical way, reducing human cognitive load. But AI doesn’t need syntactic sugar—writing a hundred lines of explicit loops and writing one line of operator expression cost AI the same.
What AI truly needs isn’t concise syntax, but clear semantic contracts—each operation’s preconditions, output guarantees, and compatibility constraints. These are already encoded in Skills files and building block metadata.
Our “DSL” is effectively: natural language (Skills files) + naming conventions + function signature conventions. Maintenance cost is minimal, extensibility is maximal.
11. Self-Healing Loop
11.1 The Essence of Self-Healing: Diagnosis, Not Random Attempts
When generated code fails to run (computation diverges, non-physical results, compilation errors), the self-healing system shouldn’t randomly swap building blocks—it should diagnose.
This is essentially the same as a doctor treating a patient: symptoms → diagnosis → prescription → follow-up.
11.2 Diagnostic Signals
- Compilation errors: Building block interface mismatches; check type and dimension consistency
- Runtime errors: Array out-of-bounds, division by zero, NaN appearance
- Residual divergence:
- Global divergence vs. local divergence
- Divergence from the first step vs. divergence halfway through
- Which variable diverges first (velocity? pressure? temperature?)
- Non-physical results:
- Velocity exceeding reasonable ranges
- Negative pressure (in incompressible flow)
- Temperature violating energy conservation
11.3 Diagnostic Knowledge Base
Each diagnostic signal corresponds to a set of possible causes and countermeasures, encoded in Skills files:
## Common Divergence Diagnostics
### Symptom: Pressure equation residual grows rapidly in the first few steps
Possible causes:
1. Relaxation factor too large → Countermeasure: reduce α_p to 0.1-0.2
2. Poor mesh quality (high skewness) → Countermeasure: check mesh quality, or switch to non-orthogonal correction
3. Initial field too far from the solution → Countermeasure: run a few hundred steps with first-order scheme first, then switch to higher order
### Symptom: Velocity field shows oscillation (checkerboard pattern)
Possible causes:
1. Missing Rhie-Chow interpolation → Countermeasure: confirm pressure-velocity coupling includes Rhie-Chow correction
2. Central differencing used for convection term but Re is too high → Countermeasure: switch to upwind or TVD scheme
11.4 Self-Healing Workflow
Run failure
↓
Collect diagnostic signals (error messages, residual history, field statistics)
↓
AI matches the most likely cause based on diagnostic knowledge in Skills
↓
Generate repair plan (swap building block variant / adjust parameters / modify mesh)
↓
Return to execution graph, modify only affected nodes
↓
Reassemble affected code segments
↓
Rerun
↓
Check if fixed → if still failing, try the next possible cause
↓ (maximum N attempts)
If all attempts fail → report to human developer with all diagnostic information
11.5 Important Limitation: Self-Healing Is Not Omnipotent
The self-healing system handles known types of failures—patterns documented in the diagnostic knowledge base. For entirely new, previously unseen failure modes, the system should honestly report “I don’t know why it failed” rather than blindly experimenting.
The real difficulty of self-healing isn’t “swapping building blocks” but understanding constraint relationships between building blocks—divergence is often not caused by a single bad building block, but by problematic combinations (e.g., the interplay between convection scheme and time step, the match between mesh quality and gradient computation method).
12. Interface Protocol
12.1 Core Interface Concept: Field
All atomic operations’ inputs and outputs revolve around one core concept: Field = Mesh + Data + Boundary Conditions.
class ScalarField:
mesh: Mesh # Mesh reference
internal_values: array # Cell-center values
boundary_values: dict # {patch_name: boundary_data}
class VectorField:
mesh: Mesh
internal_values: array # Cell-center values (N×dim)
boundary_values: dict
class FaceScalarField:
mesh: Mesh
internal_values: array # Internal face values
boundary_values: dict # Boundary face values
12.2 Unified Signatures for Atomic Operations
All discrete operators follow a unified function signature pattern:
# Gradient
def gradient(phi: ScalarField, method: str = "gauss") -> VectorField
# Divergence
def divergence(flux: FaceScalarField, phi: ScalarField,
method: str = "upwind") -> ScalarField
# Laplacian
def laplacian(gamma: ScalarField, phi: ScalarField,
method: str = "gauss_linear") -> ScalarField
# Linear solve
def solve(A: SparseMatrix, b: array,
solver: str = "cg", preconditioner: str = "ilu") -> array
# Boundary conditions
def apply_bc(phi: Field, bc_spec: dict) -> Field
12.3 Interfaces Defined from Physical Quantities, Not Data Structures
Rather than mandating that inputs and outputs must be some standardized Tensor, we define interfaces from the perspective of physical quantities. Interfaces inherently carry physical meaning, making it easier for AI to perform correctness checks during assembly.
For example: gradient accepts a scalar field and returns a vector field—this is physically self-evident. If AI tries to call gradient on a vector field, it knows from physical intuition that this should return a tensor field, and thus selects the correct building block.
12.4 Deeper Implications of the Interface Protocol
This interface protocol essentially defines a Domain-Specific Language (DSL)—but not a traditional programming language requiring a parser. Rather, it’s a set of conceptual vocabulary and combination rules:
- Atomic operations are words
- Patterns are grammar
- Execution graphs are sentences
- The AI Orchestrator is the speaker
13. Cross-Ecosystem Knowledge Distillation
13.1 Core Idea
Extract the strongest implementations from major global open-source CFD software at the atomic level, cross-compare them, and distill building blocks verified through multiple sources.
13.2 Primary Knowledge Sources
| Software | Core Strengths | Extraction Focus |
|---|---|---|
| OpenFOAM | Incompressible flow, industrial mesh handling, rich boundary conditions | FVM discrete operators, SIMPLE/PISO implementations, non-orthogonal corrections, wall functions |
| SU2 | Compressible flow, adjoint optimization, aerospace applications | Roe/HLLC schemes, implicit time advancement, Riemann solvers |
| FEniCS | Finite element framework, weak form expression | Variational form to matrix mapping, high-order element implementation |
| deal.II | Adaptive mesh refinement (AMR), high-order methods | AMR algorithms, hp-refinement |
| Gmsh | Mesh generation | Structured/unstructured mesh generation algorithms |
| VTK / ParaView | Post-processing and visualization | Iso-surface, streamline, and slice extraction algorithms |
| PETSc | Parallel linear algebra | High-performance linear solvers and preconditioners |
13.3 Extraction Principle: Atomic-Level Trade-offs
Don’t make strength/weakness judgments at the software level—make them at the atomic level.
“SU2 is strong at compressible flow” is a coarse-grained impression. The reality might be: SU2’s Roe scheme implementation is indeed refined, but its time advancement in certain situations isn’t as good as a particular OpenFOAM variant.
The correct approach is:
- For the same atomic operation, extract one version from each of multiple software packages
- Each version retains its provenance tag
- Compare different versions’ performance on validation cases
- Based on comparison data, determine “under what conditions which version is better”
Don’t presume who’s better or worse—let the validation data speak.
13.4 Extraction Method
This isn’t about “cutting code” from existing software—large software packages (especially OpenFOAM) have extremely high code coupling, making clean extraction very difficult.
The correct strategy is:
- AI reads the original source code, understanding the algorithm logic and engineering details
- Re-implement in a transparent manner, following this system’s interface protocol
- Annotate provenance, recording “this building block’s algorithm logic comes from OpenFOAM v2312’s specific file”
- Human expert review, confirming the re-implementation’s correctness
OpenFOAM’s value isn’t in its C++ code itself, but in its decades of accumulated algorithm implementation details and engineering experience—how to handle non-orthogonal corrections, how to do Rhie-Chow interpolation, how to handle ghost values for various boundary conditions. These details are often glossed over in papers but are hundreds of lines of careful handling in code.
13.5 The Unique Moat of Knowledge Distillation
This cross-ecosystem knowledge distillation is itself a moat:
- No single software company will proactively do cross-ecosystem fusion, because their commercial interest is locking users into their own ecosystem
- The building block library isn’t a subset of any single existing software, but a cross-distillation of multiple software packages’ best elements
- Over time, an increasing number of building block variants will be “in-house”—not extracted from any existing software, but redesigned based on experience from multiple sources plus original understanding
14. Detailed Open-Source Codebase Inventory & Extraction Strategy
To operationalize “cross-ecosystem knowledge distillation,” we need to systematically “procure” and “deconstruct” the open-source world. Below is a detailed codebase inventory categorized by pre-processing, solver, and post-processing, along with their extraction value.
14.1 Pre-processing Layer: From Nothing to Discrete Geometry
14.1.1 Geometry Engines
CGAL (Computational Geometry Algorithms Library)
- Positioning: The “bible” of computational geometry
- Extraction value: Underlying Boolean operations (intersection, union, difference), point-in-polygon testing, Delaunay triangulation, Voronoi diagram generation. Provides the most rigorous mathematical implementations of geometric algorithms—a pure algorithm library stripped of all UI.
- Applicable scenarios: Cases requiring complex geometric operations (e.g., multi-body combinations, cutting)
OpenCASCADE (OCCT)
- Positioning: Industrial-grade CAD kernel
- Extraction value: Capability to handle industrial CAD formats (STEP, IGES). AI can use its Python bindings (pythonocc) to directly generate precise B-Rep (Boundary Representation) geometry via code, without requiring users to draw using a GUI.
- Applicable scenarios: Industrial cases where clients provide CAD files
14.1.2 Mesh Generation
Gmsh
- Positioning: The go-to open-source mesh generator
- Extraction value: Extremely script-driven (.geo files or C++/Python API), naturally suited for AI-driven use. AI can compute hyperbolic tangent node distributions for near-wall refinement, then call the Gmsh API to define Point → Line → Surface → Physical Group, with a single command
gmsh.model.mesh.generate(2)to generate the mesh. Supports structured, unstructured, and hybrid meshes. - Key building blocks: Mesh size field definition, boundary layer mesh generation, structured transfinite meshing
blockMesh (from OpenFOAM)
- Positioning: Pure hexahedral structured mesh generation
- Extraction value: While blockMeshDict syntax is complex, its logic is extremely clear (define vertices → define blocks → define faces). AI excels at generating this kind of structured dictionary file.
- Applicable scenarios: High-quality hexahedral meshes for regular geometries
14.2 Solver & Physics Layer
14.2.1 Matrix & Linear Solvers
PETSc (Portable, Extensible Toolkit for Scientific Computation)
- Developer: Argonne National Laboratory
- Positioning: The undisputed champion of parallel scientific computing
- Extraction value: Extremely high modularity. Robust Krylov subspace methods (KSP) and algebraic multigrid (AMG) preconditioners can be extracted. Interface protocol standardization is extremely high, making it the cornerstone for building large-scale parallel solvers.
- Key building blocks: CG, GMRES, BiCGSTAB solvers; ILU, AMG preconditioners; parallel matrix assembly
Eigen
- Positioning: C++ header-only linear algebra library
- Extraction value: Header-only means AI doesn’t need complex library linking during JIT compilation—just
#includeto embed efficient sparse matrix operations into generated code. Good CUDA support. Very suitable for lightweight cases with local delivery. - Key building blocks: Sparse matrix storage (CSR/CSC), SpMV, dense matrix operations
14.2.2 Discretization & PDE Semantics
FEniCS / dolfinx
- Positioning: Top-tier open-source finite element framework
- Extraction value: Its UFL (Unified Form Language) allows direct mathematical formula input (variational forms). AI can directly output UFL expressions, then use FEniCS’s C++ generation engine (FFCx) to JIT-compile pure mathematical equations into efficient discrete operator code. This is the shortest path from “equations to code.”
- Key building blocks: Automatic mapping from weak forms to matrices, high-order finite element basis functions
OpenFOAM
- Positioning: Classic finite volume method C++ library
- Extraction value: The underlying fvMatrix class and discrete operator library (fvm::div, fvc::grad, fvm::laplacian) are priceless algorithmic treasures. Key extraction targets include spatial discretization algorithms (various upwind schemes, TVD schemes), non-orthogonal correction implementations, Rhie-Chow interpolation, and wall functions.
- Key building blocks: Full family of convection discretization schemes, SIMPLE/PISO pressure-velocity coupling, boundary condition handling details
SU2
- Positioning: Compressible flow and adjoint optimization
- Extraction value: Refined implementations of Roe/HLLC/JST compressible flux schemes, implicit time advancement (LU-SGS), adjoint methods and optimization frameworks.
- Key building blocks: Riemann solver family, flux limiters, adjoint equation discretization
14.2.3 Mesh Topology & Adaptivity
AMReX
- Developer: Lawrence Berkeley National Laboratory
- Positioning: Exascale computing framework
- Extraction value: Core capability for handling adaptive mesh refinement (AMR). When a user’s problem has localized high gradients (shocks, boundary layers), its AMR data structures and multigrid solvers can be extracted. Native GPU acceleration support (CUDA/HIP), extremely suitable as the spatial foundation for high-performance parallel computing.
- Key building blocks: Patch-based AMR data structures, MultiFab field operations, Embedded Boundary cut-cell meshes
deal.II
- Positioning: Adaptive finite elements
- Extraction value: hp-refinement (simultaneously refining the mesh and raising polynomial order), parallel adaptive mesh management.
- Key building blocks: A posteriori error estimation, dynamic load balancing
14.2.4 Next-Generation JIT Physics Compilers
Taichi Lang
- Positioning: Programming language for physics simulation
- Extraction value: Write physics simulation code in Python syntax, with the backend automatically compiling to highly optimized CUDA/Metal/Vulkan kernels. AI only needs to generate high-level Python physics constraint code; the compiler automatically handles parallelization and memory management. Highly aligned with the “JIT assembly” philosophy.
JAX
- Positioning: Differentiable computing and accelerator programming
- Extraction value: Automatic differentiation (extremely valuable for adjoint methods and optimization problems), XLA compiler compiles Python code into GPU/TPU-optimized machine code, vmap vectorization transforms. Suitable for cases requiring parameter sensitivity analysis or optimization.
LLVM / OpenAI Triton
- Positioning: The lowest-level compilation infrastructure
- Extraction value: When existing building blocks cannot meet extreme performance demands, AI can generate Triton code (a higher-level GPU programming abstraction than CUDA), with the compiler performing operator fusion and eliminating memory I/O bottlenecks, generating maximally optimized GPU kernels for specific cases.
14.3 Post-processing Layer: Visualization Mapping of High-Dimensional Data
14.3.1 Scientific Visualization Kernels
VTK (Visualization Toolkit)
- Positioning: The underlying foundation of ParaView
- Extraction value: AI should bypass ParaView’s GUI entirely and operate on underlying VTK primitives.
- Key building blocks:
vtkContourFilter/ Marching Cubes: iso-surface extractionvtkStreamTracer: RK4-based streamline tracingvtkCutter: slice extractionvtkGlyph3D: vector field arrow visualizationvtkThreshold: threshold filteringvtkIntegrateAttributes: surface integration (force, heat flux computation)
PyVista
- Positioning: Modern Python wrapper for VTK
- Extraction value: VTK’s C++ and native Python APIs are extremely verbose. PyVista allows completing the entire process of reading meshes, generating slices, drawing streamlines, and outputting static images or interactive HTML in fewer than 10 lines of code. The first choice for AI-generated post-processing code.
14.3.2 Browser-Side Visualization
VTK.js (Kitware)
- Positioning: JavaScript implementation of VTK
- Extraction value: No need to generate images on the backend and send them to the frontend. AI can have the backend push raw Float32Array (field data) to the frontend via WebSocket binary streams, where VTK.js renders 3D iso-surfaces and streamlines directly in the browser’s WebGL pipeline. This is the technical foundation for “frontend-embedded visualization.”
Trame (Kitware)
- Positioning: Cloud-native scientific visualization framework
- Extraction value: When mesh data reaches tens of millions of cells, browser memory will crash. Trame launches a headless ParaView rendering server on the backend, pushing only the rendered pixel stream (via WebRTC) to the frontend container. Suitable for cloud delivery of large-scale industrial cases.
14.3.3 Lightweight Charts
Plotly.js / Chart.js
- Extraction value: Used for generating centerline velocity distributions, residual convergence histories, parameter sweep curves, and other 2D charts. Lightweight, interactive, and natively supported by browsers.
14.4 Orchestration & Scheduling Layer
Ray (by Anyscale)
- Positioning: Distributed computing framework
- Extraction value: When AI needs to partition the fluid domain into multiple blocks for parallel computation, it can spin up multiple Ray Actors for distributed solving. Overcomes the Python GIL limitation, supports CPU and GPU mixed scheduling.
FastAPI + Pydantic
- Extraction value: AI can use Pydantic to instantly generate strict data validation Schemas (rejecting illegal physical parameters like negative fluid density), then use FastAPI to generate non-blocking API endpoints. Fully type-safe.
15. Verification Framework
15.1 Core Verification Strategy: Transitive Verification
This system doesn’t need to perform extensive experimental verification on its own. The core strategy is transitive verification:
- Developers of mature software like OpenFOAM and SU2 have already performed extensive verification against experimental data
- We only need to verify that our building blocks can reproduce these software packages’ results
- If their results match experiments, and our results match theirs, then our results also indirectly match experiments
15.2 Verification Data Sources
- OpenFOAM tutorials: Dozens of standard cases with complete input configurations and reference results
- SU2 TestCases: Numerous validated cases, especially for compressible flow and optimization
- Classic academic benchmarks:
- Ghia et al. 1982 (cavity flow)
- Kim & Moin 1985 (turbulent channel flow)
- Schäfer & Turek 1996 (flow around a cylinder)
- NASA Turbulence Modeling Resource: The authoritative dataset for turbulence model validation
- ERCOFTAC: European CFD validation database
15.3 Automated Verification Workflow
Iterate through the validation case library:
For each case:
1. Parse input conditions (geometry, mesh, boundary conditions, physical parameters)
2. AI assembles solver code using the building block library
3. Run the computation
4. Extract key result metrics
5. Compare with reference data
6. Record results:
- Pass (deviation within acceptable range) → enters validation database
- Fail → flagged for diagnosis, deviation details recorded
7. Update validation records for involved building blocks
15.4 Verification Traceability
Verification is traceable—this is the fundamental difference from black-box commercial software.
Traditional commercial software tells you “we’ve undergone extensive verification,” but you don’t know specifically what was verified. This system can tell each client for their case:
“This problem involves incompressible turbulent flow over a backward-facing step. We have 12 validation cases with similar geometry and Re number ranges, using the same building block combinations. Maximum deviation is within 3%. Here are the specific comparison data and reference sources.”
15.5 Verification-Driven Flywheel
Client case → AI assembles and solves → Result verification → Validation library expands
→ Next similar case is more reliable → More client trust → More cases
Each case completed makes the system more reliable, and this reliability is documentable. This is a positive feedback loop.
16. Client Requirements as First Directive
16.1 Core Principle: The Client’s Requirements Are the First Directive
In the entire system workflow, client requirement gathering is the starting point of everything, and the client’s directive is the First Directive. No matter how powerful the AI Orchestrator is or how rich the building block library, if there’s any deviation in understanding client requirements, all subsequent work is wasted.
Just as Claude Code generates a CLAUDE.md to record key project context when understanding a code repository, when engaging each client, we must create a tailored Client Specification Document at the very beginning—think of it as a .md file belonging to that client. This document is the supreme directive source for the AI Orchestrator; all system decisions must comply with it.
16.2 Complete Dimensions of Requirement Gathering
Client requirements are not just “what do I want to compute.” Communication and documentation must be thorough across all of the following dimensions:
16.2.1 Physical Problem Definition
- Computation type: Fluid, heat transfer, solid mechanics, multi-physics coupling?
- Flow characteristics: Compressible or incompressible? Laminar or turbulent? Steady or transient?
- Geometry description: Does the client have a CAD file, or does it need to be generated from parametric descriptions? How complex is the geometry?
- Fluid/material properties: What working fluid? Do material properties vary with temperature/pressure?
- Boundary conditions: What are the inlet conditions, outlet conditions, wall conditions? Any special source terms or external loads?
16.2.2 Accuracy & Performance Priorities
This is one of the most critical decisions—the client’s priority ranking of the following three:
- Accuracy: How precise do the results need to be? Engineering estimate level (10-20% error) or academic validation level (error < 2%)?
- Robustness: Would the client rather sacrifice some accuracy to ensure the computation doesn’t diverge and always produces a result?
- Speed: What’s the maximum acceptable runtime? Seconds (interactive parameter tuning), minutes (quick assessment), or hours (detailed analysis)?
The priority ordering among these three directly determines the AI Orchestrator’s building block selection strategy. For example: speed priority → coarse mesh + first-order scheme + relaxed convergence criteria; accuracy priority → fine mesh + high-order scheme + strict convergence + mesh independence verification.
16.2.3 Mesh Preferences
- Coarse or fine mesh: Does the client have a specific mesh size preference? Is a mesh convergence study needed?
- Mesh type preference: Structured (suitable for regular geometry, efficient) or unstructured (suitable for complex geometry, flexible)?
- Local refinement needs: Which regions are the client’s focus areas requiring finer mesh?
16.2.4 Parameterization & Interaction Requirements
- Adjustable parameters: Which parameters does the client want to modify in the product? Inlet velocity? Temperature? Geometric dimensions? Material properties?
- Parameter ranges: What’s the reasonable range for each adjustable parameter? (This determines the parameter space within which the system must ensure stability)
- Interaction mode: Slider for real-time parameter tuning? Input box submit for recomputation? Batch parameter sweep?
16.2.5 Output & Visualization Requirements
- Physical quantities of interest: Pressure distribution? Velocity field? Temperature field? Wall shear stress? Lift/drag coefficients? Heat flux?
- Visualization format: 2D contour plot? 3D iso-surface? Streamlines? Cross-sections? Animation?
- Quantitative output: Are specific location values needed (e.g., outlet average temperature)? Are integral quantities needed (e.g., total pressure drop, total heat transfer)?
- Report format: Is an auto-generated PDF report needed? Is CSV data export needed?
16.2.6 Deployment & Runtime Environment
- Cloud or local: Does the client want to use it in a browser or download it to run locally?
- Parallel computing needs: Is parallel computing needed? What’s the client’s hardware situation (how many CPU cores? GPU available?)?
- Maximum acceptable runtime: This directly constrains mesh size and algorithm selection
- Data privacy: Does the client have concerns about uploading data to the cloud? (Some industrial clients may require purely local execution)
16.2.7 Budget & Delivery Timeline
- Budget range: This determines how much computational resources and human review time we can invest in this case
- Delivery timeline: How quickly does the client need the product?
16.3 Client Specification Document Structure
After gathering is complete, a structured Client Specification Document is generated. This document is the “First Directive” for the entire system:
# Client Specification Document
# Case ID: CASE-2026-0042
# Client: [Client Name]
# Date: 2026-XX-XX
## Physical Problem
type: incompressible_flow
regime: turbulent
state: steady
geometry: pipe_with_bend
fluid: water_20C
special_physics: none
## Boundary Conditions
inlet:
type: velocity_inlet
value: 2.0 # m/s
parameter_adjustable: true
range: [0.5, 5.0]
outlet:
type: pressure_outlet
value: 0 # Pa (gauge)
walls:
type: no_slip
thermal: adiabatic
## Priority Ranking (1=highest)
priority:
speed: 1
robustness: 2
accuracy: 3
## Mesh
mesh_preference: coarse_first
mesh_type: unstructured
refinement_zones:
- location: bend_region
reason: "Client focuses on pressure drop at the bend"
## Output Requirements
quantities_of_interest:
- pressure_drop_total
- velocity_contour_bend
- pressure_contour_bend
- wall_shear_stress_bend
visualization: 2d_contour_slices
export: csv_centerline_data
## Deployment
deployment: cloud_web
parallel: not_required
max_runtime: 120 # Maximum acceptable runtime: 120 seconds
data_privacy: standard
## Delivery
budget: standard
deadline: 3_days
16.4 How the Client Specification Document Drives the System
Once generated, this document becomes the supreme directive source for the AI Orchestrator:
Drives pattern selection: type: incompressible_flow + regime: turbulent + state: steady → Select the “incompressible steady RANS” pattern.
Drives building block selection: priority.speed: 1 → Select first-order upwind convection scheme (sacrificing accuracy for speed), simple k-ε turbulence model (rather than the more accurate but slower k-ω SST).
Drives mesh strategy: mesh_preference: coarse_first + max_runtime: 120s → Back-calculate the upper bound on mesh size.
Drives frontend generation: inlet.parameter_adjustable: true + inlet.range: [0.5, 5.0] → Generate a 0.5-5.0 slider on the frontend. The quantities_of_interest list directly determines what visualizations the post-processing code generates.
Drives deployment path: deployment: cloud_web → Take the cloud delivery path.
16.5 Requirements Change Management
Client requirements are not immutable. After using the product, clients may raise new requirements:
- “I also want to see temperature distribution” → Need to add the energy equation, update the physical problem definition
- “I want to adjust the pipe diameter” → Need to parameterize the geometry, update the mesh generation logic
- “Results aren’t accurate enough” → Adjust priorities, switch to a higher-accuracy building block combination
For each requirement change, update the Client Specification Document and let AI reassemble. Since code is “disposable,” regeneration cost is low. Don’t patch old code—start fresh from the new specification document to regenerate the entire system.
16.6 Synergy with the Bilibili Community and Course System
For course students and community users, requirement gathering can be more lightweight—through structured forms on cfdqanda.com, or completed directly in conversation. But the core logic remains: figure out what the client wants first, then start building.
This “ask clearly before acting” workflow is itself a manifestation of CFD professional discipline. Many novice engineers’ mistake is jumping straight into meshing and computing without clearly thinking about the goal. The product can enforce this best practice at the process level—no assembly begins until the requirements form is complete.
17. Product Delivery Layer: Begin with the End in Mind
17.1 Core Product Design Principle
The client doesn’t want building blocks, doesn’t want a solver, doesn’t want code—the client wants something they can directly use.
A typical client’s experience should be:
- Open a webpage
- See a clean interface—only parameter input fields relevant to their problem
- Modify parameters (inlet velocity, temperature, geometric dimensions)
- Click “Compute”
- Wait a few minutes
- See results: contour plots, curves, key metrics
- Done
The client doesn’t need to know what the letters CFD stand for.
17.2 Key Features of the Customized Frontend
- Only relevant parameters: If the client says “I want to change the inlet velocity to see the effect,” then inlet velocity is an adjustable slider. If they don’t need to change geometry, geometric parameters don’t appear in the interface at all.
- Embedded visualization: Post-processing is done directly in the browser (WebGL / Plotly / VTK.js)—no requirement for the client to install ParaView or any other tool.
- Targeted results: Don’t give the client a generic “rotate-slice-do-anything” 3D viewport. Instead, directly show the specific views they want to see—AI knows what the client cares about when generating the frontend.
- No installation required: Web application, open the link and use it.
17.3 Key Product Design Concept: Every Extra Option Exposed Loses a Client
The problem with traditional CFD software isn’t insufficient features—it’s exactly too many features. Open Fluent: hundreds of menus, thousands of parameters, 99% irrelevant to the current problem.
The value of this product is precisely eliminating that 99%. Every element on the interface is directly related to the client’s problem, with nothing superfluous. This “just enough” isn’t cutting corners—it’s deep customization.
17.4 Avoiding Third-Party Tool Dependencies
If you tell a client “the results are generated, please open this VTK file in ParaView,” most non-technical clients are lost.
All post-processing should be embedded directly in the customized webpage. You don’t need ParaView’s universal capabilities—just displaying the few views relevant to the client’s problem.
18. Dual Delivery Paths: Local .exe and Cloud Web
18.1 Core Design Principle: Deployment Agnosticism
The core physical computation logic generated by the AI Orchestrator is written only once. The difference lies solely in the final step’s “Deployment Protocol.” This requires the underlying building blocks and assembly logic to achieve absolute decoupling of UI and core algorithms.
18.2 Path One: Local Delivery (Local .exe) — Forging Minimal “Digital Artifacts”
User scenario: “Give me a program that can compute 2D cavity flow, and I’ll run it on my own Windows PC.”
AI’s role: Cross-compiler + packager.
Dead code elimination & static linking: AI extracted mesh generation, solver core, and post-processing building blocks, but won’t package these libraries entirely. It generates extremely customized C++ code, using static linking to stamp the called matrix operators and discrete operators directly into the final binary. No user environment variables or dependency library installation needed.
Minimal local interface: No bloated Qt interface. Use Tauri (Rust-based) or Dear ImGui (C++-based) to generate an extremely lightweight interface—just a few input boxes and a Run button.
Deliverable: A single executable file of only a few dozen MB. The user double-clicks to open, inputs parameters, highly optimized C++ code maxes out the local CPU/GPU, then a clean rendering window pops up.
Philosophical meaning: Software degenerates into a pure “Disposable Tool” like a wrench.
18.3 Path Two: Cloud Delivery (Cloud Web) — The Omniscient Black Box
User scenario: The client doesn’t even need to download an .exe—just open a webpage and use it.
AI’s role: Full-stack architect + microservice orchestrator.
State separation & stateless backend: The frontend webpage (hosted on Vercel or Cloudflare) is responsible for only two things: receiving user parameters and displaying results. User input is packaged as a JSON contract and sent to the backend via API. The backend creates an async task and generates a unique TaskID.
Ephemeral containers & headless computation: After the task enters the queue, the system dynamically spins up a Docker container loaded with AI-generated solver code. The post-processing module generates streamlines and iso-surfaces in memory, compressed into a lightweight 3D file format (.vtp or .glTF). After completion, the container is instantly destroyed, releasing cloud compute resources.
Frontend projection: The user’s browser listens for task completion via WebSocket, fetches the result file, and renders the 3D flow field in Canvas using VTK.js.
For ultra-large-scale data: The Trame architecture can be adopted, launching a headless ParaView rendering server on the backend and pushing only the rendered pixel stream (WebRTC) to the frontend, preventing browser memory crashes.
Philosophical meaning: For the client, the cloud is an “Oracle”—input a question, wait a few seconds, get an answer. They have absolutely no idea what technology powers it underneath.
18.4 Integration with the Existing cfdqanda.com Architecture
The existing Cloudflare + Vercel + Supabase architecture is naturally suited for the cloud delivery path:
- Vercel hosts the generated frontend pages
- Supabase manages task state and result storage
- Cloudflare Workers handle API routing and CDN
- Computation is handled via Serverless Functions or dedicated compute servers
The local delivery path operates independently of cfdqanda.com, provided as a downloadable product.
19. Moat Analysis & Competitive Strategy
19.1 What Is NOT a Moat
- Code itself: Big companies have more engineers and can write more code
- AI tools: Claude Code, Codex, and similar tools are available to everyone
- Algorithm knowledge: Papers and textbooks are public
19.2 The Real Moats
Moat 1: Verification Database (Data Flywheel)
Each case completed accumulates one more validation data point. This database can only be built through time and case volume. First-mover advantage is significant. Big companies won’t do customized verification for long-tail market small clients.
Moat 2: Codification of Domain Judgment
Over a decade of CFD experience, encoded into Skills files, validation case selection criteria, and Agent decision logic. Big companies have algorithm experts, but no one wants to spend time writing their judgment into AI-usable form—they’re busy publishing papers and doing projects.
Moat 3: Community Trust & Brand
The CFD content creation community on Bilibili, course student groups, cfdqanda.com users—this is an active user community that trusts specific creators. Users aren’t using anonymous software; they’re using “the system verified by Zeng.”
Moat 4: Cross-Ecosystem Knowledge Distillation
The building block library is a cross-distillation of multiple open-source software packages’ best elements, not a subset of any single software. No single software company will proactively do this kind of cross-ecosystem fusion.
19.3 Competitive Strategy
- Don’t compete head-on with Ansys: Don’t build a general platform; build extremely vertical products deeply tied to a personal brand
- Course students are the first users: Their cases are the first validation data; their feedback drives product iteration
- Small team is an advantage: Rapid iteration, direct user communication, instant improvement. At a big company, changing a default parameter value requires three meetings
20. Technology Stack & Toolchain
20.1 AI Layer
- Main Agent engine: Claude Code or similar products (Codex)
- Domain knowledge management: Skills files + CLAUDE.md (natural language encoding)
- Tool integration: MCP protocol connecting building block library, validation database, and runtime environment
20.2 Building Block Library
- Primary languages: Python (prototyping & education), C/C++ (performance-critical building blocks)
- Organization: Git repository, organized by atomic category into directories
- Metadata: Each building block accompanied by YAML or Markdown metadata files
20.3 Verification Infrastructure
- Automated testing framework: Python script-driven batch verification
- Reference data storage: Stored alongside validation cases in the Git repository
- Comparison report generation: Auto-generated deviation reports and visual comparison charts
20.4 Product Delivery Layer
- Frontend: React (generated on demand by AI)
- Visualization: Plotly.js / VTK.js / Three.js / WebGL
- Backend: FastAPI or similar lightweight framework (generated on demand by AI)
- Deployment: Vercel / Cloudflare Workers (consistent with existing cfdqanda.com architecture)
20.5 Compute Infrastructure
- Lightweight cases: Run directly on the server with Python/NumPy
- Heavy cases: Invoke HPC resources (cloud GPU, AWS/GCP spot instances)
- Future possibility: WebAssembly running small cases directly in the browser
21. Case Study: 2D Lid-Driven Cavity Flow
21.1 Why This Case
The 2D lid-driven cavity is one of CFD’s most classic benchmarks. A square box with three stationary walls and a top wall sliding to the right at constant velocity.
Though simple, it contains nearly all core elements of incompressible flow: convection, diffusion, pressure-velocity coupling, wall boundary layers, corner singularities, and vortex structures. Moreover, there is abundant publicly available reference data (Ghia 1982 is the most classic).
21.2 Specific Manifestation of Key Concepts in This Case
Atomic Operations
All atomic operations needed for this case:
Field operations:
- Initialize velocity fields u, v and pressure field p (all zeros)
- Field addition/subtraction and linear combination (during velocity correction)
Discrete differential operators:
gradient(p)→ pressure gradient, source term for momentum equationdivergence(flux, u)→ convection termlaplacian(nu, u)→ diffusion termdivergence(u)→ continuity check
Linear algebra:
- Assemble momentum equation matrix
- Assemble pressure Poisson equation matrix
- Solve two linear systems
Mesh queries:
- 128×128 structured mesh → neighbor relationships directly computable from indices
- Face area = Δx or Δy
- Cell volume = Δx × Δy
Boundary condition injection:
- Top wall: u = U_lid, v = 0 (Dirichlet)
- Other three walls: u = 0, v = 0 (Dirichlet, no-slip)
- Pressure: one reference point fixed to 0
Pattern
Belongs to the “incompressible steady laminar flow” pattern (Pattern A), using the SIMPLE algorithm skeleton.
AI Orchestrator’s Decision Chain
- Re = 1000 → Laminar, no turbulence model needed
- Cavity is regular geometry → Structured mesh
- 128×128 → Ghia 1982’s resolution, sufficient for validation
- Convection term → Upwind (at Re=1000, Pe>2, central differencing would oscillate)
- SIMPLE is sufficient (steady-state problem)
- Convergence criterion 1e-6
Execution Graph
[Generate 128×128 structured mesh]
↓
[Initialize u=0, v=0, p=0]
↓
[Set BC: top u=1,v=0; walls u=0,v=0; p reference point=0]
↓
[SIMPLE loop (max 5000 steps)]
├─ Assemble x-momentum equation (upwind convection + linear diffusion)
├─ Solve x-momentum → u*
├─ Assemble y-momentum equation
├─ Solve y-momentum → v*
├─ Assemble pressure correction equation
├─ Solve pressure correction → p'
├─ Correct u, v, p
├─ Relaxation: α_U=0.7, α_p=0.3
└─ Check residual < 1e-6
↓
[Extract u distribution at y=0.5, v distribution at x=0.5]
↓
[Compute streamlines]
↓
[Generate Web page]
├─ Velocity vector/streamline plot
├─ Centerline u(y) comparison curve with Ghia 1982 data
└─ Convergence history plot
Self-Healing Scenario
Suppose residuals start growing at step 200:
- Diagnostic signal: pressure residual rising, velocity residual following
- AI consults Skills file: possible cause—relaxation factors too large
- Prescription: reduce α_U to 0.5, α_p to 0.2
- Rerun
- If still diverging → second possible cause: mesh too coarse causing instability at high Re
- Prescription: refine mesh to 256×256
- Rerun
Interface Protocol Manifested in This Case
All data passing through the “field” interface:
u = ScalarField(mesh, np.zeros(n_cells), bc_u) # x-velocity
v = ScalarField(mesh, np.zeros(n_cells), bc_v) # y-velocity
p = ScalarField(mesh, np.zeros(n_cells), bc_p) # pressure
grad_p = gradient(p) # Returns VectorField
div_uu = divergence(flux_u, u) # Returns ScalarField
lap_u = laplacian(nu_field, u) # Returns ScalarField
Validation
- Reference data: Ghia, Ghia & Shin (1982), “High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method,” Journal of Computational Physics
- Comparison metrics: u-velocity distribution along the vertical centerline, v-velocity distribution along the horizontal centerline
- Acceptable deviation: < 2% (compared with Ghia data)
What the Client Receives
A webpage containing:
- A Re number input box (default 1000)
- A “Compute” button
- Results area: streamline plot + centerline velocity curve (automatically overlaid with Ghia data for comparison)
- Possibly a “Download Report” button
That’s it. Simple as that.
22. Roadmap & MVP Planning
22.1 Short Term: OpenFOAM AI Assistant (0-3 Months)
Goal: Rapidly deliver value using existing technology while accumulating cases and user feedback.
Specifics:
- Build an Agent based on Claude Code / Skills that helps users configure and run OpenFOAM cases
- Users describe their problem, and the Agent generates OpenFOAM configuration files (
system/,constant/,0/) - Integrated post-processing: automatically generate ParaView scripts or Web-based result displays
- Target users: Course students, cfdqanda.com users
Value:
- Immediately creates value for users
- Accumulates case data and user requirement patterns
- Validates the feasibility of “AI understanding CFD requirements”
Limitations:
- Dependent on OpenFOAM, low moat
- Essentially an OpenFOAM frontend, not an independent product
22.2 Mid Term: Building Block Library Construction & Verification (3-12 Months)
Goal: Build core technical assets.
Specifics:
- Building block extraction:
- Have AI thoroughly read core modules of OpenFOAM, SU2, FEniCS
- Distill algorithm essentials and re-implement transparently
- Establish the building block metadata system (provenance, applicability, compatibility)
- Verification infrastructure:
- Automated verification pipeline: iterate through OpenFOAM tutorials and SU2 test cases
- Automatically assemble, run, and compare results
- Generate verification reports
- Skills file writing:
- Systematically encode domain judgment into Skills
- Including: pattern selection rules, parameter heuristics, common error diagnostics
- End-to-end demo:
- Select 3-5 representative cases (cavity flow, pipe flow, backward-facing step, heat transfer problem)
- Implement the complete chain: “user describes → AI assembles → runs → customized Web display”
- No longer dependent on OpenFOAM
22.3 Long Term: Productization & Scaling (12+ Months)
Goal: Become a sustainably operating product.
Specifics:
- Continuously expand the building block library (more physics domains: multiphase flow, turbulence, solid mechanics, heat transfer)
- Continuously grow the verification database (every client case is a validation)
- Productize: stable Web platform, paid subscription or per-case pricing
- Community building: users can contribute validation cases, parts of the building block library open to the community
- Deep integration with Bilibili content and course system
23. Intellectual Property Protection Strategy
23.1 Current Stage (Concept Phase)
- Invention disclosure document: This document serves this purpose. Recording the complete technical vision with dates, as temporal priority evidence.
- Public discussion (Prior Art): Consider publicly discussing this concept on Bilibili. The benefit is establishing “prior art,” preventing others from patenting the same concept to restrict you. The cost is that you also won’t easily be able to patent it later. But considering that the moat is in execution rather than patents, this may be the wiser strategy.
23.2 MVP Stage
- Code repository protection: Building block library and Skills files maintained as private repositories
- Verification database protection: Validation records and comparison data protected as core commercial assets
- If specific creative technical solutions are invented during the MVP process, file targeted patents
23.3 Long Term
- The core moat is in execution, not patents: verification database depth, Skills quality, community trust
- Consider patenting creative aspects of building block library organization methods, verification automation workflows, and AI orchestration algorithms
- Brand protection: register trademarks
24. Open Questions & Future Directions
24.1 Unresolved Technical Issues
-
Optimal building block granularity: How fine is “fine enough”? Too fine and assembly complexity explodes; too coarse and flexibility is insufficient. The balance point needs to be found in practice.
-
Building-block-ization of unstructured meshes: Building blocks for structured meshes are relatively simple (neighbors computable directly from indices); unstructured mesh data structures and traversal patterns are more complex. How to make them into building blocks requires in-depth design.
-
Building-block-ization of parallel computing: Serial single-machine building blocks are relatively simple, but real industrial problems require parallel computing (MPI/GPU). How to integrate parallel strategies into the building block system is an important question.
-
Building-block-ization of turbulence models: RANS models (k-ε, k-ω SST) are relatively straightforward to decompose, but LES/DNS involve more complex mesh and time step requirements.
-
Handling complex geometries: Simple geometries can have meshes generated by scripts, but complex industrial geometries (e.g., engine combustion chambers, turbine blades) require CAD import and complex mesh generation workflows.
24.2 Potential Future Extensions
- Multi-physics coupling: Fluid-thermal, fluid-structure, electromagnetic-fluid coupling problems
- Optimization & inverse design: Not just “solve given conditions” but “find the optimal design given objectives”
- Uncertainty quantification: Automated parameter sensitivity analysis and uncertainty propagation
- Real-time digital twins: Combining simulation results with actual sensor data, updating models in real-time
- Educational platform integration: The building block library itself is excellent teaching material, integratable into CFD courses
24.3 Key Risks
- AI capability ceiling: If AI code generation capability improvement slows, system reliability may be insufficient for complex industrial cases
- Big company entry: If Ansys or Siemens decides to do something similar, they have more resources and larger verification databases
- Numerical reliability: AI-generated code may produce “looks reasonable but actually wrong” results, which is very dangerous in engineering
- Client acceptance: Traditional CFD users may be skeptical of “AI-generated solvers”
24.4 Long-Term Vision
The ultimate goal is not to make a CFD software, but to change the delivery model of engineering simulation—from “sell licenses + users learn on their own” to “describe your problem, get your results.”
Clients don’t need to understand CFD, don’t need to learn software, and don’t even need to know what methods are used behind the scenes. This essentially transforms CFD from a software product into a service, and AI is the key to reducing the marginal cost of each service delivery.
25. Metaphysical Framework: Four-Layer Ontological Architecture
From a metaphysical perspective, this system can be understood through four progressive philosophical layers. This stratification is not merely a thinking tool but a methodological safeguard ensuring the system’s design stands on solid foundations.
25.1 Layer One: Ontological Foundation (Ontology) — The Source and Form of Existence
Defining the system’s “fundamental particles” and the spatial laws governing their existence.
The Atomic Operation Library is the system’s irreducible computational primitives. It contains no physical semantics, purely an abstract collection of mathematical operators and memory operations: sparse matrix-vector multiplication (SpMV), discrete gradient operator (∇ₕ), discrete divergence operator (∇ₕ·), Laplacian operator (∇ₕ²), scalar field update (φⁿ⁺¹ = φⁿ + Δt·S). These atomic operations are highly aligned with low-level hardware instruction sets (such as CUDA PTX or LLVM IR), representing the minimal closed loop of Turing machine execution.
The Interface Protocol is the contract and topological boundary between ontological entities. It determines how atomic operations safely perform state passing, serving as the system’s type system and memory model. For example, the MAC staggered grid protocol mandates that scalars (pressure) are stored at cell centers while vectors (velocity) are stored at face centers. Any operator passing that violates this protocol is rejected at the logical level.
25.2 Layer Two: Epistemological Construction (Epistemology) — Extraction and Organization of Laws
Endowing atomic mathematics with physical meaning and organizing them into a knowledge network comprehensible to AI.
The Pattern Library is the algorithmic schemata for solving specific categories of problems. Taking Chorin’s Projection Method as an example, this pattern defines an immutable flow paradigm: compute predicted velocity field u* → solve pressure Poisson equation ∇²pⁿ⁺¹ = (ρ/Δt)∇·u* → velocity field correction uⁿ⁺¹ = u* - (Δt/ρ)∇pⁿ⁺¹. The Pattern Library is the crystallization of decades of computational mathematicians’ wisdom, a methodology for numerically stabilizing nonlinear dynamical systems.
The Knowledge Encoding System is a hypergraph of cross-domain semantic mappings. It establishes lossless mappings from “natural language intent” to “physical laws,” then to “numerical patterns,” and finally to “hardware compute resources.” When a user inputs “I want to compute incompressible water flow in a cavity,” the knowledge system performs chain reasoning: incompressible → divergence-free constraint (∇·u = 0) → must invoke the pressure Poisson equation pattern → 2D steady-state → select conjugate gradient method with AMG preconditioner.
25.3 Layer Three: Teleological Execution (Teleology) — Concretization from Void to Existence
Transforming static knowledge into dynamic, single-target-optimized executable software.
The AI Orchestrator is a meta-programmer. It is not a solver but “an intelligent agent that writes solvers.” It pathfinds through the knowledge system, performing goal-driven deductive reasoning. Upon receiving a 2D laminar flow task at Re=1000, it proactively discards all knowledge nodes about turbulence models, multiphase flow, and combustion—its sole purpose is to plan the computationally most efficient data flow path for this specific problem.
JIT Assembly is the collapse from Abstract Syntax Tree (AST) to machine physical state. Traditional OpenFOAM uses virtual function tables (V-Tables) at runtime to determine 2D vs. 3D and which boundary condition, causing substantial CPU cache misses. JIT assembly performs extreme kernel fusion and dead code elimination, directly generating native code that only handles 2D arrays, with boundary condition constants hardcoded into the instruction stream. The generated program only understands cavity flow, but its execution speed approaches the hardware’s theoretical limits.
25.4 Layer Four: Cybernetic Evolution (Cybernetics) — Dynamic Equilibrium of Dissipative Systems
The system inevitably encounters numerical dissipation or nonlinear divergence during execution, necessitating feedback mechanisms from control theory.
The Self-Healing Loop is a dynamic system’s adaptive negative feedback mechanism. The system outputs not only results but also “meta-cognition” about its own state. When the Courant number exceeds a threshold or the linear solver gets stuck in an ill-conditioned matrix causing residuals to stall, the self-healing daemon intervenes, interrupts the computation, and feeds the error state back to the orchestrator. The orchestrator consults the knowledge system, performs dynamic reconfiguration—reducing the time step or instantly switching the convection discretization scheme from central differencing to upwind—then regenerates the execution graph, compiles, and continues evolving the physical fields.
25.5 Philosophical Summary: From Substance to Process
In one sentence: Traditional engineering software is substance—solidified and bloated; this system is process—fluid and precise.
It strips away all business logic facades and strikes at the essence of numerical computation: under a set of rigorous topological contracts (interface protocol), a super meta-cognitive system (AI Orchestrator), guided by a physical semantic network (knowledge system), dynamically invokes irreducible mathematical building blocks (atomic operations), combines them into solving logic targeting a single objective (pattern library and execution graph), instantly materializes at the hardware level (JIT assembly), while maintaining absolute numerical stability throughout evolution (self-healing loop).
This is the paradigm leap from “using tools” to “directly manipulating underlying computational physics through natural language.”
Appendix
A. Key Terminology
| Term | Definition |
|---|---|
| Atomic Operation | A physically meaningful, irreducible basic computational operation in CFD |
| Building Block | A specific code implementation of an atomic operation, with accompanying metadata |
| Pattern | A standard algorithm skeleton for a class of PDE systems |
| Execution Graph | Translation of user requirements into a DAG-form computational workflow |
| AI Orchestrator | The master Agent that understands requirements, selects building blocks, and generates execution graphs |
| JIT Assembly | The process of transforming an execution graph into runnable code |
| Self-Healing Loop | The mechanism for automatically diagnosing and repairing runtime failures |
| Interface Protocol | Unified specification for data passing between building blocks (centered on the “field” concept) |
| Cross-Ecosystem Knowledge Distillation | Extracting optimal implementations at the atomic level from multiple open-source software packages |
| Transitive Verification | Indirectly verifying your own building blocks by reproducing results from mature software |
| Disposable Code | Generated code is single-use, serving only a specific case |
| Shackle-Free Design | Not constraining AI with hardcoded pipelines; giving it atomic-level tools to make autonomous decisions |
| Grand Unified Vocabulary | The definition system for primitives across four dimensions: physics/solver/backend/frontend |
| Deployment Agnosticism | AI Orchestrator output can be deployed locally or in the cloud, not bound to a specific runtime environment |
| Zero-Friction Delivery | Clients receive results without installation, training, or understanding the underlying technology |
| JIT Physics Compiler | Using tools like Taichi/JAX/Triton to JIT-compile high-level physics code into optimized GPU kernels |
| Meta-Programmer | The essential role of the AI Orchestrator—not writing code, but “writing the logic that writes code” |
| Provenance | Each building block is tagged with its algorithm source’s specific software, version, and file, ensuring auditability |
| Data Contract | Strictly defined parameter passing format (Schema) between frontend and backend, ensuring type safety |
| First Directive Principle | The client’s requirement specification is the system’s supreme directive source; all technical decisions must serve client requirements |
| Client Specification Document | A tailored .md file for each client, recording their physical problem, priorities, output needs, and all other dimensions |
B. Key References
- Ghia, U., Ghia, K.N. & Shin, C.T. (1982). “High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method.” Journal of Computational Physics, 48(3), 387-411.
- OpenFOAM Foundation. OpenFOAM User Guide & Source Code. https://openfoam.org
- SU2: Open-Source CFD Code. https://su2code.github.io
- FEniCS Project. https://fenicsproject.org
- NASA Turbulence Modeling Resource. https://turbmodels.larc.nasa.gov
- PETSc: Portable, Extensible Toolkit for Scientific Computation. https://petsc.org
- Eigen: C++ Template Library for Linear Algebra. https://eigen.tuxfamily.org
- Gmsh: A Three-Dimensional Finite Element Mesh Generator. https://gmsh.info
- VTK: Visualization Toolkit. https://vtk.org
- PyVista: 3D Plotting and Mesh Analysis. https://pyvista.org
- AMReX: Adaptive Mesh Refinement Software Framework. https://amrex-codes.github.io
- deal.II: An Open Source Finite Element Library. https://dealii.org
- Taichi Lang: Productive & Portable High-Performance Programming. https://taichi-lang.org
- JAX: Autograd and XLA. https://github.com/google/jax
- CGAL: Computational Geometry Algorithms Library. https://cgal.org
- OpenCASCADE Technology. https://dev.opencascade.org
- Ray: A Unified Framework for Scaling AI. https://ray.io
- Trame: Web Framework for Scientific Visualization. https://kitware.github.io/trame
- ERCOFTAC: European Research Community on Flow, Turbulence and Combustion. https://ercoftac.org
C. Document Revision History
| Date | Version | Changes |
|---|---|---|
| 2026-03-17 | v0.1 | Initial version, compiled from Claude discussion notes |
| 2026-03-17 | v0.2 | Incremental update: incorporated Gemini conversation content. Added Chapter 2 (Design Philosophy), Chapter 4 (Grand Unified Vocabulary), Chapter 14 (Detailed Open-Source Codebase Inventory), Chapter 18 (Dual Delivery Paths), Chapter 25 (Metaphysical Framework). All chapters renumbered. Expanded terminology and references. |
| 2026-03-17 | v0.3 | Added Chapter 16 (Client Requirements as First Directive), defining the complete dimensions and structured template (YAML) of the Client Specification Document, clarifying how client requirements drive decisions at each system layer. All chapters renumbered (24→25 chapters). |
This document is a Living Document that will be continuously updated as technical validation and product iteration progress.
Ruohai — Senior Software Developer & CFD Lover. Reach me at zdsjtu@gmail.com.