# arishneel-narayan/centrifugal_pump_sizing_app architecture

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

- Interactive diagram: https://gitdiagram.com/arishneel-narayan/centrifugal_pump_sizing_app
- Repository: https://github.com/arishneel-narayan/centrifugal_pump_sizing_app

## Overview

##### Project Type & Purpose
- This is a lightweight, single‐page Streamlit web application written in Python.
- Purpose: Provide process engineers with an interactive UI to calculate TDH, power requirements, and NPSHa for centrifugal pump sizing.

##### Main Architectural Components
a. Streamlit Web Server
– Hosts the interactive UI.
– Handles HTTP(s) requests from the browser.
b. Calculation Engine
– Encapsulated by pump_sizer.py.
– Contains the domain logic and formulas for pump sizing.
c. External Libraries
– Listed in requirements.txt (e.g., streamlit, numpy, pandas).
– Provide UI widgets, numeric computation, and data handling.
d. Client (Web Browser)
– Renders the Streamlit‐generated UI.
– User interacts (inputs flows, pressures, fluid properties).

##### Relationships & Data Flow
- Browser → Streamlit Server: user inputs via HTTP/WebSocket.
- Streamlit Server → Calculation Engine: passes input parameters to pump_sizer functions.
- Calculation Engine → Streamlit Server: returns results (TDH, power, NPSHa).
- Streamlit Server → Browser: renders results as charts, tables, text.

##### Architectural Patterns & Principles
- Clear separation of concerns:
- UI layer (Streamlit)
- Domain logic (pump_sizer.py)
- Dependency management (requirements.txt)
- Single process, event‐driven model (Streamlit’s run loop).
- Stateless between runs – all state lives in session memory.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client Layer"
        Browser["Web Browser"]:::frontend
    end

    subgraph "UI Layer"
        StreamlitApp["Streamlit App\n(Python 3.x runtime)"]:::frontend
    end

    subgraph "Domain Logic"
        PumpSizer["pump_sizer.py\ncompute_TDH(), compute_power(), compute_NPSHa()"]:::domain
    end

    subgraph "Dependencies"
        ExternalLibs["External Libraries\n(streamlit, numpy, pandas)"]:::deps
    end

    Documentation["Project Documentation\nREADME.md"]:::docs

    Browser -->|"User inputs\n(flow rate, pressures,\nfluid properties)"| StreamlitApp
    StreamlitApp -->|"Invoke compute_TDH(), compute_power(), compute_NPSHa()"| PumpSizer
    PumpSizer -->|"Computed results"| StreamlitApp
    StreamlitApp -->|"Rendered UI\n(charts, tables, text)"| Browser
    StreamlitApp -.->|"Imports / uses"| ExternalLibs
    Documentation -.->|"Reference" | StreamlitApp

    click StreamlitApp "https://github.com/arishneel-narayan/centrifugal_pump_sizing_app/blob/main/pump_sizer.py"
    click PumpSizer "https://github.com/arishneel-narayan/centrifugal_pump_sizing_app/blob/main/pump_sizer.py"
    click ExternalLibs "https://github.com/arishneel-narayan/centrifugal_pump_sizing_app/blob/main/requirements.txt"
    click Documentation "https://github.com/arishneel-narayan/centrifugal_pump_sizing_app/blob/main/README.md"

    classDef frontend fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef domain fill:#90EE90,stroke:#333,stroke-width:1px
    classDef deps fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef docs fill:#FFFACD,stroke:#333,stroke-width:1px
```
