OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::surface::SnowModel Class Referenceabstract

Polymorphic point and native-batch snow boundary. One owner serializes state mutation and buffer use. Configure compatible model geometry/materials after allocation; a successful allocation alone does not establish physical snowpack parameters. Derived methods define failure and payload validation; this interface supplies no universal rollback/status. More...

#include <SnowModel.hpp>

Inheritance diagram for openswmm::surface::SnowModel:
Collaboration diagram for openswmm::surface::SnowModel:

Public Member Functions

virtual ~SnowModel ()=default
 Destroy derived owned snow state through the base interface. Caller ends all active callbacks/borrows before destruction; no implicit commit.
 
virtual void initializeElements (int n)=0
 Allocate/reset model-specific storage for point elements.
 
virtual void step (int e, const SnowInputs &input, SnowOutputs &output)=0
 Advance one model element through its SI point boundary.
 
virtual int stateSize () const =0
 Read the element payload length expected by pack/unpack.
 
virtual void pack (int e, double *output) const =0
 Copy one model's element payload into a caller buffer.
 
virtual void unpack (int e, const double *input)=0
 Restore one matching model's element payload.
 
virtual void execute (SimulationContext &context, double dt_s, double temp_F, double wind_mph, const double *rain_ft_s, const double *snow_ft_s, double gamma, double ea)=0
 Execute the native subcatchment batch boundary for legacy arithmetic/order.
 
virtual void plowSnow (SimulationContext &context, double dt_s, const double *snow_ft_s)=0
 Accumulate and redistribute native batch snowfall through derived lifecycle.
 

Detailed Description

Polymorphic point and native-batch snow boundary. One owner serializes state mutation and buffer use. Configure compatible model geometry/materials after allocation; a successful allocation alone does not establish physical snowpack parameters. Derived methods define failure and payload validation; this interface supplies no universal rollback/status.

Constructor & Destructor Documentation

◆ ~SnowModel()

virtual openswmm::surface::SnowModel::~SnowModel ( )
virtualdefault

Destroy derived owned snow state through the base interface. Caller ends all active callbacks/borrows before destruction; no implicit commit.

Member Function Documentation

◆ execute()

virtual void openswmm::surface::SnowModel::execute ( SimulationContext & context,
double dt_s,
double temp_F,
double wind_mph,
const double * rain_ft_s,
const double * snow_ft_s,
double gamma,
double ea )
pure virtual

Execute the native subcatchment batch boundary for legacy arithmetic/order.

Parameters
[in,out]contextCompatible model geometry/ownership as required by derived solver.
dt_sFinite positive interval seconds.
temp_FHeld air temperature Fahrenheit.
wind_mphHeld wind speed mph.
rain_ft_sReadable per-subcatchment rain ft/s array of initialized batch count.
snow_ft_sReadable same-count snow ft/s array; accumulation/plowing sequencing is defined by the derived model, not automatically repeated here.
gammaNative psychrometric coefficient F^-1.
eaNative saturation vapour pressure in Hg. Caller uses the derived batch lifecycle rather than also point-stepping the same water interval. No portable external clock advancement or shared failure result.

Implemented in openswmm::snow::DegreeDaySnow.

◆ initializeElements()

virtual void openswmm::surface::SnowModel::initializeElements ( int n)
pure virtual

Allocate/reset model-specific storage for point elements.

Parameters
nNonnegative requested element count, representable by the implementation. Derived storage may round capacity up; caller then supplies model parameters. No common external clock, physical water debit or context binding is performed.

Implemented in openswmm::snow::DegreeDaySnow.

◆ pack()

virtual void openswmm::surface::SnowModel::pack ( int e,
double * output ) const
pure virtual

Copy one model's element payload into a caller buffer.

Parameters
eValid initialized element index.
[out]outputWritable array of at least stateSize() doubles, not retained. Slot order/units are implementation-specific; geometry/global state can be omitted. Caller serializes packing with mutation; no common bounds/error check is promised.

Implemented in openswmm::snow::DegreeDaySnow.

◆ plowSnow()

virtual void openswmm::surface::SnowModel::plowSnow ( SimulationContext & context,
double dt_s,
const double * snow_ft_s )
pure virtual

Accumulate and redistribute native batch snowfall through derived lifecycle.

Parameters
[in,out]contextCompatible subcatchment geometry/units and plow destinations.
dt_sFinite positive elapsed seconds.
snow_ft_sReadable per-subcatchment snowfall ft/s array, qualified by caller. Derived implementation defines enabled/external ownership, removed-water and age bookkeeping. Invoke at most once before the corresponding native melt execution; this interface itself does not validate or settle an external receiver.

Implemented in openswmm::snow::DegreeDaySnow.

◆ stateSize()

virtual int openswmm::surface::SnowModel::stateSize ( ) const
pure virtual

Read the element payload length expected by pack/unpack.

Returns
Number of double slots for this implementation, not a portable versioned restart schema. Use matching model/configuration and its documented native units.

Implemented in openswmm::snow::DegreeDaySnow.

◆ step()

virtual void openswmm::surface::SnowModel::step ( int e,
const SnowInputs & input,
SnowOutputs & output )
pure virtual

Advance one model element through its SI point boundary.

Parameters
eValid initialized element index with compatible parameters/history.
inputBorrowed finite interval weather in SnowInputs units; positive dt_s.
[out]outputElement interval depths/state; derived class defines available fields and invalid-input behavior. Must not alias input or mutable model storage. Point stepping does not imply native inter-subcatchment plowing; caller must use the derived model's specified accumulation/plowing lifecycle exactly once.

Implemented in openswmm::snow::DegreeDaySnow.

◆ unpack()

virtual void openswmm::surface::SnowModel::unpack ( int e,
const double * input )
pure virtual

Restore one matching model's element payload.

Parameters
eValid initialized element index with matching model/configuration.
inputReadable stateSize()-double buffer in the implementation's slot order/ units, borrowed during this call. Caller validates shape/finite physical values. No common schema migration, rollback or clock/geometry restoration is implied.

Implemented in openswmm::snow::DegreeDaySnow.


The documentation for this class was generated from the following file: