![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Heat-transport configuration as an editable surface (phase H6a). More...
#include "openswmm_engine.h"Go to the source code of this file.
Classes | |
| struct | SWMM_Heat2DStatus |
| struct | SWMM_GroundHeatStatus |
| struct | SWMM_ChannelGroundStatus |
| struct | SWMM_ChannelGroundContact |
| struct | SWMM_ChannelGroundPreview |
Typedefs | |
| typedef enum SWMM_HeatFluxModule | SWMM_HeatFluxModule |
| Flux modules of heat plan §2, each independently toggleable. | |
| typedef int(* | SWMM_HydrothermalEdit) (SWMM_Engine engine, void *user) |
| typedef void * | SWMM_HeatSnapshot |
| typedef void * | SWMM_ConfigSnapshot |
| typedef enum SWMM_HeatShortwaveMode | SWMM_HeatShortwaveMode |
| Where incoming shortwave comes from (plan §2.5, D-H6a-3). | |
| typedef enum SWMM_HeatRadiativeParam | SWMM_HeatRadiativeParam |
[RADIATIVE_FLUXES] scalar parameters. | |
| typedef enum SWMM_HeatSolarParam | SWMM_HeatSolarParam |
[SOLAR_RADIATION] parameters (consulted under COMPUTED only). | |
| typedef enum SWMM_HeatCloudParam | SWMM_HeatCloudParam |
[CLOUD_COVER] parameters. | |
| typedef enum SWMM_HeatSourceKind | SWMM_HeatSourceKind |
[HEAT_SOURCES] water sources. Mirrors openswmm::HeatSource. | |
| typedef enum SWMM_HeatSedimentParam | SWMM_HeatSedimentParam |
[SEDIMENT_EXCHANGE] GLOBAL parameters (bed zone beneath conduits). | |
| typedef enum SWMM_HeatAttr | SWMM_HeatAttr |
Attributes that take per-element overrides. Mirrors openswmm::HeatAttr. | |
| typedef enum SWMM_HeatOverrideScope | SWMM_HeatOverrideScope |
| Scope of a per-element override row. GLOBAL values are set with swmm_heat_set_radiative / swmm_heat_set_sediment instead. | |
| typedef struct SWMM_Heat2DStatus | SWMM_Heat2DStatus |
| typedef enum SWMM_Heat2DValue | SWMM_Heat2DValue |
| typedef struct SWMM_GroundHeatStatus | SWMM_GroundHeatStatus |
| typedef enum SWMM_GroundHeatValue | SWMM_GroundHeatValue |
| typedef enum SWMM_GroundHeatLayerValue | SWMM_GroundHeatLayerValue |
| typedef struct SWMM_ChannelGroundStatus | SWMM_ChannelGroundStatus |
| typedef enum SWMM_ChannelGroundValue | SWMM_ChannelGroundValue |
| typedef struct SWMM_ChannelGroundContact | SWMM_ChannelGroundContact |
| typedef struct SWMM_ChannelGroundPreview | SWMM_ChannelGroundPreview |
Functions | |
| SWMM_ENGINE_API int | swmm_hydrothermal_edit_atomic (SWMM_Engine engine, SWMM_HydrothermalEdit edit, void *user) |
| Apply one synchronous hydrothermal configuration transaction with rollback. | |
| SWMM_ENGINE_API int | swmm_heat_get_dry_policy (SWMM_Engine engine, int *policy) |
| Dry policy: HOLD=0, AIR=1, DEFAULT=2. | |
| SWMM_ENGINE_API int | swmm_heat_set_dry_policy (SWMM_Engine engine, int policy) |
| Select the reported temperature policy for dry water elements. | |
| SWMM_ENGINE_API int | swmm_heat_get_lid_material (SWMM_Engine engine, double values[4]) |
| Read-only LID material assumptions: water conductivity, soil conductivity, soil density, soil specific heat, all SI. | |
| SWMM_ENGINE_API int | swmm_heat_clear_solar_site (SWMM_Engine engine) |
| Remove explicit shared solar coordinates and their provenance. | |
| SWMM_ENGINE_API int | swmm_heat_get_authoring_flags (SWMM_Engine engine, unsigned *flags) |
| Authoring provenance bits: configured=1, shared site=2, explicit latitude/longitude/timezone/elevation=4/8/16/32. | |
| SWMM_ENGINE_API SWMM_HeatSnapshot | swmm_heat_snapshot_create (SWMM_Engine engine) |
| Allocate a reusable heat authoring snapshot for an editable engine. | |
| SWMM_ENGINE_API int | swmm_heat_snapshot_restore (SWMM_Engine engine, SWMM_HeatSnapshot snapshot) |
| Restore a reusable heat authoring snapshot to its original engine. | |
| SWMM_ENGINE_API void | swmm_heat_snapshot_destroy (SWMM_HeatSnapshot snapshot) |
| Release a heat authoring snapshot. | |
| SWMM_ENGINE_API SWMM_ConfigSnapshot | swmm_config_snapshot_create (SWMM_Engine engine) |
| Allocate a reusable complete hydrothermal authoring snapshot. | |
| SWMM_ENGINE_API int | swmm_config_snapshot_restore (SWMM_Engine engine, SWMM_ConfigSnapshot snapshot) |
| Restore complete hydrothermal authoring configuration atomically. | |
| SWMM_ENGINE_API void | swmm_config_snapshot_destroy (SWMM_ConfigSnapshot snapshot) |
| Release a config authoring snapshot. | |
| SWMM_ENGINE_API int | swmm_heat_sediment_temperature_configured (SWMM_Engine engine, int param, int *configured) |
| Authored status and reset for ground/initial bed temperature. | |
| SWMM_ENGINE_API int | swmm_heat_clear_sediment_temperature (SWMM_Engine engine, int param) |
| Reset one authored sediment temperature to inherited/default behavior. | |
| SWMM_ENGINE_API int | swmm_heat_get_enabled (SWMM_Engine engine, int *enabled) |
Is [OPTIONS] HEAT_TRANSPORT on? | |
| SWMM_ENGINE_API int | swmm_heat_get_module (SWMM_Engine engine, int module, int *on) |
Read one [HEAT_FLUXES] module toggle. | |
| SWMM_ENGINE_API int | swmm_heat_set_module (SWMM_Engine engine, int module, int on) |
Write one [HEAT_FLUXES] module toggle. | |
| SWMM_ENGINE_API int | swmm_heat_get_radiative (SWMM_Engine engine, int param, double *value) |
Read one [RADIATIVE_FLUXES] parameter. | |
| SWMM_ENGINE_API int | swmm_heat_set_radiative (SWMM_Engine engine, int param, double value) |
Write one [RADIATIVE_FLUXES] parameter. | |
| SWMM_ENGINE_API int | swmm_heat_get_shortwave_mode (SWMM_Engine engine, int *mode) |
| Read the incoming-shortwave mode (SWMM_HeatShortwaveMode). | |
| SWMM_ENGINE_API int | swmm_heat_set_shortwave_mode (SWMM_Engine engine, int mode) |
| Set the incoming-shortwave mode. | |
| SWMM_ENGINE_API int | swmm_heat_set_shortwave_timeseries (SWMM_Engine engine, const char *name) |
Bind a [TIMESERIES] (by name) as the shortwave record and switch the mode to SWMM_HEAT_SW_TIMESERIES. | |
| SWMM_ENGINE_API int | swmm_heat_get_shortwave_timeseries (SWMM_Engine engine, char *buf, int buflen) |
Name of the [TIMESERIES] bound as the shortwave record, or "" when none is bound. NUL-terminated, truncated to buflen. | |
| SWMM_ENGINE_API int | swmm_heat_get_current_shortwave (SWMM_Engine engine, double *wm2) |
| Resolved incoming shortwave at the CURRENT step, W/m², cloud already applied. Read-only: this is state, not configuration. 0 before the first step, and whenever radiative exchange is off. | |
| SWMM_ENGINE_API int | swmm_heat_get_solar (SWMM_Engine engine, int param, double *value) |
Read one [SOLAR_RADIATION] parameter. | |
| SWMM_ENGINE_API int | swmm_heat_set_solar (SWMM_Engine engine, int param, double value) |
Write one [SOLAR_RADIATION] parameter. | |
| SWMM_ENGINE_API int | swmm_heat_get_solar_sited (SWMM_Engine engine, int *sited) |
| Have latitude AND longitude both been explicitly set? | |
| SWMM_ENGINE_API int | swmm_heat_get_cloud_configured (SWMM_Engine engine, int *configured) |
Is a [CLOUD_COVER] section in effect? | |
| SWMM_ENGINE_API int | swmm_heat_get_cloud (SWMM_Engine engine, int param, double *value) |
Read one [CLOUD_COVER] parameter. | |
| SWMM_ENGINE_API int | swmm_heat_set_cloud (SWMM_Engine engine, int param, double value) |
Write one [CLOUD_COVER] parameter. Writing any of them marks cloud cover as configured. | |
| SWMM_ENGINE_API int | swmm_heat_set_cloud_timeseries (SWMM_Engine engine, const char *name) |
Bind a [TIMESERIES] (by name) as the cloud-fraction record. | |
| SWMM_ENGINE_API int | swmm_heat_get_cloud_timeseries (SWMM_Engine engine, char *buf, int buflen) |
Name of the [TIMESERIES] bound as the cloud-fraction record, or "" when none is bound. NUL-terminated, truncated to buflen. | |
| SWMM_ENGINE_API int | swmm_heat_clear_cloud (SWMM_Engine engine) |
Clear [CLOUD_COVER] entirely — back to clear sky. | |
| SWMM_ENGINE_API int | swmm_heat_get_current_cloud (SWMM_Engine engine, double *fraction) |
| Cloud fraction in effect at the CURRENT step, [0,1]. Read-only. | |
| SWMM_ENGINE_API int | swmm_heat_source_count (SWMM_Engine engine, int *count) |
| Number of sources the table carries (7). Never fails on a model with no heat configured — the table is a fixed enum extent, not a parsed list. | |
| SWMM_ENGINE_API int | swmm_heat_get_source_temp (SWMM_Engine engine, int source, double *temp_c) |
| Read one source's GLOBAL inlet temperature (°C). | |
| SWMM_ENGINE_API int | swmm_heat_set_source_temp (SWMM_Engine engine, int source, double temp_c) |
| Write one source's GLOBAL inlet temperature (°C). | |
| SWMM_ENGINE_API int | swmm_heat_get_source_configured (SWMM_Engine engine, int source, int *configured) |
| Did the model set this source explicitly, or is it taking the default? The editor needs the distinction to avoid writing rows a user never asked for. | |
| SWMM_ENGINE_API int | swmm_heat_clear_source_temp (SWMM_Engine engine, int source) |
| Return a source to the 20 °C default and mark it unconfigured, so the writer emits no row for it. NODE overrides are untouched — they are separate rows and removing them silently would delete model the caller did not name. | |
| SWMM_ENGINE_API int | swmm_heat_node_override_count (SWMM_Engine engine, int *count) |
| Number of NODE-scope override rows. | |
| SWMM_ENGINE_API int | swmm_heat_get_node_override (SWMM_Engine engine, int index, int *source, int *node, double *temp_c) |
| Read one NODE override by row index. Any out-pointer may be NULL. | |
| SWMM_ENGINE_API int | swmm_heat_set_node_override (SWMM_Engine engine, int source, int node, double temp_c) |
Add or update the NODE override for (source, node). | |
| SWMM_ENGINE_API int | swmm_heat_remove_node_override (SWMM_Engine engine, int index) |
| Remove one NODE override by row index. Later rows shift down, so a caller iterating by index must re-read the count after removing. | |
| SWMM_ENGINE_API int | swmm_heat_get_effective_source_temp (SWMM_Engine engine, int source, int node, double *temp_c) |
The temperature source water actually enters node at (°C) — the NODE override when one exists, else the GLOBAL value. This is HeatConfigData::source_temp, exposed so a caller reads the same resolution the engine uses rather than re-deriving the precedence and drifting from it. | |
| SWMM_ENGINE_API int | swmm_heat_get_sediment (SWMM_Engine engine, int param, double *value) |
Read a [SEDIMENT_EXCHANGE] GLOBAL parameter. | |
| SWMM_ENGINE_API int | swmm_heat_set_sediment (SWMM_Engine engine, int param, double value) |
Write a [SEDIMENT_EXCHANGE] GLOBAL parameter. | |
| SWMM_ENGINE_API int | swmm_heat_get_sediment_ground_timeseries (SWMM_Engine engine, char *buf, int buflen) |
| Ground-temperature timeseries name; empty when the constant spelling is in force. | |
| SWMM_ENGINE_API int | swmm_heat_set_sediment_ground_timeseries (SWMM_Engine engine, const char *name) |
Drive the ground temperature from a [TIMESERIES]; NULL or "" returns to the constant value. | |
| SWMM_ENGINE_API int | swmm_heat_element_override_count (SWMM_Engine engine, int *count) |
| Number of per-element override rows (radiative and sediment). | |
| SWMM_ENGINE_API int | swmm_heat_get_element_override (SWMM_Engine engine, int index, int *attr, int *scope, char *name, int name_len, double *value) |
| Read one override row. Any out-pointer may be NULL. | |
| SWMM_ENGINE_API int | swmm_heat_set_element_override (SWMM_Engine engine, int attr, int scope, const char *name, double value) |
Add or update the override for (attr, scope, name). | |
| SWMM_ENGINE_API int | swmm_heat_remove_element_override (SWMM_Engine engine, int index) |
| Remove one override row by index. | |
| SWMM_ENGINE_API int | swmm_heat_get_effective_element (SWMM_Engine engine, int attr, int scope, const char *name, double *value, int *source, char *source_name, int source_name_len) |
| Read the effective property for a named NODE, LINK or CELL2D. Source is GLOBAL=0, TAG=1, NODE=2, LINK=3, air temperature=4, ground series=5, CELL2D=6 or MESH_TAG=7. CELL2D names use one-based native cell IDs. Dynamic temperatures return NaN; source_name identifies the tag/series. This reports configuration precedence, independent of process activation. | |
| SWMM_ENGINE_API int | swmm_heat_get_2d_status (SWMM_Engine engine, SWMM_Heat2DStatus *status) |
| Read requested and initialized coupled surface-heat status. | |
| SWMM_ENGINE_API int | swmm_heat_get_2d_values (SWMM_Engine engine, int kind, int first_cell, int count, double *values) |
| Read a contiguous range of accepted surface-heat runtime values. | |
| SWMM_ENGINE_API int | swmm_heat_ground_source_configured (SWMM_Engine engine, int *configured) |
| Exact authoring state for the new channel ground selector. Clear restores the absent/default PRESCRIBED choice; both operations are pre-run only. | |
| SWMM_ENGINE_API int | swmm_heat_clear_ground_source (SWMM_Engine engine) |
| Restore the absent/default prescribed channel ground-source choice. | |
| SWMM_ENGINE_API int | swmm_heat_get_ground_status (SWMM_Engine engine, SWMM_GroundHeatStatus *status) |
| Read canonical ground thermal ownership and runtime status. | |
| SWMM_ENGINE_API int | swmm_heat_get_ground_values (SWMM_Engine engine, int kind, int first_cell, int count, double *values) |
| Read a contiguous cell range of canonical soil thermal values. | |
| SWMM_ENGINE_API int | swmm_heat_get_ground_layers (SWMM_Engine engine, int cell, int kind, int first_layer, int count, double *values) |
| Zero-based cell/layer ranges. Invalid ranges leave all output untouched. | |
| SWMM_ENGINE_API int | swmm_heat_get_channel_ground_status (SWMM_Engine engine, SWMM_ChannelGroundStatus *status) |
| Read requested and measured channel-to-ground contact status. | |
| SWMM_ENGINE_API int | swmm_heat_get_channel_ground_values (SWMM_Engine engine, int kind, int first_link, int count, double *values) |
| Read a contiguous link range of accepted channel-ground values. | |
| SWMM_ENGINE_API int | swmm_heat_get_channel_ground_contact (SWMM_Engine engine, int index, SWMM_ChannelGroundContact *contact) |
| Read one initialized channel-to-ground contact interval. | |
| SWMM_ENGINE_API int | swmm_heat_preview_channel_ground_map (SWMM_Engine engine, int link, SWMM_ChannelGroundPreview *out, SWMM_ChannelGroundContact *contacts, int capacity, int *required) |
| Preview complete channel XY coverage on a private mesh copy. | |
| SWMM_ENGINE_API int | swmm_heat_preview_channel_ground_map_with_progress (SWMM_Engine engine, int link, SWMM_ChannelGroundPreview *out, SWMM_ChannelGroundContact *contacts, int capacity, int *required, SWMM_CancelCallback callback, void *user_data) |
Cancellable variant of the read-only channel-contact preview. The callback may be invoked during mesh indexing and channel mapping. If it returns nonzero, the function returns SWMM_ERR_CANCELLED and leaves out, contacts, and required unchanged. | |
| SWMM_ENGINE_API int | swmm_heat_preview_channel_ground_map_page (SWMM_Engine engine, int link, SWMM_ChannelGroundPreview *out, int first, SWMM_ChannelGroundContact *contacts, int capacity, int *required, SWMM_CancelCallback callback, void *user_data) |
Bounded, cancellable contact page. first is a zero-based interval offset; at most capacity rows are copied while required reports the total count. The summary counts describe the complete mapping. On cancellation, all output arguments remain unchanged. | |
Heat-transport configuration as an editable surface (phase H6a).
The model.heat component configuration — flux-module toggles, [RADIATIVE_FLUXES] parameters, and H6a's [SOLAR_RADIATION] and [CLOUD_COVER] sections — reachable from C. This is the header UNIFIED_PLAN_STATUS_2026-08-29.md §6 names as the blocker on GUI task G4g (heat configuration editor).
openswmm_reactions.h's count/get/add shape, refusing exactly what the parser refuses.openswmm_water_age.h documents. New finite mesh/soil stores require model selection, initial state and capacity-defining parameters before initialization. Weather and flux inputs retain their live-update behavior.swmm_heat_set_shortwave_mode with SWMM_HEAT_SW_COMPUTED returns SWMM_ERR_BADPARAM unless BOTH latitude and longitude have been set. The engine will not fall back on the [TEMPERATURE] SNOWMELT latitude: that field defaults to 0, so borrowing it would silently model equatorial noon (heat plan §2.5).| typedef struct SWMM_ChannelGroundContact SWMM_ChannelGroundContact |
One initialized contact interval. Fractions refer to the full polyline; share divides legitimate common-edge ownership, never an entire reach. Invert is its representative elevation in metres SI.
| typedef struct SWMM_ChannelGroundPreview SWMM_ChannelGroundPreview |
Pre-run, read-only XY coverage preview for one routed channel. Contact intervals use whole-polyline fractions, have layer=-1, and may be returned even when valid is false so uncovered geometry remains visible. A valid result means the complete polyline lies in the mesh; soil-profile, invert, bed-thickness and thermal-owner checks still run at initialization. Initialize struct_size and pass contacts=null/capacity=0 to query the required interval count. If capacity is too small, status and required are returned but the contact array is left untouched. Only OPENED/BUILDING engines with a parsed mesh are accepted.
| typedef struct SWMM_ChannelGroundStatus SWMM_ChannelGroundStatus |
Routed-channel contact configuration and initialized mapping counts. Initialize struct_size. Counts describe the measured topology, even when a live parent switch pauses its exchange. All new physics is experimental.
| typedef enum SWMM_ChannelGroundValue SWMM_ChannelGroundValue |
Zero-based link ranges; unmapped links return NaN. Bed temperature is a capacity-weighted view of the actual soil under the bed, available dry or wet. It adds no reservoir and must not be counted as extra soil energy.
| typedef void* SWMM_ConfigSnapshot |
Exact pre-run authoring memento spanning simulation options, monthly climate adjustments, climate/snow/UEB, heat (including 2D thermal/GW authoring), shared site state and process-component registrations. It owns no engine; restore requires the same editable engine used to create it. The snapshot is reusable for Undo and Redo.
| typedef enum SWMM_GroundHeatLayerValue SWMM_GroundHeatLayerValue |
Fixed thermal depth grid, independent of hydraulic sigma layers.
| typedef struct SWMM_GroundHeatStatus SWMM_GroundHeatStatus |
Soil state is canonical solid-plus-water energy, not a second copy of the transported water-temperature row. Initialize struct_size before reading.
| typedef enum SWMM_GroundHeatValue SWMM_GroundHeatValue |
Per-cell canonical fields. Positive receipts enter soil. Unmodeled cells return NaN; an entirely inactive model returns SWMM_ERR_LIFECYCLE. All energies are J relative to 0 degC, accumulated since initialization.
| typedef struct SWMM_Heat2DStatus SWMM_Heat2DStatus |
Requested configuration and measured 2D runtime activation are distinct. Initialize struct_size before calling. Values apply to the mesh domain. New coupled physics remains experimental until its restart/owner matrix is qualified; the reason field states this explicitly.
| typedef enum SWMM_Heat2DValue SWMM_Heat2DValue |
SI runtime fields, cumulative since initialization. Positive J enters the named store; WATER_TO_BED is positive water -> bed. Cell indices are zero based at this bulk API. Bed-only fields are unavailable without a bed.
| typedef enum SWMM_HeatAttr SWMM_HeatAttr |
Attributes that take per-element overrides. Mirrors openswmm::HeatAttr.
| typedef enum SWMM_HeatCloudParam SWMM_HeatCloudParam |
[CLOUD_COVER] parameters.
| typedef enum SWMM_HeatFluxModule SWMM_HeatFluxModule |
Flux modules of heat plan §2, each independently toggleable.
| typedef enum SWMM_HeatOverrideScope SWMM_HeatOverrideScope |
Scope of a per-element override row. GLOBAL values are set with swmm_heat_set_radiative / swmm_heat_set_sediment instead.
| typedef enum SWMM_HeatRadiativeParam SWMM_HeatRadiativeParam |
[RADIATIVE_FLUXES] scalar parameters.
| typedef enum SWMM_HeatSedimentParam SWMM_HeatSedimentParam |
[SEDIMENT_EXCHANGE] GLOBAL parameters (bed zone beneath conduits).
| typedef enum SWMM_HeatShortwaveMode SWMM_HeatShortwaveMode |
Where incoming shortwave comes from (plan §2.5, D-H6a-3).
The three are MUTUALLY EXCLUSIVE in EFFECT — exactly one is read, and there is no precedence ladder behind them.
Switching modes does NOT erase the other modes' settings: a constant stays stored while a timeseries is active, and vice versa, so a GUI can offer three radio buttons without destroying what the user typed under the other two. Only the selected one reaches the model. (A deck cannot express that ambiguity at all — the parser refuses a second SHORTWAVE row outright.)
| typedef void* SWMM_HeatSnapshot |
| typedef enum SWMM_HeatSolarParam SWMM_HeatSolarParam |
[SOLAR_RADIATION] parameters (consulted under COMPUTED only).
| typedef enum SWMM_HeatSourceKind SWMM_HeatSourceKind |
[HEAT_SOURCES] water sources. Mirrors openswmm::HeatSource.
| typedef int(* SWMM_HydrothermalEdit) (SWMM_Engine engine, void *user) |
Pre-run climate/snow/heat transaction. The callback may use only climate, snow configuration, heat configuration (including 2D heat and GW/aquifer authoring), HEAT_TRANSPORT, component registrations and climate-file path setters. Returning an error restores values and provenance. The callback must not change topology, destroy the engine, run, or nest transactions.
Zero-based link ranges; unmapped links return NaN. Bed temperature is a capacity-weighted view of the actual soil under the bed, available dry or wet. It adds no reservoir and must not be counted as extra soil energy.
Fixed thermal depth grid, independent of hydraulic sigma layers.
| enum SWMM_GroundHeatValue |
Per-cell canonical fields. Positive receipts enter soil. Unmodeled cells return NaN; an entirely inactive model returns SWMM_ERR_LIFECYCLE. All energies are J relative to 0 degC, accumulated since initialization.
| enum SWMM_Heat2DValue |
SI runtime fields, cumulative since initialization. Positive J enters the named store; WATER_TO_BED is positive water -> bed. Cell indices are zero based at this bulk API. Bed-only fields are unavailable without a bed.
| enum SWMM_HeatAttr |
Attributes that take per-element overrides. Mirrors openswmm::HeatAttr.
| enum SWMM_HeatCloudParam |
| enum SWMM_HeatFluxModule |
Flux modules of heat plan §2, each independently toggleable.
Scope of a per-element override row. GLOBAL values are set with swmm_heat_set_radiative / swmm_heat_set_sediment instead.
[RADIATIVE_FLUXES] scalar parameters.
[SEDIMENT_EXCHANGE] GLOBAL parameters (bed zone beneath conduits).
Where incoming shortwave comes from (plan §2.5, D-H6a-3).
The three are MUTUALLY EXCLUSIVE in EFFECT — exactly one is read, and there is no precedence ladder behind them.
Switching modes does NOT erase the other modes' settings: a constant stays stored while a timeseries is active, and vice versa, so a GUI can offer three radio buttons without destroying what the user typed under the other two. Only the selected one reaches the model. (A deck cannot express that ambiguity at all — the parser refuses a second SHORTWAVE row outright.)
| Enumerator | |
|---|---|
| SWMM_HEAT_SW_CONSTANT | Fixed W/m². |
| SWMM_HEAT_SW_TIMESERIES | Measured record. |
| SWMM_HEAT_SW_COMPUTED | Solar position + Bird clear-sky. |
| enum SWMM_HeatSolarParam |
[SOLAR_RADIATION] parameters (consulted under COMPUTED only).
| enum SWMM_HeatSourceKind |
[HEAT_SOURCES] water sources. Mirrors openswmm::HeatSource.
| SWMM_ENGINE_API SWMM_ConfigSnapshot swmm_config_snapshot_create | ( | SWMM_Engine | engine | ) |
Allocate a reusable complete hydrothermal authoring snapshot.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| SWMM_ENGINE_API void swmm_config_snapshot_destroy | ( | SWMM_ConfigSnapshot | snapshot | ) |
Release a config authoring snapshot.
| [in] | snapshot | Owned snapshot of the matching type; NULL is safe. |
| SWMM_ENGINE_API int swmm_config_snapshot_restore | ( | SWMM_Engine | engine, |
| SWMM_ConfigSnapshot | snapshot ) |
Restore complete hydrothermal authoring configuration atomically.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | snapshot | Required live snapshot produced by swmm_config_snapshot_create() for this exact engine identity. The snapshot remains valid and reusable after restore. |
| SWMM_ENGINE_API int swmm_heat_clear_cloud | ( | SWMM_Engine | engine | ) |
Clear [CLOUD_COVER] entirely — back to clear sky.
Restores the exact H3 longwave path, not an approximation of it: the cloud factor becomes a literal 1.0 that atmosphericEmissivity short-circuits.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| SWMM_ENGINE_API int swmm_heat_clear_ground_source | ( | SWMM_Engine | engine | ) |
Restore the absent/default prescribed channel ground-source choice.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| SWMM_ENGINE_API int swmm_heat_clear_sediment_temperature | ( | SWMM_Engine | engine, |
| int | param ) |
Reset one authored sediment temperature to inherited/default behavior.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HEAT_SED_GROUND_TEMPERATURE or SWMM_HEAT_SED_INITIAL_TEMPERATURE. |
| SWMM_ENGINE_API int swmm_heat_clear_solar_site | ( | SWMM_Engine | engine | ) |
Remove explicit shared solar coordinates and their provenance.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| SWMM_ENGINE_API int swmm_heat_clear_source_temp | ( | SWMM_Engine | engine, |
| int | source ) |
Return a source to the 20 °C default and mark it unconfigured, so the writer emits no row for it. NODE overrides are untouched — they are separate rows and removing them silently would delete model the caller did not name.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | source | SWMM_HeatSourceKind code, in [0,6]. |
| SWMM_ENGINE_API int swmm_heat_element_override_count | ( | SWMM_Engine | engine, |
| int * | count ) |
Number of per-element override rows (radiative and sediment).
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | count | Required destination for the current override-row count. |
| SWMM_ENGINE_API int swmm_heat_get_2d_status | ( | SWMM_Engine | engine, |
| SWMM_Heat2DStatus * | status ) |
Read requested and initialized coupled surface-heat status.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in,out] | status | Required caller-owned record with struct_size at least sizeof(SWMM_Heat2DStatus). |
| SWMM_ENGINE_API int swmm_heat_get_2d_values | ( | SWMM_Engine | engine, |
| int | kind, | ||
| int | first_cell, | ||
| int | count, | ||
| double * | values ) |
Read a contiguous range of accepted surface-heat runtime values.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | kind | SWMM_Heat2DValue selector; units/signs follow the enum member. |
| [in] | first_cell | Nonnegative zero-based starting cell index. |
| [in] | count | Nonnegative number of consecutive values to copy; span must fit the model. |
| [out] | values | Caller-owned count-double destination; may be NULL only when count == 0. |
| SWMM_ENGINE_API int swmm_heat_get_authoring_flags | ( | SWMM_Engine | engine, |
| unsigned * | flags ) |
Authoring provenance bits: configured=1, shared site=2, explicit latitude/longitude/timezone/elevation=4/8/16/32.
Exact pre-run memento for heat settings, 2D heat/GW/aquifer authoring, their shared site and component registrations. Callers must check their authoring identity before Undo. It owns no engine; the caller must ensure the original engine is still open before restoring. Destroy is safe after closing the engine.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | flags | Required result destination: bitwise provenance flags listed above. |
| SWMM_ENGINE_API int swmm_heat_get_channel_ground_contact | ( | SWMM_Engine | engine, |
| int | index, | ||
| SWMM_ChannelGroundContact * | contact ) |
Read one initialized channel-to-ground contact interval.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | index | Zero-based initialized contact-interval index. |
| [in,out] | contact | Required record with struct_size at least sizeof(SWMM_ChannelGroundContact). |
| SWMM_ENGINE_API int swmm_heat_get_channel_ground_status | ( | SWMM_Engine | engine, |
| SWMM_ChannelGroundStatus * | status ) |
Read requested and measured channel-to-ground contact status.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in,out] | status | Required caller-owned record with struct_size at least sizeof(SWMM_ChannelGroundStatus). |
| SWMM_ENGINE_API int swmm_heat_get_channel_ground_values | ( | SWMM_Engine | engine, |
| int | kind, | ||
| int | first_link, | ||
| int | count, | ||
| double * | values ) |
Read a contiguous link range of accepted channel-ground values.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | kind | SWMM_ChannelGroundValue selector; units/signs follow the enum member. |
| [in] | first_link | Nonnegative zero-based starting link index. |
| [in] | count | Nonnegative number of consecutive values to copy; span must fit the model. |
| [out] | values | Caller-owned count-double destination; may be NULL only when count == 0. |
| SWMM_ENGINE_API int swmm_heat_get_cloud | ( | SWMM_Engine | engine, |
| int | param, | ||
| double * | value ) |
Read one [CLOUD_COVER] parameter.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatCloudParam selector. |
| [out] | value | Required destination; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_get_cloud_configured | ( | SWMM_Engine | engine, |
| int * | configured ) |
Is a [CLOUD_COVER] section in effect?
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | configured | Required result destination: 1 for authored cloud cover, otherwise 0. |
| SWMM_ENGINE_API int swmm_heat_get_cloud_timeseries | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Name of the [TIMESERIES] bound as the cloud-fraction record, or "" when none is bound. NUL-terminated, truncated to buflen.
The shortwave getter's sibling — see swmm_heat_get_shortwave_timeseries.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | buf | Required writable string destination, safely truncated with a trailing NUL. |
| [in] | buflen | Positive capacity in bytes including the terminator. |
| SWMM_ENGINE_API int swmm_heat_get_current_cloud | ( | SWMM_Engine | engine, |
| double * | fraction ) |
Cloud fraction in effect at the CURRENT step, [0,1]. Read-only.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | fraction | Required result destination: last resolved dimensionless cloud fraction in [0,1]. |
| SWMM_ENGINE_API int swmm_heat_get_current_shortwave | ( | SWMM_Engine | engine, |
| double * | wm2 ) |
Resolved incoming shortwave at the CURRENT step, W/m², cloud already applied. Read-only: this is state, not configuration. 0 before the first step, and whenever radiative exchange is off.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | wm2 | Required result destination: last resolved incoming shortwave in W/m2. |
| SWMM_ENGINE_API int swmm_heat_get_dry_policy | ( | SWMM_Engine | engine, |
| int * | policy ) |
Dry policy: HOLD=0, AIR=1, DEFAULT=2.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | policy | Required result destination: HOLD=0, AIR=1 or DEFAULT=2. |
| SWMM_ENGINE_API int swmm_heat_get_effective_element | ( | SWMM_Engine | engine, |
| int | attr, | ||
| int | scope, | ||
| const char * | name, | ||
| double * | value, | ||
| int * | source, | ||
| char * | source_name, | ||
| int | source_name_len ) |
Read the effective property for a named NODE, LINK or CELL2D. Source is GLOBAL=0, TAG=1, NODE=2, LINK=3, air temperature=4, ground series=5, CELL2D=6 or MESH_TAG=7. CELL2D names use one-based native cell IDs. Dynamic temperatures return NaN; source_name identifies the tag/series. This reports configuration precedence, independent of process activation.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | attr | SWMM_HeatAttr selector; sediment attributes cannot use NODE scope. |
| [in] | scope | NODE, LINK or CELL2D. |
| [in] | name | Required existing element identifier; CELL2D uses a decimal one-based ID. |
| [out] | value | Required effective-value destination; units follow the attribute. |
| [out] | source | Required origin code destination from the list above. |
| [out] | source_name | Optional source description, copied only when capacity is positive. |
| [in] | source_name_len | Source-name byte capacity; positive capacity safely truncates with NUL. |
| SWMM_ENGINE_API int swmm_heat_get_effective_source_temp | ( | SWMM_Engine | engine, |
| int | source, | ||
| int | node, | ||
| double * | temp_c ) |
The temperature source water actually enters node at (°C) — the NODE override when one exists, else the GLOBAL value. This is HeatConfigData::source_temp, exposed so a caller reads the same resolution the engine uses rather than re-deriving the precedence and drifting from it.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | source | SWMM_HeatSourceKind code [0,6]. |
| [in] | node | Zero-based existing node index. |
| [out] | temp_c | Required resolved-temperature destination in degrees Celsius. |
| SWMM_ENGINE_API int swmm_heat_get_element_override | ( | SWMM_Engine | engine, |
| int | index, | ||
| int * | attr, | ||
| int * | scope, | ||
| char * | name, | ||
| int | name_len, | ||
| double * | value ) |
Read one override row. Any out-pointer may be NULL.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | index | Zero-based element-override row index. |
| [out] | attr | Optional SWMM_HeatAttr destination. |
| [out] | scope | Optional SWMM_HeatOverrideScope destination. |
| [out] | name | Optional name destination; copied only for positive name_len, safely truncated with NUL. |
| [in] | name_len | Capacity in bytes; nonpositive capacity skips the string. |
| [out] | value | Optional authored value, with units from its attribute. |
| SWMM_ENGINE_API int swmm_heat_get_enabled | ( | SWMM_Engine | engine, |
| int * | enabled ) |
Is [OPTIONS] HEAT_TRANSPORT on?
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | enabled | Required result destination: 1 when HEAT_TRANSPORT is enabled, otherwise 0. |
| SWMM_ENGINE_API int swmm_heat_get_ground_layers | ( | SWMM_Engine | engine, |
| int | cell, | ||
| int | kind, | ||
| int | first_layer, | ||
| int | count, | ||
| double * | values ) |
Zero-based cell/layer ranges. Invalid ranges leave all output untouched.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | cell | Zero-based mesh cell with an initialized thermal column. |
| [in] | kind | SWMM_GroundHeatLayerValue selector; units follow the enum. |
| [in] | first_layer | Nonnegative zero-based starting thermal layer, surface first. |
| [in] | count | Nonnegative layer count; the complete span must fit the column. |
| [out] | values | Caller-owned count-double destination; NULL only when count == 0. |
| SWMM_ENGINE_API int swmm_heat_get_ground_status | ( | SWMM_Engine | engine, |
| SWMM_GroundHeatStatus * | status ) |
Read canonical ground thermal ownership and runtime status.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in,out] | status | Required caller-owned record with struct_size at least sizeof(SWMM_GroundHeatStatus). |
| SWMM_ENGINE_API int swmm_heat_get_ground_values | ( | SWMM_Engine | engine, |
| int | kind, | ||
| int | first_cell, | ||
| int | count, | ||
| double * | values ) |
Read a contiguous cell range of canonical soil thermal values.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | kind | SWMM_GroundHeatValue selector; units/signs follow the enum member. |
| [in] | first_cell | Nonnegative zero-based starting cell index. |
| [in] | count | Nonnegative number of consecutive values to copy; span must fit the model. |
| [out] | values | Caller-owned count-double destination; may be NULL only when count == 0. |
| SWMM_ENGINE_API int swmm_heat_get_lid_material | ( | SWMM_Engine | engine, |
| double | values[4] ) |
Read-only LID material assumptions: water conductivity, soil conductivity, soil density, soil specific heat, all SI.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | values | Required array of four doubles: water conductivity W/(m K), soil conductivity W/(m K), soil density kg/m3, and soil specific heat J/(kg K). |
| SWMM_ENGINE_API int swmm_heat_get_module | ( | SWMM_Engine | engine, |
| int | module, | ||
| int * | on ) |
Read one [HEAT_FLUXES] module toggle.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | module | SWMM_HeatFluxModule selector. |
| [out] | on | Required destination; zero disables, nonzero enables. |
| SWMM_ENGINE_API int swmm_heat_get_node_override | ( | SWMM_Engine | engine, |
| int | index, | ||
| int * | source, | ||
| int * | node, | ||
| double * | temp_c ) |
Read one NODE override by row index. Any out-pointer may be NULL.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | index | Zero-based NODE override row index. |
| [out] | source | Optional source-kind destination. |
| [out] | node | Optional zero-based node-index destination. |
| [out] | temp_c | Optional temperature destination in degrees Celsius. |
| SWMM_ENGINE_API int swmm_heat_get_radiative | ( | SWMM_Engine | engine, |
| int | param, | ||
| double * | value ) |
Read one [RADIATIVE_FLUXES] parameter.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatRadiativeParam selector. |
| [out] | value | Required destination; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_get_sediment | ( | SWMM_Engine | engine, |
| int | param, | ||
| double * | value ) |
Read a [SEDIMENT_EXCHANGE] GLOBAL parameter.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatSedimentParam selector. |
| [out] | value | Required destination; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_get_sediment_ground_timeseries | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Ground-temperature timeseries name; empty when the constant spelling is in force.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | buf | Required writable string destination, safely truncated with a trailing NUL. |
| [in] | buflen | Positive capacity in bytes including the terminator. |
| SWMM_ENGINE_API int swmm_heat_get_shortwave_mode | ( | SWMM_Engine | engine, |
| int * | mode ) |
Read the incoming-shortwave mode (SWMM_HeatShortwaveMode).
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | mode | Required result destination: SWMM_HeatShortwaveMode code. |
| SWMM_ENGINE_API int swmm_heat_get_shortwave_timeseries | ( | SWMM_Engine | engine, |
| char * | buf, | ||
| int | buflen ) |
Name of the [TIMESERIES] bound as the shortwave record, or "" when none is bound. NUL-terminated, truncated to buflen.
The read half swmm_heat_set_shortwave_timeseries never had — an editor could rebind a series but only display "(keep current
series)" for the one already bound (the G4g gap, recorded 2026-08-31). Valid in every mode: the binding survives a switch to CONSTANT or COMPUTED, exactly as the parser's does.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | buf | Required writable string destination, safely truncated with a trailing NUL. |
| [in] | buflen | Positive capacity in bytes including the terminator. |
| SWMM_ENGINE_API int swmm_heat_get_solar | ( | SWMM_Engine | engine, |
| int | param, | ||
| double * | value ) |
Read one [SOLAR_RADIATION] parameter.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatSolarParam selector. |
| [out] | value | Required destination; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_get_solar_sited | ( | SWMM_Engine | engine, |
| int * | sited ) |
Have latitude AND longitude both been explicitly set?
The precondition for SWMM_HEAT_SW_COMPUTED. A GUI should gate the COMPUTED radio button on this rather than discovering the refusal after the fact.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | sited | Required result destination: 1 for a shared explicit site or both explicit heat latitude/longitude, otherwise 0. |
| SWMM_ENGINE_API int swmm_heat_get_source_configured | ( | SWMM_Engine | engine, |
| int | source, | ||
| int * | configured ) |
Did the model set this source explicitly, or is it taking the default? The editor needs the distinction to avoid writing rows a user never asked for.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | source | SWMM_HeatSourceKind code, in [0,6]. |
| [out] | configured | Required result, 1 for an authored global row or 0 for its default. |
| SWMM_ENGINE_API int swmm_heat_get_source_temp | ( | SWMM_Engine | engine, |
| int | source, | ||
| double * | temp_c ) |
Read one source's GLOBAL inlet temperature (°C).
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | source | SWMM_HeatSourceKind code, in [0,6]. |
| [out] | temp_c | Required temperature destination in degrees Celsius. |
| SWMM_ENGINE_API int swmm_heat_ground_source_configured | ( | SWMM_Engine | engine, |
| int * | configured ) |
Exact authoring state for the new channel ground selector. Clear restores the absent/default PRESCRIBED choice; both operations are pre-run only.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | configured | Required result destination: 1 for an explicit channel ground-source selection, otherwise 0. |
| SWMM_ENGINE_API int swmm_heat_node_override_count | ( | SWMM_Engine | engine, |
| int * | count ) |
Number of NODE-scope override rows.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | count | Required destination for the current override-row count. |
| SWMM_ENGINE_API int swmm_heat_preview_channel_ground_map | ( | SWMM_Engine | engine, |
| int | link, | ||
| SWMM_ChannelGroundPreview * | out, | ||
| SWMM_ChannelGroundContact * | contacts, | ||
| int | capacity, | ||
| int * | required ) |
Preview complete channel XY coverage on a private mesh copy.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | link | Zero-based existing routed-channel link index. |
| [in,out] | out | Required summary with struct_size at least sizeof(SWMM_ChannelGroundPreview). |
| [out] | contacts | Caller-owned array of capacity contact records; NULL only when capacity == 0. |
| [in] | capacity | Nonnegative contact-record capacity; zero permits a size query. |
| [out] | required | Required destination for the complete mapping's interval count. |
| SWMM_ENGINE_API int swmm_heat_preview_channel_ground_map_page | ( | SWMM_Engine | engine, |
| int | link, | ||
| SWMM_ChannelGroundPreview * | out, | ||
| int | first, | ||
| SWMM_ChannelGroundContact * | contacts, | ||
| int | capacity, | ||
| int * | required, | ||
| SWMM_CancelCallback | callback, | ||
| void * | user_data ) |
Bounded, cancellable contact page. first is a zero-based interval offset; at most capacity rows are copied while required reports the total count. The summary counts describe the complete mapping. On cancellation, all output arguments remain unchanged.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | link | Zero-based existing routed-channel link index. |
| [in,out] | out | Required summary with struct_size at least sizeof(SWMM_ChannelGroundPreview). |
| [out] | contacts | Caller-owned array of capacity contact records; NULL only when capacity == 0. |
| [in] | capacity | Nonnegative contact-record capacity; zero permits a size query. |
| [out] | required | Required destination for the complete mapping's interval count. |
| [in] | first | Zero-based interval offset, at most the complete interval count. |
| [in] | callback | Optional synchronous cancellation/progress callback; receives engine, stage SWMM_HEAT_PREVIEW_STAGE_*, percentage [0,100], and user_data. Nonzero cancels. |
| [in,out] | user_data | Opaque caller-owned callback context; may be NULL and is not retained. |
| SWMM_ENGINE_API int swmm_heat_preview_channel_ground_map_with_progress | ( | SWMM_Engine | engine, |
| int | link, | ||
| SWMM_ChannelGroundPreview * | out, | ||
| SWMM_ChannelGroundContact * | contacts, | ||
| int | capacity, | ||
| int * | required, | ||
| SWMM_CancelCallback | callback, | ||
| void * | user_data ) |
Cancellable variant of the read-only channel-contact preview. The callback may be invoked during mesh indexing and channel mapping. If it returns nonzero, the function returns SWMM_ERR_CANCELLED and leaves out, contacts, and required unchanged.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | link | Zero-based existing routed-channel link index. |
| [in,out] | out | Required summary with struct_size at least sizeof(SWMM_ChannelGroundPreview). |
| [out] | contacts | Caller-owned array of capacity contact records; NULL only when capacity == 0. |
| [in] | capacity | Nonnegative contact-record capacity; zero permits a size query. |
| [out] | required | Required destination for the complete mapping's interval count. |
| [in] | callback | Optional synchronous cancellation/progress callback; receives engine, stage SWMM_HEAT_PREVIEW_STAGE_*, percentage [0,100], and user_data. Nonzero cancels. |
| [in,out] | user_data | Opaque caller-owned callback context; may be NULL and is not retained. |
| SWMM_ENGINE_API int swmm_heat_remove_element_override | ( | SWMM_Engine | engine, |
| int | index ) |
Remove one override row by index.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | index | Zero-based override row to erase; later rows shift down. |
| SWMM_ENGINE_API int swmm_heat_remove_node_override | ( | SWMM_Engine | engine, |
| int | index ) |
Remove one NODE override by row index. Later rows shift down, so a caller iterating by index must re-read the count after removing.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | index | Zero-based override row to erase; later rows shift down. |
| SWMM_ENGINE_API int swmm_heat_sediment_temperature_configured | ( | SWMM_Engine | engine, |
| int | param, | ||
| int * | configured ) |
Authored status and reset for ground/initial bed temperature.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HEAT_SED_GROUND_TEMPERATURE or SWMM_HEAT_SED_INITIAL_TEMPERATURE. |
| [out] | configured | Required result, 1 for explicitly authored temperature or 0 for inheritance. |
| SWMM_ENGINE_API int swmm_heat_set_cloud | ( | SWMM_Engine | engine, |
| int | param, | ||
| double | value ) |
Write one [CLOUD_COVER] parameter. Writing any of them marks cloud cover as configured.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatCloudParam selector. |
| [in] | value | New value; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_set_cloud_timeseries | ( | SWMM_Engine | engine, |
| const char * | name ) |
Bind a [TIMESERIES] (by name) as the cloud-fraction record.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | name | Required nonempty existing model time-series name; resolved during this call. |
| SWMM_ENGINE_API int swmm_heat_set_dry_policy | ( | SWMM_Engine | engine, |
| int | policy ) |
Select the reported temperature policy for dry water elements.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | policy | HOLD=0, AIR=1 or DEFAULT=2; other values are refused. |
| SWMM_ENGINE_API int swmm_heat_set_element_override | ( | SWMM_Engine | engine, |
| int | attr, | ||
| int | scope, | ||
| const char * | name, | ||
| double | value ) |
Add or update the override for (attr, scope, name).
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | attr | SWMM_HeatAttr selector. |
| [in] | scope | TAG, NODE, LINK, CELL2D or MESH_TAG; GROUND_SOURCE permits TAG/LINK only. |
| [in] | name | Required nonempty copied identifier/tag; CELL2D is a one-based native cell ID. |
| [in] | value | New value with the selected attribute's units/range. |
| SWMM_ENGINE_API int swmm_heat_set_module | ( | SWMM_Engine | engine, |
| int | module, | ||
| int | on ) |
Write one [HEAT_FLUXES] module toggle.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | module | SWMM_HeatFluxModule selector. |
| [in] | on | New value; zero disables, nonzero enables. |
| SWMM_ENGINE_API int swmm_heat_set_node_override | ( | SWMM_Engine | engine, |
| int | source, | ||
| int | node, | ||
| double | temp_c ) |
Add or update the NODE override for (source, node).
source is not DWF or EXTERNAL_INFLOW — the H1 scope rule, refused rather than deferred silently, the same answer the deck gets; if node is out of range; or if temp_c is outside [-50, 100]. | [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | source | DWF or EXTERNAL_INFLOW source code. |
| [in] | node | Zero-based existing node index. |
| [in] | temp_c | Finite new value in [-50,100] in degrees Celsius. |
| SWMM_ENGINE_API int swmm_heat_set_radiative | ( | SWMM_Engine | engine, |
| int | param, | ||
| double | value ) |
Write one [RADIATIVE_FLUXES] parameter.
Values are REFUSED, not clamped — the parser's rule, so the API and the deck agree. A refused write does not take effect.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatRadiativeParam selector. |
| [in] | value | New value; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_set_sediment | ( | SWMM_Engine | engine, |
| int | param, | ||
| double | value ) |
Write a [SEDIMENT_EXCHANGE] GLOBAL parameter.
param. Temperatures mark the value as stated so the writer keeps it.| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatSedimentParam selector. |
| [in] | value | New value; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_set_sediment_ground_timeseries | ( | SWMM_Engine | engine, |
| const char * | name ) |
Drive the ground temperature from a [TIMESERIES]; NULL or "" returns to the constant value.
name is not a timeseries of the model.| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | name | Optional copied series name; NULL or empty clears the binding. |
| SWMM_ENGINE_API int swmm_heat_set_shortwave_mode | ( | SWMM_Engine | engine, |
| int | mode ) |
Set the incoming-shortwave mode.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | mode | SWMM_HEAT_SW_CONSTANT, SWMM_HEAT_SW_TIMESERIES or SWMM_HEAT_SW_COMPUTED. |
| SWMM_ENGINE_API int swmm_heat_set_shortwave_timeseries | ( | SWMM_Engine | engine, |
| const char * | name ) |
Bind a [TIMESERIES] (by name) as the shortwave record and switch the mode to SWMM_HEAT_SW_TIMESERIES.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | name | Required nonempty existing model time-series name; resolved during this call. |
| SWMM_ENGINE_API int swmm_heat_set_solar | ( | SWMM_Engine | engine, |
| int | param, | ||
| double | value ) |
Write one [SOLAR_RADIATION] parameter.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | param | SWMM_HeatSolarParam selector. |
| [in] | value | New value; units and allowed range follow the selected enum member. |
| SWMM_ENGINE_API int swmm_heat_set_source_temp | ( | SWMM_Engine | engine, |
| int | source, | ||
| double | temp_c ) |
Write one source's GLOBAL inlet temperature (°C).
HeatComponent.cpp parse_celsius). REFUSED, not clamped, and a refused write does not take effect. Marks the source configured.| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | source | SWMM_HeatSourceKind code, in [0,6]. |
| [in] | temp_c | Finite source temperature in [-50,100] degrees Celsius. |
| SWMM_ENGINE_API SWMM_HeatSnapshot swmm_heat_snapshot_create | ( | SWMM_Engine | engine | ) |
Allocate a reusable heat authoring snapshot for an editable engine.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| SWMM_ENGINE_API void swmm_heat_snapshot_destroy | ( | SWMM_HeatSnapshot | snapshot | ) |
Release a heat authoring snapshot.
| [in] | snapshot | Owned snapshot of the matching type; NULL is safe. |
| SWMM_ENGINE_API int swmm_heat_snapshot_restore | ( | SWMM_Engine | engine, |
| SWMM_HeatSnapshot | snapshot ) |
Restore a reusable heat authoring snapshot to its original engine.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | snapshot | Required live snapshot produced by swmm_heat_snapshot_create() for this exact engine identity. The snapshot remains valid and reusable after restore. |
| SWMM_ENGINE_API int swmm_heat_source_count | ( | SWMM_Engine | engine, |
| int * | count ) |
Number of sources the table carries (7). Never fails on a model with no heat configured — the table is a fixed enum extent, not a parsed list.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [out] | count | Required destination for the current fixed seven-source extent. |
| SWMM_ENGINE_API int swmm_hydrothermal_edit_atomic | ( | SWMM_Engine | engine, |
| SWMM_HydrothermalEdit | edit, | ||
| void * | user ) |
Apply one synchronous hydrothermal configuration transaction with rollback.
| [in] | engine | Borrowed live engine handle; not retained by this call. |
| [in] | edit | Required synchronous callback, called once with engine and user; return SWMM_OK to commit, another status to restore the captured configuration. |
| [in,out] | user | Opaque caller-owned context forwarded unchanged; may be NULL. |