Sunday, December 29, 2024

SWMM5 runoff.c Summary

 The runoff.c module in the EPA SWMM5 source code handles the runoff analysis by calculating the runoff from rainfall, simulating snowmelt, and handling water quality aspects like pollutant buildup, washoff, and wet weather inflows. This module is crucial for managing the hydrological processes and surface runoff in the SWMM5 simulation.

Key Functions in the runoff.c Module:

  1. runoff_open:

    • Initializes the runoff analysis system, including the ODE solver and memory for pollutant runoff loads. It also checks for the appropriate runoff interface file mode (use or save file) and initializes it.
  2. runoff_close:

    • Frees memory and closes any interface files used to store runoff results. It also writes the total number of time steps to the runoff file.
  3. runoff_execute:

    • Main function for executing the runoff analysis during the simulation. It calculates runoff, pollutant loads, snowmelt, and processes the results by updating the subcatchment states.
  4. runoff_getTimeStep:

    • Determines the appropriate time step for the runoff analysis based on the current simulation date, rainfall, and other conditions like evaporation.
  5. runoff_initFile:

    • Initializes the runoff interface file for saving results. This includes writing the necessary headers like the number of subcatchments and pollutants.
  6. runoff_readFromFile:

    • Reads runoff results from an interface file. This is useful when resuming a simulation that uses previously saved runoff data.
  7. runoff_saveToFile:

    • Saves the current runoff results to an interface file, including runoff flow rates and pollutant loads.
  8. runoff_getOutfallRunon:

    • Determines the runoff that is routed from outfall nodes to subcatchments as runon. This simulates the transfer of water from outfalls into receiving subcatchments.
  9. runoff_getRunoff:

    • Computes the total runoff (in cubic feet per second) generated by each subcatchment during the time step.
  10. runoff_getOutfallRunon:

    • Handles the routing of runoff from outfall nodes to corresponding subcatchments as runon, accounting for the flow and pollutant load transfer.
  11. runoff_saveToFile:

    • Saves runoff results (both flow and pollutant loads) to the runoff interface file.
  12. runoff_readFromFile:

    • Reads runoff results from an interface file for the current time step.

Key Concepts in the Module:

  • Runoff Time Step: The module calculates runoff in discrete time steps, which are determined based on the current simulation conditions (e.g., whether it's raining or dry).

  • Evaporation, Infiltration, and Snowmelt: The module also accounts for water lost to evaporation and infiltration, as well as snowmelt runoff, if applicable.

  • Pollutant Buildup and Washoff: The module computes the buildup of pollutants on surfaces and how much of it is washed off during runoff events, taking into account the effects of street sweeping and land use types.

  • LID (Low Impact Development): This module integrates LID features, such as permeable pavements or bioretention, in subcatchments to handle runoff more sustainably.

  • Interface File: The module reads and writes runoff results to an interface file that stores runoff volumes, pollutant loads, and other related data.

Workflow:

  1. Initialization: The module first initializes the runoff system by allocating memory, checking file modes, and setting up necessary components like the ODE solver.

  2. Runoff Calculation: During each time step, the module calculates runoff based on the precipitation, snowmelt, evaporation, infiltration, and pollutant washoff. The results are updated in the subcatchments.

  3. Reading and Writing Data: The module reads data from previous runoff simulations if available, and writes the results of the current simulation to the interface file.

  4. Outfall Runon: The module handles runoff from outfall nodes, routing it to receiving subcatchments and adding it to their respective runon.

  5. Final Reporting: After the simulation, the module outputs the runoff data, including pollutant loads and runoff volumes, to the designated file.

Summary:

The runoff.c module is a core component of the SWMM5 engine. It performs essential hydrological computations related to surface runoff, snowmelt, and water quality in urban drainage systems. It integrates various factors, including rainfall, snowmelt, evaporation, and infiltration, to simulate runoff accurately. The module also accounts for Low Impact Development (LID) practices and tracks pollutants as they are washed off surfaces. It supports both reading from and writing to interface files for saving and resuming simulations.

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...