# nathanrooy/ahmed-bluff-body-cfd architecture

> Architecture diagram of the GitHub repository nathanrooy/ahmed-bluff-body-cfd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nathanrooy/ahmed-bluff-body-cfd
- Repository: https://github.com/nathanrooy/ahmed-bluff-body-cfd

## Overview

##### Project type and purpose
- This is a CFD‐validation repository for the Ahmed bluff‐body geometry, built around OpenFOAM. Its purpose is to provide a standard set of RANS and LES cases (with corresponding meshes, solver settings, and post‐processing) so that users can reproduce or extend automotive/motorsport CFD results.

##### File structure
- Top level
- README.md – project overview, results tables, instructions
- docs/ – visual assets, e.g. animated gif of flow around the body
- geometry/ – raw STL and FreeCAD source for the Ahmed body at two decklid angles
- openfoam_rans/ – RANS validation case directory
- openfoam_les/ – LES validation case directory
- Each case directory (openfoam_rans & openfoam_les) follows the standard OpenFOAM layout:
- 0/ – initial boundary conditions (U, p, k, ω or ν̃, nut)
- constant/ – mesh surface files (triSurface) + transportProperties, turbulenceProperties
- system/ – controlDict, fvSchemes, fvSolution, snappyHexMeshDict, blockMeshDict, decomposeParDict & post‐processing dicts (forceCoeffs, cuttingPlane, streamLines)
- Allrun & Allclean – shell scripts automating mesh generation, solver launch, parallel decomposition, reconstruction, and post-processing

##### Key architecture insights from README
- Two parallel workflows:
- RANS (simpleFoam + kOmegaSST) for steady-state solutions
- LES (pisoFoam + SpalartAllmarasDDES) for transient solutions
- Mesh generation is handled by snappyHexMesh (with blockMesh seed) producing ≈8M cells for RANS case
- Post-processing utilities extract aerodynamic coefficients (Cₓ, Cₗ), cutting planes, and streamline images

##### Detail without overcomplicating
- OpenFOAM directory as a component
- Flow of data from geometry to final aerodynamic coefficients

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Geometry Source
    Geometry["Geometry Source\n(STL, FCStd)"]:::data
    click Geometry "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/geometry/"

    %% RANS Case
    subgraph "RANS Case (openfoam_rans)" 
        direction TB
        ARunR["Allrun"]:::script
        BlockR["blockMeshDict"]:::process
        click BlockR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/blockMeshDict"
        TriR["triSurface STL"]:::data
        click TriR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/blob/master/openfoam_rans/constant/triSurface/ahmed_25deg_m.stl"
        SnappyR["snappyHexMeshDict"]:::process
        click SnappyR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/snappyHexMeshDict"
        SolverR["simpleFoam + kOmegaSST"]:::process
        CTRL_R["controlDict"]:::data
        click CTRL_R "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/controlDict"
        FVSchR["fvSchemes & fvSolution"]:::data
        click FVSchR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/fvSchemes"
        click FVSchR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/fvSolution"
        TurbR["turbulenceProperties"]:::data
        click TurbR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/constant/turbulenceProperties"
        PostR1["forceCoeffs"]:::process
        click PostR1 "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/forceCoeffs"
        PostR2["cuttingPlane"]:::process
        click PostR2 "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/cuttingPlane"
        PostR3["streamLines"]:::process
        click PostR3 "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/system/streamLines"
        CleanR["Allclean"]:::script
        click CleanR "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_rans/Allclean"
    end

    %% LES Case
    subgraph "LES Case (openfoam_les)" 
        direction TB
        ARunL["Allrun"]:::script
        click ARunL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/Allrun"
        BlockL["blockMeshDict"]:::process
        click BlockL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/blockMeshDict"
        TriL["triSurface STL"]:::data
        click TriL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/blob/master/openfoam_les/constant/triSurface/ahmed_25deg_m.stl"
        SnappyL["snappyHexMeshDict"]:::process
        click SnappyL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/snappyHexMeshDict"
        SolverL["pisoFoam + SpalartAllmarasDDES"]:::process
        CTRL_L["controlDict"]:::data
        click CTRL_L "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/controlDict"
        FVSchL["fvSchemes & fvSolution"]:::data
        click FVSchL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/fvSchemes"
        click FVSchL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/fvSolution"
        TurbL["turbulenceProperties"]:::data
        click TurbL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/constant/turbulenceProperties"
        PostL1["forceCoeffs"]:::process
        click PostL1 "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/forceCoeffs"
        PostL2["cuttingPlane"]:::process
        click PostL2 "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/cuttingPlane"
        PostL3["streamLines"]:::process
        click PostL3 "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/system/streamLines"
        CleanL["Allclean"]:::script
        click CleanL "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/openfoam_les/Allclean"
    end

    %% Documentation & Results
    Docs["Documentation & Results\n(README, docs/)"]:::docs
    click Docs "https://github.com/nathanrooy/ahmed-bluff-body-cfd/blob/master/README.md"
    click Docs "https://github.com/nathanrooy/ahmed-bluff-body-cfd/tree/master/docs/"

    %% Flows Geometry to Cases
    Geometry --> ARunR
    Geometry --> ARunL

    %% RANS Workflow
    ARunR --> BlockR --> TriR --> SnappyR --> SolverR
    SolverR --> PostR1 --> PostR2 --> PostR3 --> CleanR --> Docs

    %% LES Workflow
    ARunL --> BlockL --> TriL --> SnappyL --> SolverL
    SolverL --> PostL1 --> PostL2 --> PostL3 --> CleanL --> Docs

    classDef data fill:#cff4fc,stroke:#0b7285;
    classDef process fill:#d3f9d8,stroke:#2b8a3e;
    classDef script fill:#ffd8a8,stroke:#d9480f;
    classDef docs fill:#e9ecef,stroke:#495057;
```
