# mwasifanwar/aeroflow architecture

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

- Interactive diagram: https://gitdiagram.com/mwasifanwar/aeroflow
- Repository: https://github.com/mwasifanwar/aeroflow

## Overview

##### Project type and purpose
- This is a Python-based scientific computing “full-stack” pipeline (no user-facing GUI) that integrates:
- Computational Fluid Dynamics (CFD) simulation
- Geometry generation
- Physics-informed and surrogate neural networks
- Optimization algorithms (Bayesian, genetic, gradient)
- A minimal API layer for orchestration
- Visualization of results
- Purpose: iterate on aircraft/vehicle design by automating geometry → mesh → CFD solve → surrogate training → optimization → visualization.

##### File structure
- Top-level:
- main.py: CLI entry point
- config.yaml: global parameters
- src/api/server.py: REST API entrypoint (likely Flask/FastAPI)
- src/cfd: solver, BCs, post-processor
- src/geometry: airfoil & mesh generation, parameterization
- src/neural_networks: CNNs, physics-informed, surrogate models
- src/optimization: Bayesian, GA, gradient-based optimizers
- src/utils: config loader, helper routines
- src/visualization: flow visualization, plotting
- tests/: unit tests for CFD and NN
- No database; data flows through in-memory objects or file I/O.

##### Extract additional insights from README
- The pipeline blends CFD with deep learning surrogates for rapid design exploration.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Orchestration/API Layer
    subgraph "Orchestration/API Layer"
        API["API Layer<br>(server)"]:::api
        CLI["CLI Entry Point<br>(main.py)"]:::api
    end

    %% Configuration
    subgraph "Configuration"
        CFGFile["Global Config<br>(config.yaml)"]:::config
        CFGMgr["Configuration Manager"]:::config
        Helper["Utility Helpers"]:::config
    end

    %% Data Preparation & Simulation
    subgraph "Data Preparation & Simulation"
        Geometry["Geometry Module"]:::data
        Mesh["Mesh Generator"]:::data
        CFD["CFD Engine"]:::data
        BC["Boundary Conditions"]:::data
        Post["Post-Processor"]:::data
    end

    %% Machine Learning
    subgraph "Machine Learning"
        CNN["CNN Models"]:::ml
        PINN["Physics-Informed NN"]:::ml
        SURROG["Surrogate Models"]:::ml
    end

    %% Optimization
    subgraph "Optimization"
        Bayes["Bayesian Optimization"]:::opt
        GA["Genetic Algorithm"]:::opt
        Grad["Gradient-based Optimization"]:::opt
    end

    %% Visualization
    subgraph "Visualization"
        FlowViz["Flow Visualization"]:::viz
        Plotter["Plotter"]:::viz
    end

    %% Auxiliary/Testing
    subgraph "Auxiliary/Testing"
        TestCFD["Test CFD"]:::aux
        TestNN["Test NN"]:::aux
    end

    %% Connections
    CFGFile --> CFGMgr
    Helper --> CFGMgr

    CFGMgr --> API
    CFGMgr --> CLI

    API --> Geometry
    CLI --> Geometry

    Geometry --> Mesh
    Mesh --> CFD
    CFD --> BC
    CFD --> Post
    Post --> CNN
    Post --> PINN
    Post --> SURROG
    Post --> FlowViz
    Post --> Plotter

    SURROG --> Bayes
    SURROG --> GA
    SURROG --> Grad

    Bayes -->|optimized parameters| Geometry
    GA -->|optimized parameters| Geometry
    Grad -->|optimized parameters| Geometry

    API --> Bayes
    API --> GA
    API --> Grad

    API --> CNN
    API --> PINN
    API --> SURROG

    API --> FlowViz
    API --> Plotter

    TestCFD -.-> CFD
    TestNN -.-> CNN

    %% Click Events
    click CFGFile "https://github.com/mwasifanwar/aeroflow/blob/main/config.yaml"
    click CFGMgr "https://github.com/mwasifanwar/aeroflow/blob/main/src/utils/config.py"
    click Helper "https://github.com/mwasifanwar/aeroflow/blob/main/src/utils/helpers.py"
    click Geometry "https://github.com/mwasifanwar/aeroflow/tree/main/src/geometry/"
    click Mesh "https://github.com/mwasifanwar/aeroflow/blob/main/src/geometry/mesh_generator.py"
    click CFD "https://github.com/mwasifanwar/aeroflow/blob/main/src/cfd/solver.py"
    click BC "https://github.com/mwasifanwar/aeroflow/blob/main/src/cfd/boundary_conditions.py"
    click Post "https://github.com/mwasifanwar/aeroflow/blob/main/src/cfd/post_processor.py"
    click CNN "https://github.com/mwasifanwar/aeroflow/blob/main/src/neural_networks/cnn_models.py"
    click PINN "https://github.com/mwasifanwar/aeroflow/blob/main/src/neural_networks/physics_informed_nn.py"
    click SURROG "https://github.com/mwasifanwar/aeroflow/blob/main/src/neural_networks/surrogate_models.py"
    click Bayes "https://github.com/mwasifanwar/aeroflow/blob/main/src/optimization/bayesian_optimization.py"
    click GA "https://github.com/mwasifanwar/aeroflow/blob/main/src/optimization/genetic_algorithm.py"
    click Grad "https://github.com/mwasifanwar/aeroflow/blob/main/src/optimization/gradient_based.py"
    click API "https://github.com/mwasifanwar/aeroflow/blob/main/src/api/server.py"
    click CLI "https://github.com/mwasifanwar/aeroflow/blob/main/main.py"
    click FlowViz "https://github.com/mwasifanwar/aeroflow/blob/main/src/visualization/flow_visualization.py"
    click Plotter "https://github.com/mwasifanwar/aeroflow/blob/main/src/visualization/plotter.py"
    click TestCFD "https://github.com/mwasifanwar/aeroflow/blob/main/tests/test_cfd.py"
    click TestNN "https://github.com/mwasifanwar/aeroflow/blob/main/tests/test_nn.py"

    %% Styles
    classDef config fill:#cccccc,stroke:#333,stroke-width:1px;
    classDef api fill:#999999,stroke:#333,stroke-width:1px;
    classDef data fill:#bbdefb,stroke:#1e88e5,stroke-width:1px;
    classDef ml fill:#c8e6c9,stroke:#43a047,stroke-width:1px;
    classDef opt fill:#ffe0b2,stroke:#fb8c00,stroke-width:1px;
    classDef viz fill:#e1bee7,stroke:#8e24aa,stroke-width:1px;
    classDef aux fill:#fff9c4,stroke:#fdd835,stroke-width:1px;
```
