# msmasnadi/opgeev4 architecture

> Architecture diagram of the GitHub repository msmasnadi/opgeev4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/msmasnadi/opgeev4
- Repository: https://github.com/msmasnadi/opgeev4

## Overview

##### Main Components

a) Core System Components:
- XML Model Parser/Reader
- Field Management System
- Process Engine
- Stream Management System
- Monte Carlo Simulation Engine
- Results Generator
- GUI Interface

b) Process Components:
- Process Base System
- Individual Process Types (CO2 Injection, Gas Treatment, Transport, etc.)
- Process Groups Manager
- Stream Flow Controller

##### Key Architectural Elements

Top Layer:
- User Interface Components (GUI, CLI)
- Input Handling (XML Parser, Configuration)

Middle Layer:
- Core Processing Engine
- Field Management
- Process Orchestration
- Stream Management

Bottom Layer:
- Data Storage (CSV Tables)
- Results Generation
- Export Systems

##### Component Relationships

Following interactions:
**XML Input → Model Parser → Field Manager**
- ↓
- Process Engine ←→ Stream Manager
- ↓
- Results Generator
- ↓
- Output (CSV/GUI)

##### Technical Details

- Python package structure
- External dependencies
- File format support (XML, CSV)
- Configuration system
- Plugin architecture

##### Additional Elements

Annotations for:
- Parallel processing capabilities
- SLURM cluster support
- Plugin extension points
- Configuration options

##### The parallel processing capabilities

This system design should reflect OPGEEv4's nature as a scientific computation tool with emphasis on accuracy, extensibility, and performance while maintaining clarity about the flow of data through the system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        XML[XML Input Files]
        Config[Configuration]:::config
    end

    subgraph "Core System"
        XMLParser["XML Model Parser"]:::xmlparser
        ModelMgr["Model Management"]:::model
        CoreSys["Core System"]:::core
        Config --> CoreSys
    end

    subgraph "Process Management"
        ProcEngine["Process Engine"]:::process
        ProcGroups["Process Groups Manager"]:::procgroups
        StreamMgr["Stream Management"]:::stream
        ThermoEngine["Thermodynamics Engine"]:::thermo

        subgraph "Process Types"
            direction TB
            CO2["CO2 Injection"]:::processes
            GasTreat["Gas Treatment"]:::processes
            Transport["Transport"]:::processes
        end
    end

    subgraph "Analysis & Simulation"
        MCS["Monte Carlo Simulation"]:::mcs
        Analysis["Analysis System"]:::analysis
        PostProc["Results Generator"]:::postproc
    end

    subgraph "Data Management"
        TableMgr["Table Manager"]:::tablemgr
        ImportExport["Import/Export System"]:::importexport
        Field["Field Management"]:::field
    end

    subgraph "User Interface"
        GUI["GUI Interface"]:::gui
    end

    %% Connections
    XML --> XMLParser
    XMLParser --> ModelMgr
    ModelMgr --> CoreSys
    CoreSys --> Field
    Field --> ProcEngine
    ProcEngine <--> StreamMgr
    ProcEngine <--> ProcGroups
    StreamMgr <--> ThermoEngine
    ProcGroups --> CO2
    ProcGroups --> GasTreat
    ProcGroups --> Transport
    Field --> MCS
    MCS --> Analysis
    Analysis --> PostProc
    PostProc --> TableMgr
    TableMgr <--> ImportExport
    CoreSys --> GUI

    %% Styling
    classDef core fill:#a8d5ff
    classDef process fill:#98fb98
    classDef stream fill:#98fb98
    classDef field fill:#ffa07a
    classDef mcs fill:#dda0dd
    classDef gui fill:#f0e68c
    classDef config fill:#d3d3d3
    classDef xmlparser fill:#a8d5ff
    classDef model fill:#a8d5ff
    classDef procgroups fill:#98fb98
    classDef processes fill:#98fb98
    classDef thermo fill:#98fb98
    classDef analysis fill:#dda0dd
    classDef postproc fill:#dda0dd
    classDef tablemgr fill:#ffa07a
    classDef importexport fill:#ffa07a

    %% Click events
    click XMLParser "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/XMLFile.py"
    click Field "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/field.py"
    click ProcEngine "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/process.py"
    click StreamMgr "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/stream.py"
    click MCS "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/mcs/simulation.py"
    click GUI "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/gui/app.py"
    click ProcGroups "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/process_groups.py"
    click CO2,GasTreat,Transport "https://github.com/msmasnadi/OPGEEv4/tree/master/opgee/processes"
    click PostProc "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/post_processor.py"
    click CoreSys "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/core.py"
    click Config "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/config.py"
    click ModelMgr "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/model.py"
    click ThermoEngine "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/thermodynamics.py"
    click Analysis "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/analysis.py"
    click TableMgr "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/table_manager.py"
    click ImportExport "https://github.com/msmasnadi/OPGEEv4/blob/master/opgee/import_export.py"
```
