# jiesun-pku/detonationfoam architecture

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

- Interactive diagram: https://gitdiagram.com/jiesun-pku/detonationfoam
- Repository: https://github.com/jiesun-pku/detonationfoam

## Overview

detonationFoam is an OpenFOAM gaseous-detonation CFD solver. A case selects a solver formulation, then the solver advances time, updates the mesh and time step, computes convective fluxes, solves conservation and chemistry equations, corrects transport/turbulence where applicable, and writes results. The README documents Euler and two Navier–Stokes transport options plus optional adaptive mesh refinement, dynamic chemistry load balancing, and low-dissipation reconstruction. The supplied excerpts show selected time-loop, flux, species, and mesh behavior; unsampled subsystem connections are left unasserted or marked optional.

Main entry points: [`applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H) (Mixture-average solver), [`applications/solvers/detonationFoam_V2.0/detonationFoam_V2.0.C`](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/detonationFoam_V2.0.C) (Solver entry), [`applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/fluxScheme/fluxScheme.H`](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/fluxScheme/fluxScheme.H) (Flux update), [`applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H`](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H) (Euler solver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_solver["Solver and equations"]
  node_entry["Solver entry"]
  node_fields["Field setup<br/>[createFields.H]"]
  node_euler["Euler solver<br/>[solverTypeEuler.H]"]
  node_suth["Sutherland solver"]
  node_mix["Mixture-average solver"]
  node_dt["Time-step control<br/>[calculateDt.H]"]
  node_cellular["Cellular diagnostics<br/>[detoCellular.H]"]
  node_equations["Flow equations"]
end

subgraph group_physics["Flux and transport physics"]
  node_fluxfields["Flux update<br/>[fluxScheme.H]"]
  node_riemann["Riemann convection"]
  node_schemes["Flux schemes"]
  node_transport["Mixture transport<br/>[transport]"]
  node_chemistry["Reaction chemistry"]
end

subgraph group_adapt["Mesh and reconstruction"]
  node_mesh2d["2D mesh refinement"]
  node_mesha["Axisymmetric refinement"]
  node_reconstruction["ROUND reconstruction<br/>[src]"]
end

subgraph group_chem["Chemistry load balancing"]
  node_dlbmodel["Chemistry problem<br/>[ChemistryProblem.H]"]
  node_dlbmanager["Load balancing<br/>[LoadBalancer.C]"]
end

node_case(("Simulation case"))
node_result["Written fields"]

node_case -->|"starts"| node_entry
node_entry -.->|"sets up"| node_fields
node_entry -.->|"selects solver"| node_euler
node_entry -.->|"selects solver"| node_suth
node_entry -.->|"selects solver"| node_mix
node_euler -->|"includes"| node_dt
node_euler -->|"includes"| node_cellular
node_euler -->|"updates fluxes"| node_fluxfields
node_suth -->|"includes"| node_dt
node_suth -->|"includes"| node_cellular
node_suth -->|"updates fluxes"| node_fluxfields
node_mix -->|"includes"| node_dt
node_mix -->|"includes"| node_cellular
node_mix -->|"updates fluxes"| node_fluxfields
node_mix -->|"includes equations"| node_equations
node_mix -->|"updates properties"| node_transport
node_mix -->|"writes fields"| node_result
node_equations -.->|"solves species"| node_chemistry
node_chemistry -.->|"uses diffusivity"| node_transport
node_fluxfields -->|"provides flux scheme"| node_riemann
node_riemann -.->|"uses selected scheme"| node_schemes
node_mix -.->|"updates mesh"| node_mesh2d
node_mix -.->|"updates mesh"| node_mesha
node_fluxfields -.->|"may use"| node_reconstruction
node_chemistry -.->|"may balance work"| node_dlbmanager
node_dlbmanager -.->|"manages problems"| node_dlbmodel

click node_entry "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/detonationFoam_V2.0.C"
click node_fields "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/createFields.H"
click node_euler "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H"
click node_suth "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_Sutherland/solverTypeNS_Sutherland.H"
click node_mix "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H"
click node_dt "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/calculateDt.H"
click node_cellular "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/detoCellular.H"
click node_equations "https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage"
click node_fluxfields "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/fluxScheme/fluxScheme.H"
click node_riemann "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/RiemannConvectionScheme/RiemannConvectionScheme.H"
click node_schemes "https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved"
click node_transport "https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/transport"
click node_chemistry "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/rhoYEqn_NS_mixtureAverage.H"
click node_mesh2d "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/dynamicMesh2D/dynamicFvMesh/dynamicRefineFvMesh2D/dynamicRefineFvMesh2D.C"
click node_mesha "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/dynamicMesh2D/dynamicFvMesh/dynamicRefineFvMeshAxi/dynamicRefineFvMeshAxi.C"
click node_reconstruction "https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/ROUNDSchemes/src"
click node_dlbmodel "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/DLBFoam-1.0-1.0_OF8/src/thermophysicalModels/chemistryModel/loadBalancing/ChemistryProblem.H"
click node_dlbmanager "https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/DLBFoam-1.0-1.0_OF8/src/thermophysicalModels/chemistryModel/loadBalancing/LoadBalancer.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_entry,node_fields,node_euler,node_suth,node_mix,node_dt,node_cellular,node_equations toneBlue
class node_fluxfields,node_riemann,node_schemes,node_transport,node_chemistry toneAmber
class node_mesh2d,node_mesha,node_reconstruction toneMint
class node_dlbmodel,node_dlbmanager toneRose
class node_case,node_result toneIndigo
```

## Components

### Solver and equations

- [Solver entry](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/detonationFoam_V2.0.C): `applications/solvers/detonationFoam_V2.0/detonationFoam_V2.0.C`
- [Field setup](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/createFields.H): `applications/solvers/detonationFoam_V2.0/createFields.H`
- [Euler solver](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H): `applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H`
- [Sutherland solver](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_Sutherland/solverTypeNS_Sutherland.H): `applications/solvers/detonationFoam_V2.0/solverTypeNS_Sutherland/solverTypeNS_Sutherland.H`
- [Mixture-average solver](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H): `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`
- [Time-step control](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/calculateDt.H): `applications/solvers/detonationFoam_V2.0/calculateDt.H`
- [Cellular diagnostics](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/detoCellular.H): `applications/solvers/detonationFoam_V2.0/detoCellular.H`
- [Flow equations](https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage): `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage`

### Flux and transport physics

- [Flux update](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/fluxScheme/fluxScheme.H): `applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/fluxScheme/fluxScheme.H`
- [Riemann convection](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/RiemannConvectionScheme/RiemannConvectionScheme.H): `applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/RiemannConvectionScheme/RiemannConvectionScheme.H`
- [Flux schemes](https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/fluxSchemes_improved): `applications/solvers/detonationFoam_V2.0/fluxSchemes_improved`
- [Mixture transport](https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/transport): `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/transport`
- [Reaction chemistry](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/rhoYEqn_NS_mixtureAverage.H): `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/rhoYEqn_NS_mixtureAverage.H`

### Mesh and reconstruction

- [2D mesh refinement](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/dynamicMesh2D/dynamicFvMesh/dynamicRefineFvMesh2D/dynamicRefineFvMesh2D.C): `applications/solvers/detonationFoam_V2.0/dynamicMesh2D/dynamicFvMesh/dynamicRefineFvMesh2D/dynamicRefineFvMesh2D.C`
- [Axisymmetric refinement](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/dynamicMesh2D/dynamicFvMesh/dynamicRefineFvMeshAxi/dynamicRefineFvMeshAxi.C): `applications/solvers/detonationFoam_V2.0/dynamicMesh2D/dynamicFvMesh/dynamicRefineFvMeshAxi/dynamicRefineFvMeshAxi.C`
- [ROUND reconstruction](https://github.com/jiesun-pku/detonationfoam/tree/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/ROUNDSchemes/src): `applications/solvers/detonationFoam_V2.0/ROUNDSchemes/src`

### Chemistry load balancing

- [Chemistry problem](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/DLBFoam-1.0-1.0_OF8/src/thermophysicalModels/chemistryModel/loadBalancing/ChemistryProblem.H): `applications/solvers/detonationFoam_V2.0/DLBFoam-1.0-1.0_OF8/src/thermophysicalModels/chemistryModel/loadBalancing/ChemistryProblem.H`
- [Load balancing](https://github.com/jiesun-pku/detonationfoam/blob/detonationFoam_V1.2_OF8/applications/solvers/detonationFoam_V2.0/DLBFoam-1.0-1.0_OF8/src/thermophysicalModels/chemistryModel/loadBalancing/LoadBalancer.C): `applications/solvers/detonationFoam_V2.0/DLBFoam-1.0-1.0_OF8/src/thermophysicalModels/chemistryModel/loadBalancing/LoadBalancer.C`

### Other components

- **Simulation case**
- **Written fields**

## Connections

- Simulation case → Solver entry: starts
- Solver entry → Field setup: sets up
- Solver entry → Euler solver: selects solver
- Solver entry → Sutherland solver: selects solver
- Solver entry → Mixture-average solver: selects solver
- Euler solver → Time-step control: includes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H`)
- Euler solver → Cellular diagnostics: includes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H`)
- Euler solver → Flux update: updates fluxes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeEuler/solverTypeEuler.H`)
- Sutherland solver → Time-step control: includes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_Sutherland/solverTypeNS_Sutherland.H`)
- Sutherland solver → Cellular diagnostics: includes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_Sutherland/solverTypeNS_Sutherland.H`)
- Sutherland solver → Flux update: updates fluxes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_Sutherland/solverTypeNS_Sutherland.H`)
- Mixture-average solver → Time-step control: includes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Mixture-average solver → Cellular diagnostics: includes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Mixture-average solver → Flux update: updates fluxes (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Mixture-average solver → Flow equations: includes equations (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Mixture-average solver → Mixture transport: updates properties (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Mixture-average solver → Written fields: writes fields (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Flow equations → Reaction chemistry: solves species (evidence: `applications/solvers/detonationFoam_V2.0/solverTypeNS_mixtureAverage/solverTypeNS_mixtureAverage.H`)
- Reaction chemistry → Mixture transport: uses diffusivity
- Flux update → Riemann convection: provides flux scheme (evidence: `applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/RiemannConvectionScheme/RiemannConvectionScheme.H`)
- Riemann convection → Flux schemes: uses selected scheme (evidence: `applications/solvers/detonationFoam_V2.0/fluxSchemes_improved/RiemannConvectionScheme/RiemannConvectionScheme.H`)
- Mixture-average solver → 2D mesh refinement: updates mesh
- Mixture-average solver → Axisymmetric refinement: updates mesh
- Flux update → ROUND reconstruction: may use
- Reaction chemistry → Load balancing: may balance work
- Load balancing → Chemistry problem: manages problems
