Saturday, January 21, 2023

SWMM 5.2.2 Code for LID Function roofFluxRates

The function "roofFluxRates" computes the flux rates for a roof disconnection system. The input to the function is a vector of storage levels, and the output is a vector of flux rates.

The function starts by initializing a variable "surfaceDepth" with the value of the first element of the input vector "x". Then, it calls the function "getEvapRates" with the value of "surfaceDepth" and assigns the returned value to the variable "SurfaceVolume".

The function then sets the variable "SurfaceInfil" to 0.0, and checks the value of "theLidProc->surface.alpha". If the value is greater than 0.0, the function calls "getSurfaceOutflowRate" with the "surfaceDepth" as an argument, and assigns the returned value to the variable "SurfaceOutflow". Otherwise, it calls "getSurfaceOverflowRate" with "surfaceDepth" as an argument.

After that, the function calculates the "StorageDrain" by using the minimum value of "theLidProc->drain.coeff/UCF(RAINFALL)" and "SurfaceOutflow". Then, it subtracts the "StorageDrain" from "SurfaceOutflow" and assigns the result to the first element of the output vector "f".

void roofFluxRates(double x[], double f[])
//  Purpose: computes flux rates for roof disconnection.
//  Input:   x = vector of storage levels
//  Output:  f = vector of flux rates
    double surfaceDepth = x[SURF];

    getEvapRates(surfaceDepth, 0.0, 0.0, 0.0, 1.0);
    SurfaceVolume = surfaceDepth;
    SurfaceInfil = 0.0;
    if ( theLidProc->surface.alpha > 0.0 )
      SurfaceOutflow = getSurfaceOutflowRate(surfaceDepth);
    else getSurfaceOverflowRate(&surfaceDepth);
    StorageDrain = MIN(theLidProc->drain.coeff/UCF(RAINFALL), SurfaceOutflow);
    SurfaceOutflow -= StorageDrain;
    f[SURF] = (SurfaceInflow - SurfaceEvap - StorageDrain - SurfaceOutflow);

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