# natlabrockies/ssc architecture

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

- Interactive diagram: https://gitdiagram.com/natlabrockies/ssc
- Repository: https://github.com/natlabrockies/ssc

## Overview

SSC is the simulation core behind SAM: users or SDK callers select compute modules, which model renewable-energy technologies and project finances and expose results through SSC’s variable-table/API layer. The sampled PV module shows irradiance and resilience responsibilities; the molten-salt module shows CSP coordination with SolarPILOT and thermal-system components. The README establishes the compute-module workflow and model scope. Several major modules are unsampled, so their presence is represented at directory level without inferred call chains.

Main entry points: [`ssc/cmod_tcsmolten_salt.cpp`](https://github.com/natlabrockies/ssc/blob/patch/ssc/cmod_tcsmolten_salt.cpp) (Molten-salt model), [`tcs/storage_hx.cpp`](https://github.com/natlabrockies/ssc/blob/patch/tcs/storage_hx.cpp) (Thermal storage), [`ssc/cmod_pvsamv1.cpp`](https://github.com/natlabrockies/ssc/blob/patch/ssc/cmod_pvsamv1.cpp) (PV system model), [`ssc/core.h`](https://github.com/natlabrockies/ssc/blob/patch/ssc/core.h) (Module runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["SSC API"]
  node_core["Module runtime<br/>[core.h]"]
  node_variables["Variable tables<br/>[vartab.cpp]"]
  node_common["Common services<br/>[common.h]"]
end

subgraph group_models["Compute Models"]
  node_techmodels["Technology models"]
  node_finmodels["Financial models"]
end

subgraph group_pv["PV Simulation"]
  node_pvsam["PV system model<br/>[cmod_pvsamv1.cpp]"]
  node_pvio["PV input/output"]
  node_resilience["Resilience analysis<br/>[lib_resilience.h]"]
  node_irradiance["Irradiance models<br/>[lib_irradproc.h]"]
end

subgraph group_csp["CSP Simulation"]
  node_cspmodel["Molten-salt model"]
  node_solarpilot["Solar field design<br/>[SolarField.cpp]"]
  node_cspsolver["CSP system solver<br/>[csp_solver_core.h]"]
  node_dispatch["CSP dispatch"]
  node_storage["Thermal storage<br/>[storage_hx.cpp]"]
end

subgraph group_shared["Shared Physics"]
  node_htf["Heat-fluid properties<br/>[htf_props.h]"]
  node_csputil["CSP utilities<br/>[sam_csp_util.h]"]
  node_utilities["General utilities<br/>[lib_util.h]"]
end

node_caller(("SDK caller"))

node_caller -->|"invokes"| node_core
node_core -->|"uses"| node_variables
node_common -->|"includes"| node_core
node_caller -->|"selects model"| node_techmodels
node_caller -->|"selects model"| node_finmodels
node_pvsam -->|"uses inputs"| node_pvio
node_pvsam -->|"runs analysis"| node_resilience
node_pvsam -->|"calculates irradiance"| node_irradiance
node_cspmodel -->|"uses field"| node_solarpilot
node_cspmodel -->|"uses solver"| node_cspsolver
node_cspmodel -->|"uses dispatch"| node_dispatch
node_cspmodel -.->|"uses storage"| node_storage
node_storage -->|"reads properties"| node_htf
node_storage -->|"uses utilities"| node_csputil
node_storage -->|"uses helpers"| node_utilities

click node_core "https://github.com/natlabrockies/ssc/blob/patch/ssc/core.h"
click node_variables "https://github.com/natlabrockies/ssc/blob/patch/ssc/vartab.cpp"
click node_common "https://github.com/natlabrockies/ssc/blob/patch/ssc/common.h"
click node_techmodels "https://github.com/natlabrockies/ssc/tree/patch/ssc"
click node_finmodels "https://github.com/natlabrockies/ssc/tree/patch/ssc"
click node_pvsam "https://github.com/natlabrockies/ssc/blob/patch/ssc/cmod_pvsamv1.cpp"
click node_pvio "https://github.com/natlabrockies/ssc/blob/patch/shared/lib_pv_io_manager.h"
click node_resilience "https://github.com/natlabrockies/ssc/blob/patch/shared/lib_resilience.h"
click node_irradiance "https://github.com/natlabrockies/ssc/blob/patch/shared/lib_irradproc.h"
click node_cspmodel "https://github.com/natlabrockies/ssc/blob/patch/ssc/cmod_tcsmolten_salt.cpp"
click node_solarpilot "https://github.com/natlabrockies/ssc/blob/patch/solarpilot/SolarField.cpp"
click node_cspsolver "https://github.com/natlabrockies/ssc/blob/patch/tcs/csp_solver_core.h"
click node_dispatch "https://github.com/natlabrockies/ssc/blob/patch/tcs/csp_dispatch_ortools.h"
click node_storage "https://github.com/natlabrockies/ssc/blob/patch/tcs/storage_hx.cpp"
click node_htf "https://github.com/natlabrockies/ssc/blob/patch/tcs/htf_props.h"
click node_csputil "https://github.com/natlabrockies/ssc/blob/patch/tcs/sam_csp_util.h"
click node_utilities "https://github.com/natlabrockies/ssc/blob/patch/shared/lib_util.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_core,node_variables,node_common toneBlue
class node_techmodels,node_finmodels toneAmber
class node_pvsam,node_pvio,node_resilience,node_irradiance toneMint
class node_cspmodel,node_solarpilot,node_cspsolver,node_dispatch,node_storage toneRose
class node_htf,node_csputil,node_utilities,node_caller toneIndigo
```

## Components

### SSC API

- [Module runtime](https://github.com/natlabrockies/ssc/blob/patch/ssc/core.h): `ssc/core.h`
- [Variable tables](https://github.com/natlabrockies/ssc/blob/patch/ssc/vartab.cpp): `ssc/vartab.cpp`
- [Common services](https://github.com/natlabrockies/ssc/blob/patch/ssc/common.h): `ssc/common.h`

### Compute Models

- [Technology models](https://github.com/natlabrockies/ssc/tree/patch/ssc): `ssc`
- [Financial models](https://github.com/natlabrockies/ssc/tree/patch/ssc): `ssc`

### PV Simulation

- [PV system model](https://github.com/natlabrockies/ssc/blob/patch/ssc/cmod_pvsamv1.cpp): `ssc/cmod_pvsamv1.cpp`
- [PV input/output](https://github.com/natlabrockies/ssc/blob/patch/shared/lib_pv_io_manager.h): `shared/lib_pv_io_manager.h`
- [Resilience analysis](https://github.com/natlabrockies/ssc/blob/patch/shared/lib_resilience.h): `shared/lib_resilience.h`
- [Irradiance models](https://github.com/natlabrockies/ssc/blob/patch/shared/lib_irradproc.h): `shared/lib_irradproc.h`

### CSP Simulation

- [Molten-salt model](https://github.com/natlabrockies/ssc/blob/patch/ssc/cmod_tcsmolten_salt.cpp): `ssc/cmod_tcsmolten_salt.cpp`
- [Solar field design](https://github.com/natlabrockies/ssc/blob/patch/solarpilot/SolarField.cpp): `solarpilot/SolarField.cpp`
- [CSP system solver](https://github.com/natlabrockies/ssc/blob/patch/tcs/csp_solver_core.h): `tcs/csp_solver_core.h`
- [CSP dispatch](https://github.com/natlabrockies/ssc/blob/patch/tcs/csp_dispatch_ortools.h): `tcs/csp_dispatch_ortools.h`
- [Thermal storage](https://github.com/natlabrockies/ssc/blob/patch/tcs/storage_hx.cpp): `tcs/storage_hx.cpp`

### Shared Physics

- [Heat-fluid properties](https://github.com/natlabrockies/ssc/blob/patch/tcs/htf_props.h): `tcs/htf_props.h`
- [CSP utilities](https://github.com/natlabrockies/ssc/blob/patch/tcs/sam_csp_util.h): `tcs/sam_csp_util.h`
- [General utilities](https://github.com/natlabrockies/ssc/blob/patch/shared/lib_util.h): `shared/lib_util.h`

### Other components

- **SDK caller**

## Connections

- SDK caller → Module runtime: invokes (evidence: `README.md`)
- Module runtime → Variable tables: uses (evidence: `ssc/core.h`)
- Common services → Module runtime: includes (evidence: `ssc/common.h`)
- SDK caller → Technology models: selects model (evidence: `README.md`)
- SDK caller → Financial models: selects model (evidence: `README.md`)
- PV system model → PV input/output: uses inputs (evidence: `ssc/cmod_pvsamv1.cpp`)
- PV system model → Resilience analysis: runs analysis (evidence: `ssc/cmod_pvsamv1.cpp`)
- PV system model → Irradiance models: calculates irradiance (evidence: `ssc/cmod_pvsamv1.cpp`)
- Molten-salt model → Solar field design: uses field (evidence: `ssc/cmod_tcsmolten_salt.cpp`)
- Molten-salt model → CSP system solver: uses solver (evidence: `ssc/cmod_tcsmolten_salt.cpp`)
- Molten-salt model → CSP dispatch: uses dispatch (evidence: `ssc/cmod_tcsmolten_salt.cpp`)
- Molten-salt model → Thermal storage: uses storage
- Thermal storage → Heat-fluid properties: reads properties (evidence: `tcs/storage_hx.cpp`)
- Thermal storage → CSP utilities: uses utilities
- Thermal storage → General utilities: uses helpers
