# andytorrestb/rarefiedplume architecture

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

- Interactive diagram: https://gitdiagram.com/andytorrestb/rarefiedplume
- Repository: https://github.com/andytorrestb/rarefiedplume

## Overview

rarefiedPlume provides analytical and case-specific tooling for DSMC plume simulations in OpenFOAM. The principal workflow configures a study, generates case inputs and meshes, writes or injects inflow conditions, runs dsmcFoam, then verifies and post-processes results. Separate Cai & Wang and Markelov model families support their distinct physical setups; visualization and statistical-health analysis are additional capabilities. Edges reflect README statements or SOURCE INDEX references; unsampled case-runner and integration details are not expanded beyond documented behavior.

Main entry points: [`cases/cai2012/generate_cases.py`](https://github.com/andytorrestb/rarefiedplume/blob/main/cases/cai2012/generate_cases.py) (Cai case generation), [`cases/markelov1999/generate_cases.py`](https://github.com/andytorrestb/rarefiedplume/blob/main/cases/markelov1999/generate_cases.py) (Markelov case generation), [`plumetools/inflow.py`](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/inflow.py) (Inflow orchestration), [`plumetools/cai2012/mesh.py`](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/mesh.py) (Cai mesh planning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Shared plume tools"]
  node_shared_config["Case configuration<br/>[config.py]"]
  node_sourceflow["Legacy source flow<br/>[sourceflow.py]"]
  node_common_inflow["Inflow orchestration<br/>[inflow.py]"]
  node_mesh_read["Mesh readers<br/>[boundary.py]"]
  node_foamio["OpenFOAM I/O"]
end

subgraph group_cai["Cai 2012 family"]
  node_cai_config["Cai configuration<br/>[config.py]"]
  node_cai_gas["Gas properties<br/>[gas.py]"]
  node_cai_geometry["Nozzle geometry<br/>[geometry.py]"]
  node_cai_analytical["Collisionless solution<br/>[analytical.py]"]
  node_cai_mesh["Cai mesh planning<br/>[mesh.py]"]
  node_cai_study["Study generation<br/>[study.py]"]
  node_cai_casegen["Cai case generation<br/>[generate_cases.py]"]
  node_cai_post["Cai post-processing<br/>[post.py]"]
  node_health["Statistical health<br/>[health.py]"]
end

subgraph group_markelov["Markelov 1999 family"]
  node_mark_geometry["Cylinder geometry<br/>[geometry.py]"]
  node_mark_study["Markelov study<br/>[study.py]"]
  node_mark_post["Markelov post-process<br/>[postprocess.py]"]
  node_mark_cases["Markelov case generation<br/>[generate_cases.py]"]
end

subgraph group_runtime["DSMC runtime"]
  node_boundary_model["Patch inflow model<br/>[plumeFieldInflow.C]"]
  node_dsmc["dsmcFoam"]
end

subgraph group_analysis["Analysis and visualization"]
  node_audit["Parcel occupancy audit<br/>[audit.py]"]
  node_viz_spec["Visualization specification<br/>[spec.py]"]
  node_viz_catalog["Visualization catalog<br/>[catalog.py]"]
  node_viz_render["ParaView rendering<br/>[render.py]"]
  node_cai_analyse["Health analysis<br/>[analyse.py]"]
end

node_engineer(("Researcher"))
node_case_studies[("OpenFOAM studies")]

node_engineer -->|"configures and runs"| node_case_studies
node_case_studies -->|"sets inputs"| node_shared_config
node_shared_config -->|"configures"| node_common_inflow
node_common_inflow -->|"evaluates"| node_sourceflow
node_common_inflow -->|"reads mesh"| node_mesh_read
node_case_studies -->|"writes fields"| node_foamio
node_engineer -->|"generates cases"| node_cai_casegen
node_cai_casegen -->|"loads configuration"| node_cai_config
node_cai_casegen -->|"uses mesh plan"| node_cai_mesh
node_cai_casegen -->|"uses geometry"| node_cai_geometry
node_cai_config -->|"uses gas model"| node_cai_gas
node_cai_mesh -->|"uses geometry"| node_cai_geometry
node_cai_mesh -->|"uses solution"| node_cai_analytical
node_cai_casegen -->|"loads study"| node_cai_study
node_cai_post -->|"compares solution"| node_cai_analytical
node_health -->|"uses study"| node_cai_study
node_health -->|"uses study"| node_mark_study
node_audit -->|"reads metrics"| node_cai_post
node_engineer -->|"generates cases"| node_mark_cases
node_mark_cases -->|"loads configuration"| node_shared_config
node_mark_cases -->|"uses geometry"| node_mark_geometry
node_mark_cases -->|"loads study"| node_mark_study
node_mark_post -->|"uses geometry"| node_mark_geometry
node_case_studies -->|"injects patch inflow"| node_boundary_model
node_boundary_model -->|"adds parcels"| node_dsmc
node_engineer -->|"defines plots"| node_viz_spec
node_viz_spec -->|"uses catalog"| node_viz_catalog
node_viz_render -->|"renders specification"| node_viz_spec
node_viz_render -->|"uses catalog"| node_viz_catalog
node_cai_analyse -->|"builds health table"| node_health
node_cai_analyse -->|"audits occupancy"| node_audit
node_dsmc -.->|"produces simulation output"| node_cai_post
node_dsmc -.->|"produces simulation output"| node_mark_post

click node_shared_config "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/config.py"
click node_sourceflow "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/sourceflow.py"
click node_common_inflow "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/inflow.py"
click node_mesh_read "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/mesh/boundary.py"
click node_foamio "https://github.com/andytorrestb/rarefiedplume/tree/main/plumetools/foamio"
click node_cai_config "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/config.py"
click node_cai_gas "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/gas.py"
click node_cai_geometry "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/geometry.py"
click node_cai_analytical "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/analytical.py"
click node_cai_mesh "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/mesh.py"
click node_cai_study "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/study.py"
click node_cai_casegen "https://github.com/andytorrestb/rarefiedplume/blob/main/cases/cai2012/generate_cases.py"
click node_cai_post "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/post.py"
click node_health "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/health.py"
click node_audit "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/audit.py"
click node_mark_geometry "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/markelov1999/geometry.py"
click node_mark_study "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/markelov1999/study.py"
click node_mark_post "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/markelov1999/postprocess.py"
click node_mark_cases "https://github.com/andytorrestb/rarefiedplume/blob/main/cases/markelov1999/generate_cases.py"
click node_boundary_model "https://github.com/andytorrestb/rarefiedplume/blob/main/applications/dsmcBoundaryModels/plumeFieldInflow/plumeFieldInflow.C"
click node_viz_spec "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/viz/spec.py"
click node_viz_catalog "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/viz/catalog.py"
click node_viz_render "https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/viz/render.py"
click node_cai_analyse "https://github.com/andytorrestb/rarefiedplume/blob/main/cases/cai2012-health/analyse.py"

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_shared_config,node_sourceflow,node_common_inflow,node_mesh_read,node_foamio toneBlue
class node_cai_config,node_cai_gas,node_cai_geometry,node_cai_analytical,node_cai_mesh,node_cai_study,node_cai_casegen,node_cai_post,node_health,node_case_studies toneAmber
class node_mark_geometry,node_mark_study,node_mark_post,node_mark_cases toneMint
class node_boundary_model,node_dsmc toneRose
class node_audit,node_viz_spec,node_viz_catalog,node_viz_render,node_cai_analyse,node_engineer toneIndigo
```

## Components

### Shared plume tools

- [Case configuration](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/config.py): `plumetools/config.py`
- [Legacy source flow](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/sourceflow.py): `plumetools/sourceflow.py`
- [Inflow orchestration](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/inflow.py): `plumetools/inflow.py`
- [Mesh readers](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/mesh/boundary.py): `plumetools/mesh/boundary.py`
- [OpenFOAM I/O](https://github.com/andytorrestb/rarefiedplume/tree/main/plumetools/foamio): `plumetools/foamio`

### Cai 2012 family

- [Cai configuration](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/config.py): `plumetools/cai2012/config.py`
- [Gas properties](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/gas.py): `plumetools/cai2012/gas.py`
- [Nozzle geometry](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/geometry.py): `plumetools/cai2012/geometry.py`
- [Collisionless solution](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/analytical.py): `plumetools/cai2012/analytical.py`
- [Cai mesh planning](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/mesh.py): `plumetools/cai2012/mesh.py`
- [Study generation](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/study.py): `plumetools/cai2012/study.py`
- [Cai case generation](https://github.com/andytorrestb/rarefiedplume/blob/main/cases/cai2012/generate_cases.py): `cases/cai2012/generate_cases.py`
- [Cai post-processing](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/post.py): `plumetools/cai2012/post.py`
- [Statistical health](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/health.py): `plumetools/cai2012/health.py`

### Markelov 1999 family

- [Cylinder geometry](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/markelov1999/geometry.py): `plumetools/markelov1999/geometry.py`
- [Markelov study](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/markelov1999/study.py): `plumetools/markelov1999/study.py`
- [Markelov post-process](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/markelov1999/postprocess.py): `plumetools/markelov1999/postprocess.py`
- [Markelov case generation](https://github.com/andytorrestb/rarefiedplume/blob/main/cases/markelov1999/generate_cases.py): `cases/markelov1999/generate_cases.py`

### DSMC runtime

- [Patch inflow model](https://github.com/andytorrestb/rarefiedplume/blob/main/applications/dsmcBoundaryModels/plumeFieldInflow/plumeFieldInflow.C): `applications/dsmcBoundaryModels/plumeFieldInflow/plumeFieldInflow.C`
- **dsmcFoam**

### Analysis and visualization

- [Parcel occupancy audit](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/cai2012/audit.py): `plumetools/cai2012/audit.py`
- [Visualization specification](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/viz/spec.py): `plumetools/viz/spec.py`
- [Visualization catalog](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/viz/catalog.py): `plumetools/viz/catalog.py`
- [ParaView rendering](https://github.com/andytorrestb/rarefiedplume/blob/main/plumetools/viz/render.py): `plumetools/viz/render.py`
- [Health analysis](https://github.com/andytorrestb/rarefiedplume/blob/main/cases/cai2012-health/analyse.py): `cases/cai2012-health/analyse.py`

### Other components

- **Researcher**
- **OpenFOAM studies**

## Connections

- Researcher → OpenFOAM studies: configures and runs (evidence: `README.md`)
- OpenFOAM studies → Case configuration: sets inputs (evidence: `README.md`)
- Case configuration → Inflow orchestration: configures (evidence: `plumetools/inflow.py`)
- Inflow orchestration → Legacy source flow: evaluates (evidence: `plumetools/inflow.py`)
- Inflow orchestration → Mesh readers: reads mesh (evidence: `plumetools/inflow.py`)
- OpenFOAM studies → OpenFOAM I/O: writes fields (evidence: `README.md`)
- Researcher → Cai case generation: generates cases (evidence: `README.md`)
- Cai case generation → Cai configuration: loads configuration (evidence: `cases/cai2012/generate_cases.py`)
- Cai case generation → Cai mesh planning: uses mesh plan (evidence: `cases/cai2012/generate_cases.py`)
- Cai case generation → Nozzle geometry: uses geometry (evidence: `cases/cai2012/generate_cases.py`)
- Cai configuration → Gas properties: uses gas model (evidence: `plumetools/cai2012/config.py`)
- Cai mesh planning → Nozzle geometry: uses geometry (evidence: `plumetools/cai2012/mesh.py`)
- Cai mesh planning → Collisionless solution: uses solution (evidence: `plumetools/cai2012/mesh.py`)
- Cai case generation → Study generation: loads study (evidence: `cases/cai2012/generate_cases.py`)
- Cai post-processing → Collisionless solution: compares solution (evidence: `plumetools/cai2012/post.py`)
- Statistical health → Study generation: uses study (evidence: `plumetools/cai2012/health.py`)
- Statistical health → Markelov study: uses study (evidence: `plumetools/cai2012/health.py`)
- Parcel occupancy audit → Cai post-processing: reads metrics (evidence: `plumetools/cai2012/audit.py`)
- Researcher → Markelov case generation: generates cases (evidence: `README.md`)
- Markelov case generation → Case configuration: loads configuration (evidence: `cases/markelov1999/generate_cases.py`)
- Markelov case generation → Cylinder geometry: uses geometry (evidence: `cases/markelov1999/generate_cases.py`)
- Markelov case generation → Markelov study: loads study (evidence: `cases/markelov1999/generate_cases.py`)
- Markelov post-process → Cylinder geometry: uses geometry (evidence: `plumetools/markelov1999/postprocess.py`)
- OpenFOAM studies → Patch inflow model: injects patch inflow (evidence: `README.md`)
- Patch inflow model → dsmcFoam: adds parcels (evidence: `applications/dsmcBoundaryModels/plumeFieldInflow/plumeFieldInflow.C`)
- Researcher → Visualization specification: defines plots (evidence: `README.md`)
- Visualization specification → Visualization catalog: uses catalog (evidence: `plumetools/viz/spec.py`)
- ParaView rendering → Visualization specification: renders specification (evidence: `plumetools/viz/render.py`)
- ParaView rendering → Visualization catalog: uses catalog (evidence: `plumetools/viz/render.py`)
- Health analysis → Statistical health: builds health table (evidence: `cases/cai2012-health/analyse.py`)
- Health analysis → Parcel occupancy audit: audits occupancy (evidence: `cases/cai2012-health/analyse.py`)
- dsmcFoam → Cai post-processing: produces simulation output (evidence: `README.md`)
- dsmcFoam → Markelov post-process: produces simulation output (evidence: `README.md`)
