OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
openswmm::snow::SnowSolver Class Reference

#include <Snow.hpp>

Collaboration diagram for openswmm::snow::SnowSolver:

Public Member Functions

void init (int n_subcatch)
 
void execute (SimulationContext &ctx, double dt, double temp, double wind, const double *rainfall, const double *snowfall, double gamma=0.0, double ea=0.0)
 Compute snowmelt for all subcatchments (batch).
 
void execute (SimulationContext &ctx, double dt, double temp, double wind, double rainfall, double snowfall=0.0, double gamma=0.0, double ea=0.0)
 
void setMeltCoeffs (int day_of_year)
 Update seasonal melt coefficients based on day of year.
 
void plowSnow (SimulationContext &ctx, double dt, const double *snowfall)
 Snow accumulation + plowing — adds new snowfall to each pack and redistributes excess snow between subareas.
 
void plowSnow (SimulationContext &ctx, double dt, double snowfall)
 
SnowSoAstate ()
 
const SnowSoAstate () const
 

Member Function Documentation

◆ execute() [1/2]

void openswmm::snow::SnowSolver::execute ( SimulationContext & ctx,
double dt,
double temp,
double wind,
const double * rainfall,
const double * snowfall,
double gamma = 0.0,
double ea = 0.0 )

Compute snowmelt for all subcatchments (batch).

For each subcatchment × subarea:

  1. Batch ATI update (vectorisable)
  2. Batch cold content update (vectorisable)
  3. Batch degree-day or rain-on-snow melt (vectorisable)
  4. Batch snow accumulation from snowfall (vectorisable)
  5. Batch free water routing (vectorisable)
Parameters
ctxSimulation context.
dtTimestep (seconds).
tempAir temperature (deg F, scalar — broadcast).
windWind speed (mph, scalar — broadcast).
rainfallPer-subcatchment rainfall rate (ft/sec, sized n_subcatch — matching legacy subcatch_getRunoff → snow_getSnowMelt which receives each subcatchment's own precipitation).
snowfallPer-subcatchment snowfall rate (ft/sec, sized n_subcatch).
gammaPsychrometric constant from climate (deg F^-1).
eaSaturation vapor pressure from climate (in Hg).
Here is the caller graph for this function:

◆ execute() [2/2]

void openswmm::snow::SnowSolver::execute ( SimulationContext & ctx,
double dt,
double temp,
double wind,
double rainfall,
double snowfall = 0.0,
double gamma = 0.0,
double ea = 0.0 )

Scalar convenience overload: broadcast a single rainfall (and optional snowfall) rate to every subcatchment. Equivalent to filling per-subcatchment arrays with the same value and calling the array form above.

Here is the call graph for this function:

◆ init()

void openswmm::snow::SnowSolver::init ( int n_subcatch)

◆ plowSnow() [1/2]

void openswmm::snow::SnowSolver::plowSnow ( SimulationContext & ctx,
double dt,
const double * snowfall )

Snow accumulation + plowing — adds new snowfall to each pack and redistributes excess snow between subareas.

Parameters
ctxSimulation context (for subcatchment areas).
dtTimestep (seconds).
snowfallPer-subcatchment snowfall rate (ft/sec, sized n_subcatch).
Note
Legacy reference: snow.csnow_plowSnow(), called from runoff_execute() each runoff step before melt computation.
Here is the caller graph for this function:

◆ plowSnow() [2/2]

void openswmm::snow::SnowSolver::plowSnow ( SimulationContext & ctx,
double dt,
double snowfall )

Scalar convenience overload: broadcast a single snowfall rate to every subcatchment before accumulation + plowing.

Here is the call graph for this function:

◆ setMeltCoeffs()

void openswmm::snow::SnowSolver::setMeltCoeffs ( int day_of_year)

Update seasonal melt coefficients based on day of year.

Parameters
day_of_yearDay of year (1-365).
Note
Legacy reference: snow.csnow_setMeltCoeffs()

◆ state() [1/2]

SnowSoA & openswmm::snow::SnowSolver::state ( )
inline

◆ state() [2/2]

const SnowSoA & openswmm::snow::SnowSolver::state ( ) const
inline

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