# os-climate/witness-energy architecture

> Architecture diagram of the GitHub repository os-climate/witness-energy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/os-climate/witness-energy
- Repository: https://github.com/os-climate/witness-energy

## Overview

##### Project Type and Purpose
This is a specialized Python package for modeling energy production technologies, carbon capture, usage and storage (CCUS) technologies, and their integration into a unified energy mix system. It's a complex modeling system with multiple interconnected components.

##### Main Architectural Components

a. Core Components:
- Stream Types System
- Technology Models
- Investment Management
- Energy Mix Integration
- CCUS (Carbon Capture, Usage, and Storage)

b. Technology Categories:
- Electricity Generation (Nuclear, Solar, Wind, etc.)
- Fuel Production (Hydrogen, Methane, etc.)
- Heat Generation (High, Medium, Low temperature)
- Carbon Capture Technologies
- Storage Solutions

**┌─────────────────────────────────────────────────────┐**
- Energy Models                      │
- ┬───────────┬──────────────┬─────────────┤
- Stream   │Technology │  Investment   │  Energy Mix │
- Types   │  Models   │  Management  │ Integration │
- ┴───────────┴──────────────┴─────────────┘

##### Data Flow Indicators
- Input/output relationships
- Feedback loops
- Optimization points

##### Component Labels
- Version information
- Parameters
- Technology types

##### Optimization feedback loops

Remember to include:
- Technology interfaces
- Stream type relationships
- Investment distribution mechanisms
- Optimization pathways
- Integration points
- Data flow directions
- Control mechanisms
- Feedback loops

This will create a comprehensive yet understandable representation of this complex energy modeling system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef core fill:#b3d1ff,stroke:#333,stroke-width:2px
    classDef tech fill:#d1f2eb,stroke:#333,stroke-width:2px
    classDef stream fill:#ffe6cc,stroke:#333,stroke-width:2px
    classDef integration fill:#fff2cc,stroke:#333,stroke-width:2px
    classDef carbon fill:#e6ccff,stroke:#333,stroke-width:2px

    %% Core Framework Layer
    subgraph CoreFramework
        STM["Stream Type Management"]
        PBS["Process Builder System"]
        IM["Investment Management"]
        EMC["Energy Mix Core"]
    end

    %% Technology Models Layer
    subgraph TechnologyModels
        %% Primary Energy Production
        subgraph PrimaryEnergy
            FossilTech["Fossil Technologies"]
            NuclearTech["Nuclear Technologies"]
            RenewableTech["Renewable Technologies"]

            %% Fossil Technologies Subcomponents
            FossilTech --> Coal["Coal Generation"]
            FossilTech --> Oil["Oil Generation"]
            FossilTech --> NatGas["Natural Gas"]

            %% Nuclear Technologies Subcomponents
            NuclearTech --> PWR["Pressurized Water Reactor"]
            NuclearTech --> BWR["Boiling Water Reactor"]
            NuclearTech --> SMR["Small Modular Reactor"]

            %% Renewable Technologies Subcomponents
            RenewableTech --> Solar["Solar Energy"]
            RenewableTech --> Wind["Wind Energy"]
            RenewableTech --> Hydro["Hydropower"]
            RenewableTech --> Geo["Geothermal"]

            %% Solar Subcomponents
            Solar --> PV["Photovoltaic"]
            Solar --> CSP["Concentrated Solar Power"]

            %% Wind Subcomponents
            Wind --> Onshore["Onshore Wind"]
            Wind --> Offshore["Offshore Wind"]
        end

        %% Energy Transformation
        subgraph EnergyTransform
            ElecGen["Electricity Generation"]
            HydrogenProd["Hydrogen Production"]
            FuelProc["Fuel Processing"]

            %% Electricity Generation Subcomponents
            ElecGen --> TPP["Thermal Power Plants"]
            ElecGen --> CCP["Combined Cycle Plants"]
            ElecGen --> CHP["CHP Systems"]

            %% Hydrogen Production Subcomponents
            HydrogenProd --> PEM["PEM Electrolysis"]
            HydrogenProd --> SOEC["SOEC Electrolysis"]
            HydrogenProd --> AWE["AWE Electrolysis"]
            HydrogenProd --> SR["Steam Reforming"]
            HydrogenProd --> PC["Plasma Cracking"]

            %% Fuel Processing Subcomponents
            FuelProc --> FT["Fischer-Tropsch"]
            FuelProc --> RO["Refinery Operations"]
            FuelProc --> BP["Biomass Processing"]
        end

        %% Carbon Management
        subgraph CarbonMgmt
            CarbonCapture["Carbon Capture"]
            CarbonStorage["Carbon Storage"]
            CarbonUtil["Carbon Utilization"]

            %% Carbon Capture Subcomponents
            CarbonCapture --> DAC["Direct Air Capture"]
            CarbonCapture --> FGC["Flue Gas Capture"]
            CarbonCapture --> IC["Industrial Capture"]

            %% Carbon Storage Subcomponents
            CarbonStorage --> GeoStore["Geological Storage"]
            CarbonStorage --> OceanStore["Ocean Storage"]
            CarbonStorage --> MinStore["Mineralization"]

            %% Carbon Utilization Subcomponents
            CarbonUtil --> EOR["Enhanced Oil Recovery"]
            CarbonUtil --> CC["Chemical Conversion"]
        end
    end

    %% Stream Types Layer
    subgraph StreamTypes
        EnergyCarriers["Energy Carriers"]
        Fuels["Fuels"]
        CarbonStreams["Carbon Streams"]

        %% Energy Carriers Subcomponents
        EnergyCarriers --> Electricity
        EnergyCarriers --> Heat["Heat Types"]
        EnergyCarriers --> H2["Hydrogen Types"]

        %% Fuels Subcomponents
        Fuels --> LiquidFuels["Liquid Fuels"]
        Fuels --> GaseousFuels["Gaseous Fuels"]
        Fuels --> SolidFuels["Solid Fuels"]

        %% Carbon Streams Subcomponents
        CarbonStreams --> CO2["CO2"]
        CarbonStreams --> Syngas["Syngas"]
        CarbonStreams --> FlueGas["Flue Gas"]
    end

    %% Integration Layer
    subgraph Integration
        EMixCalc["Energy Mix Calculator"]
        InvDist["Investment Distribution"]
        EmissAcc["Emissions Accounting"]
        TechPerf["Technology Performance Evaluation"]
    end

    %% Component Mappings (Click Events)
    click STM "https://github.com/os-climate/witness-energy/tree/main/energy_models/core/stream_type/"
    click PBS "https://github.com/os-climate/witness-energy/blob/main/energy_models/core/energy_process_builder.py"
    click IM "https://github.com/os-climate/witness-energy/tree/main/energy_models/core/investments/"
    click EMC "https://github.com/os-climate/witness-energy/tree/main/energy_models/core/energy_mix/"
    click FossilTech "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/fossil/"
    click NuclearTech "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/electricity/nuclear/"
    click RenewableTech "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/electricity/"
    click ElecGen "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/electricity/"
    click HydrogenProd "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/gaseous_hydrogen/"
    click FuelProc "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/liquid_fuel/"
    click CarbonCapture "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/carbon_capture/"
    click CarbonStorage "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/carbon_storage/"
    click CarbonUtil "https://github.com/os-climate/witness-energy/tree/main/energy_models/models/carbon_capture/flue_gas_capture/"
    click EnergyCarriers "https://github.com/os-climate/witness-energy/tree/main/energy_models/core/stream_type/energy_models/"
    click CarbonStreams "https://github.com/os-climate/witness-energy/tree/main/energy_models/core/stream_type/carbon_models/"
    click EMixCalc "https://github.com/os-climate/witness-energy/blob/main/energy_models/core/energy_mix/energy_mix.py"
    click InvDist "https://github.com/os-climate/witness-energy/blob/main/energy_models/core/investments/investments_redistribution.py"
    click EmissAcc "https://github.com/os-climate/witness-energy/blob/main/energy_models/core/energy_ghg_emissions/energy_ghg_emissions.py"

    %% Apply styles
    class STM,PBS,IM,EMC core
    class FossilTech,NuclearTech,RenewableTech,ElecGen,HydrogenProd,FuelProc tech
    class EnergyCarriers,Fuels,CarbonStreams stream
    class EMixCalc,InvDist,EmissAcc,TechPerf integration
    class CarbonCapture,CarbonStorage,CarbonUtil carbon
```
