# particulateflow/rcfd-pfm architecture

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

- Interactive diagram: https://gitdiagram.com/particulateflow/rcfd-pfm
- Repository: https://github.com/particulateflow/rcfd-pfm

## Overview

rCFD is a transport-based reduced CFD implementation with an ANSYS Fluent adapter. Its apparent user workflow is to initialize a case, provide preparation fields and generate cell-to-cell transport shifts, then run transport and inspect or report results. The tree also identifies configuration, topology, parallel, and output concerns. Source excerpts are incomplete, so edges are limited to documented or visible relationships; several product-stage connections are intentionally not asserted.

Main entry points: [`src/rCFD_library.c`](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_library.c) (rCFD API), [`src/rCFD_init.h`](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_init.h) (Initialization), [`src/rCFD_dict_read_toml.h`](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict_read_toml.h) (TOML reader), [`src/rCFD_topo.h`](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_topo.h) (Topology I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_api["rCFD API<br/>[rCFD_library.c]"]
  node_adapter["Fluent adapter<br/>[rCFD_fluent.h]"]
end

subgraph group_setup["Configuration and Setup"]
  node_config["Config dictionaries<br/>[rCFD_dict.h]"]
  node_config_read["TOML reader"]
  node_config_write["TOML writer"]
  node_toml["TOML parser<br/>[tomlc17.c]"]
  node_init["Initialization<br/>[rCFD_init.h]"]
  node_topology["Topology I/O<br/>[rCFD_topo.h]"]
end

subgraph group_transport["Transport Workflow"]
  node_prepare["Preparation fields<br/>[rCFD_prepare.h]"]
  node_c2c_prep["Shift preparation<br/>[rCFD_C2C_prep.c]"]
  node_run["Transport run<br/>[rCFD_run.h]"]
  node_c2c_run["Shift execution<br/>[rCFD_C2C_run.c]"]
  node_post["Post-processing<br/>[rCFD_post.h]"]
end

subgraph group_support["Runtime Support"]
  node_parallel["Parallel support<br/>[rCFD_parallel.h]"]
  node_reports["Reports<br/>[rCFD_report.h]"]
  node_dump["Data output<br/>[rCFD_dump.h]"]
  node_state["Runtime state<br/>[rCFD_types.h]"]
end

node_user(("Fluent / caller"))

node_user -->|"calls API"| node_api
node_user -.->|"uses adapter"| node_adapter
node_init -->|"reads topology"| node_topology
node_api -->|"writes topology"| node_topology
node_config_read -->|"parses TOML"| node_toml
node_init -->|"loads settings"| node_config_read
node_api -->|"sets fields"| node_prepare

click node_api "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_library.c"
click node_adapter "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_fluent.h"
click node_config "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict.h"
click node_config_read "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict_read_toml.h"
click node_config_write "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict_write_toml.h"
click node_toml "https://github.com/particulateflow/rcfd-pfm/blob/master/third-party/tomlc17/tomlc17.c"
click node_init "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_init.h"
click node_topology "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_topo.h"
click node_prepare "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_prepare.h"
click node_c2c_prep "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_C2C_prep.c"
click node_run "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_run.h"
click node_c2c_run "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_C2C_run.c"
click node_post "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_post.h"
click node_parallel "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_parallel.h"
click node_reports "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_report.h"
click node_dump "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dump.h"
click node_state "https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_types.h"

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_api,node_adapter toneBlue
class node_config,node_config_read,node_config_write,node_toml,node_init,node_topology toneAmber
class node_prepare,node_c2c_prep,node_run,node_c2c_run,node_post toneMint
class node_parallel,node_reports,node_dump,node_state toneRose
class node_user toneIndigo
```

## Components

### User Interface

- [rCFD API](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_library.c): `src/rCFD_library.c`
- [Fluent adapter](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_fluent.h): `src/rCFD_fluent.h`

### Configuration and Setup

- [Config dictionaries](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict.h): `src/rCFD_dict.h`
- [TOML reader](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict_read_toml.h): `src/rCFD_dict_read_toml.h`
- [TOML writer](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dict_write_toml.h): `src/rCFD_dict_write_toml.h`
- [TOML parser](https://github.com/particulateflow/rcfd-pfm/blob/master/third-party/tomlc17/tomlc17.c): `third-party/tomlc17/tomlc17.c`
- [Initialization](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_init.h): `src/rCFD_init.h`
- [Topology I/O](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_topo.h): `src/rCFD_topo.h`

### Transport Workflow

- [Preparation fields](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_prepare.h): `src/rCFD_prepare.h`
- [Shift preparation](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_C2C_prep.c): `src/rCFD_C2C_prep.c`
- [Transport run](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_run.h): `src/rCFD_run.h`
- [Shift execution](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_C2C_run.c): `src/rCFD_C2C_run.c`
- [Post-processing](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_post.h): `src/rCFD_post.h`

### Runtime Support

- [Parallel support](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_parallel.h): `src/rCFD_parallel.h`
- [Reports](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_report.h): `src/rCFD_report.h`
- [Data output](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_dump.h): `src/rCFD_dump.h`
- [Runtime state](https://github.com/particulateflow/rcfd-pfm/blob/master/src/rCFD_types.h): `src/rCFD_types.h`

### Other components

- **Fluent / caller**

## Connections

- Fluent / caller → rCFD API: calls API
- Fluent / caller → Fluent adapter: uses adapter
- Initialization → Topology I/O: reads topology
- rCFD API → Topology I/O: writes topology
- TOML reader → TOML parser: parses TOML
- Initialization → TOML reader: loads settings
- rCFD API → Preparation fields: sets fields
