Tuesday, January 17, 2023

SWMM 5.2.2 Code for Defining LID data in LID.h

 This code defines several structs that are used to store information about different layers of a LID (Low Impact Development) unit. The structs define the properties of each layer, such as thickness, porosity, permeability, and other parameters that are specific to each layer.

The structs defined in this code are:

Struct NameDescription
TSurfaceLayerInformation about the surface layer of the LID unit, such as depression storage or berm height, roughness, slope, and alpha term in Manning equation.
TPavementLayerInformation about the pavement layer of the LID unit, such as thickness, void fraction, permeability, clogging factor, and regeneration interval.
TSoilLayerInformation about the soil layer of the LID unit, such as thickness, porosity, field capacity, wilting point, suction, saturated hydraulic conductivity.
TStorageLayerInformation about the storage layer of the LID unit, such as thickness, void fraction, saturated hydraulic conductivity, clogging factor and information about whether it is covered or not.
TDrainLayerInformation about the underdrain system of the LID unit, such as flow coefficient, head exponent, offset height, delay time, head when drain opens and closes, flow rate curve.
TDrainMatLayerInformation about the drainage mat layer of the LID unit, such as thickness, void fraction, roughness, slope/roughness term in Manning equation.

The fields of all the structs are double type except for the "covered" field which is of int type.

The code also defines a MAX_LAYERS macro which is set to 4. This macro is used as a constant throughout the code to specify the maximum number of layers that are allowed in the LID unit.

This way, the code defines the different layers of LID unit and the properties of each layer with the help of structs. This makes it easy to simulate and analyze the performance of LID unit by using these structs to store the information about different layers and their properties.



#define MAX_LAYERS 4 // LID Surface Layer typedef struct { double thickness; // depression storage or berm ht. (ft) double voidFrac; // available fraction of storage volume double roughness; // surface Mannings n double surfSlope; // land surface slope (fraction) double sideSlope; // swale side slope (run/rise) double alpha; // slope/roughness term in Manning eqn. char canOverflow; // 1 if immediate outflow of excess water } TSurfaceLayer; // LID Pavement Layer typedef struct { double thickness; // layer thickness (ft) double voidFrac; // void volume / total volume double impervFrac; // impervious area fraction double kSat; // permeability (ft/sec) double clogFactor; // clogging factor double regenDays; // clogging regeneration interval (days) double regenDegree; // degree of clogging regeneration } TPavementLayer; // LID Soil Layer typedef struct { double thickness; // layer thickness (ft) double porosity; // void volume / total volume double fieldCap; // field capacity double wiltPoint; // wilting point double suction; // suction head at wetting front (ft) double kSat; // saturated hydraulic conductivity (ft/sec) double kSlope; // slope of log(K) v. moisture content curve } TSoilLayer; // LID Storage Layer typedef struct { double thickness; // layer thickness (ft) double voidFrac; // void volume / total volume double kSat; // saturated hydraulic conductivity (ft/sec) double clogFactor; // clogging factor int covered; // TRUE if rain barrel is covered } TStorageLayer; // Underdrain System (part of Storage Layer) typedef struct { double coeff; // underdrain flow coeff. (in/hr or mm/hr) double expon; // underdrain head exponent (for in or mm) double offset; // offset height of underdrain (ft) double delay; // rain barrel drain delay time (sec) double hOpen; // head when drain opens (ft) double hClose; // head when drain closes (ft) int qCurve; // curve controlling flow rate (optional) } TDrainLayer; // Drainage Mat Layer (for green roofs) typedef struct { double thickness; // layer thickness (ft) double voidFrac; // void volume / total volume double roughness; // Mannings n for green roof drainage mats double alpha; // slope/roughness term in Manning equation } TDrainMatLayer;

SWMM 5.2.2 Code for LID Storage Layer

 

Variable NameTypeDescription
thicknessdoublethe layer thickness (ft)
voidFracdoublethe void volume / total volume
kSatdoublesaturated hydraulic conductivity (ft/sec)
clogFactordoubleclogging factor
coveredintBoolean flag indicating if rain barrel is covered (TRUE if it is covered)

This code defines a struct called TStorageLayer, which represents a storage layer in a Low Impact Development (LID) system. The struct contains several variables:

  • thickness: a double that represents the thickness of the layer, in feet.
  • voidFrac: a double that represents the void volume of the layer over the total volume of the layer.
  • kSat: a double that represents the saturated hydraulic conductivity, the rate at which water can flow through the soil, in feet per second.
  • clogFactor: a double that represents the clogging factor, which can be used to account for the potential reduction of the saturated hydraulic conductivity due to clogging or other factors.
  • covered: an integer that is a Boolean flag indicating if the rain barrel is covered. This is set to TRUE if the rain barrel is covered and FALSE otherwise.

The struct is used to store information about the LID storage layer, which can then be used in various calculations and simulations related to the LID system. The struct is usually used along with other parameters such as precipitation, infiltration, and evapotranspiration to evaluate the water management of the LID system.



// LID Storage Layer typedef struct { double thickness; // layer thickness (ft) double voidFrac; // void volume / total volume double kSat; // saturated hydraulic conductivity (ft/sec) double clogFactor; // clogging factor int covered; // TRUE if rain barrel is covered } TStorageLayer;

SWMM 5.2.2 Code for Drainage Mat Layer (for green roofs)

 

Variable NameTypeDescription
thicknessdoublethe layer thickness (ft)
voidFracdoublethe void volume / total volume
roughnessdoubleMannings n for green roof drainage mats
alphadoubleslope/roughness term in Manning equation

This code defines a struct called TDrainMatLayer, which represents a Drainage Mat Layer commonly used in green roofs. The struct contains several variables:

  • thickness: a double that represents the thickness of the layer, in feet.
  • voidFrac: a double that represents the void volume of the layer over the total volume of the layer.
  • roughness: a double that represents the Mannings n, a roughness coefficient used in the calculation of flow through open channels, for green roof drainage mats.
  • alpha: a double that represents the slope/roughness term in the Manning equation, used to estimate the resistance to flow in open channels.

The struct is used to store information about the Drainage Mat Layer, which can then be used in various calculations and simulations related to green roofs. This struct is usually used along with other layers and other parameters to evaluate the water management of green roofs.




// Drainage Mat Layer (for green roofs)
typedef struct
{
    double    thickness;          // layer thickness (ft)
    double    voidFrac;           // void volume / total volume
    double    roughness;          // Mannings n for green roof drainage mats
    double    alpha;              // slope/roughness term in Manning equation
}  TDrainMatLayer;

SWMM 5.2.2 Underdrain System (part of Storage Layer) Code

 

Variable NameTypeDescription
coeffdoubleunderdrain flow coefficient (in/hr or mm/hr)
expondoubleunderdrain head exponent (for in or mm)
offsetdoubleoffset height of underdrain (ft)
delaydoublerain barrel drain delay time (sec)
hOpendoublehead when drain opens (ft)
hClosedoublehead when drain closes (ft)
qCurveintcurve controlling flow rate (optional)

This code defines a struct called TDrainLayer, which represents an underdrain system as part of a storage layer. The struct contains several variables:

  • coeff: a double representing the underdrain flow coefficient, in units of in/hr or mm/hr.
  • expon: a double representing the underdrain head exponent, used to calculate the head loss through the underdrain.
  • offset: a double representing the offset height of the underdrain, in feet.
  • delay: a double that represents the delay time for the rain barrel drain, in seconds.
  • hOpen: a double representing the head at which the drain opens, in feet.
  • hClose: a double representing the head at which the drain closes, in feet.
  • qCurve: an integer that represents the curve controlling the flow rate of the underdrain. This is optional and may not be used in all cases.

The struct is used to store information about the underdrain system, which can then be used in various calculations and simulations related to the storage layer.





// Underdrain System (part of Storage Layer) typedef struct { double coeff; // underdrain flow coeff. (in/hr or mm/hr) double expon; // underdrain head exponent (for in or mm) double offset; // offset height of underdrain (ft) double delay; // rain barrel drain delay time (sec) double hOpen; // head when drain opens (ft) double hClose; // head when drain closes (ft) int qCurve; // curve controlling flow rate (optional) } TDrainLayer;

InfoSWMM: A 2030 AI-Assisted Study Guide

  InfoSWMM: A 2030 AI-Assisted Study Guide delete   InfoSWMM: A 2030 AI-Assisted Study Guide A comprehensive study guide for someone in 2030...