# aalto-cfd/dlbfoam-hydrogen-tutorials architecture

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

- Interactive diagram: https://gitdiagram.com/aalto-cfd/dlbfoam-hydrogen-tutorials
- Repository: https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials

## Overview

This repository is a set of OpenFOAM hydrogen-combustion tutorial cases plus a shared chemical-mechanism/Jacobian source package. The user-facing workflow is to select a documented flame case, run it with the required OpenFOAM ecosystem, and inspect simulation or validation data. The README establishes the four case types and the shared DLBFoam/FickianTransportFoam context; source excerpts show the chemistry-rate and Jacobian internals. Case-specific runtime wiring is not sampled, so those connections are documented at the case level rather than expanded into guessed solver pipelines.

Main entry points: [`2D_planar_flame`](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/2D_planar_flame) (2D planar flame), [`mech/src/jacob.c`](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacob.c) (Jacobian evaluation), [`2D_jet_flame`](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/2D_jet_flame) (2D jet flame), [`3D_AHEAD`](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/3D_AHEAD) (3D AHEAD flame)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tutorials["Flame Tutorials"]
  node_planar["2D planar flame"]
  node_jet["2D jet flame"]
  node_ahead["3D AHEAD flame"]
  node_hylon["3D HYLON flame"]
end

subgraph group_chemistry["Mechanism Core"]
  node_chem_utils["Thermo and concentrations<br/>[chem_utils.c]"]
  node_reaction_rates["Reaction rates<br/>[rxn_rates.c]"]
  node_species_rates["Species rates<br/>[spec_rates.c]"]
  node_jacobian["Jacobian evaluation<br/>[jacob.c]"]
  node_jac0["Jacobian block zero<br/>[jacob_0.c]"]
  node_jac1["Jacobian block one<br/>[jacob_1.c]"]
  node_jac2["Jacobian block two<br/>[jacob_2.c]"]
  node_chem_dydt["Chemistry ODE<br/>[dydt.c]"]
  node_mechanism["Mechanism definitions<br/>[mechanism.c]"]
  node_mass_mole["Mass-mole conversion<br/>[mass_mole.c]"]
  node_sparse["Sparse multiplier"]
end

subgraph group_case_data["Case Data"]
  node_mech_data["Kinetic mechanism"]
  node_planar_init["Mapped flame initialization<br/>[flame_cpp_funcs.H]"]
  node_planar_map["Vector field mapping"]
end

subgraph group_ecosystem["OpenFOAM Ecosystem"]
  node_openfoam["OpenFOAM 10"]
  node_dlbfoam["DLBFoam"]
  node_fickian["FickianTransportFoam"]
end

node_user(("Tutorial user"))
node_results[("Simulation results")]

node_user -->|"selects case"| node_planar
node_user -->|"selects case"| node_jet
node_user -->|"selects case"| node_ahead
node_user -->|"selects case"| node_hylon
node_planar -->|"runs with"| node_openfoam
node_jet -->|"runs with"| node_openfoam
node_ahead -->|"runs with"| node_openfoam
node_hylon -->|"runs with"| node_openfoam
node_planar -->|"uses chemistry"| node_dlbfoam
node_jet -->|"uses chemistry"| node_dlbfoam
node_ahead -->|"uses chemistry"| node_dlbfoam
node_hylon -->|"uses chemistry"| node_dlbfoam
node_planar -->|"uses transport"| node_fickian
node_jet -->|"uses transport"| node_fickian
node_ahead -->|"uses transport"| node_fickian
node_hylon -->|"uses transport"| node_fickian
node_planar -->|"uses mechanism"| node_mech_data
node_jet -->|"uses mechanism"| node_mech_data
node_ahead -->|"uses mechanism"| node_mech_data
node_hylon -->|"uses mechanism"| node_mech_data
node_planar -->|"maps initial field"| node_planar_map
node_planar_map -->|"interpolates with"| node_planar_init
node_jacobian -->|"evaluates concentrations"| node_chem_utils
node_jacobian -->|"evaluates rates"| node_reaction_rates
node_jacobian -->|"calls block"| node_jac0
node_jacobian -->|"calls block"| node_jac1
node_jacobian -->|"evaluates thermo"| node_chem_utils
node_chem_dydt -->|"uses utilities"| node_chem_utils
node_chem_dydt -->|"uses rates"| node_reaction_rates
node_mechanism -->|"uses conversion"| node_mass_mole
node_reaction_rates -.->|"provides kinetics"| node_results
node_openfoam -.->|"produces fields"| node_results

click node_planar "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/2D_planar_flame"
click node_jet "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/2D_jet_flame"
click node_ahead "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/3D_AHEAD"
click node_hylon "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/3D_HYLON_flame_A"
click node_mech_data "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/mech"
click node_planar_init "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/2D_planar_flame/0/flame_cpp_funcs.H"
click node_planar_map "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/2D_planar_flame/0/readInternalVectorXField.H"
click node_chem_utils "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/chem_utils.c"
click node_reaction_rates "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/rxn_rates.c"
click node_species_rates "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/spec_rates.c"
click node_jacobian "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacob.c"
click node_jac0 "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacobs/jacob_0.c"
click node_jac1 "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacobs/jacob_1.c"
click node_jac2 "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacobs/jacob_2.c"
click node_chem_dydt "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/dydt.c"
click node_mechanism "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/mechanism.c"
click node_mass_mole "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/mass_mole.c"
click node_sparse "https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/sparse_multiplier.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_planar,node_jet,node_ahead,node_hylon,node_user toneBlue
class node_chem_utils,node_reaction_rates,node_species_rates,node_jacobian,node_jac0,node_jac1,node_jac2,node_chem_dydt,node_mechanism,node_mass_mole,node_sparse,node_results toneAmber
class node_mech_data,node_planar_init,node_planar_map toneMint
class node_openfoam,node_dlbfoam,node_fickian toneRose
```

## Components

### Flame Tutorials

- [2D planar flame](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/2D_planar_flame): `2D_planar_flame`
- [2D jet flame](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/2D_jet_flame): `2D_jet_flame`
- [3D AHEAD flame](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/3D_AHEAD): `3D_AHEAD`
- [3D HYLON flame](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/3D_HYLON_flame_A): `3D_HYLON_flame_A`

### Mechanism Core

- [Thermo and concentrations](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/chem_utils.c): `mech/src/chem_utils.c`
- [Reaction rates](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/rxn_rates.c): `mech/src/rxn_rates.c`
- [Species rates](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/spec_rates.c): `mech/src/spec_rates.c`
- [Jacobian evaluation](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacob.c): `mech/src/jacob.c`
- [Jacobian block zero](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacobs/jacob_0.c): `mech/src/jacobs/jacob_0.c`
- [Jacobian block one](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacobs/jacob_1.c): `mech/src/jacobs/jacob_1.c`
- [Jacobian block two](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/jacobs/jacob_2.c): `mech/src/jacobs/jacob_2.c`
- [Chemistry ODE](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/dydt.c): `mech/src/dydt.c`
- [Mechanism definitions](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/mechanism.c): `mech/src/mechanism.c`
- [Mass-mole conversion](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/mass_mole.c): `mech/src/mass_mole.c`
- [Sparse multiplier](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/mech/src/sparse_multiplier.c): `mech/src/sparse_multiplier.c`

### Case Data

- [Kinetic mechanism](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/tree/main/mech): `mech`
- [Mapped flame initialization](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/2D_planar_flame/0/flame_cpp_funcs.H): `2D_planar_flame/0/flame_cpp_funcs.H`
- [Vector field mapping](https://github.com/aalto-cfd/dlbfoam-hydrogen-tutorials/blob/main/2D_planar_flame/0/readInternalVectorXField.H): `2D_planar_flame/0/readInternalVectorXField.H`

### OpenFOAM Ecosystem

- **OpenFOAM 10**
- **DLBFoam**
- **FickianTransportFoam**

### Other components

- **Tutorial user**
- **Simulation results**

## Connections

- Tutorial user → 2D planar flame: selects case (evidence: `README.md`)
- Tutorial user → 2D jet flame: selects case (evidence: `README.md`)
- Tutorial user → 3D AHEAD flame: selects case (evidence: `README.md`)
- Tutorial user → 3D HYLON flame: selects case (evidence: `README.md`)
- 2D planar flame → OpenFOAM 10: runs with (evidence: `README.md`)
- 2D jet flame → OpenFOAM 10: runs with (evidence: `README.md`)
- 3D AHEAD flame → OpenFOAM 10: runs with (evidence: `README.md`)
- 3D HYLON flame → OpenFOAM 10: runs with (evidence: `README.md`)
- 2D planar flame → DLBFoam: uses chemistry (evidence: `README.md`)
- 2D jet flame → DLBFoam: uses chemistry (evidence: `README.md`)
- 3D AHEAD flame → DLBFoam: uses chemistry (evidence: `README.md`)
- 3D HYLON flame → DLBFoam: uses chemistry (evidence: `README.md`)
- 2D planar flame → FickianTransportFoam: uses transport (evidence: `README.md`)
- 2D jet flame → FickianTransportFoam: uses transport (evidence: `README.md`)
- 3D AHEAD flame → FickianTransportFoam: uses transport (evidence: `README.md`)
- 3D HYLON flame → FickianTransportFoam: uses transport (evidence: `README.md`)
- 2D planar flame → Kinetic mechanism: uses mechanism (evidence: `README.md`)
- 2D jet flame → Kinetic mechanism: uses mechanism (evidence: `README.md`)
- 3D AHEAD flame → Kinetic mechanism: uses mechanism (evidence: `README.md`)
- 3D HYLON flame → Kinetic mechanism: uses mechanism (evidence: `README.md`)
- 2D planar flame → Vector field mapping: maps initial field (evidence: `2D_planar_flame/0/readInternalVectorXField.H`)
- Vector field mapping → Mapped flame initialization: interpolates with (evidence: `2D_planar_flame/0/readInternalVectorXField.H`)
- Jacobian evaluation → Thermo and concentrations: evaluates concentrations (evidence: `mech/src/jacob.c`)
- Jacobian evaluation → Reaction rates: evaluates rates (evidence: `mech/src/jacob.c`)
- Jacobian evaluation → Jacobian block zero: calls block (evidence: `mech/src/jacob.c`)
- Jacobian evaluation → Jacobian block one: calls block (evidence: `mech/src/jacob.c`)
- Jacobian evaluation → Thermo and concentrations: evaluates thermo (evidence: `mech/src/jacob.c`)
- Chemistry ODE → Thermo and concentrations: uses utilities (evidence: `mech/src/dydt.c`)
- Chemistry ODE → Reaction rates: uses rates (evidence: `mech/src/dydt.c`)
- Mechanism definitions → Mass-mole conversion: uses conversion (evidence: `mech/src/mechanism.c`)
- Reaction rates → Simulation results: provides kinetics
- OpenFOAM 10 → Simulation results: produces fields
