Friday, September 16, 2016

How to Add Extra Output Files to SWMM 5.1.011

How to Add Extra Output Files to #SWMM 5.1.011 – the goal here is to automatically make calibration files for InfoSWMM, H2OMap SWMM, SWMM 5 and other programs based on the name of the Outflows file in SWMM 5.

Step 1.   Add names to globals.h

EXTERN TFile
                  Finp,                     // Input file
                  Fout,                     // Output file
                  Frpt,                     // Report file
                  Fclimate,                 // Climate file
                  Frain,                    // Rainfall file
                  Frunoff,                  // Runoff file
                  Frdii,                    // RDII inflow file
                  Fhotstart1,               // Hot start input file
                  Fhotstart2,               // Hot start output file
                  Finflows,                 // Inflows routing file
                  Foutflows,                // Outflows routing file
                  FcalibrationS,            // Calibration file Innovyze RED 2016  // Storage Volume in a Storage Node
                  FcalibrationR,            // Calibration file Innovyze RED 2016   Runoff
                  FcalibrationE,            // Calibration file Innovyze RED 2016   Groundwater Elevation
                  FcalibrationG,            // Calibration file Innovyze RED 2016   Groundwater Q
                  FcalibrationH,            // Calibration file Innovyze RED 2016   Node Depth
                  FcalibrationL,            // Calibration file Innovyze RED 2016   Node Lateral Q
                  FcalibrationQ,            // Calibration file Innovyze RED 2016  Link Q
                  FcalibrationV,            // Calibration file Innovyze RED 2016  Link V
                  FcalibrationD;            // Calibration file Innovyze RED 2016  Link D

Step 2. Name them in iface.c
      case OUTFLOWS_FILE:
        if ( k != SAVE_FILE ) return error_setInpError(ERR_ITEMS, "");
        Foutflows.mode = k;
        sstrncpy(Foutflows.name, tok[2], MAXFNAME);
        // SWMM 5 Calibration File // Innovyze RED - 2016
        sstrncpy(FcalibrationS.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationR.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationG.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationE.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationH.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationL.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationQ.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationV.name, tok[2], MAXFNAME);
        sstrncpy(FcalibrationD.name, tok[2], MAXFNAME);
            FcalibrationS.mode = k;
             FcalibrationR.mode = k;
             FcalibrationG.mode = k;
             FcalibrationE.mode = k;
             FcalibrationH.mode = k;
             FcalibrationL.mode = k;
             FcalibrationQ.mode = k;
             FcalibrationV.mode = k;
             FcalibrationD.mode = k;
             strcat(FcalibrationS.name,".SWMM5_S_CALIBRATION.DAT");
             strcat(FcalibrationR.name,".SWMM5_R_CALIBRATION.DAT");
             strcat(FcalibrationG.name,".SWMM5_G_CALIBRATION.DAT");
             strcat(FcalibrationE.name,".SWMM5_E_CALIBRATION.DAT");
             strcat(FcalibrationH.name,".SWMM5_H_CALIBRATION.DAT");
             strcat(FcalibrationL.name,".SWMM5_L_CALIBRATION.DAT");
             strcat(FcalibrationQ.name,".SWMM5_Q_CALIBRATION.DAT");
             strcat(FcalibrationV.name,".SWMM5_V_CALIBRATION.DAT");
             strcat(FcalibrationD.name,".SWMM5_D_CALIBRATION.DAT");
           break;

Step 3. Open them in iface.c

void openFileForOutput()
//
//  Input:   none
//  Output:  none
//  Purpose: opens a routing interface file for writing.
//
{
    int i, n;

    // --- open the routing file for writing text
    Foutflows.file = fopen(Foutflows.name, "wt");
       FcalibrationS.file  = fopen(FcalibrationS.name, "wt");                        // Innovyze RED 2016
       FcalibrationR.file = fopen(FcalibrationR.name, "wt");                        // Innovyze RED 2016
       FcalibrationG.file = fopen(FcalibrationG.name, "wt");                        // Innovyze RED 2016
       FcalibrationE.file = fopen(FcalibrationE.name, "wt");                        // Innovyze RED 2016
       FcalibrationH.file = fopen(FcalibrationH.name, "wt");                        // Innovyze RED 2016
       FcalibrationL.file = fopen(FcalibrationL.name, "wt");                        // Innovyze RED 2016
       FcalibrationQ.file = fopen(FcalibrationQ.name, "wt");                        // Innovyze RED 2016
       FcalibrationV.file = fopen(FcalibrationV.name, "wt");                        // Innovyze RED 2016
       FcalibrationD.file = fopen(FcalibrationD.name, "wt");                        // Innovyze RED 2016
    if ( Foutflows.file == NULL )
    {
        report_writeErrorMsg(ERR_ROUTING_FILE_OPEN, Foutflows.name);
        return;
    }

Step 5.   Alter Report.c to save data to the Extra Output files

I will leave out these details as they are too tedious. 


    if ( Nobjects[SUBCATCH] == 0 ) return;
    WRITE(";Subcatchment Results");
     k = 0;
    for (j = 0; j < Nobjects[SUBCATCH]; j++)
    {
        if ( Subcatch[j].rptFlag == TRUE )
        {
            fprintf(FcalibrationR.file,"\n%s", Subcatch[j].ID);   
               //fprintf(FcalibrationG.file,"\n%s", Subcatch[j].ID);   
               //Fprintf(FcalibrationE.file,"\n%s", Subcatch[j].ID);          
                    report_SubcatchHeader(Subcatch[j].ID);
            for ( period = 1; period <= Nperiods; period++ )
            {
                output_readDateTime(period, &days);
                datetime_dateToStr(days, theDate);
                datetime_timeToStr(days, theTime);
                output_readSubcatchResults(period, k);
                        datetime_decodeDate(days, &year, &month, &day);               
                 fprintf(FcalibrationR.file, "\n%02d/%02d/%4d %4s %9.3f R",   
                   month,day,year, theTime, SubcatchResults[SUBCATCH_RUNOFF]) ;
            }
            k++;
        }
    }

Step 5.  Close them in iface.c

void iface_closeRoutingFiles()
//
//  Input:   none
//  Output:  none
//  Purpose: closes routing interface files.
//
{
    FREE(IfacePolluts);
    FREE(IfaceNodes);
    if ( OldIfaceValues != NULL ) project_freeMatrix(OldIfaceValues);
    if ( NewIfaceValues != NULL ) project_freeMatrix(NewIfaceValues);
    if ( Finflows.file )  fclose(Finflows.file);
    if ( Foutflows.file ) fclose(Foutflows.file);
    if ( FcalibrationS.file )  fclose(FcalibrationS.file);  //  Innovyze RED - 2016
    if ( FcalibrationR.file ) fclose(FcalibrationR.file);   //  Innovyze RED - 2016
    if ( FcalibrationG.file ) fclose(FcalibrationG.file);   //  Innovyze RED - 2016
    if ( FcalibrationE.file ) fclose(FcalibrationE.file);   //  Innovyze RED - 2016
    if ( FcalibrationH.file ) fclose(FcalibrationH.file);   //  Innovyze RED - 2016
    if ( FcalibrationL.file ) fclose(FcalibrationL.file);   //  Innovyze RED - 2016
    if ( FcalibrationQ.file ) fclose(FcalibrationQ.file);   //  Innovyze RED - 2016
    if ( FcalibrationV.file ) fclose(FcalibrationV.file);   //  Innovyze RED - 2016
    if ( FcalibrationD.file ) fclose(FcalibrationD.file);   //  Innovyze RED - 2016
}

Tuesday, September 13, 2016

Using RDII or RTK or I&I Hydrographs in #INFOSEWER

Using RDII or RTK or I&I Hydrographs in #INFOSEWER – InfoSewer from Innovyze also has the features to model Infiltration/Inflow from Rainfall Events into a Sanitary or Combined Sewershed.  There are three parameters, R, T and K, a Sewershed Area and a fraction division that divides up the overall R to the three individual R’s

1UH has an overall R (percent of Rainfall that turns into Rainfall Dependent Infiltration Inflow)
a.      R1 = Percent R1 * R / 100
b.      R2 = Percent R2 * R / 100
c.      R3 =  R – R1 – R2
2Figure 1 shows the Rainfall for InfoSewer
3Figure 2 shows the result of using 100 Percent R1, R2 or R3 at a node
4T is in hour and T*K is the Time Base of the resulting UH

Figure 1 - Rainfall for RTK in InfoSewer

Figure 2 - Resultant UH for Nodes with  only R1, R2 or R3.

Monday, September 12, 2016

Street Flooding in 2009, Inlet Flows, Street Flooding #SWMM5 #INLETS

Street Flooding in 2009, Inlet Flows, Street Flooding #SWMM5  #INLETS

Heavy rainfall, inlets with capture and bypassing flows.


New Events Editor In EPA SWMM 5.1.011 and InfoSWMM Non Steady Period Dialog


The Events Editor in SWMM 5 (Figure 2) is activated when the Events sub-category of simulation Options is selected for editing from the Project Browser.   InfoSWMM has the same feature but it called Non Steady Period (Figure 1)

It is used to limit the periods of time in which a full unsteady hydraulic analysis of the drainage network is performed. For times outside of these periods, the hydraulic state of the network stays the same as it was at the end of the previous hydraulic event.  Although hydraulic calculations are restricted to these pre-defined event periods, a full accounting of the system's hydrology is still computed over the entire simulation duration. During inter-event periods any inflows to the network, from runoff, groundwater flow, dry weather flow, etc., are ignored. The purpose of only computing hydraulics for particular time periods is to speed up long-term continuous simulations where one knows in advance which periods of time (such as representative or critical storm events) are of most interest.



The new tab for Non Steady State periods in InfoSWMM and H2OMap SWMM allows you to use the  Skip steady State option for selected  time periods.

If selected and the change in lateral inflow or node volume or node depth is higher that the defined tolerance for any single node in the collection system, then hydraulic routing will be conducted, otherwise the steady state condition will be assumed.  (See Improved Dry Weather Computation Efficiency for more information.)

Skip Steady State Period - Select to skip steady state period and use the tolerances below or leave blank to use internal default tolerances. (Note: Internal default tolerance: Lateral Inflow = 0.00001 cfs, Node Depth = 0.00001 ft, Node Volume = 0.01 ft3.)

Lateral Inflow Tolerance - minimum change in lateral inflow per simulation timestep for hydraulic routing to be performed.
 




Figure 1 - InfoSWMM Non Steady Periods



Figure 2 - Event Editor in EPA SWMM 5.1.011

Sunday, September 11, 2016

How to change the Status Form in SWMM 5.1.011 so it works as in Earlier SWMM 5 Versions

In the current EPA SWMM 5.1.011 the Report/Status tool only shows the non tabular output.  The tabular output is shown in the Summary Tables (Figure 1).  If you use Delphi XE2 to XE7 and make a small change to file FSTATS.PAS (Figure 3) you will see  the Summary tables in both the Status Report and the Summary Talbles (Figure 3).  The tables are stored in the same form they have been in past SWMM 5’s.

The current code looks for the Summary Tables and if it finds them the lines after the Summary is not saved to the Status Form.

            if  (ContainsText(Line, Subcatchment Runoff'))    
            or (ContainsText(Line, Node Depth'))            

If you change the words searched to words that will not appear in the output then the line will be copied to the Status Form. 

            if  (ContainsText(Line, 'Do not Skip this Subcatchment Runoff'))     // 2016 RED
            or (ContainsText(Line, 'Do not Skip this Node Depth'))               // 2016 RED

Figure 1 - Current SWMM 5.1.011 only shows to the Routing Time Step Summary in the Status Form.

Figure 2 - Small Change to Make in the Delphi XE7 Code

Figure 3 - Now you can See the Summary Tables in the Status Form.

Changing the top of the #EPA #SWMM 5 GUI Window Caption to the current EPA Version using Delphi XE7

If you want to change the top of the EPA SWMM 5 GUI Window Caption and you have access to Delphi XE2 to XE7 (I use XE7 and the EPA GUI uses XE2)  you can change the caption by changing the following line in FMAIN.PAS and recompliing

TXT_MAIN_CAPTION = 'SWMM 5.1.011 - QA/QC';

Figure 1 shows the new GUI top and Figure 2 shows the snippet to be changed in FMAIN.PAS

Figure 2 - New Caption at the Top of the SWMM 5 GUI

Figure 2 - FMAIN.PAS code Snippet

Meaning of Left and Right Bank Station in the Transects of #SWMM5 and #InfoSWMM

Meaning of Left and Right Bank Station in the Transecrts of #SWMM5 and #InfoSWMM

Vertical Roughness in a Pipe In InfoSWMM

Vertical Roughness Threshold-  The Vertical Roughness Threshold is a fraction and
the Threshold depth calculated from this fraction will be the Vertical Roughness
Threshold Fraction * Maximum depth. If the Maximum depth is 3 meters and the Vertical
Roughness Threshold is 0.5 then the dividing depth is 1.5 meters
Vertical Roughness - The lower or higher link roughness is entered as the Vertical
Roughness value

Vertical Roughness in a Pipe In InfoSWMM

Graphical View of the Runoff process in #SWMM5 and #INFOSWMM

Here is a graphical view of the nonlinear runoff processes in InfoSWMM and SWMM5:
1. Three runoff surfaces
a. Impervious with Depression Storage
b. Pervious
c. Impervious without Depression Storage
2. Slope (same for all runoff surfaces)
3. Width or the Dimension of the Subcatchment (same for all runoff surfaces)
4. Infiltration
a. Horton
b. Modified Horton
c. Green Ampt
d. Modified Green Ampt
e. Curve Number or SCS or CN
f. Monthly Adjustments for Climate Change for all Infiltration Methods
5. Evaporation
a. Constant
b. Time Series
c. Monthly
d. Temperature
e. Climate File
f. Monthly Adjustments for Climate Change
6. Roughness (Manning’s n)
a. Impervious
b. Pervious
7. Depression Storage
a. Impervious
b. Pervious
8. Temperature for Snowmelt
a. Climate File
b. Time Series
c. Monthly Adjustments for Climate Change
9. Wind Speed for Snowmelt
a. Climate File
b. Time Series
10. Other connected processes
a. LID Controls
b. Groundwater
c. Snowmelt
d. Water Quality
11. Outlet
a. Node
b. Pervious Runoff Surface
c. Impervious Runoff Surface
d. Another Subcatchment
e. LID Controls
i. Rain Garden
ii. Green Roofs
iii. Porous or Permeable Pavements
iv. Bio Retention Cells
v. Infiltration Trench
vi. Vegetative Swales
vii. Rain Barrel
viii. Rooftop Disconnection
12. Rainfall
a. Design Storms
b. Historical Storms
c. Long term NWS data or a Climate File
d. User Time Series
e. Monthly Adjustments for Climate Change

Immerse yourself in the vibrant, non-linear world of runoff processes with InfoSWMM and SWMM5, where every drop of rain and every grain of soil tells a story of hydrological complexity. 🌧️🌿🔍

Explore the Runoff Realm: Your journey begins with the varied landscapes of runoff surfaces, each with its own character:

  • The hard, storage-savvy impervious surfaces 🏙️
  • The absorbent, life-giving pervious grounds 🌱
  • The slick, unyielding impervious zones without depression storage 🛣️

Navigate the Terrain: Traverse slopes identical across terrains and witness how width shapes the subcatchment's hydrological response. 🏞️📐

Infiltrate the Infiltration Puzzle: Decipher the infiltration enigma with methods ranging from Horton to Green-Ampt, each nuanced by climate change's monthly adjustments. 💧🕵️‍♂️

Evaporation - Nature's Algorithm: Engage with evaporation, nature's algorithm, modulated by constants, series, and even the rhythm of the seasons, all under the watchful eye of climate change. ☀️💨

The Roughness Factor: Feel the surface beneath your feet, from the sleek impervious to the textured pervious, each with its unique roughness coefficient. 🚶‍♂️🌳

Depression Storage - Nature's Reservoirs: Discover the pockets of storage across your urban and natural landscapes, critical in the initial interception of rainfall. 🛤️🌼

The Chill of Snowmelt: Brace against the chill of snowmelt, guided by temperature readings and wind speeds from climate files or time series, all fine-tuned for a changing world. ❄️🌡️

The Web of Water Processes: Weave through the intricate web of connected water processes, from LID controls that mimic nature to the groundwater's silent flow, the transformation of snow to water, and the dance of water quality constituents. 💦🌐

Where Waters Flow: Follow the water as it journeys to nodes, pervious surfaces, other subcatchments, or through LID controls like rain gardens and green roofs, each a story of ingenuity and design. 🌈🏞️

The Drama of Rainfall: And finally, gaze skyward to the drama of rainfall, from design storms to historical patterns, enriched by long-term data and user-created sagas, all under the shadow of climate change. 🌦️📖

This is the mosaic of runoff processes in InfoSWMM and SWMM5—a symphony of hydrological phenomena waiting for you to conduct its performance. 🎶🌍📚

Tips for modeling Force Mains (FM) in #SWMM5, ICM SWMM and #InfoSWMM

Tips for modeling Force Mains (FM) in #SWMM5 and #InfoSWMM


 It often helps to add a break node to a long force main (especially if it joins the Gravity Main (GM) system at the end of the FM):
  1. Adding a Surcharge Node at the end of the Force Main (FM): The implementation of a surcharge node at the end of the force main can be seen as a good modeling practice in hydraulic engineering. This node acts as a buffer or transition point between the pressurized flow in the force main and the gravity-fed flow in the gravity main. By doing so, it allows for the accurate representation of the behavior of flows transitioning from a force main to a gravity main.

  2. The FM has a d/D ratio of 1 most of the time: In hydraulic modeling, the d/D ratio is a representation of the flow depth (d) to pipe diameter (D) ratio. In a force main, the d/D ratio is typically 1, indicating that the pipe is running full. This makes sense because force mains, unlike gravity sewers, are designed to operate under pressure and thus are usually completely filled with the flow. This d/D ratio is a crucial parameter to keep in mind when dealing with force mains and their transition to gravity mains.

  3. Avoiding an abrupt transition between the FM and GM system: The introduction of a surcharge node can help mitigate the potential problems associated with the abrupt transition from the force main (FM) to the gravity main (GM). An abrupt transition can lead to hydraulic issues, such as a sudden drop in flow velocity and potential backflows. These problems can lead to pipe damage or even system failure. The addition of a surcharge node helps to better manage this transition, making the system more resilient to such problems. This practice, therefore, enhances the reliability and efficiency of the combined force main and gravity main system.

By carefully considering these points and strategically incorporating them into the system design, you can effectively mitigate potential issues and ensure a more robust and resilient sewer system operation.



Plotting a Reference Graph in InfoSWMM makes it easy to see how the Pumps react to Wet Well Depths.
FM to GM Transitions 

Break Node in FM's

Saturday, September 10, 2016

A few of the many fantastic features of embedding InfoSWMM inside of ESRI Arc GIS

A few of the many fantastic features of embedding InfoSWMM inside of ESRI Arc GIS is the ability to use the other programs of ESRI such as
  1. magnifying windows, 
  2. Arc Catalog, 
  3. ArcScene 
  4. and having many background maps.
Here are multiple views of InfoSWMM 2D and InfoSWMM Sustain in Arc GIS (Top Image) and ArcScene (Bottom Image).


InfoSWMM 2D in Arc Scene

The Power or Graphics in InfoSWMM and H2OMap SWMM

The Power or Graphics in InfoSWMM and H2OMap SWMM:  The graphs have a lot of flexibility to show, compare and explain your model results.

Monday, September 5, 2016

Example Pump Controls in InfoSewer and H2OMap Sewer

Example Pump Controls in InfoSewer and H2OMap Sewer
Five ways to control the pump by controls in InfoSewerH20Map Sewer. Here are a few examples and important features of the various InfoSewer Pump Controls. A pump in InfoSewerH20Map Sewer uses a Newton-Raphson iteration process for 50 iterations or until the successive iterations between pump flows are 0.001 cfs.
  • Pump volume – control the pump by the pump volume (cubic feet or cubic meters). The on and off settings, pump curve and the iteration process applying to pumps are the controlling simulation features.
  • By Level– control the pump by the pump level or depth ( feet or meters). The on and off settings, pump curve and the iteration process applying to pumps are the controlling simulation features.
  • By Discharge – control the pump by the pump pattern in flow units. The pump pattern (discharge), pump curve and the iteration process applying to pumps are the controlling simulation features. The pump speed adjusts to main the pump pattern.
  • By Inflow – control the pump by the inflow to the Wet Well. The Wet Well inflow, the iteration process applying to pumps are the controlling simulation features. The pump flow equals the inflow to the Wet Well and the Wet Well stays at a constant level.
  • By Time – control the pump by the time speed pattern. The pump curve is used when the pump is turned on by the pattern.

GIF Presentation of LID’s in InfoSWMM Sustain

GIF Presentation of LID’s in InfoSWMM Sustain

This GIF was originally made in Powerpoint and gifmaker.me

How to See the Highest Continuity Errors Table in the Output Report Manager for #InfoSWMM

How to See the Highest Continuity Errors Table in the Output Report Manager for #InfoSWMM
In the output text report file of infoSWMM and H2OMap SWMM there is the Highest Node Continuity Error Table. The Table shows the highest 20 Nodes for percent node continuity errors and the actual continuity error as defined by Node Outflow – Node Inflow. This table is also shown in the Output Report Manger table 
The same value of Node Outflow – Node Inflow is shown in the Junction Summary table under the column flow volume difference. The units of flow volume difference will be the same as the RPT file if the units are changed in the Output Unit Manger.
How to change the volume units in the Output Unit Manger. Change the volume to MG or ML (for SI units).
The flow volume difference can also be seen in Map Display by picking the Active Output variable Vol_Diff or Flow Volume Difference.

AI Rivers of Wisdom about ICM SWMM

Here's the text "Rivers of Wisdom" formatted with one sentence per line: [Verse 1] 🌊 Beneath the ancient oak, where shadows p...