Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to Model Open Channels in SSA v2.0

2 REPLIES 2
Reply
Message 1 of 3
ouspensky
3205 Views, 2 Replies

How to Model Open Channels in SSA v2.0

I see a lot of posts asking for advice on how to model open channels in SSA so I thought I would share my slick system: How to Model Open Channels in SSA. The big idea behind it all is that SSA can merge BOTH GIS network data AND exported C3D pipe networks in a single model.  I like to use a WYSIWYG approach because it keeps everything clear when all the data is bouncing back and forth between applications and that allows us to easily flag errors.  Since SSA is a one dimensional analysis tool, the open channels are drawn in Civil3D as centerlines, elevations are points, Subbasins are polygons, and pipes are C3D pipe networks.  The data is exported to SSA in four separate files.  As long as the data is formatted with an eye toward a merged network it should come in pretty painlessly.

 

Drawing setups

Getting Started in Civil3D:

  1. Add the correct GIS coordinate system in your Civil3D file.
  2. Setup correct part matching.
  3. XREF in your site base plan file (such as L-SITE or C-SITE if you follow NCS conventions)
  4. Clone this file three times using SAVEAS to create three new files C-SITE-PIPE, C-SITE-MTRL, C-HYDR-BASE. (You don't HAVE to use these names)

Getting Started in SSA:

  1. Changes the element prototypes of conveyance links to open channel.
  2. In the setup tab configure SWMM using hydrodyamic routing and by elevation options.
  3. SAVEAS SWMM_Template.spf

IDcodes.png

 

 

Prototypes.png

 

Drafting the network

Open up C-SITE-PIPE.dwg and draft the drainage network by sketching out the centerline of the swales with 2D polylines.   Don't worry about elevations.  I keep mine at zero elevation.  Very important; at places where the surface flow enters or leaves a pipe network be sure to snap the pline to the insertion point of the structure.  The surface flow lines DO NOT pass through the structures in Civil3D.  (Just like in the real world a surface flow is no longer a surface flow when it’s under a culvert, remember WYSISYG).  Mark all the places where you will want or need an SSA junction object with the Node block.  These are places like the top and bottom of weir, the begin/end of a culvert, channel junctions, inlet/outlets of storage areas, start/end of swales.  Finish by elevating all these node blocks to the C3D surface using SENDTOSURFACE command.  Very Important; update the fields TWICE.  The reason why is explained in the next section.

 

A more detailed look at the node marker

A good way to think of the node block is a typical cross section of open channel.  Within this block are 6 attributes.  Set them to invisible except for RIM and INVERT.

RIM

DEPTH

INVERT

INITAL_WSEL

SURCHARGE

PONDED_AREA

For RIM use an object field type to read out Z-Position of the block in decimal units. 

For INVERT use a formula field type to create RIM-DEPTH expression.

Let’s drill into the block design more deeply.  These attributes all correspond to parameters in an SSA node object.  Nodes in SSA are conceptually cylinders (with a radius of zero, oh the irony!) Think of the attributes as bands measuring depth painted on this cylinder.  To conceptually adapt nodes for open channel networks; the RIM is the bankfull elevation of the channel, and the INVERT is the thalweg elevation.  Confusingly, the DEPTH is measured upward from the INVERT in positive units.  Likewise, the Initial Depth/Water Surface Elevation (WSEL) parameter, which measures water depth, if any, already in channel is measured up from the INVERT.  This parameter is called INTIAL_WSEL in our block because it is displayed as either a depth (Initial Depth) or an elevation (WSEL), however it is always entered as a depth value up from the INVERT on SSA import so be sure to enter it this way in your block.  SURCHARGE is abstraction for sealed systems where there might be an air gap that can be filled with water before the system becomes pressurized.  Unless your open channels are sealed, this should always be set to 0.  Finally, PONDED_AREA is an abstraction of an imaginary cylinder sitting above the RIM which can hold water flowing over the RIM and then release it back into the system as water levels drop.  Leave this as 0 unless the design required this specialized options for flood storage.

 

Nodes.png

 

Preparing the data for export to SSA

After the geometry of the surface flow network is compete, and it’s time for Map3D side of Civil3D. 

Use ADEDEFDATA to create a new table

Name = SSA-Links

In the table create two attributes:

MANNING

DEPTH

Use the command ADEATTACHDATA to attach the table to all the lines

These two commands create a table of extended custom fields in the property manager for you to populate with values.  If the Manning's or channel depth varies in some parts of the network, use the property manager to alter those segments. 

 

Exporting to Shapefiles

SSA only accepts shapefiles as GIS input.  Moreover, the node blocks (point topology), flow paths (link topology), and subbasins (polygon topology) must be in separate files.

 

Use MAPEXPORT to export the node blocks again with filter by layer to C-STRM-SWLE-NODE.  In the data tab map all the block attribute to shapefile attributes

 

Use MAPEXPORT to export the open channel flow network.  Choose the filter option so select everything on the C-STRM-SWLE-CNTR layer and in the data tab map three object properties to shapefile attributes

LENGTH

MANNING

DEPTH

 

SSA Importing: order of operations

The order of file import is very important in SSA.  Fire up SSA, open the SWMM5 template file and SAVEAS to create a new project.  First import the hydraflow.stm file.  Notice when it comes in all of the culverts may be described by a junction at the inlet and an outfall at the outlet.  Be sure to convert every outfall to a junction before importing anything else.  Next bring in the two shapefiles with GIS import wizard using the settings pictured.

 

ImportNodes.png

 

LinkImportSettings.png
 

 

Notice how the attributes automatically match up the SSA parameters based on the names.  It is important to note the search parameter in the pipes tab never be set below 1.  This number describes how close two points can be before they are considered as one SSA junction.  So for example Node Blocks that are within 1.000' or less of each other are brought in as a single junction.

Celebrate! All your hard work paid-off, the Civil3D plan has been fully transferred to SSA and merged into a single unified network.  Well, not quite.  A closer inspection will show that the network is riddled with rococo defects as only Autodesk software can produce.  To clean up the network step through each open channel dialog box and

  1. Set the in and out inverts with the "<" button.
  2. Manually enter the bottom width and side slopes.
  3. Remember, how we named the import ID codes for open channel nodes differently that pipe nodes? Using this naming convention to verify that open channels are connecting to pipe inlet outlet points. Check nodes that are close together is the downstream link actually connecting to the correct one?  If not use the reconnect from/to tool to alter the connections. 
  4. Finally direct links into the gaps created for them to indicate weirs

SSA Design Check

Now celebrate again your network is clean and valid! Or is it?  If you had to step through hundreds of dialogs in a complex design chances are you missed something.  Don't worry that is what a design check is for.  The quickest way to create as design check is to export the file to excel.  In the spreadsheet you can use all the data analysis tools to look for things like negative slopes, or mis-entered data.

To visually check your data export to GIS (file>export>GIS).  Once exported to shapefiles, the data is linked back into Civil3D using the FDO data connect tool.  Load the shapefiles with the coordinate system unspecified and it should land in the correct location.  As an example a negative drainage slope check. 

Open the attribute table of the links shapefile

Create a calculated property

Name = SLOPE_CHK

Expression = IF (INV_IN-INV_OUT) <0 THEN 1 ELSE 0. 

Go into the style tab of the layer and them the layer by SLOPE_CHK red for 1 and blue for 0 now all the negative sloped channels and pipes and highlighted red.  Use MAPEXPORTOACAD command to export a vanilla CAD file back to the design team.  This same system will be used later to style data for more advanced analysis or design exhibits.

 

Importing Subbasins

Preparing subbasins relies heavily on the MAP3D functions in Civil3D. First create three sets of parcel objects.  One for drainage areas, one for soils, and one for landcovers.  In SSA all the complexity of terrain is abstracted into rectangular blocks of similar hydrologic properties.  Each rectangle is bisected by a flow path which is analogous to the time of concentration line.  Each of these subbasin objects has three physical parameters and four material parameters

 

 

 

Physical Parameters:

Area

Average Slope (meaning the average slope of the flow path)

Equivalent width (the width of half the rectangle on either side of the flow path)

 

Equiv Width.png

 

Material Parameters:

Impervious area (expressed as percent of total subbasin area)

Impervious Manning’s (weighted average)

Pervious Manning’s (weighted average)

SCS Curve Number (weighted average)

 

Get started in Civil3D:

Open C-SITE-PIPE.dwg and draft the subbasins by sketching out 2D polylines to indicate the perimeter DO NOT waste time drawing closed loops or formatting this can be fixed later in a MAPCLEAN operation.

Import a parcel style Subbasin

Import a parcel label style called Subbasin. 

Create a site called Subbasins

Isolate the subbasin polyline layer and run MAPCLEAN a few times to remove drafting errors. 

Convert to parcels erasing the lines in the process

Use Rename/Renumber to match the IDs to the CAD drawing

Export the parcels to the SDF file Basin.sdf

 

On a layer called C-STRM-TOCL (or whatever you want to call it) sketch out the Time of Concentration line.  Be sure to snap to a point on the perimeter of the subbasin at the start and end points, which indicate the hydrologically most distant point and the pour point respectively. Very Important; be sure to always sketch these lines from highest to lowest points.  A good way to check this is the use an arrow linetype in C-STRM-TOCL and judicious use of REVERSE command.

 

Create a site called TimeConcLine. 

Convert the Time of concentration lines to feature lines and elevate to surface then explode to 3D polylines. 

Use MAPEXPORT to export the 3D polylines with three attributes to the file TimeConc.sdf

Z1 = HighPoint

Z2 = PourPoint

LENGTH = Length

 

Open C-SITE-MTRL.dwg using a similar method to the subbasins create a parcel topology of all the different materials in the site.  Ideally this would be the same file used for QTO.  Export that file to SDF Landcover.sdf

 

Get started in Map3D

Open C-HYDR-BASE and link to the SDF files you have generated which are

Basins.sdf a polygon topology of hydrologic units

Landcover.sdf a polygon topology of surface materials

TimeConc.sdf a network topology of time of concentration lines

Soils.sdf a clipped polygon topology of USDA soils

Because the SDF exports from Civil3D do not contain parcel IDs we will need to re-create them with a calculated property.  Open the attribute table of Basins.sdf and create a calculate

Calculate name = HID

Calculate expression = Substr ('name', 5,1)

 

This will remove the text string from the name leaving on the number.  We now have Hydrologic IDs or HIDs for each subbasin. Later using feature overlays we will tag each of the other SDFs with an HID. Create an output folder for the overlay operations for some reason Map3D cannot output an overlay to the same folder it was created in.

 

Operation: Identity Overlay

Source: TimeConc

Overlay: Basins

Output: TimeConc_HID.sdf

Calcuate name = Slope

Calculate expression = (HighPoint-PourPoint)/LENGTH*100

 

Operation: Intersect Overlay

Source: Landcover

Overlay: Basins

Output: Landcover_HID.sdf

Name = AreaByHID

Expression = Area2D(Geometry)

 

Operation: Intersect Overlay

Source: Landcover_HID

Overlay: Soils

Output: preCN_HID.sdf

Name = AreaByHID

Expression = Area2D(Geometry)

 

Operation: SaveAs SDF

Source: Basins

Output: BasinsHalf_HID.sdf

We need to modify the BasinsHalf.sdf to split the basins in half.  This cannot be done in an overlay operation.  Go into the split/merge rules for SPLIT attributes:

HID = Copy

All other attributes = empty

 

Turn off all the other layers in MAPEXPLORER except BasinsHalf_HID and TimeConc_HID Then use MAPFEATURESPLIT on BasinsHalf_HID choosing to create new features, zoom out and select all the TimeConc_HID lines as the split objects. use MAPCHECKINALL to save the save changes.

 

Now we need to find the area of each newly formed half basin so create a calculated property

Name = AreaNew

Expression = Area2D(Geomery)

 

Notice at this point all the geometry has been processed in such a way that each of the overlapping layers has passed its attributes into new layers tagged by the HID.  Since there is nothing more to be gained from the geometry it makes sense to export the attribute tables and finish manipulating the data in a spreadsheet or RDMS.  Since most software can't read SDF file use BULKCOPY to merge all the layers into a single SQLite file.  Use a saved schema to drop unnecessary properties and rename properties.

 

Working with tables in GIS

QGIS + Excel is my preference to roundtrip the tables out of and back into a GIS format.  Other options are MS Access which has several advantages to link excel data back to Map3D for a GIS join to roundtrip the data.  If this tool isn't available other options are using the table tools in ESRI ArcMap, or OpenOffice dBASE.

 

In QGIS load in the layers from the SQLite transfer file with the tables:

BasinsHalf_HID

Landcover_HID

preCN_HID

TimeConc_HID

 

In both Landcover and preCN we will process the data with lookup tables and SQL.  The idea in Landcover is the assign Manning's coefficient N to each landcover type so hopefully you've been using standardized names for the surface materials! 

First we create our lookup tables.  Be sure to save them, these tables can be added to over time to include more and more unique situations.  In notepad save a file called ManningsLookup.txt write an SQL expression

 

CASE

WHEN "Landtype" LIKE 'value' THEN #.#

END

 

For example:

CASE

WHEN "Landtype" LIKE '%field%' THEN 0.4

END

 

Next we use our newly created Manning's coefficient as a threshold value for Imperviousness.  Hardscape impervious materials usually have Manning's less than 0.02.  This expression will flag all the impervious landtypes with 1 = true it is impervious or 0 = false it is not impervious.   In notepad save a file called I_FlagLookup.txt write an SQL expression

 

CASE

WHEN "Manning" < # THEN 1 ELSE 0

END

 

Calculate the Manning's Coefficient

Create a new calculated property called Manning

Copy Paste the SQL expression from ManningsLookup.txt

Create a new calculated property called I_Flag

Copy Paste the SQL expression from I_FlagLookup.txt

 

Next create a new calculated property

Name = Weight

Expression = Manning*AreaByHID

 

Next we will create a lookup table for the SCS curve number, sometimes called the NRCS curve number.  This table is uses two conditions, it can become quite long.  For example, the four USDA soil types with seven landcover types would yield 28 unique CNs! luckily this only needs to be done once. In notepad save a file called CN_Lookup.txt write an SQL expression

 

CASE

WHEN "Landtype" LIKE 'value' AND "Soil" LIKE 'value' THEN #

END

 

CASE

WHEN "Landtype" LIKE '%field%' AND "Soil" LIKE 'D' THEN 91

END

 

Create a new calculated property called CN

Copy Paste the SQL expression from CN_Lookup.txt

Next create a new calculated property

Name = Weight

Expressions CN*AreaByHID

 

At this point we reach the limit of what can be efficiently done in QGIS. CopyPaste the tables into Excel tabs.  Hint a premade Excel template will greatly speed up this step.

 

Working with tables in Excel

Begin in BasinsHalf_HID

Sort by HID

Create a new property

Name = Area_Majr

Expression = IF(Area1>Area2, Area1,Area2)

Name = Area_Minr

Expression = IF(Area1<Area2, Area1,Area2)

Note that each HID has exactly two rows; Area1 is the first row(X1) and Area2 is the second row(X2).  This formula uses logic to exploit the known fact of exactly two unequal rows per and HID to write the larger and smaller halves to each property. Select the block of four cells and drag the expression to the end to populate the table.

Create a new property

Name = Skew

Expression = 2 - (Area_Majr - Area_Minr) / (Area_Majr + Area_Minr)

Select the block of two cells and drag the expression to the end to populate the table.  We now have one Skew value per an HID.

 

Being work in preCN_HID

Unlike BasinsHalf_HID in preCN_HID there are many values of CN per and HID.  How do we deal with this problem?  Luckily all we are finding is the weighted average so we can exploit the SUMPRODUCT function.

To the right of table create a new property

Name = key

Value = 1

This drag down to enumerate a list of numbers

Create a new property

Name = CN_Mean

Expression = { SUMPRODUCT ((key=HID)*Weight) / SUMPRODUCT ((key=HID)*AreaByHID) }

Drag this down to end of the list in Key.

 

Note this is an array function so when you write the expression in the initial cell use SHIFT+CTRL+ENTER and the {} will appear.  Be sure to use the lock symbol $ on rows and columns as necessary to keep everything in the right place when dragging!

A deeper look at the logic behind this operation.  This expression queries a defined array of cells for only those that match a criteria then sums them up.  The difficult many-to-one relationship is overcome on the value of Key (one per a row) to the entire array of HID (many rows per a value) to create the weighted average we are using SUMPRODUCT twice once on the weighted CN and once on the Areas that give them weight.  The result?  One CN per and HID.

 

Begin work in Landcover_HID

The calculations for Landcover_HID are the most complex, but essentially it is the same query + summation technique we used to find a weighted average in preCN_HID.  Only this time instead of a single query criteria there are two: HID and I_Flag.

 

To the right of table create a new property

Name = key

Value = 1

This drag down to enumerate a list of numbers

 

Create a new Property

Name = 0

Expression = { SUMPRODUCT ((key=HID)*(0=I_Flag)*Weight) /  SUMPRODUCT ((key=HID)*(0=I_Flag)*AreaByHID) }

Create a new Property

Name = 1

 

Drag the expression over into the 1 property.  If the row and column locks are set correctly this should switch the I_Flag critera from 0 to 1.  Note we are using these properties as query keys now but they should be renamed to Mngs_Perv and Mngs_Impr the final table.  Drag the two cell block to the end of the key list.

 

The final calculation is for the percentage of impervious area per an HID.  For this we will a two criteria summation again with slight adjustments.

Create a new Property

Name = Prcnt_Impr

Expression = { SUMPRODUCT ((key=HID)*(1=I_Flag)*AreaByHID) /  SUMPRODUCT ((key=HID)*AreaByHID) }

Make sure all the row and column locks are correct and drag to the end of the key list.  Notice the results are exactly one Mngs_Perv, Mngs_Impr, Prcnt_Impr per an HID

Congratulations all the calculations are now finished!  The next step is to prepare the data for a table join back in GIS.

Begin in the Join Tab 

Create new properties

Key

Skew

CN_Mean

Mngs_Perv

Mngs_Impr

Prcnt_Impr

 

Enumerate the Key list and write an expression with SUMPRODUCT to query and write out the values for each of those properties from the other tabs.

 

Roundtrip the data

In Map3D using OBDC database connect, add the final table as a layer and join this table to Basins_HID.sdf using HID to Key as the join key.  Or in QGIS import the final table as a CSV and join it using HID to Key as the join key.

Then Join the table from TimeConc_HID using HID to HID as the join key and bring in the properties

Length

Slope

Create a new calculated property

Name = Width

Expression = Skew/Length

Congratulations! You have now created a complete table for export to SSA.

Then create a new shapefile called SSA_Basins.shp and use BULKCOPY to move all of the relevant properties from Basins_HID.sdf to SSA-Basins.shp.  Hint having a schema saved helps a lot.  Or in QGIS save the Basins_HID layer as SSA-Basins.shp

 

Finish in SSA

Load SSA_Basins.shp into the GIS import wizard of SSA and bring it in.  All of the Basins will drop into SSA with all the subbasin parameters populated by values from the GIS attribute table.  Use the input command to globally link all the subbasins to the rain gage then manually link each subbase to the correct junction in plan.  At this point your model should be ready to run an SWMM5 analysis.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 REPLIES 2
Message 2 of 3
ouspensky
in reply to: ouspensky

Addendum:

Flowchart for processing subbasin paramters:

SWMM5 SubBasin4.jpg

 

and the Document Object Model for the GIS operations

 

SSA_DOM.png

 

Message 3 of 3
Anonymous
in reply to: ouspensky

Sorry for the uneducated question but I'm new to SSA. Is this still your preferred method for modeling open channels in Version 13.0.94.0? Thanks a lot.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report