OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
Global Mass Balance Methods

Global mass balance methods. More...

Collaboration diagram for Global Mass Balance Methods:

Functions

int massbal_open (void)
 Opens and initializes mass balance continuity checking.
 
void massbal_close (void)
 Frees memory used by mass balance system.
 
void massbal_report (void)
 Reports mass balance results.
 
void massbal_updateRunoffTotals (int flowType, double v)
 Updates runoff totals after current time step.
 
void massbal_updateLoadingTotals (int type, int p, double w)
 Adds inflow mass loading to loading totals for current time step.
 
void massbal_updateGwaterTotals (double vInfil, double vUpperEvap, double vLowerEvap, double vLowerPerc, double vGwater)
 Updates groundwater totals after current time step.
 
void massbal_updateRoutingTotals (double tStep)
 Updates overall routing totals with totals from current time step.
 
void massbal_initTimeStepTotals (void)
 Initializes routing totals for current time step.
 
void massbal_addInflowFlow (int type, double q)
 Adds flow inflow to routing totals for current time step.
 
void massbal_addInflowQual (int type, int pollutIndex, double w)
 Adds quality inflow to routing totals for current time step.
 
void massbal_addOutflowFlow (double q, int isFlooded)
 Adds flow outflow over current time step to routing totals.
 
void massbal_addOutflowQual (int p, double w, int isFlooded)
 Adds pollutant outflow over current time step to routing totals.
 
void massbal_addNodeLosses (double evapLoss, double seepLoss)
 Adds node losses over current time step to routing totals.
 
void massbal_addLinkLosses (double evapLoss, double seepLoss)
 Adds link losses over current time step to routing totals.
 
void massbal_addReactedMass (int pollutIndex, double w)
 Adds mass reacted during current time step to routing totals.
 
void massbal_addSeepageLoss (int pollutIndex, double w)
 Adds mass lost to seepage during current time step to routing totals.
 
void massbal_addToFinalStorage (int pollutIndex, double w)
 Adds mass remaining on dry surface to routing totals.
 
double massbal_getStepFlowError (void)
 Computes flow routing mass balance error at current time step.
 
double massbal_getRunoffError (void)
 Computes runoff mass balance error.
 
double massbal_getFlowError (void)
 Computes flow routing mass balance error.
 

Detailed Description

Global mass balance methods.

Function Documentation

◆ massbal_addInflowFlow()

void massbal_addInflowFlow ( int type,
double q )

Adds flow inflow to routing totals for current time step.

Parameters
[in]typeType of inflow
[in]qInflow rate (cfs)
Implementation arguments
  • type (in): Type of inflow
  • q (in): Inflow rate (cfs)
Here is the caller graph for this function:

◆ massbal_addInflowQual()

void massbal_addInflowQual ( int type,
int pollutIndex,
double w )

Adds quality inflow to routing totals for current time step.

Parameters
[in]typeType of inflow
[in]pollutIndexPollutant index
[in]wMass flow rate (mass/sec)
Implementation arguments
  • type (in): Type of inflow
  • pollutIndex (in): Pollutant index
  • w (in): Mass flow rate (mass/sec)
Here is the caller graph for this function:

◆ massbal_addLinkLosses()

void massbal_addLinkLosses ( double evapLoss,
double seepLoss )

Adds link losses over current time step to routing totals.

Parameters
[in]evapLossEvaporation loss from all links (ft3/sec)
[in]seepLossInfiltration loss from all links (ft3/sec)
Implementation arguments
  • evapLoss (in): Evaporation loss from all links (ft3/sec)
  • seepLoss (in): Infiltration loss from all links (ft3/sec)

◆ massbal_addNodeLosses()

void massbal_addNodeLosses ( double evapLoss,
double seepLoss )

Adds node losses over current time step to routing totals.

Parameters
[in]evapLossEvaporation loss from all nodes (ft3/sec)
[in]seepLossSeepage loss from all nodes (ft3/sec)
Implementation arguments
  • evapLoss (in): Evaporation loss from all nodes (ft3/sec)
  • seepLoss (in): Seepage loss from all nodes (ft3/sec)

◆ massbal_addOutflowFlow()

void massbal_addOutflowFlow ( double q,
int isFlooded )

Adds flow outflow over current time step to routing totals.

Parameters
[in]qOutflow rate (cfs)
[in]isFloodedTRUE if outflow represents internal flooding
Implementation arguments
  • q (in): Outflow rate (cfs)
  • isFlooded (in): TRUE if outflow represents internal flooding

◆ massbal_addOutflowQual()

void massbal_addOutflowQual ( int p,
double w,
int isFlooded )

Adds pollutant outflow over current time step to routing totals.

Parameters
[in]pPollutant index
[in]wMass outflow rate (mass/sec)
[in]isFloodedTRUE if outflow represents internal flooding
Implementation arguments
  • p (in): Pollutant index
  • w (in): Mass outflow rate (mass/sec)
  • isFlooded (in): TRUE if outflow represents internal flooding

◆ massbal_addReactedMass()

void massbal_addReactedMass ( int pollutIndex,
double w )

Adds mass reacted during current time step to routing totals.

Parameters
[in]pollutIndexPollutant index
[in]wRate of mass reacted (mass/sec)
Implementation arguments
  • pollutIndex (in): Pollutant index
  • w (in): Rate of mass reacted (mass/sec)
Here is the caller graph for this function:

◆ massbal_addSeepageLoss()

void massbal_addSeepageLoss ( int pollutIndex,
double w )

Adds mass lost to seepage during current time step to routing totals.

Parameters
[in]pollutIndexPollutant index
[in]wMass seepage rate (mass/sec)
Implementation arguments
  • pollutIndex (in): Pollutant index
  • w (in): Mass seepage rate (mass/sec)

◆ massbal_addToFinalStorage()

void massbal_addToFinalStorage ( int pollutIndex,
double w )

Adds mass remaining on dry surface to routing totals.

Parameters
[in]pollutIndexPollutant index
[in]wPollutant mass
Implementation arguments
  • pollutIndex (in): Pollutant index
  • w (in): Pollutant mass

◆ massbal_close()

void massbal_close ( void )

Frees memory used by mass balance system.

◆ massbal_getFlowError()

double massbal_getFlowError ( void )

Computes flow routing mass balance error.

Returns
Returns percent flow routing mass balance error.

Computes flow routing mass balance error.

Returns
Percent discrepancy, positive for excess inflow and negative for excess outflow; a difference below one cubic foot returns TINY.
Postcondition
Updates FlowTotals.finalStorage and pctError and the corresponding global error value. Recomputes final network storage and separates signed inflow/outflow categories.
Precondition
The global model and mass-balance totals are initialized; values use internal cubic-foot volume accounting, not report-scaled totals.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ massbal_getRunoffError()

double massbal_getRunoffError ( void )

Computes runoff mass balance error.

Returns
Returns percent runoff mass balance error.

Computes runoff mass balance error.

Returns
Percent discrepancy, positive for excess inflow and negative for excess outflow; a difference below one cubic foot returns TINY.
Postcondition
Updates RunoffTotals.finalStorage and pctError and the corresponding global error value. Recomputes final surface storage and snow cover and copies Snow.removed.
Precondition
The global model and mass-balance totals are initialized; values use internal cubic-foot volume accounting, not report-scaled totals.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ massbal_getStepFlowError()

double massbal_getStepFlowError ( void )

Computes flow routing mass balance error at current time step.

Returns
Returns fractional difference between total inflow and outflow.
Fractional difference between total inflow and outflow.
Here is the caller graph for this function:

◆ massbal_initTimeStepTotals()

void massbal_initTimeStepTotals ( void )

Initializes routing totals for current time step.

Here is the caller graph for this function:

◆ massbal_open()

int massbal_open ( void )

Opens and initializes mass balance continuity checking.

Returns
Error code
Error code.
Here is the call graph for this function:

◆ massbal_report()

void massbal_report ( void )

Reports mass balance results.

Here is the call graph for this function:

◆ massbal_updateGwaterTotals()

void massbal_updateGwaterTotals ( double vInfil,
double vUpperEvap,
double vLowerEvap,
double vLowerPerc,
double vGwater )

Updates groundwater totals after current time step.

Parameters
[in]vInfilVolume depth of infiltration (ft)
[in]vUpperEvapVolume depth of upper zone evaporation (ft)
[in]vLowerEvapVolume depth of lower zone evaporation (ft)
[in]vLowerPercVolume depth of percolation to deep GW (ft)
[in]vGwaterVolume depth of groundwater outflow (ft)
Implementation arguments
  • vInfil (in): Volume depth of infiltration (ft)
  • vUpperEvap (in): Volume depth of upper zone evaporation (ft)
  • vLowerEvap (in): Volume depth of lower zone evaporation (ft)
  • vLowerPerc (in): Volume depth of percolation to deep GW (ft)
  • vGwater (in): Volume depth of groundwater outflow (ft)

◆ massbal_updateLoadingTotals()

void massbal_updateLoadingTotals ( int type,
int p,
double w )

Adds inflow mass loading to loading totals for current time step.

Parameters
[in]typeType of inflow
[in]pPollutant index
[in]wMass loading
Implementation arguments
  • type (in): Type of inflow
  • p (in): Pollutant index
  • w (in): Mass loading
Here is the caller graph for this function:

◆ massbal_updateRoutingTotals()

void massbal_updateRoutingTotals ( double tStep)

Updates overall routing totals with totals from current time step.

Parameters
[in]tStepTime step (sec)
Implementation arguments
  • tStep (in): Time step (sec)
Here is the caller graph for this function:

◆ massbal_updateRunoffTotals()

void massbal_updateRunoffTotals ( int flowType,
double v )

Updates runoff totals after current time step.

Parameters
[in]flowTypeType of flow (RUNOFF_RAINFALL, RUNOFF_EVAP, RUNOFF_RUNOFF, etc.)
[in]vVolume of flow (ft3)
Implementation arguments
  • flowType (in): Type of flow (RUNOFF_RAINFALL, RUNOFF_EVAP, RUNOFF_RUNOFF, etc.)
  • v (in): Volume of flow (ft3)
Here is the caller graph for this function: