# openfoam/openfoam-9 architecture

> Architecture diagram of the GitHub repository openfoam/openfoam-9, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openfoam/openfoam-9
- Repository: https://github.com/openfoam/openfoam-9

## Overview

OpenFOAM is a general-purpose computational-fluid-dynamics package. Users configure a case and run a solver to calculate flow and related physical phenomena; engine solvers additionally advance engine time and move an engine mesh during the simulation. The tree shows solver families for combustion, heat transfer, electromagnetics, and other domains, alongside shared finite-volume and engine infrastructure. The sampled sources expose parts of the engine-solver workflow, but not the wiring of most solver families, so those branches are shown without inferred call edges.

Main entry points: [`applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C`](https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C) (Cold engine solver), [`src/engine/include/createEngineMesh.H`](https://github.com/openfoam/openfoam-9/blob/master/src/engine/include/createEngineMesh.H) (Engine mesh setup), [`src/engine/engineMesh/engineMesh/engineMesh.H`](https://github.com/openfoam/openfoam-9/blob/master/src/engine/engineMesh/engineMesh/engineMesh.H) (Engine mesh), [`applications/solvers/combustion`](https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/combustion) (Combustion solvers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_physics["Physics solvers"]
  node_combustion["Combustion solvers"]
  node_heat["Heat transfer"]
  node_electro["Electromagnetics"]
  node_incompressible["Incompressible flow"]
  node_multiphase["Multiphase geometry<br/>[MPLICcellStorage.C]"]
end

subgraph group_engine["Engine simulation"]
  node_engine_cold["Cold engine solver<br/>[coldEngineFoam.C]"]
  node_engine_xi["Engine Xi solver<br/>[XiEngineFoam.C]"]
  node_engine_reacting["Reacting engine solver<br/>[engineFoam.C]"]
  node_engine_time["Engine time<br/>[engineTime.H]"]
  node_engine_mesh_factory["Engine mesh setup<br/>[createEngineMesh.H]"]
  node_engine_mesh["Engine mesh<br/>[engineMesh.H]"]
end

subgraph group_core["Shared simulation core"]
  node_fv_core["Finite-volume core<br/>[fvCFD.H]"]
  node_fv_models["Finite-volume models<br/>[fvModels.H]"]
  node_fv_constraints["Finite-volume constraints<br/>[fvConstraints.H]"]
  node_root_case["Case initialization<br/>[setRootCase.H]"]
  node_transport_models["Momentum transport"]
end

subgraph group_analysis["Field analysis"]
  node_postprocess["Field averaging"]
end

node_user(("Case user"))
node_package["OpenFOAM"]

node_user -->|"uses"| node_package
node_package -->|"solves flows"| node_combustion
node_package -->|"solves heat"| node_heat
node_package -->|"solves fields"| node_electro
node_engine_cold -->|"creates time"| node_engine_time
node_engine_cold -->|"creates mesh"| node_engine_mesh_factory
node_engine_mesh_factory -->|"selects mesh"| node_engine_mesh
node_engine_cold -->|"moves mesh"| node_engine_mesh
node_engine_cold -->|"pre-updates mesh"| node_fv_models

click node_combustion "https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/combustion"
click node_heat "https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/heatTransfer"
click node_electro "https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/electromagnetics"
click node_incompressible "https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/incompressible"
click node_engine_cold "https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C"
click node_engine_xi "https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.C"
click node_engine_reacting "https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/reactingFoam/engineFoam/engineFoam.C"
click node_engine_time "https://github.com/openfoam/openfoam-9/blob/master/src/engine/engineTime/engineTime/engineTime.H"
click node_engine_mesh_factory "https://github.com/openfoam/openfoam-9/blob/master/src/engine/include/createEngineMesh.H"
click node_engine_mesh "https://github.com/openfoam/openfoam-9/blob/master/src/engine/engineMesh/engineMesh/engineMesh.H"
click node_fv_core "https://github.com/openfoam/openfoam-9/blob/master/src/finiteVolume/cfdTools/general/include/fvCFD.H"
click node_fv_models "https://github.com/openfoam/openfoam-9/blob/master/src/finiteVolume/cfdTools/general/fvModels/fvModels.H"
click node_fv_constraints "https://github.com/openfoam/openfoam-9/blob/master/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H"
click node_root_case "https://github.com/openfoam/openfoam-9/blob/master/src/OpenFOAM/include/setRootCase.H"
click node_transport_models "https://github.com/openfoam/openfoam-9/blob/master/src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H"
click node_postprocess "https://github.com/openfoam/openfoam-9/blob/master/src/functionObjects/field/fieldAverage/fieldAverageTemplates.C"
click node_multiphase "https://github.com/openfoam/openfoam-9/blob/master/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.C"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_combustion,node_heat,node_electro,node_incompressible,node_multiphase,node_user toneBlue
class node_engine_cold,node_engine_xi,node_engine_reacting,node_engine_time,node_engine_mesh_factory,node_engine_mesh toneAmber
class node_fv_core,node_fv_models,node_fv_constraints,node_root_case,node_transport_models toneMint
class node_postprocess toneRose
class node_package toneIndigo
```

## Components

### Physics solvers

- [Combustion solvers](https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/combustion): `applications/solvers/combustion`
- [Heat transfer](https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/heatTransfer): `applications/solvers/heatTransfer`
- [Electromagnetics](https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/electromagnetics): `applications/solvers/electromagnetics`
- [Incompressible flow](https://github.com/openfoam/openfoam-9/tree/master/applications/solvers/incompressible): `applications/solvers/incompressible`
- [Multiphase geometry](https://github.com/openfoam/openfoam-9/blob/master/src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.C): `src/twoPhaseModels/twoPhaseMixture/MPLIC/MPLICcellStorage.C`

### Engine simulation

- [Cold engine solver](https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C): `applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C`
- [Engine Xi solver](https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.C): `applications/solvers/combustion/XiFoam/XiEngineFoam/XiEngineFoam.C`
- [Reacting engine solver](https://github.com/openfoam/openfoam-9/blob/master/applications/solvers/combustion/reactingFoam/engineFoam/engineFoam.C): `applications/solvers/combustion/reactingFoam/engineFoam/engineFoam.C`
- [Engine time](https://github.com/openfoam/openfoam-9/blob/master/src/engine/engineTime/engineTime/engineTime.H): `src/engine/engineTime/engineTime/engineTime.H`
- [Engine mesh setup](https://github.com/openfoam/openfoam-9/blob/master/src/engine/include/createEngineMesh.H): `src/engine/include/createEngineMesh.H`
- [Engine mesh](https://github.com/openfoam/openfoam-9/blob/master/src/engine/engineMesh/engineMesh/engineMesh.H): `src/engine/engineMesh/engineMesh/engineMesh.H`

### Shared simulation core

- [Finite-volume core](https://github.com/openfoam/openfoam-9/blob/master/src/finiteVolume/cfdTools/general/include/fvCFD.H): `src/finiteVolume/cfdTools/general/include/fvCFD.H`
- [Finite-volume models](https://github.com/openfoam/openfoam-9/blob/master/src/finiteVolume/cfdTools/general/fvModels/fvModels.H): `src/finiteVolume/cfdTools/general/fvModels/fvModels.H`
- [Finite-volume constraints](https://github.com/openfoam/openfoam-9/blob/master/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H): `src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.H`
- [Case initialization](https://github.com/openfoam/openfoam-9/blob/master/src/OpenFOAM/include/setRootCase.H): `src/OpenFOAM/include/setRootCase.H`
- [Momentum transport](https://github.com/openfoam/openfoam-9/blob/master/src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H): `src/MomentumTransportModels/momentumTransportModels/LES/SpalartAllmarasDDES/SpalartAllmarasDDES.H`

### Field analysis

- [Field averaging](https://github.com/openfoam/openfoam-9/blob/master/src/functionObjects/field/fieldAverage/fieldAverageTemplates.C): `src/functionObjects/field/fieldAverage/fieldAverageTemplates.C`

### Other components

- **Case user**
- **OpenFOAM**

## Connections

- Case user → OpenFOAM: uses
- OpenFOAM → Combustion solvers: solves flows
- OpenFOAM → Heat transfer: solves heat
- OpenFOAM → Electromagnetics: solves fields
- Cold engine solver → Engine time: creates time (evidence: `applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C`)
- Cold engine solver → Engine mesh setup: creates mesh (evidence: `applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C`)
- Engine mesh setup → Engine mesh: selects mesh (evidence: `src/engine/include/createEngineMesh.H`)
- Cold engine solver → Engine mesh: moves mesh (evidence: `applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C`)
- Cold engine solver → Finite-volume models: pre-updates mesh (evidence: `applications/solvers/combustion/coldEngineFoam/coldEngineFoam.C`)
