Thursday, August 8, 2013

How to Create an InfoSWMM model from CSV Files

How to Create an InfoSWMM model from CSV Files

An InfoSWMM model can be newly created from a CSV file but it helps to have a background map or shapefile to initialize the Arc Map project.  BEFORE initializing yourInfoSWMM map Add a data layer using the Arc Map command Add Data.   Create a new InfoSWMM project using the same spatial reference as your added shapefile (Figure 1).  Import the CSV files (Figure 2) and define the imported variables (Figure 3) followed by an Update Map from DB (Figure 4) which will draw your imported nodes and links on the Arc Map screen.  The updated Map will have the same coordinates as the background shapefile (Figure 5).  It is important to have the proper spatial reference for your imported data in Arc Map.

Figure 1.  Import a background shape file and initialize your InfoSWMM map to the coordinates of the shapefile.


Figure 2.  Import a CSV file for both pipes and nodes using the Import Manager of InfoSWMM

Figure 3.  Set up the Field Mapping between the CSV parameters and the Node and Link Parameters of InfosWMM.

Figure 4.  Update the Map from the DB tables you just imported using the command Force All Network.

Figure 5.  The imported model has the same coordinates as the original imported shapefile.

InfoSewer Minimum Travel Time Sensitivity

InfoSewer Minimum Travel Time Sensitivity

The three Run manager parameters, Maximum Number of Segments, Minimum Travel Distance and the Minimum Travel Time in InfoSewer and H2OMAP Sewer affect the shape and flow attenuation of the flow in a link.  The effect of decreasing the Minimum Travel Time is to reduce the peak flow and spread out the flow as the number of segments increases(Figure 1).  The larger the Minimum Travel Time, which has the effect of decreasing the number of segments in a link up the limit of the parameter Maximum Number of segments, the smaller the peak and the more attenuation of the flow in InfoSewer.

There is three ways to control attenuation in InfoSewer: (1) use the flow attenuation option, (2) increase the Maximum Number of Segments per link and (3) decrease the Minimum travel distance.    You can also use all three parameters to make more segments per link for long links and only a few segments for short links.
Figure 1.  Effect of the Minimum Travel Time in InfoSewer and H2OMAP Sewer

How to Create an InfoSWMM model from CSV Files, Alternate Method

How to Create an InfoSWMM model from CSV FilesAlternate Method

An InfoSWMM model can be newly created from a CSV file but it helps to have an idea of the maximum extents before you initialize the Arc Map project.  Use the ArcGIS default and Edit the extents of your future imported network (Figure 1).  Import the CSV files (Figure 2) and define the imported variables (Figure 3) followed by an Update Map from DB (Figure 4) which will draw your imported nodes and links on the Arc Map screen.  The updated Map should be within the extents of your defined spatial reference (Figure 5).  It is important to have the proper spatial reference for your imported data in Arc Map.  If you do not have the proper extents then when you update the Map from DB you will have a warning message "The coordinates or measures are out of bounds". 

Figure 1.  Import a background shape file and initialize your InfoSWMM map to the coordinates of the shapefile.


Figure 2.  Import a CSV file for both pipes and nodes using the Import Manager of InfoSWMM

Figure 3.  Set up the Field Mapping between the CSV parameters and the Node and Link Parameters of InfosWMM.

Figure 4.  Update the Map from the DB tables you just imported using the command Force All Network.
Figure 5.  The imported model has the same coordinates as the original imported shapefile.

The Structure of InfoSWMM in Arc Map

The Structure of InfoSWMM in Arc Map

Siphon Modeling in InfoSewer and Arc Map Atrribute Display

Siphon Modeling in InfoSewer and Arc Map Atrribute Display

Here is at typical view of  a siphon in InfoSewer, the rising links have a d/D of 1 and the dropping links typically have a d/D value less than 1.  The q/Q for the rising links is based on the slope and the dropping links typically have a q/Q less than 1 as the full flow is high due to the steep slopes.  You can show both the d/D and q/Q values in an Arc Map Display by using the following code.  I find it easier to first plot one variable using the InfoSewer Map Display followed by editing the TOC Properties for Pipes to show more than one variable at a time in the Label properties.

Function FindLabel ([D_OVER_D],  [Q_OVER_Q] )
If IsNull([D_OVER_D]) then Exit Function
FindLabel ="" &  FormatNumber([D_OVER_D],3) & "  d/D "  & "" &  FormatNumber([Q_OVER_Q],3) & " q/Q"
End Function

InfoSewer By Discharge Control for a PUMP

InfoSewer By Discharge Control for a PUMP

You can control the pumps in InfoSewer and H2OMap Sewer by using a Pump Control which will control the pump based on:

1.       Volume
2.      Level
3.      Discharge
4.      Inflow
5.      Time

If you use a By Discharge control the pump speed of the pump is increased or decreased to pump the incoming Wet Well flow based on the pump rules and the geometry of the Wet Well (Figure 1).

Figure 1.  By Discharge Control for  PUMP in InfoSewer and H2OMAP Sewer will change the Pump Speed of the pump to follow the Base Pump Flow Rules.

SWMM 4 and SWMM 5 St. Venant Solutions Contrasted

SWMM 4 and SWMM 5 StVenant Solutions Contrasted

1. Compute at time t+delta t the values of dQ/dt for the Links and dH/dt for the Nodes from the properties at time t
2 Iterate at least 2 times until either all nodes and links are converged or a maximum of 8 iterations are reached
3. Use the values of Q and H at time t+delta t for the new time step

The SWMM5 Solution for Flow and Depth at each time step.  The new depth and new flow is always based on the old depth and old flow and normally converges fast as the flow is gradually varied.   The solution is iterative and implicitly uses the new depth and flow at each iteration.

The SWMM4 Solution for Flow and Depth is solved Explicitly at each time step.  The new depth and new flow is always based on the old depth and old flow and and a half and full time step during the time step.

InfoSewer Maximum Number of Segments Sensitivity

InfoSewer Maximum Number of Segments Sensitivity

The three Run manager parameters, Maximum Number of Segments, Minimum Travel Distance and the Minimum Travel Distance in InfoSewer and H2OMAP Sewer affect the shape and flow attenuation of the flow in a link.  The effect of decreasing the Minimum Travel Distance is to reduce the peak flow and spread out the flow as the number of segments increases(Figure 1).  The smaller the minimum travel distance, which has the effect of increasing the number ofsegments in a link up the limit of the parameter Maximum Number of segments, the smaller the peak and the more attenuation of the flow in InfoSewer.

There is three ways to control attenuation in InfoSewer: (1) use the flow attenuation option, (2) increase the Maximum Number of Segments per link and (3) decrease the Minimum travel distance.    You can also use all three parameters to make more segments per link for long links and only a few segments for short links.
Figure 1.  Effect of the Minimum Travel Distance in InfoSewer and H2OMAP Sewer

Singapore - Catching Every Drop of Rain

Singapore - Catching Every Drop of Rain

The source of the map of the rivers of Singapore is the Singapore PUB
As a small island that doesn't have natural aquifers and lakes and with little land to collect rainwater, Singapore needs to maximize whatever it can harvest.
Currently, Singapore uses two separate systems to collect rainwater and used water. Rainwater is collected through a comprehensive network of drains, canals, rivers and stormwater collection ponds before it is channelled to Singapore's 17 reservoirs for storage. This makes Singapore one of the few countries in the world to harvest urban stormwater on a large scale for its water supply.
The newest reservoirs are Punggol and Serangoon Reservoirs which are our 16th and 17th reservoirs. By 2011, the water catchment area has increased from half to two-thirds of Singapore's land surface with the completion of the Marina, Punggol and Serangoon reservoirs.
With all the major estuaries already dammed to create reservoirs, PUB aims to harness water from the remaining streams and rivulets near the shoreline using technology that can treat water of varying salinity. This will boost Singapore's water catchment area to 90% by 2060,
The goal is to capture every drop of rain (Figure 1)
 

Reservoirs
Pandan Reservoir
Kranji Reservoir
Jurong Lake Reservoir
MacRitchie Reservoir
Upper Peirce Reservoir
Lower Peirce Reservoir
Bedok Reservoir
Upper Seletar Reservoir
Lower Seletar Reservoir
Poyan Reservoir
Murai Reservoir
Tengeh Reservoir
Sarimbun Reservoir
Pulau Tekong Reservoir
Marina Reservoir
Serangoon Reservoir
Punggol Reservoir


Rivers
Singapore River
Sungei Kallang
Rochor River
Sungei Whampoa
Geylang River
Sungei Bedok
Sungei Ketapang
Sungei Changi
Sungei Selarang
Sungei Loyang
Sungei Tampines
Sungei Api Api
Sungei Blukar
Sungei Serangoon
Sungei Punggol
Sungei Tongkang
Sungei Pinang
Sungei Seletar
Sungei Khatib Bongsu
Sungei Seletar Simpang Kiri
Sungei Sembawang
Sungei Mandai
Sungei China
Sungei Mandai Kechil
Sungei Peng Siang
Sungei Tengah
Sungei Kangkar
Sungei Buloh Besar
Sungei Jurong
Sungei Lanchar
Sungei Pandan
Sungei Ulu Pandan



Here's an emoji-laden table summarizing Singapore's efforts in rainwater harvesting and management:

Topic 📚Description 📝Emoji Illustration 🌟
Rainwater Harvesting 🌧️Singapore utilizes a comprehensive network of drains, canals, rivers, and stormwater collection ponds to channel rainwater into 17 reservoirs, making it one of the few countries to harvest urban stormwater on a large scale.🌧️💦🔄
Reservoir Expansion 🏞️The addition of Punggol and Serangoon Reservoirs, as well as the completion of Marina Reservoir, increased the water catchment area from half to two-thirds of Singapore's land surface by 2011.🏞️⬆️🇸🇬
Future Water Catchment Goals 🎯PUB aims to boost Singapore's water catchment area to 90% by 2060 by harnessing water from remaining streams and rivulets near the shoreline using technology to treat water of varying salinity.🎯💧🔜
Reservoirs 🚰List includes Pandan, Kranji, Jurong Lake, MacRitchie, Upper Peirce, Lower Peirce, Bedok, Upper Seletar, Lower Seletar, Poyan, Murai, Tengeh, Sarimbun, Pulau Tekong, Marina, Serangoon, and Punggol Reservoirs.🚰📋💧
Rivers 🏞️Extensive list of rivers including Singapore River, Sungei Kallang, Rochor River, and many others which play a role in the rainwater collection system.🏞️💦🔄

This table encapsulates Singapore's robust approach towards maximizing rainwater harvesting amidst geographical constraints, its expansion of reservoirs to increase water catchment areas, and its ambitious goals for future water catchment, along with a mention of the numerous reservoirs and rivers that contribute to this system.


InfoSewer Inflow Control for a PUMP

InfoSewer Inflow Control for a PUMP

You can control the pumps in InfoSewer and H2OMap Sewer by using a Pump Control which will control the pump based on:

1.       Volume
2.      Level
3.      Discharge
4.      Inflow
5.      Time

If you use a By Inflow control the pump speed of the pump is increased or decreased to make the Upstream Wet Well Level Constant (Figure 1).
Figure 1.  Inflow Control for  PUMP in InfoSewer and H2OMAP Sewer will change the Pump Speed of the pump to make the Wet Well level constant

How to Make an Excel Fixed Width File from SWMM 5

How to Make an Excel Fixed Width File from SWMM 5

You can use this macro for MATLAB or some other DOS based program by using the Tools command of SWMM 5 and configuring the EXCEL file option.  If you use the EXCEL tool then your SWMM 5 input file will be opened up in EXCEL and you can use this macro to make a fixed format file for SWMM 5.  Note, SWMM 5 does not use fixed format but other programs may need it for reading,  You adjust the column widths in the macro for your program.


Here is the macro, which is placed  in Excel using these command:
  1. Copy the code above.
  2. Open Excel.
  3. Alt + F11 to open the Visual Basic Editor.
  4. Click Insert-Module from the menu.
  5. Paste the code into the window that appears at right.
Option Explicit

Sub CreateFixedWidthFile(strFile As String, ws As Worksheet, s() As Integer)
    Dim i As Long, j As Long
    Dim strLine As String, strCell As String
    
     'get a freefile
    Dim fNum As Long
    fNum = FreeFile
    
     'open the textfile
    Open strFile For Output As fNum
     'loop from first to last row
     'use 2 rather than 1 to ignore header row
    For i = 1 To ws.Range("a65536").End(xlUp).Row
         'new line
        strLine = ""
         'loop through each field
        For j = 0 To UBound(s)
             'make sure we only take chars up to length of field (may want to output some sort of error if it is longer than field)
            strCell = Left$(ws.Cells(i, j + 1).Value, s(j))
             'add on string of spaces with length equal to the difference in length between field length and value length
            strLine = strLine & strCell & String$(s(j) - Len(strCell), Chr$(32))
        Next j
         'write the line to the file
        Print #fNum, strLine
    Next i
     'close the file
    Close #fNum
    
End Sub

 'for example the code could be called using:

Sub CreateFile()
    Dim sPath As String
    sPath = Application.GetSaveAsFilename("SWMM5_Fixed_EXPORT", "Text Files,*.inp")
    If LCase$(sPath) = "false" Then Exit Sub
     'specify the widths of our fields
     'the number of columns is the number specified in the line below +1
    Dim s(15) As Integer
     'starting at 0 specify the width of each column for the SWMM5 File, alter the columns if you need more columns in your data input file
    s(0) = 40
    s(1) = 20
    s(2) = 20
    s(3) = 20
    s(4) = 20
    s(5) = 20
    s(6) = 20
    s(7) = 20
    s(8) = 20
    s(9) = 20
    s(10) = 20
    s(11) = 20
    s(12) = 20
    s(13) = 20
    s(14) = 20
    s(15) = 20
     'for example to use 3 columns with field of length 5, 10 and 15 you would use:
    'dim s(2) as Integer
     's(0)=5
     's(1)=10
     's(2)=15
     'write to file the data from the activesheet
    CreateFixedWidthFile sPath, ActiveSheet, s
End Sub
 .

Maximum HGL Head Class in InfoSWMM AND H2OMAP SWMM

Maximum HGL Head Class in InfoSWMM AND H2OMAP SWMM

You can find the node flood or surcharge maximum occurrence during a simulation in the Junction Summary Report table in InfoSWMM and H2OMAP SWMM (Figure 1)

Empty                                   if the Node Head is below or equal to the Lowest Link Connecting  Elevation
Below Link Crown            if the Node Head is below or equal to the Highest Link Connecting Crown
Below Maximum Depth   if the Node Head is below or equal to the Node Invert + Full  Depth.  The column Max Surcharge Height above Crown will also tell you how deep the Surcharge in a Node.
Surchaged                           if none of the above is true.


Figure 1.  Junction Summary Report in InfoSWMM

Figure 2.  Maximum Surcharge Height above Crown Definition

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