![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
#include <GroundHeat.hpp>
Public Member Functions | |
| bool | active () const noexcept |
| Test whether the owner has allocated any thermal cell slots. | |
| void | clear () |
| Reset thermal cells, diagnostics, configuration and borrowed bindings to defaults. | |
| double | activeCapacity (int cell, std::size_t layer) const noexcept |
| Remove promised outgoing water capacity from one physical thermal layer. | |
| double | activeTemperature (int cell, std::size_t layer) const noexcept |
| Divide physical-layer energy by its unreserved heat capacity. | |
| bool | snowContactEnabled (int cell) const noexcept |
| Test reciprocal UEB snow/soil thermal contact availability. | |
| double | snowContactFraction (int cell) const noexcept |
| Read the active snow-contact footprint fraction. | |
| bool | appendSnowContact (int cell, double area, std::vector< ThermalBoundary > &) const |
| Append the top-layer boundary representing a reciprocal finite snow/soil contact. | |
| std::string | applySnowContactEnergy (int cell, double soil_j) |
| Publish reciprocal energy to the active snow owner after a soil contact solve. | |
| std::string | initialize (SimulationContext &, const MeshData &, const SubsurfaceState &, const SubsurfaceTransportState &, const GwTransportData &, const std::vector< uint8_t > &coverage) |
| Build physical aquifer thermal layers and seed conserved energy from resolved moisture. | |
| std::string | initializeStandalone (SimulationContext &, const MeshData &, const GwTransportData &, const std::vector< unsigned char > &owned) |
| Build fixed saturated physical soil columns for surface-owned transient storage. | |
| void | prepare () |
| Sample top and deep thermal forcing at context.current_date. | |
| void | prepareAt (double elapsed_seconds) |
| Sample top/deep thermal forcing at a coupled elapsed horizon. | |
| void | appendRk2Cuts (double start, double end, std::vector< double > &) const |
| Append thermal forcing knots inside a coupled interval after validating series support. | |
| void | refreshView (int cell, SubsurfaceTransportState &) |
| Publish canonical physical heat/porewater inventories into the derived groundwater view. | |
| double | zoneTemperature (int cell, bool saturated) const |
| Read a water-volume-weighted physical-layer temperature for a hydraulic zone. | |
| std::size_t | boundaries (int cell, double exposed_fraction, std::vector< ThermalBoundary > &) const |
| Append configured top/deep thermal boundaries for one physical ground column. | |
| std::string | conduct (int cell, double seconds, bool midpoint=false) |
| Advance unowned physical-column conduction once after accepted water advection. | |
Public Attributes | |
| SimulationContext * | context = nullptr |
| surface::MeshSnow * | snow_owner = nullptr |
| const GwTransportData * | config = nullptr |
| std::vector< GroundThermalCell > | cells |
| std::vector< std::vector< GroundLidThermalOwner > > | lid_owners |
| double | top_now = 0 |
| double | deep_now = 0 |
| double | density = 1000 |
| double | water_capacity = 4184000 |
| int | top_series = -1 |
| int | deep_series = -1 |
|
inlinenoexcept |
Test whether the owner has allocated any thermal cell slots.
|
noexcept |
Remove promised outgoing water capacity from one physical thermal layer.
| [in] | i | Valid prepared cell index (header: cell), unchecked. |
| [in] | j | Valid physical layer index (header: layer), unchecked against capacity. |
|
noexcept |
Divide physical-layer energy by its unreserved heat capacity.
| [in] | i | Valid prepared cell index (header: cell). |
| [in] | j | Valid physical layer index (header: layer). |
| void openswmm::twoD::GroundHeatState::appendRk2Cuts | ( | double | start, |
| double | end, | ||
| std::vector< double > & | cuts ) const |
Append thermal forcing knots inside a coupled interval after validating series support.
| [in] | start | Finite elapsed interval start s. |
| [in] | end | Finite elapsed end s, at least start; required by the caller, not checked here. |
| [in,out] | cuts | Appends strictly interior knot times s from top and deep series. Existing entries are retained; output is neither sorted nor deduplicated. May allocate. |
| std::runtime_error | Invalid series index/shape/time ordering/finiteness, elapsed conversion overflow or missing temperature reservoir coverage across the complete interval. |
| bool openswmm::twoD::GroundHeatState::appendSnowContact | ( | int | i, |
| double | area, | ||
| std::vector< ThermalBoundary > & | bc ) const |
Append the top-layer boundary representing a reciprocal finite snow/soil contact.
| [in] | i | Prepared mesh cell index (header: cell); disabled returns false. |
| [in] | area | Finite positive contact area m2; invalid returns false. |
| [in,out] | bc | Receives one top-store ThermalBoundary with conductance W/K and snow surface temperature degC. Existing records are preserved; local store index is zero. |
| std::runtime_error | Missing top-layer geometry or invalid resistance, temperature/conductance. |
| std::string openswmm::twoD::GroundHeatState::applySnowContactEnergy | ( | int | cell, |
| double | soil_j ) |
Publish reciprocal energy to the active snow owner after a soil contact solve.
| [in] | cell | Matching prepared soil/snow cell. |
| [in] | soil_j | Signed energy J added to soil; the snow owner applies the matching reciprocal receipt. Caller supplies a finite accepted solve result and serializes owner mutation. |
| std::size_t openswmm::twoD::GroundHeatState::boundaries | ( | int | i, |
| double | exposed, | ||
| std::vector< ThermalBoundary > & | bc ) const |
Append configured top/deep thermal boundaries for one physical ground column.
| [in] | i | Valid prepared cell index (header: cell). |
| [in] | exposed | Fraction of column area exposed to top forcing, expected in [0,1] but unchecked. |
| [in,out] | bc | Appended local-store boundary records. Caller normally supplies an empty vector. |
|
inline |
Reset thermal cells, diagnostics, configuration and borrowed bindings to defaults.
| std::string openswmm::twoD::GroundHeatState::conduct | ( | int | i, |
| double | dt, | ||
| bool | midpoint = false ) |
Advance unowned physical-column conduction once after accepted water advection.
| [in] | i | Valid prepared column index (header: cell). |
| [in] | dt | Solve duration s (header: seconds), required finite positive by the thermal solver. |
| [in] | midpoint | True uses the RK2 thermal contact solver, false the ordinary finite solve. |
| std::string openswmm::twoD::GroundHeatState::initialize | ( | SimulationContext & | ctx, |
| const MeshData & | mesh, | ||
| const SubsurfaceState & | water, | ||
| const SubsurfaceTransportState & | tr, | ||
| const GwTransportData & | cfg, | ||
| const std::vector< uint8_t > & | coverage ) |
Build physical aquifer thermal layers and seed conserved energy from resolved moisture.
| [in,out] | ctx | Prepared engine context providing water properties, calendar, names and initial heat values; pointer is borrowed for subsequent forcing sampling. |
| [in] | mesh | SI mesh tags/geometry for scope matching. |
| [in] | water | Prepared hydraulic cell arrays and SIGMA profile, unchanged by this call. |
| [in] | tr | Prepared species layout and temperature row, used for activation/layer initial data. |
| [in] | cfg | Resolved SI groundwater thermal/material/initial conditions, borrowed as config; must remain alive and stable after this call. |
| [in] | coverage | Exactly water.n_cells ownership bytes; nonzero enables a valid positive-area, positive-depth column. Caller supplies consistent hydraulic/mesh/transport shapes and positive thermal_layers. |
| std::string openswmm::twoD::GroundHeatState::initializeStandalone | ( | SimulationContext & | ctx, |
| const MeshData & | mesh, | ||
| const GwTransportData & | cfg, | ||
| const std::vector< unsigned char > & | owned ) |
Build fixed saturated physical soil columns for surface-owned transient storage.
| [in,out] | ctx | Prepared engine context supplying SI water/material and initial temperatures; borrowed after initialization for boundary sampling. |
| [in] | mesh | SI cell geometry and scoped material identity. |
| [in] | cfg | Resolved thermal controls, borrowed as config for the owner's lifetime. |
| [in] | owned | At least mesh.n_cells() bytes; nonzero selects a standalone surface-owned column. Bounds are unchecked. Positive thermal_layers and valid phase/geometry properties are required. |
| void openswmm::twoD::GroundHeatState::prepare | ( | ) |
Sample top and deep thermal forcing at context.current_date.
| std::runtime_error | Missing temperature coverage or nonfinite sampled forcing. |
| void openswmm::twoD::GroundHeatState::prepareAt | ( | double | time | ) |
Sample top/deep thermal forcing at a coupled elapsed horizon.
| std::runtime_error | Invalid/uncovered temperature forcing; partially updated caches may remain. Requires live prepared context/config and exclusive access to forcing cache. |
| [in] | time | Finite elapsed time s from the engine start calendar (header: elapsed_seconds). |
| std::runtime_error | Uncovered/invalid temperature series or nonfinite forcing. |
| void openswmm::twoD::GroundHeatState::refreshView | ( | int | i, |
| SubsurfaceTransportState & | tr ) |
Publish canonical physical heat/porewater inventories into the derived groundwater view.
Rebuild groundwater transport views from canonical physical heat and porewater stores.
| [in] | i | Valid prepared cell index (header: cell), unchecked. |
| [in,out] | tr | Matching prepared native species/temperature view. Publishes porewater SIGMA mass, saturated/unsaturated temperature-volume degC*m3 and per-SIGMA-layer temperature where mapped; nonlayered non-temperature rows are rebuilt from physical zone mass. |
| std::runtime_error | Porewater publishSigma rejects incompatible mapping/state. |
|
noexcept |
Test reciprocal UEB snow/soil thermal contact availability.
| [in] | cell | Cell index, called i in source; invalid returns false. |
|
noexcept |
Read the active snow-contact footprint fraction.
| [in] | cell | Mesh cell index; invalid/disabled contact returns zero. |
| double openswmm::twoD::GroundHeatState::zoneTemperature | ( | int | i, |
| bool | saturated ) const |
Read a water-volume-weighted physical-layer temperature for a hydraulic zone.
| [in] | i | Valid prepared cell index (header: cell); arrays are unchecked. |
| [in] | saturated | True uses saturated_water, false uses the remaining physical porewater. |
| std::vector<GroundThermalCell> openswmm::twoD::GroundHeatState::cells |
| const GwTransportData* openswmm::twoD::GroundHeatState::config = nullptr |
| SimulationContext* openswmm::twoD::GroundHeatState::context = nullptr |
| double openswmm::twoD::GroundHeatState::deep_now = 0 |
| int openswmm::twoD::GroundHeatState::deep_series = -1 |
| double openswmm::twoD::GroundHeatState::density = 1000 |
| std::vector<std::vector<GroundLidThermalOwner> > openswmm::twoD::GroundHeatState::lid_owners |
| surface::MeshSnow* openswmm::twoD::GroundHeatState::snow_owner = nullptr |
| double openswmm::twoD::GroundHeatState::top_now = 0 |
| int openswmm::twoD::GroundHeatState::top_series = -1 |
| double openswmm::twoD::GroundHeatState::water_capacity = 4184000 |