OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
LidNodeHeat.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#pragma once
13#include "PorousHeat.hpp"
16#include <cstddef>
17#include <string>
18#include <vector>
19
20namespace openswmm::twoD {
21// Finite-volume thermal graph for the custom [LID_NODES] storage layers.
22// Runtime owners advance it with accepted water/heat receipts and persist its
23// energy through the hydraulic and thermal checkpoints.
25 std::vector<std::size_t> cells; // compact thermal-store index -> LID cell
26 std::vector<ThermalStore> stores;
27 std::vector<ThermalContact> contacts;
29 // Water and matrix geometry are kept in physical-cell layout so accepted
30 // packets can update donor capacity and temperature in producer order.
33};
34
35// Accepted hydraulic transfer. Cell indices are physical top-to-bottom LID
36// cells; -1 denotes the external water owner. External inflows use the
37// producer's Celsius temperature. Internal transfers always use the donor
38// cell's pre-transfer temperature, so split packets cannot change donors.
40 int from_cell = -1, to_cell = -1;
41 double volume_m3 = 0;
43};
44
45// Build capacities and vertical series-resistance contacts from one accepted
46// LID water state. mobile_water_ft3 supplies the separate surface/mobile row;
47// water_heat_capacity is volumetric J/m3/K. An absent energy vector is seeded
48// at initial_celsius; a present vector is retained exactly.
58std::string buildLidNodeThermalGraph(const LidNodeState&, double mobile_water_ft3,
59 double water_heat_capacity, const ConductionConfig&,
60 double initial_celsius, LidNodeThermalGraph&);
61
62// Build the bottom LID-to-soil contact for a combined graph whose ground
63// store has already been appended. Contact area is the actual mapped overlap,
64// bounded by both owners; the two half-layer resistances remain distinct.
65// interface_resistance_m2_k_w is an additional nonnegative interface term.
80 std::size_t combined_store_count, int ground_store,
81 double overlap_area_m2, double ground_area_m2,
82 double ground_layer_thickness_m,
83 double ground_conductivity,
84 double interface_resistance_m2_k_w, ThermalContact&);
85
86// Publish a successful graph solution back to its original physical-cell
87// layout. Zero-capacity cells carry exactly zero stored energy.
96 const std::vector<double>& energy);
97
98// Convert accepted water receipts to sensible energy at producer temperature.
99// Internal donor temperature and capacity are updated after every ordered
100// packet, so split transfers use the state at their accepted time. external_j
101// is signed positive into the LID owner. This is a pure transaction: outputs
102// are replaced only after every packet validates.
115 const LidNodeThermalGraph&, std::size_t physical_cell_count, double water_heat_capacity,
116 const std::vector<LidThermalWaterTransfer>&, std::vector<double>& physical_cell_energy,
117 double& external_j, std::vector<double>* transfer_j = nullptr);
118} // namespace openswmm::twoD
Heat-transport data (heat plan §1, §3; phase H1).
Data-oriented storage for LID node layers, properties, and state.
Local thermal equilibrium in porous ground layers.
Definition ExchangeLaw.hpp:60
std::string publishLidNodeThermalEnergy(LidNodeState &state, const LidNodeThermalGraph &graph, const std::vector< double > &energy)
Replace persisted physical-cell energy with a successful compact graph solution.
Definition LidNodeHeat.cpp:244
std::string transferLidNodeThermalEnergy(const LidNodeThermalGraph &graph, std::size_t cell_count, double water_heat_capacity, const std::vector< LidThermalWaterTransfer > &transfers, std::vector< double > &physical_energy, double &external_j, std::vector< double > *transfer_j)
Stage producer-ordered sensible energy transfers through a fixed physical LID graph.
Definition LidNodeHeat.cpp:285
std::string buildLidNodeThermalGraph(const LidNodeState &state, double mobile_water_ft3, double water_heat_capacity, const ConductionConfig &material, double initial_celsius, LidNodeThermalGraph &output)
Build compact active thermal stores and vertical contacts from accepted LID water state.
Definition LidNodeHeat.cpp:63
std::string buildLidNodeGroundThermalContact(const LidNodeThermalGraph &graph, std::size_t combined_store_count, int ground_store, double overlap_area, double ground_area, double soil_thickness, double soil_conductivity, double interface_resistance, ThermalContact &output)
Connect the compact bottom LID store to an appended physical ground store.
Definition LidNodeHeat.cpp:207
Vertical conduction between LID layers (plan §6.1 D-H5b, H5b).
Definition HeatData.hpp:129
Definition LidNodeData.hpp:54
Definition LidNodeHeat.hpp:24
std::vector< double > physical_conductivity
Definition LidNodeHeat.hpp:28
std::vector< ThermalStore > stores
Definition LidNodeHeat.hpp:26
std::vector< double > physical_matrix_capacity_density
Definition LidNodeHeat.hpp:32
std::vector< std::size_t > cells
Definition LidNodeHeat.hpp:25
std::vector< double > physical_area_m2
Definition LidNodeHeat.hpp:28
std::vector< double > physical_water_m3
Definition LidNodeHeat.hpp:31
std::vector< ThermalContact > contacts
Definition LidNodeHeat.hpp:27
std::vector< double > physical_water_limit_m3
Definition LidNodeHeat.hpp:31
std::vector< double > physical_matrix_bulk_m3
Definition LidNodeHeat.hpp:32
std::vector< double > physical_thickness_m
Definition LidNodeHeat.hpp:28
Definition LidNodeHeat.hpp:39
double volume_m3
Definition LidNodeHeat.hpp:41
int from_cell
Definition LidNodeHeat.hpp:40
double source_temperature_c
Definition LidNodeHeat.hpp:42
int to_cell
Definition LidNodeHeat.hpp:40
Definition PorousHeat.hpp:52