# zhiwar-ep/coffee architecture

> Architecture diagram of the GitHub repository zhiwar-ep/coffee, 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/zhiwar-ep/coffee
- Repository: https://github.com/zhiwar-ep/coffee

## Overview

This repository is a coupled YADE–OpenFOAM coffee-bean drying simulation case. The workflow combines a configured OpenFOAM case with a YADE particle/spring model; YADE advances particles and exports sphere and spring results. The provided tree also documents chemistry, heat transfer, radiation, pyrolysis, and material-property configuration. Only excerpts of yade.py were supplied, so internal calls beyond those visible there are not inferred; links between configured solvers and the coupling script are shown as unverified.

Main entry points: [`o.foam`](https://github.com/zhiwar-ep/coffee/blob/main/o.foam) (OpenFOAM case), [`yade.py`](https://github.com/zhiwar-ep/coffee/blob/main/yade.py) (YADE particle simulation), [`system/blockMeshDict`](https://github.com/zhiwar-ep/coffee/blob/main/system/blockMeshDict) (Mesh and regions), [`system/controlDict`](https://github.com/zhiwar-ep/coffee/blob/main/system/controlDict) (Solver controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_case["OpenFOAM Case"]
  node_foam["OpenFOAM case<br/>[o.foam]"]
  node_mesh["Mesh and regions"]
  node_solver_controls["Solver controls"]
  node_fields["Initial fields"]
  node_decomposition["Parallel decomposition"]
  node_numerics["Numerical schemes"]
  node_solution["Solution settings"]
end

subgraph group_materials["Physics Configuration"]
  node_chemistry["Chemistry and reactions"]
  node_pyrolysis["Pyrolysis"]
  node_heat["Heat transfer"]
  node_radiation["Radiation"]
  node_thermo["Thermophysical properties"]
  node_solid_thermo["Solid properties"]
  node_boundary_radiation["Boundary radiation"]
  node_turbulence["Turbulence model"]
end

subgraph group_particles["YADE Particle Model"]
  node_particle_model["YADE particle simulation<br/>[yade.py]"]
  node_bean_geometry["Bean geometry inputs<br/>[0.orig]"]
  node_coupling["Fluid coupling"]
  node_spring_model["Particle springs<br/>[yade.py]"]
  node_parallel_exchange["MPI exchange<br/>[yade.py]"]
end

subgraph group_results["Simulation Output"]
  node_sphere_export["Sphere export<br/>[yade.py]"]
  node_spring_export["Spring export<br/>[yade.py]"]
  node_foam_output["OpenFOAM output"]
end

node_operator(("Case operator"))
node_postprocessor["Visualization tools"]

node_operator -->|"sets up"| node_foam
node_operator -.->|"runs"| node_particle_model
node_foam -.->|"uses"| node_mesh
node_foam -.->|"uses"| node_solver_controls
node_foam -.->|"uses"| node_fields
node_foam -.->|"uses"| node_decomposition
node_foam -.->|"uses"| node_numerics
node_foam -.->|"uses"| node_solution
node_foam -.->|"configures"| node_chemistry
node_foam -.->|"configures"| node_pyrolysis
node_foam -.->|"configures"| node_heat
node_foam -.->|"configures"| node_radiation
node_foam -.->|"configures"| node_thermo
node_foam -.->|"configures"| node_solid_thermo
node_foam -.->|"configures"| node_boundary_radiation
node_foam -.->|"configures"| node_turbulence
node_particle_model -.->|"reads"| node_bean_geometry
node_particle_model -.->|"uses"| node_coupling
node_particle_model -->|"updates"| node_spring_model
node_spring_model -->|"exchanges data"| node_parallel_exchange
node_particle_model -->|"exports spheres"| node_sphere_export
node_spring_model -->|"exports springs"| node_spring_export
node_foam -.->|"writes"| node_foam_output
node_sphere_export -.->|"visualizes"| node_postprocessor
node_spring_export -.->|"visualizes"| node_postprocessor

click node_foam "https://github.com/zhiwar-ep/coffee/blob/main/o.foam"
click node_mesh "https://github.com/zhiwar-ep/coffee/blob/main/system/blockMeshDict"
click node_solver_controls "https://github.com/zhiwar-ep/coffee/blob/main/system/controlDict"
click node_fields "https://github.com/zhiwar-ep/coffee/blob/main/system/setFieldsDict"
click node_decomposition "https://github.com/zhiwar-ep/coffee/blob/main/system/decomposeParDict"
click node_numerics "https://github.com/zhiwar-ep/coffee/blob/main/system/fvSchemes"
click node_solution "https://github.com/zhiwar-ep/coffee/blob/main/system/fvSolution"
click node_chemistry "https://github.com/zhiwar-ep/coffee/blob/main/constant/chemistryProperties"
click node_pyrolysis "https://github.com/zhiwar-ep/coffee/blob/main/constant/pyrolysisProperties"
click node_heat "https://github.com/zhiwar-ep/coffee/blob/main/constant/heatTransferProperties"
click node_radiation "https://github.com/zhiwar-ep/coffee/blob/main/constant/radiationProperties"
click node_thermo "https://github.com/zhiwar-ep/coffee/blob/main/constant/thermophysicalProperties"
click node_solid_thermo "https://github.com/zhiwar-ep/coffee/blob/main/constant/solidThermophysicalProperties"
click node_boundary_radiation "https://github.com/zhiwar-ep/coffee/blob/main/constant/boundaryRadiationProperties"
click node_turbulence "https://github.com/zhiwar-ep/coffee/blob/main/constant/turbulenceProperties"
click node_particle_model "https://github.com/zhiwar-ep/coffee/blob/main/yade.py"
click node_bean_geometry "https://github.com/zhiwar-ep/coffee/tree/main/0.orig"
click node_coupling "https://github.com/zhiwar-ep/coffee/blob/main/constant/yadeProperties"
click node_spring_model "https://github.com/zhiwar-ep/coffee/blob/main/yade.py"
click node_parallel_exchange "https://github.com/zhiwar-ep/coffee/blob/main/yade.py"
click node_sphere_export "https://github.com/zhiwar-ep/coffee/blob/main/yade.py"
click node_spring_export "https://github.com/zhiwar-ep/coffee/blob/main/yade.py"
click node_foam_output "https://github.com/zhiwar-ep/coffee/blob/main/system/controlDict"

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_foam,node_mesh,node_solver_controls,node_fields,node_decomposition,node_numerics,node_solution toneBlue
class node_chemistry,node_pyrolysis,node_heat,node_radiation,node_thermo,node_solid_thermo,node_boundary_radiation,node_turbulence toneAmber
class node_particle_model,node_bean_geometry,node_coupling,node_spring_model,node_parallel_exchange toneMint
class node_sphere_export,node_spring_export,node_foam_output toneRose
class node_operator,node_postprocessor toneIndigo
```

## Components

### OpenFOAM Case

- [OpenFOAM case](https://github.com/zhiwar-ep/coffee/blob/main/o.foam): `o.foam`
- [Mesh and regions](https://github.com/zhiwar-ep/coffee/blob/main/system/blockMeshDict): `system/blockMeshDict`
- [Solver controls](https://github.com/zhiwar-ep/coffee/blob/main/system/controlDict): `system/controlDict`
- [Initial fields](https://github.com/zhiwar-ep/coffee/blob/main/system/setFieldsDict): `system/setFieldsDict`
- [Parallel decomposition](https://github.com/zhiwar-ep/coffee/blob/main/system/decomposeParDict): `system/decomposeParDict`
- [Numerical schemes](https://github.com/zhiwar-ep/coffee/blob/main/system/fvSchemes): `system/fvSchemes`
- [Solution settings](https://github.com/zhiwar-ep/coffee/blob/main/system/fvSolution): `system/fvSolution`

### Physics Configuration

- [Chemistry and reactions](https://github.com/zhiwar-ep/coffee/blob/main/constant/chemistryProperties): `constant/chemistryProperties`
- [Pyrolysis](https://github.com/zhiwar-ep/coffee/blob/main/constant/pyrolysisProperties): `constant/pyrolysisProperties`
- [Heat transfer](https://github.com/zhiwar-ep/coffee/blob/main/constant/heatTransferProperties): `constant/heatTransferProperties`
- [Radiation](https://github.com/zhiwar-ep/coffee/blob/main/constant/radiationProperties): `constant/radiationProperties`
- [Thermophysical properties](https://github.com/zhiwar-ep/coffee/blob/main/constant/thermophysicalProperties): `constant/thermophysicalProperties`
- [Solid properties](https://github.com/zhiwar-ep/coffee/blob/main/constant/solidThermophysicalProperties): `constant/solidThermophysicalProperties`
- [Boundary radiation](https://github.com/zhiwar-ep/coffee/blob/main/constant/boundaryRadiationProperties): `constant/boundaryRadiationProperties`
- [Turbulence model](https://github.com/zhiwar-ep/coffee/blob/main/constant/turbulenceProperties): `constant/turbulenceProperties`

### YADE Particle Model

- [YADE particle simulation](https://github.com/zhiwar-ep/coffee/blob/main/yade.py): `yade.py`
- [Bean geometry inputs](https://github.com/zhiwar-ep/coffee/tree/main/0.orig): `0.orig`
- [Fluid coupling](https://github.com/zhiwar-ep/coffee/blob/main/constant/yadeProperties): `constant/yadeProperties`
- [Particle springs](https://github.com/zhiwar-ep/coffee/blob/main/yade.py): `yade.py`
- [MPI exchange](https://github.com/zhiwar-ep/coffee/blob/main/yade.py): `yade.py`

### Simulation Output

- [Sphere export](https://github.com/zhiwar-ep/coffee/blob/main/yade.py): `yade.py`
- [Spring export](https://github.com/zhiwar-ep/coffee/blob/main/yade.py): `yade.py`
- [OpenFOAM output](https://github.com/zhiwar-ep/coffee/blob/main/system/controlDict): `system/controlDict`

### Other components

- **Case operator**
- **Visualization tools**

## Connections

- Case operator → OpenFOAM case: sets up
- Case operator → YADE particle simulation: runs
- OpenFOAM case → Mesh and regions: uses
- OpenFOAM case → Solver controls: uses
- OpenFOAM case → Initial fields: uses
- OpenFOAM case → Parallel decomposition: uses
- OpenFOAM case → Numerical schemes: uses
- OpenFOAM case → Solution settings: uses
- OpenFOAM case → Chemistry and reactions: configures
- OpenFOAM case → Pyrolysis: configures
- OpenFOAM case → Heat transfer: configures
- OpenFOAM case → Radiation: configures
- OpenFOAM case → Thermophysical properties: configures
- OpenFOAM case → Solid properties: configures
- OpenFOAM case → Boundary radiation: configures
- OpenFOAM case → Turbulence model: configures
- YADE particle simulation → Bean geometry inputs: reads
- YADE particle simulation → Fluid coupling: uses
- YADE particle simulation → Particle springs: updates (evidence: `yade.py`)
- Particle springs → MPI exchange: exchanges data (evidence: `yade.py`)
- YADE particle simulation → Sphere export: exports spheres (evidence: `yade.py`)
- Particle springs → Spring export: exports springs (evidence: `yade.py`)
- OpenFOAM case → OpenFOAM output: writes
- Sphere export → Visualization tools: visualizes
- Spring export → Visualization tools: visualizes
