Sunday, January 15, 2023

SWMM 5.2.2 Function for LID updateWaterBalance

 This code is for updating the water balance for a low impact development (LID) unit. It takes in several input parameters such as inflow, evaporation, infiltration, surface flow, drain flow, and storage. It then calculates the volume of water treated, and updates the water balance object for the LID unit with the inflow, evaporation, infiltration, surface flow, drain flow, and final volume of water stored in the unit. The time step (Tstep) is used to convert the rates to total volumes for the current time step. The output of this function is updating the member variables of the passed in LID unit and doesn't return any value.

void updateWaterBalance(TLidUnit *lidUnit, double inflow, double evap, double infil, double surfFlow, double drainFlow, double storage) // // Purpose: updates components of the water mass balance for a LID unit // over the current time step. // Input: lidUnit = a particular LID unit // inflow = runon + rainfall to the LID unit (ft/s) // evap = evaporation rate from the unit (ft/s) // infil = infiltration out the bottom of the unit (ft/s) // surfFlow = surface runoff from the unit (ft/s) // drainFlow = underdrain flow from the unit // storage = volume of water stored in the unit (ft) // Output: none // { lidUnit->volTreated += inflow * Tstep; lidUnit->waterBalance.inflow += inflow * Tstep; lidUnit->waterBalance.evap += evap * Tstep; lidUnit->waterBalance.infil += infil * Tstep; lidUnit->waterBalance.surfFlow += surfFlow * Tstep; lidUnit->waterBalance.drainFlow += drainFlow * Tstep; lidUnit->waterBalance.finalVol = storage; }

No comments:

ChatGPT Version of the SWMM5 Wikipedia Page Introduction

  The EPA Storm Water Management Model (SWMM) is a computer software that simulates the rainfall-runoff-routing process in urban areas. It o...