Pages

Tuesday, May 13, 2014

Tuesday Tip of the Week–Axis Zooming for True Peak Discharge

Written by Christopher Goodell, P.E., D.WRE  |  WEST Consultants

Copyright © The RAS Solution 2014.  All rights reserved.

Another simple, yet very convenient tool not found discussed in the manuals is the ability to zoom in on one of the axes of a graphical plot.  This is especially useful when trying to determine if you’ve captured the true peak discharge in a steeply rising hydrograph.  Take the following example: an unsteady flow dam breach output flow hydrograph.

image

Here we have a steeply rising flow hydrograph from a breach at the inline structure that appears to have a peak discharge of about 35,000 cfs.  To visually inspect whether or not this hydrograph captures the true peak, we can zoom in on the x axis by clicking and dragging a “bar” on the axis itself.  Simply place your cursor just below the x axis line, on the axis labels (in this plot, the time, in hours), then click and drag a red bar bracketing the portion of the hydrograph you wish to zoom in to.

image

Once you release the mouse button, the plot zooms in only on the x axis, in effect “spreading” out the hydrograph so that the peak is more apparent.  Notice that the full range of discharges still appear in the plot, we’ve simply truncated the time window to a more visually convenient range. 

image

Now notice we can see that because the hydrograph output interval is set too coarse (in this case every 10 minutes), we miss out on the true peak of the discharge hydrograph.  It happens somewhere between 1950 hours and 2000 hours.  By rerunning the model with a smaller hydrograph output interval, we can capture a better representation of the true peak discharge.  In the next figure, the discharge hydrograph is shown for the same location with a 2 minute hydrograph output interval.

image

After zooming in again on the x axis, we can see that we have a much better representation of the true peak of the discharge hydrograph, which is closer to 42,000 cfs, versus the 35,000 cfs shown in the first simulation:

image

The axis zooming feature works on any plot (input or output) and you can zoom on either the x or y axis.  So next time you’re evaluating hydrographs, or simply wish to have a better view of a curve in any of the plots, give the axis zooming feature a try.

Friday, May 9, 2014

The Measuring Tool

Written by Christopher Goodell, P.E., D.WRE  |  WEST Consultants

Copyright © The RAS Solution 2014.  All rights reserved.

I don’t think you’ll find this anywhere in the manuals, but HEC-RAS has a very convenient tool for measuring lengths and slopes in the Geometry window and just about any graphical plot.  It only works in the geometry window if your RAS model is georeferenced, as it measures distances based on coordinates.  However, in the graphical plots, it works great whether your model is georeferenced or not. 

While in the Geometry window or any graphical plot, push and hold the Ctrl key on your keyboard.  You’ll see your cursor change from a pointer to a crosshair with a measuring square like this:

image

While keeping the Ctrl key pressed, mouse click and move the measuring tool.  You’ll see a line drawn on the plot. 

image

When you release the Ctrl key, you’ll see a window pop up with the line length, as well as the x direction length (dx) and the y direction length (dy).  dy/dx gives you the slope of the line.  This is very useful for getting river bed slopes for using the normal depth boundary condition or for calculating n values using Jarrett’s equation.  You’ll notice that Polygon Area is also provided.  This works if you click multiple times in the plot, making a polygon.  This is useful if you’re interested in measuring surface area of a storage area in the geometry window. 

image

You’ll notice that Polygon Area is also provided.  This works if you click multiple times in the plot, making a polygon.  This is useful if you’re interested in measuring surface area of a storage area in the geometry window.  Just be sure to keep the Ctrl key depressed while making your “clicks” to define the polygon. 

image

Thursday, May 8, 2014

Controlling HEC-RAS

Written by Christopher Goodell, P.E., D.WRE  |  WEST Consultants
Copyright © The RAS Solution 2014.  All rights reserved.

So you want to control HEC-RAS from a external program.  Perhaps, you have a lot of plans to run and want to run in batch mode.  Maybe you wish to run HEC-RAS, evaluate the results, make some changes, and rerun HEC-RAS-all automatically, on its own, while you’re at home with the family.  The good news is it can be done.  The bad news is there is really no documentation on how to do this. However I will be publishing a book on this topic this year, so keep checking back for more information on that.  The book, "Breaking the HEC-RAS Code" is now available here.

In the meantime, here’s a quick way to open HEC-RAS, select the plan you want to run, and then run it, all through Visual Basic for Applications in Excel.  If you have HEC-RAS, and you have Excel, you can do this. 

To begin, open Excel and enter the VBA Environment by pressing Alt-F11 or by clicking on the Visual Basic button under the DEVELOPER tab. If the DEVELOPER tab is not already present in your list of menu items, you can add it by accessing the Excel Options under the File menu item and selecting Customize Ribbon. Check the box next to the Developer tab so that it shows up on in your list of menu items. The DEVELOPER tab provides quick access to the VBA Code Editor as well as a host of other programming options and tools. The VBA editor will look like this when it’s opened for the first time.

image
Visual Basic for Applications Editor.
 
If a module doesn’t already exist, add one by clicking INSERT…Module from the Visual Basic Editor. A new module will be added and the space to the right of the window will be ready for programming code. You can change the name of the module if you like in the properties window (see figure below).

image
Visual Basic for Applications Editor with a New Module.

Before you can begin accessing the RAS Dynamic Link Library (RAS DLL), it must be added as a reference. In the Visual Basic for Applications window, select Tools…References from the menu items. A window that lists all of the available reference libraries will come up as shown in the “Add Reference” window. Look for the HEC River Analysis System reference and check the box next to it.

image
Add Reference Window.

If you don’t see a reference for HEC River Analysis System, you need to install HEC-RAS on your computer. If you have multiple versions of HEC-RAS installed on your computer, you’ll see multiple entries for HEC River Analysis System. Make sure to check the one for the version of HEC-RAS you wish to use.

Now that you’ve added the RAS DLL as a reference, you have access to it’s library of commands that can control HEC-RAS.  Click on the module (Module 1) and type the following code:

image

Now, it should open and run whatever project you have listed in cell C4 on your Excel Sheet. 
Next, you might want to explore the RC.Plan_SetCurrent() subroutine and a Do-Loop block in your code to run through multiple plans in batch mode. 

Have Fun!







Wednesday, May 7, 2014

Cross Section Points Filter

Written by Christopher Goodell, P.E., D.WRE  |  WEST Consultants

Copyright © The RAS Solution 2014.  All rights reserved.

As RAS model development is done more and more through GIS, using the HEC-GeoRAS extension, cross section point filtering is becoming a standard part of the HEC-RAS model development exercise.  It’s not too uncommon for a model created in GIS to have multiple hundreds of cross section station elevation points.  This is normally not a problem, as long as you don’t exceed 500 points (the maximum allowed for any cross section in HEC-RAS.  However, do an interpolation with bounding cross sections that have more than 255 points each, and you will have interpolated sections with more than 500 points.  Try to run that model and HEC-RAS will give you a message like this:

image

Fortunately, this is easily remedied.  Simply use the Cross Section Points Filter tool located in the Tools menu item in the Geometry schematic:

image

In this tool, you can filter a single cross section, or do multiple cross sections together.  For a single cross section, either go to the cross section indicated in the error message, or scroll through the river station dropdown box until you find one with more than 500 points.

image

Once you’ve selected your cross section(s), you have a number of different ways to filter.  Near and Colinear filtering will remove points that are either very close to another point, or that are in line with other points.  You just provide the tolerances (tell RAS how close is too close, etc.) . Once you enter the tolerance values, press the “Filter Points on Selected XS”, and check to see if you removed enough points to get below 500.  If not, you’ll have to tighten your tolerances.  This can take a little bit of trial and error as you figure out what tolerance levels will remove enough points. 

My preferred method for filtering is to use the “Minimum Area Change” method.

image

Here, all you do is enter in the desired number of cross section points you wish to have in the cross section (500 or less), and then HEC-RAS will remove points until it gets to that number.  No trial and error necessary.  BUT, you do not have control on which points are removed.  HEC-RAS uses a built-in scheme to remove points while minimizing the change in cross section area.  At first I was a bit reluctant to use this feature, thinking that it might drastically alter the shape of my cross section.  However, when comparing the original and filtered cross sections, I’ve never noticed a visual difference.  The “minimum area change” scheme that is used by HEC-RAS does a very good job at preserving the shape and hydraulic characteristics.  Give it a try next time you need to filter. 

Friday, February 28, 2014

Software to check downstream boundary conditions.

Although I don't typically use The RAS Solution to promote software other than HEC-RAS, this utility by Mr. Vladimir Moya is free and some of you may find it useful for testing the effects of different boundary conditions in steady flow, when using normal depth.  Enjoy!

http://sciengsustainability.blogspot.jp/2014/02/boundary-conditions-in-hec-ras.html

Monday, February 10, 2014

Vertical Datum Adjustments in HEC-RAS

Written by Daniela Todesco, P.E.  |  WEST Consultants

Copyright © The RAS Solution 2014.  All rights reserved.

If you have built enough HEC-RAS models, you’ve probably discovered that having data in different vertical datums is a bit of a pain. RAS lets you adjust the vertical datum of individual cross sections (under “Geometric Data”, “Cross Section”, “Options”, “Adjust Elevations”) or portions of the model (“Geometric Data”, “Tools”, “Datum Adjustment”). However, I have to confess this: datum adjustments are always a little bit puzzling to me. I need pen and paper and a little numbering conversion to make sure that I’m doing things right when moving from one vertical datum to the next. And I recently had a “eureka” moment when I finally realized that the sentence “NAVD88 is higher than NGVD29 (for most of the locations we work on)” is actually wrong. Let me step back a moment and I’ll explain why.

The two most common vertical datums used in the U.S. are the North American Vertical Datum of 1988 (NAVD88) and the National Geodetic Vertical Datum of 1929 (NGVD29). NOAA’s VERTCON program can be used to compute the conversion factors from one datum to the other.

Tidal datums are, in general, confusing. Vertical elevations can refer to NAVD88, the station datum, Mean High Water, Mean Low Water, Mean Range of Tide, and a variety of other datums. In recent years, NOAA has been updating its reference tables with excellent graphs showing how the different datums relate to each other (like the one below for Astoria, OR - http://tidesandcurrents.noaa.gov/datums.html?id=9439040 -, where all elevations presented are related to the station datum, which is the Columbia River Datum or CRD).

clip_image002

Let’s say that you download data in the Astoria station datum and you want to convert the data in NAVD88. Since the NAVD88 datum is 2.02 ft above the station datum, you need to subtract 2.02 ft from the station datum to obtain elevations in NAVD88. Or, to make it easier to remember, if the data you obtain is in datum X and you want to convert it to datum Y, you need to ADD the vertical distance between the two datums if X is ABOVE Y (or SUBTRACT if X is below Y). In our case, X is the Astoria station datum, Y is NAVD88, X is below Y, and you subtract 2.02 ft to the Astoria datum to obtain elevations in NAVD88 (the distance between the two). Makes sense, right? This also explains why for most locations on the West Coast USA, the elevation in NAVD88 of a certain location is always higher than the elevation in NGVD29 of the same location (that’s because the NGVD29 datum is actually above the NAVD88 datum). For example, in Astoria, you need to subtract 3.4 ft to elevations in NAVD88 to obtain elevations in NGVD29.

Now, to confuse things even more, gage locations along the Columbia River follow an intrinsic datum that actually changes as you move upstream from the river’s mouth. For example, at Astoria, the station datum is BELOW NGVD29, while at Vancouver, the station datum is ABOVE NGVD29 (see graph below, at http://www.thsoa.org/hy05/09_1.pdf).

clip_image004

The USGS sent us a nice graph (see below) that helped me clear things up when reading datum-related station description information. This one is for the Columbia River at Vancouver gage in WA. The short station description reads: “Datum of gage: 1.82 ft above NGVD29”. The long version reads: “Datum of gage is Columbia River Datum (add 1.82 ft to correct to NGVD29)”. Remember: X is the station datum, Y is NGVD 29, X is ABOVE Y, so you need to add the distance to go from X to Y. To add something more to this graph, I would say that in CRD, the 0 of the NGVD29 datum is 1.82 ft below the 0 of the CDR datum, which reflects the previous graph. Hope this helps!

clip_image005

Tuesday, December 24, 2013

Lateral Structure Coefficients

Written by Chris Goodell, P.E., D.WRE  |  WEST Consultants
Copyright © RASModel.com.  2013.  All rights reserved.
Lateral structures can be used in HEC-RAS to transfer flow from a river/reach to a storage area, or to another river/reach.  With the coming release of HEC-RAS with 2D capabilities (estimated beta release January/February 2014), you’ll be able to hook a river/reach to a 2-D area using a lateral structure. 
Although its primary function in HEC-RAS is to transfer flow out of one river/reach into another component (river/reach, storage area, 2D area), a lateral structure can physically represent a wide range of geometric features, including a levee, a flow diversion structure, a morning glory spillway, or even a natural ground or bathymetric profile.  Including a lateral structure in your model to represent a levee is important if the levee is ever overtopped or breached during the simulation.  Flow diversion structures can have multiple outlet features, including culverts, gates, and spillways.  These features are all available in the lateral structure editor in HEC-RAS. 
Another common use of lateral structures is to simulate flow transfer from the river to a tributary during a flood event.  This is especially convenient if you don’t want to model the tributary as an individual reach, but still want to account for it’s available storage, for a proper accounting of flood wave attenuation in the main stem river/reach.  As an example, the following figure shows a storage area representing a tributary to the main stem river.  This storage area is connected to the main stem by a lateral structure (highlighted in red). 
image
Because a lateral structure can represent a variety of different flow transferring structures (or non-structures), the hydraulics in and around the lateral structure can be quite different, depending upon the case.  Every lateral structure in HEC-RAS requires a lateral weir coefficient, and different hydraulics mean different lateral weir coefficients.  Any hydraulics textbook will have a multitude of weir coefficients for “inline” conditions, but it’s rare to find something similar for lateral flows, or diversion flows.  But it is generally agreed that lateral structure weir coefficients should be much lower than a similar inline configuration.  For example, an inline, hydraulically efficient broad-crested weir might have a weir coefficient around 3.0 (US units) or 1.7 (SI Units).  Turn that structure sideways (a lateral structure), and it will have a coefficient closer to 2.0 (US Units) or 1.1 (SI Units).  The difference is due to the energy/momentum loss associated with turning flow lines from their downstream orientation to a lateral direction out of the river/reach.    Unfortunately, there has simply not been a lot of research done on quantifying this energy/momentum loss and what that does to lateral weir coefficients.
The research that is available could be useful and might be worth checking out.  Hagar’s equation is one reference and is actually built into the HEC-RAS lateral structure editor, under Lateral Weir Embankment…Weir Computations.  It will compute an equivalent lateral weir coefficient based on an inline value (the Default Weir Coefficient) and some physical and hydraulic properties of the weir and  the adjacent river/reach. 
image
You can read more about Hagar’s equation in the HEC-RAS Hydraulic Reference Manual on page 8-17. 
Useful references for lateral structure weir coefficients (including Hager’s):
  • Hager, W.H. (1987). “Lateral Outflow over Side Weirs.” Journal of Hydraulic Engineering, ASCE, 113(4).
  • Borghei, S.M.; Malili, M.R.; Ghodsian, M. (1999). “Discharge Coefficient for Sharp-Crested Side Weir in Subcritical Flow.” Journal of Hydraulic Engineering, ASCE, October, 1999.
  • Ranga Raju, K.G.; Prasad, B.; Gupta, S.K. (1979). “Side Weir in Rectangular Channel.” Journal of Hydraulic Engineering, ASCE, 105(5).
  • Subramanya, K.; Awasthy, S.C. (1972). “Spatially Varied Flow over Side Weirs.” J. Hydr. Div., ASCE, 98(1).
  • Singh, R.; Manivannan, D.; Satyanarayana T. (1994). “Discharge Coefficient of Rectangular Side Weirs.” Journal of Irrigation and Drainage Engineering, ASCE, 120(4).
However, none of these references discuss lateral weir coefficients for lateral flow transfers over natural ground, or surface flow (i.e. non-elevation overbank terrain).  HEC has a reference table for lateral structure coefficients that I like to use-it’s also included in the new “Combined 1D and 2D Modeling with HEC-RAS” document that was released in August 2013, in anticipation of the new 2D feature in HEC-RAS expected to be released as a beta version in the January/February 2014 time frame.   Note how low the suggested range of coefficients is for “non-elevated overbank terrain.”  Because they are not dimensionless, be aware that weir coefficients in SI Units are different from US units by a factor of the square root of the ratio of the SI gravitational constant to the US gravitational constant,
image

What is being modeled with the Lateral Structure Description Range of Weir Coefficients
Levee/Roadway – 3 ft (1 meter) or higher above natural ground Broad crested weir shape, flow over Levee/road acts like weir flow US Units: 1.5 to 2.2 (2.0 default)
SI Units:  0.83 to 1.2 (1.1 default)
Levee/Roadway – 1 to 3 ft (0.3 to 1.0 meter) elevated above ground Broad crested weir shape, flow over levee/road acts like weir flow, but becomes submerged easily. US Units:  1.0 to 2.0
SI Units:  0.55 to 1.1
Natural high ground barrier – 1 to 3 ft (0.3 to 1.0 meter) high. Does not really act like a weir, but must flow over high ground to get into 2D (or storage) area. US Units: 0.5 to 1.0
SI Units: 0.28 to 0.55
Non-elevated overbank terrain. Lateral Structure not elevated above ground Overland flow escaping the main river. US Units: 0.1 to 0.5
SI Units:  0.06 to 0.28

*Hydrologic Engineering Center, August 2013.  “Combined 1D and 2D Modeling with HEC-RAS”

Although this table is presented within the context of 1-D to 2-D flow transfers, these values will work with river/reach to storage area or river/reach to river/reach flow transfers as well.  As noted in the referenced document (HEC 2013), “In general, Lateral Structure weir coefficients should be lower than typical values used for inline weirs.  Additionally, when a lateral structure (i.e. weir equation) is being used to transfer flow from the river (1D region) to the floodplain (2D Flow Area), and then [sic] the weir coefficients that are used need to be very low, or too much flow will be transferred.”  Also, “The number 1 problem people have been having with interfacing 1D river reaches with 2D areas, is user’s [sic] have been using way to [sic] high of weir coefficients for the situation being modeled.  If the lateral structure is really just an overland flow interface between the 1D river and the 2D floodplain, then weir coefficients in the range of 0.1 to 0.5 must be used to get the right flow transfer and keep the model stable.” 

The HEC 2013 document ("Combined 1D and 2D Modeling with HEC-RAS") with the Table of lateral weir coefficients can be downloaded from my Google Drive site here:  https://drive.google.com/file/d/0B_s8OLJOgOi0Nm5sdHFhSzFUYkk/edit?usp=sharing.  The lateral weir coefficient table is on page 35.