Posts

Showing posts from July, 2017

This is how node interface files works in #SWMM5, Caveats and Tips

The routine readNewIfaceValues reads a line interface flows in SWMM5.  It is a string parser, finds tokens and creates dates, times and flows from the tokens.  It is important to have the correct format for your line else the tokens will not be correctly converted to integers and doubles. Further, it is important to have more than one date/time for each node as the SWMM5 engine interpolates the flow values for each node during the simulation.  One time value or time values out of the simulation date/times will result in no flows.
void readNewIfaceValues() // //  Input:   none //  Output:  none //  Purpose: reads data from inflows interface file for next date. // { int    i, j; char*  s; int    yr = 0, mon = 0, day = 0,                 hr = 0, min = 0, sec = 0;   // year, month, day, hour, minute, second char   line[MAXLINE+1];            // line from interface file
// --- read a line for each interface node     NewIfaceDate = NO_DATE; for (i=0; i<NumIfaceNodes; i++)     { if ( feof(Finf…

A Visual Studio Compiler for #SWMM5 Note

Image
A Visual Studio Compiler for #SWMM5 note.  If you have many many copies of the SWMM5 code on your PC you can rename the Visual Studio project files from the default SWMM5 names to a more meaningful version name (Figure 2) and using the DLL Properties/General/Output file change the SWMM5.DLL creation directory (Figure 1). 

#SWMM5 - Delphi Pascal unit that imports a SWMM project's data from a formatted text file

unit Uimport;

{-------------------------------------------------------------------}
{                    Unit:    Uimport.pas                           }
{                    Project: EPA SWMM                              }
{                    Version: 5.1                                   }
{                    Date:    12/02/13    (5.1.001)                 }
{                             04/04/14    (5.1.003)                 }
{                             04/14/14    (5.1.004)                 }
{                             09/15/14    (5.1.007)                 }
{                             03/19/15    (5.1.008)                 }
{                             08/05/15    (5.1.010)                 }
{                             08/01/16    (5.1.011)                 }
{                    Author:  L. Rossman                            }
{                                                                   }
{   Delphi Pascal unit that imports a SWMM project's data from a    }