Friday, November 10, 2023

Kinematic Wave Flow Routing Functions Summary 🌊🔍💻

 

Kinematic Wave Flow Routing Functions Summary 🌊🔍💻

The kinwave.c module in EPA SWMM5, updated in version 5.2 (Build 5.2.0), authored by L. Rossman and M. Tryby, focuses on kinematic wave flow routing functions.

Key Features 📌

  • Constants: Includes constants like WX (distance weighting), WT (time weighting), and EPSIL (convergence criterion).
  • Shared Variables: Utilizes shared variables such as Beta1, C1, C2, Afull (full area), Qfull (full flow), and a pointer to the cross-section (pXsect).
  • Main Function: kinwave_execute, responsible for finding outflow over a time step using kinematic wave routing in conduits.
    • Process Flow:
      • Checks for non-conduit links and dummy cross-sections.
      • Normalizes previous flows and inflow, and computes evaporation and infiltration loss rate.
      • Solves the continuity equation for downstream normalized area (aout).
      • Updates flows and areas for the conduit, and returns the number of iterations used.

Continuity Equation Solution 📈

  • solveContinuity function aims to solve the continuity equation for normalized area using the Newton-Raphson root finder.
  • It establishes upper and lower bounds for the area and determines the flow based on these bounds.
  • The function evalContinuity is used to compute the value of the continuity equation and its derivative with respect to normalized area.

Updates and Improvements 🛠️

  • Various updates have been integrated, such as conduit inflow consideration for computing losses, and changes in the arguments to the link_getLossRate function.

Technical Specifications 🖥️

  • Uses standard mathematical and header files (math.h and headers.h), and includes the findroot.h file for root finding functionalities.
  • Employs constants and shared variables to simplify and standardize calculations across the module.
  • Integrates detailed documentation and update history for better understanding and maintenance.

Overall, the kinwave.c module is a crucial part of SWMM5, providing advanced routing calculations for modeling flow in urban drainage systems. 🌆🚰🌧️🔢👨‍💻🔍🌊💧📊🛠️📝🖥️🔄

🔍🌊 Summary of 'exfil.c' Code with Emojis

 🔍🌊 Summary of 'exfil.c' Code with Emojis

This code, part of the EPA SWMM5 (Storm Water Management Model) project, is authored by L. Rossman and focuses on functions related to storage unit exfiltration.

Key Updates and Functions:

  • Version Information: Part of SWMM version 5.2, updated on 11/01/21.
  • Major Updates:
    • Build 5.1.008: Monthly conductivity adjustments applied to exfiltration rate.
    • Build 5.1.010: Introduction of a modified Green-Ampt infiltration option.
    • Build 5.1.011: Correction of a unit conversion error for storage units with surface area curves.
    • Build 5.2.0: Addition of support for analytical storage shapes.

Core Functionalities:

  1. Reading Storage Parameters (📖🔍):

    • exfil_readStorageParams(): Reads exfiltration parameters for a storage unit. Handles Green-Ampt infiltration parameters and checks for errors.
  2. Initial State of Exfiltration Object (🌱🚀):

    • exfil_initState(): Initializes the exfiltration object's state, including handling various storage shapes like tabular, functional, and cylindrical.
  3. Computing Exfiltration Rate (💧📊):

    • exfil_getLoss(): Calculates the water exfiltration rate from a storage node into the soil, incorporating both bottom unit and sloped banks infiltration.
  4. Creating Exfiltration Object (🛠️🌐):

    • createStorageExfil(): Creates and initializes an exfiltration object for a storage node, setting up Green-Ampt infiltration parameters for the bottom and banks.

Technical Aspects:

  • Green-Ampt Model: Used for infiltration calculations, with parameters like suction head, hydraulic conductivity, and maximum initial deficit.
  • Error Handling: Checks and returns errors related to input data and memory allocation.
  • Exfiltration Calculations: Factors in the Green-Ampt infiltration model for both bottom and banks of storage units.
  • Dynamic Adjustments: Adapts the exfiltration rate based on storage unit properties and water depth.

Application and Impact:

🌍 This code plays a crucial role in urban water management, specifically in modeling how water is exfiltrated from storage units into the surrounding soil. It aids in accurately simulating and managing stormwater runoff, which is essential for sustainable urban planning and flood mitigation.

🔧 In summary, 'exfil.c' represents a critical component of the SWMM5 project, showcasing advanced computational techniques for environmental modeling and contributing to effective water management solutions.

🔍📊 Summary of the Code with Emojis for FindRoot.C in SWMM5

 🔍📊 Summary of the Code with Emojis

This code snippet focuses on finding the roots of a function, i.e., solving for func(x) = 0, using two distinct methods: Newton-Raphson method and Ridder's Method. Authored by L. Rossman on 11/19/13, it's a part of a larger numerical analysis routine.

1. Newton-Raphson Method 📐🔢

  • Purpose: Used to find the root of a function bracketed between x1 and x2.
  • Process: Combines Newton-Raphson and bisection methods.
  • Root Refinement: Refines the root rts within an accuracy of +/-xacc.
  • Function Evaluations: Returns the number of evaluations used or 0 if maximum iterations are exceeded.
  • Constraints: Requires that func(x1) and func(x2) have opposite signs.
  • Adjustments: May need to recalibrate subcatchment's properties like Percent Impervious and Width after LID placement.
  • Special Conditions: Handles cases where Green Roofs and Roof Disconnection only treat direct precipitation.

2. Ridder's Method 🧮📉

  • Functionality: Finds the root of func between x1 and x2 within an accuracy of xacc.
  • Return Values: Returns the root if found, or a large negative number if not.
  • Methodology: Uses an algorithmic approach to refine the root estimate.
  • Conditions: Effective when func(x1) and func(x2) have opposite signs.
  • Iterations: Executes up to a maximum of MAXIT iterations.
  • Result: If the method converges, it returns the estimated root value.

Common Aspects of Both Methods 🔍🔄

  • Max Iterations: Both methods limit the number of iterations to MAXIT (60).
  • Accuracy: Aim to refine the root estimate to within a specified accuracy (xacc).
  • Error Checking: Includes checks for function values and bisection requirements.

Implementation Details 🖥️💡

  • Header File: Utilizes a custom header file findroot.h.
  • Mathematical Functions: Employs standard math functions from math.h.
  • Constants: Defines a SIGN function and sets MAXIT as 60.

Application Scenario 🌍📚

This code is typically used in scenarios like hydrological modeling or environmental simulations where root-finding algorithms are crucial for analyzing and predicting natural processes.

🔎 In summary, the code effectively implements two root-finding algorithms with careful considerations for accuracy, iteration limits, and method-specific conditions, making it a valuable tool for numerical computations in various scientific and engineering applications.

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