Monday, September 26, 2016

Spatial Databases in #InfoSWMM and #InfoSewer using ArcCatalog™

Spatial Databases in #InfoSWMM and #InfoSewer using ArcCatalog™

With ArcCatalog™ , you can explore and manage geographic data stored in an RDBMS through ArcSDE™ . Similarly, SDE for Coverages lets you access coverage, ArcInfo™ LIBRARIAN, and ArcStorm™ databases the same way you access data from an RDBMS. To access these spatial databases, you must add a spatial database connection to the Catalog.
Refer to the section on Database Connections folder -> Spatial Database Connection link in the ArcGIS help file to learn more.

Pump as a Node In Water and System Head Curve

System Head Curve


Note:  This is a feature often asked for in InfoSWMM and SWMM5.  Pumps are links in the SWMM5 engine.
The dialog box for system head curve is shown below. Click here for the methodology of system head curve.

Input for system head curve:

 Flow Unit – Select the desired flow unit.
 Head Loss Equation – Select from Manning, Darcy-Weisbach (Colebrook-White), or Hazen–Williams formula.
 Pipe 1 – The pipe that connects the upstream reservoir with the pump (i.e., pipe on the suction side of the pump).
 Pipe 2 – The pipe that connects the pump with the downstream reservoir (i.e., pipe on the discharge side of the pump).
 Coefficient – Roughness coefficient.
 Head at Position 1 – Head at the upstream reservoir.
 Head at Position 2 – Head at the downstream reservoir.
 Length – Length of the pipe (i.e., pipe 1 or pipe 2).
 Diameter – Diameter of the pipe (i.e., pipe 1 or pipe 2).
 Sum of Minor Loss Coefficients – Sum of minor loss coefficients for the pipe (i.e., pipe 1 or pipe 2).
 Maximum Flow – Maximum flow for use in constructing the system head curve. The maximum flow is divided into ten equal intervals and the head corresponding to each of the ten flows is computed to construct the system head curve. Therefore, it is advisable to use a maximum flow that is divisible by ten.

Output for system head curve:

 Graphical System Curve – Presents the system head curve graphically.
 Tabular System Curve – Presents the system head curve in tabular form.  


#SWMM6 - A Sustainable Center for Crowd-Sourced Water Infrastructure Modeling



Friday, September 16, 2016

How to add a new view variable to SWMM 5.1.011

How to add a new view variable to SWMM 5.1.011

If you want to add a new view variable to the graphs of SWMM 5 – this is the steps you have to take (3 in the Delphi GUI and 3 in the SWMM 5 C Engine code).

This example will add a new view variable called NodeXTRA at the end of the Node list of view variables (Figure 1).  You add it to three locations in the Delphi XE7 code (Figure 3) and three locations in the SWMM 5 Engine code (Figure 3).  The purpose of this note is for students and as a reminder to myself.

Figure 1 - New view variable called NodeXtra

Figure 2 - We need to make a few additions to the Delphi GUI code to see the Name NodeXtra when we run SWMM 5.1.011



Figure 3 - SWMM 5 C code - We need to add the NodeXtra variable to the code to see some numbers and results.

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.

The Goal of SWMM5 Input Files

 ðŸŒŸ SWMM5 (Storm Water Management Model 5) is a widely used urban hydrology and hydraulic modeling software developed by the United States E...