Saturday, December 28, 2024

SWMM5 lidproc.c Summary

 The lidproc.c file is responsible for computing the hydrological performance of LID (Low Impact Development) units in a given time step in the EPA SWMM5 (Storm Water Management Model) framework. It models the water movement through various layers in LID systems (e.g., surface, pavement, soil, storage, and underdrain) and calculates flux rates for each layer based on input parameters such as rainfall, runoff, infiltration, and evaporation.

Key Features of the Code:

Constants:

  1. STOPTOL: The tolerance for integration error, which defines how accurate the model must be.
  2. MINFLOW: The cutoff for dry conditions, below which the flow is considered negligible.

Enumerations:

  1. LidLayerTypes: Defines the layers in an LID unit:

    • SURF: Surface layer
    • SOIL: Soil layer
    • STOR: Storage layer
    • PAVE: Pavement layer
    • DRAIN: Underdrain system
  2. LidRptVars: Represents different variables that can be reported for LID units, such as surface inflow, total evaporation, surface infiltration, etc.

Imported Variables:

  • HasWetLids: A flag indicating whether any LID units are wet, used in the model to determine if runoff treatment is active.

Local Variables:

These variables track the current state of moisture levels, flux rates, and water volumes in each layer of an LID unit (surface, pavement, soil, storage, etc.). The variables also handle calculations for fluxes like evaporation, infiltration, runoff, and drain flow.

Key Functions:

  1. lidproc_initWaterBalance():

    • Initializes the water balance components for an LID unit (inflow, evaporation, infiltration, surface flow, drain flow, and initial storage volume).
  2. lidproc_getOutflow():

    • This is the core function that computes the outflow from a specific LID unit. It uses the moisture levels in each layer to calculate fluxes for evaporation, infiltration, storage, and runoff. It integrates the changes over time and returns the surface runoff from the LID unit.
  3. modpuls_solve():

    • Solves the system of equations for LID units using the Modified Puls method, which is an iterative process to solve the differential equations governing the water flow in each layer of the LID unit.
  4. getSurfaceOutflowRate(), getSurfaceOverflowRate(), getPavementPermRate():

    • These functions compute the surface outflow, surface overflow, and pavement permeability, respectively, based on the conditions of the LID unit at the given time.
  5. Flux Rate Functions:

    • Functions like biocellFluxRates(), greenRoofFluxRates(), pavementFluxRates(), etc., are used to compute the flux rates for different types of LID processes (e.g., bio-retention cells, green roofs, porous pavement, etc.). These functions take the current moisture levels as input and compute how water moves through the system, including infiltration, evaporation, and runoff.
  6. getStorageExfilRate() and getStorageDrainRate():

    • These functions compute the exfiltration rate from the storage layer and the flow rate through the underdrain system, respectively. These are critical for LID systems with storage and drainage components.
  7. updateWaterBalance():

    • This function updates the mass balance for the LID unit, adding the contributions of inflow, evaporation, infiltration, and outflow to the unit's water balance.
  8. getEvapRates():

    • Computes the evaporation rates from each layer (surface, pavement, soil, storage) of the LID unit, considering factors like the available water and pervious fraction of the surface.
  9. Special LID Functions:

    • roofFluxRates(), barrelFluxRates(), and other similar functions compute the specific flux rates for different LID types like rooftop disconnection and rain barrels.

Key Concepts:

  • Moisture Level and Flux Calculation: The model computes the moisture levels in each layer (surface, soil, pavement, storage) and calculates the fluxes (infiltration, evaporation, runoff) based on these levels. The fluxes are then used to update the water balance of the LID unit.
  • Surface, Soil, and Storage Layers: Each layer of the LID unit behaves differently. For example, the surface layer allows for surface runoff, the soil layer permits infiltration, and the storage layer manages excess water.
  • Puls Method for Integration: The code uses the Modified Puls method to solve the system of differential equations governing the LID’s performance over time.

Water Balance and Simulation:

The lidproc_getOutflow() function integrates the flow through each layer of the LID unit, updating the water balance at each time step. It accounts for:

  • Surface Inflow: Runoff and rainfall that enter the LID unit.
  • Surface Evaporation: Water lost from the surface layer.
  • Surface Infiltration: Water that moves from the surface layer into the soil or storage.
  • Storage Evaporation and Exfiltration: Evaporation and water loss from the storage layer.
  • Underdrain Flow: Water that drains from the storage layer via the underdrain system.

Reporting:

  • The lidproc_saveResults() function writes the results to a report file, including detailed information about the flux rates, volumes, and water balance of each LID unit. It tracks whether the LID is dry or wet and adjusts the reporting accordingly.

Summary:

This module is central to the performance analysis of LID systems in SWMM5. It calculates how each LID unit handles stormwater over time, considering all aspects of water flow, storage, infiltration, and evaporation. The integration of these processes through the Modified Puls method provides a detailed and accurate representation of LID performance in managing runoff and water quality.

No comments:

A comprehensive explanation of how minimum travel distance relates to link length in InfoSewer

In hydraulic modeling of sewer networks, the minimum travel distance is a fundamental parameter that affects how accurately the model can si...