OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
surfqual.c File Reference

Subcatchment water quality functions. More...

#include <math.h>
#include <string.h>
#include "headers.h"
#include "lid.h"
Include dependency graph for surfqual.c:

Macros

#define _CRT_SECURE_NO_DEPRECATE
 

Functions

void surfqual_initState (int subcatchIndex)
 Initializes pollutant buildup, ponded mass, and washoff.
 
void surfqual_getBuildup (int subcatchIndex, double tStep)
 Adds to pollutant buildup on subcatchment surface.
 
void surfqual_applyAPIBuildup (int subcatchIndex)
 Applies the buildup of a pollutant over a subcatchment for a given time step.
 
void surfqual_sweepBuildup (int subcatchIndex, DateTime aDate)
 Reduces pollutant buildup over a subcatchment if sweeping occurs.
 
void surfqual_getWashoff (int subcatchIndex, double runoff, double tStep)
 Computes new runoff quality for a subcatchment.
 
double surfqual_getWtdWashoff (int j, int p, double f)
 Finds wtd. combination of old and new washoff for a pollutant.
 

Variables

double * OutflowLoad
 
double Vinfil
 
double Vinflow
 
double Voutflow
 
double VlidIn
 
double VlidInfil
 
double VlidOut
 
double VlidDrain
 
double VlidReturn
 

Detailed Description

Subcatchment water quality functions.

Author
L. Rossman
Date
Created: 2023-07-14 (Build 5.2.4)
Last edited: 2026-07-11
Version
5.3

Subcatchment water quality functions.

Update History

Build 5.1.008:

  • Pollutant surface buildup and washoff functions were moved here from subcatch.c.
  • Support for separate accounting of LID drain flows included. Build 5.1.014:
  • Fixed bug in computing effective BMP removal by LIDs. Build 5.2.4:
  • Set low runoff flow concentrations to zero before computing runoff mass loads rather than after so that they match wet weather mass inflows reported for conveyance system nodes. Build 5.3.0
  • Added support for API provided pollutant build up and washoff.
  • Fixed the runoff quality continuity error introduced in Build 5.2.4. Zeroing the low runoff concentration ahead of the mass balance bookings (rather than only ahead of the reported load) left any pollutant load generated in that step assigned to no output category, so the mass was silently dropped. The washoff concentration is now computed whenever there is inflow. This affects subcatchments with LID controls (where capture approaching 100% drives the surface + underdrain outflow below the cutoff) and subcatchments without LID controls (wet deposition and/or runon while runoff is below the cutoff). Note the Build 5.2.4 rationale does not require zeroing the concentration: no cutoff is applied to node mass inflow, and the only cutoff lives in subcatch_getResults(), which zeroes the reported runoff rather than the newRunoff used for routing.
  • Pollutant mass carried into the native soil by LID infiltration is now reported under Infiltration Loss (INFIL_LOAD) instead of being lumped into BMP Removal, so infiltration loss, treatment removal and underdrain/surface overflow export are accounted for separately. \TODO: Add support for tracking the mass balance of API provided pollutant build up and washoff seperately. \TODO: Concentration-based LID treatment (pollutant mass stored in the LID and released through the drain, overflow and infiltration) is not yet modeled; LID removal is still driven by volume reduction plus the underdrain REMOVALS fraction.

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

Variable Documentation

◆ OutflowLoad

double* OutflowLoad
extern

◆ Vinfil

double Vinfil
extern

◆ Vinflow

double Vinflow
extern

◆ VlidDrain

double VlidDrain
extern

◆ VlidIn

double VlidIn
extern

◆ VlidInfil

double VlidInfil
extern

◆ VlidOut

double VlidOut
extern

◆ VlidReturn

double VlidReturn
extern

◆ Voutflow

double Voutflow
extern