# ganeshkumar-v/propellant-regression-framework architecture

> Architecture diagram of the GitHub repository ganeshkumar-v/propellant-regression-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ganeshkumar-v/propellant-regression-framework
- Repository: https://github.com/ganeshkumar-v/propellant-regression-framework

## Overview

##### Project Type and Purpose
- This is a domain-specific, open-source CFD framework built on OpenFOAM.
- Core application: “rocketMotor” simulates propellant regression and two-phase flows.
- Supplementary modules: libraries for boundary conditions, interfacial/turbulence models, functionObjects, and utilities for post-processing.

##### High-Level Components
- External Dependency:
- OpenFOAM v2112 (C++ toolchain, wmake)
- Build System:
- bashrc + Allwmake/Allwclean + per-module Makefiles under `Make/` and `platforms/`
- Applications (`applications/`):
- rocketMotor – main solver executable
- (future) other custom apps
- Core Libraries (`src/`):
- PhaseSystems (multiphase reaction/combustion systems)
- interfacialModels (drag models, heat transfer models)
- multiphaseCompressibleTurbulenceModels
- phaseModel (single-phase/particle models)
- fvPatchFields (custom boundary conditions)
- functionObjects (thrust, vorticity, stream function)
- interfaceTrackingModels
- sharpInterfaceHeatTransferModels
- multiphaseSystem (overall solver orchestrator)
- Utilities (`utilities/`):
- postProcessRocket, mapVolFields, ReynoldsNumber, etc., for field manipulation and performance metrics
- Tutorials/Validation (`tutorials/`, future `validation/`):
- Case directories containing mesh (`constant/polyMesh`), fields (`0/`), solver settings (`system/`)

##### Relationships and Data Flow
- Build Phase:
OpenFOAM environment → wmake (via Allwmake) → compiles core libraries + applications + utilities
- Runtime Phase:
Case definition (tutorials/…: mesh, initial & boundary files, controlDict)
↓
rocketMotor (links to core libs: PhaseSystems, fvPatchFields, interfacialModels, etc.)
↓
Simulation outputs (field data in time directories)
↓
Utilities & functionObjects (calculateThrust, vorticityStreamFunction) → post-process results → performance metrics, visualization data

##### Architectural Patterns & Design Principles
- Plugin-like modularity: each model or boundary condition resides in its own folder with C/H files and Make options
- Separation of concerns:
- Core solver logic (multiphaseSystem, PhaseSystems)
- Physics models (interfacialModels, phaseModel, turbulenceModels)
- Boundary conditions (fvPatchFields)
- Post-processing (utilities, functionObjects)
- Build-time extensibility via per-module Makefiles, runtime extensibility via functionObject API

##### Essential Details to Capture
- Build dependencies: Makefiles → wmake → module compilation
- Runtime linkage: rocketMotor + core libraries + OpenFOAM libs
- Data I/O: case directory structure → solver → output directories
- Extensibility: where new code slots in (e.g., add new functionObject under `src/functionObjects`)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Dependency
    OpenFOAMEnv["OpenFOAM Environment\n(libOpenFOAM, libfiniteVolume, MPI)"]:::external

    %% Build System
    subgraph "Build System" 
        direction TB
        Allwmake["Allwmake"]:::build
        Allwclean["Allwclean"]:::build
        Bashrc["bashrc"]:::build
        subgraph "Per-module Make Configs"
            direction TB
            MakeSrc["src/Make"]:::build
            MakeSrcFiles["src/Make/files"]:::build
            MakeSrcOptions["src/Make/options"]:::build
            MakeApp["applications/rocketMotor/Make"]:::build
            MakeAppFiles["applications/rocketMotor/Make/files"]:::build
            MakeAppOpts["applications/rocketMotor/Make/options"]:::build
            MakeUtil1["utilities/ReynoldsNumber/Make"]:::build
            MakeUtil2["utilities/mapVolFields/Make"]:::build
            MakeUtil3["utilities/postProcessRocket/Make"]:::build
        end
    end

    %% Core Libraries
    subgraph "Core Libraries" 
        direction TB
        subgraph "Physics Models"
            PhaseSystems["PhaseSystems"]:::core
            Interfacial["interfacialModels"]:::core
            Turbulence["multiphaseCompressibleTurbulenceModels"]:::core
            PhaseModel["phaseModel"]:::core
            InterfaceTrack["interfaceTrackingModels"]:::core
            SharpHeat["sharpInterfaceHeatTransferModels"]:::core
        end
        subgraph "Boundary Conditions"
            fvPatchFields["fvPatchFields"]:::core
        end
        FunctionObjs["functionObjects"]:::core
        MultiPhaseSys["multiphaseSystem"]:::core
    end

    %% Applications
    subgraph "Applications"
        rocketMotor["rocketMotor (solver)"]:::app
    end

    %% Utilities
    subgraph "Utilities"
        direction TB
        UtilRe["ReynoldsNumber"]:::util
        UtilMap["mapVolFields"]:::util
        UtilPost["postProcessRocket"]:::util
        UtilCons["rocketConservation"]:::util
        UtilSetAlpha["setMultipleAlphaField"]:::util
        UtilInit["setRocketInitField"]:::util
        UtilStream["streamFunction"]:::util
    end

    %% Data: Case Definitions & Outputs
    subgraph "Data"
        direction TB
        CaseDefs["Case Definitions\n(tutorials/)"]:::data
        SimOutputs["Simulation Outputs\n(time directories)"]:::data
    end

    %% Build-time Flow
    OpenFOAMEnv -->|"setup env"| Allwmake
    Allwmake -->|"invoke wmake"| MakeSrc
    Allwmake --> MakeApp
    Allwmake --> MakeUtil1
    MakeSrc --> PhaseSystems
    MakeSrc --> Interfacial
    MakeSrc --> Turbulence
    MakeSrc --> PhaseModel
    MakeSrc --> InterfaceTrack
    MakeSrc --> SharpHeat
    MakeSrc --> fvPatchFields
    MakeSrc --> FunctionObjs
    MakeSrc --> MultiPhaseSys
    MakeApp --> rocketMotor
    MakeUtil1 --> UtilRe
    MakeUtil2 --> UtilMap
    MakeUtil3 --> UtilPost

    %% Runtime Flow
    CaseDefs -->|"read case files"| rocketMotor
    rocketMotor -->|"link & invoke core libs"| PhaseSystems
    rocketMotor --> Interfacial
    rocketMotor --> Turbulence
    rocketMotor --> PhaseModel
    rocketMotor --> fvPatchFields
    rocketMotor --> MultiPhaseSys
    rocketMotor -->|"write fields"| SimOutputs
    SimOutputs -->|"post-process"| UtilRe
    SimOutputs --> UtilMap
    SimOutputs --> UtilPost
    SimOutputs --> UtilCons
    SimOutputs --> UtilSetAlpha
    SimOutputs --> UtilInit
    SimOutputs --> UtilStream

    %% Click Events
    click Allwmake "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/./Allwmake"
    click Allwclean "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/./Allwclean"
    click Bashrc "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/./bashrc"
    click MakeSrc "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/Make"
    click MakeSrcFiles "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/Make/files"
    click MakeSrcOptions "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/Make/options"
    click MakeApp "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/applications/rocketMotor/Make"
    click MakeAppFiles "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/applications/rocketMotor/Make/files"
    click MakeAppOpts "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/applications/rocketMotor/Make/options"
    click MakeUtil1 "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/ReynoldsNumber/Make"
    click MakeUtil2 "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/mapVolFields/Make"
    click MakeUtil3 "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/postProcessRocket/Make"
    click rocketMotor "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/applications/rocketMotor"
    click PhaseSystems "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/PhaseSystems"
    click Interfacial "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/interfacialModels"
    click Turbulence "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/multiphaseCompressibleTurbulenceModels"
    click PhaseModel "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/phaseModel"
    click InterfaceTrack "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/interfaceTrackingModels"
    click SharpHeat "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/sharpInterfaceHeatTransferModels"
    click fvPatchFields "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/fvPatchFields"
    click FunctionObjs "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/functionObjects"
    click MultiPhaseSys "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/src/multiphaseSystem"
    click UtilRe "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/ReynoldsNumber"
    click UtilMap "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/mapVolFields"
    click UtilPost "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/postProcessRocket"
    click UtilCons "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/rocketConservation"
    click UtilSetAlpha "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/setMultipleAlphaField"
    click UtilInit "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/setRocketInitField"
    click UtilStream "https://github.com/ganeshkumar-v/propellant-regression-framework/tree/master/utilities/streamFunction"

    %% Styles
    classDef external fill:#CCCCCC,stroke:#333,stroke-width:1px
    classDef build fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef core fill:#90EE90,stroke:#000,stroke-width:1px
    classDef app fill:#FFA500,stroke:#000,stroke-width:1px
    classDef util fill:#D8BFD8,stroke:#000,stroke-width:1px
    classDef data fill:#FFFFE0,stroke:#000,stroke-width:1px
```
