Friday, May 30, 2014

HEC-RAS Version 5.0 beta Issue with HDF5 Viewer

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

 

A few testers have discovered a dll conflict when trying to open the new 5.0 beta version of HEC-RAS.  The following message appears:

clip_image002

This happens if you’ve installed the HDF5 Viewer as described in the new “Combined 1D and 2D Modeling with HEC-RAS” document on page 115. 

HDF5 is a new file format used by HEC-RAS to store 2D output as well as some 1D output (in addition to the standard output files and dss files).  The HDF5 file contains more output information than is currently available in the HEC-RAS graphics and tables, such as velocity information for cell faces and face points.  The HDF5 Viewer is currently the only way for users to access the 2D velocity output. 

The issue is resolved by uninstalling the HDF5 Viewer.  HEC will be posting an updated install soon that corrects this problem. 

Tuesday, May 27, 2014

Tuesday Tip of the Week–Open Last Project on Startup

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



Alright, this won’t wow everyone.  It might even induce a few yawns.  But I’m surprised how few people know this option, or if they do know it, use it.  I’m talking about the HEC-RAS option to open the last project on startup.  This little nugget is found under Options…Program Setup in the main HEC-RAS window. 


image


Check this box and every time you open HEC-RAS, it will automatically open the last project you were working on.  This can save you a lot of mouse clicks, especially if your project is buried deep within your computer’s directory structure. 
One of the first things I do once I’ve installed a new version of HEC-RAS (i.e. Version 5.0 beta, which was just released Friday!) is check the “Open last project on startup” box. 

Friday, May 23, 2014

HEC-RAS 5.0 beta with 2D modeling is out!

***Note-this post was for the old 5.0 beta version.  Please get the latest version here:  http://hecrasmodel.blogspot.com/2014/10/updated-hec-ras-version-50-beta-now.html


Hey RAS Modelers-The long awaited HEC-RAS Version 5.0 with 2D Modeling is finally out in beta form!  Please read the message below from Gary Brunner that provides instructions for downloading and installing HEC-RAS 5.0 beta.   Please note that there is a required password to install, "ras4you!"  Have fun with it and please provide constructive comments/suggestions to HEC.  As you'll read below, there will be an aggressive testing period of only 4 months, so give this version a try as soon as possible and let HEC know if you run into any bugs. 


I've also uploaded the "What's New" document and the updated "Combined 1D and 2D Modeling" document to my The RAS Solution Google Drive Site:


https://drive.google.com/file/d/0B_s8OLJOgOi0OTlwbjNYSGd4SFE/edit?usp=sharing
https://drive.google.com/file/d/0B_s8OLJOgOi0Nm5sdHFhSzFUYkk/edit?usp=sharing




Chris G.




Dear HEC-RAS 5.0 Beta (with 2D) tester,




     You are receiving the this email, and a link to an updated version of "HEC-RAS 5.0.0 May 2014 Beta (with 2D Flow Areas)", because you are either a previous Beta tester, or you have expressed interest in the new 2-Dimensional modeling capabilities being added to HEC-RAS.  Here is the link to the latest version:








      This link lets you download a self extracting Archive file called "HEC-RAS_5.0_Beta_2014-05-23.exe" 




      Download the file to a separate directory and run the self extracting zip file.  The self extracting zip file contains:




            1). The installation setup package called: " HEC-RAS_5.0_Beta_2014-05-23_Setup.exe"


            2). A updated PDF version of the User's Manual called "Combine 1D and 2D Modeling with HEC-RAS.pdf"


            3). Two 2D Test Data sets in a directory called "RAS_50 Test Data"




      This installation setup package is password protected.  The password to run the setup package is: "ras4you!"






      This version of HEC-RAS has many new features.  I have enclosed a Word Document called "Whats New in HEC-RAS 50 Beta.docx", that describes most of the new features.
Here is a link to the User’s manual:






The main new features are the following:





            1.         2D Only Computations (no 1D elements) and Multiple 2D areas in the same model


            2.         Several New Ways to Link 2D Flow Areas to 1D Elements


            3.         Hydraulic Structures Inside of 2D Flow Areas


            4.         Improved Computational Speed for 2D and 1D


            5.         New HEC-RAS Mapper Features and Output Capabilities


            6.         New Computational Options for 2D and 1D


            7.         Improved Speed and Memory Usage of the 2D Pre-Processor


            8.         Additional 2D Flow Area Initial Conditions Options


     9.   New Sediment bank erosion capabilities (USDA-ARS Bank Stability and Toe Erosion Model (BSTEM))


10.       Unsteady Flow Sediment Transport Modeling (please Contact Stanford Gibson at HEC for updated Sediment documentation)




            IMPORTANT NOTE:  We have changed the file format for how we store Terrain data in HEC-RAS.  To use this version of HEC-RAS, you will need to redo the development of your Terrain model for use in RAS Mapper and 2D modeling.  You will also have to rerun your model to see mapping output.  Please See Section II of the enclosed User’s Manual for building Terrain models in HEC-RAS.  Previously we were using our own file format called the “Tiled Mapping System” (*tms).  We have switched to using the GeoTiff file format (*.tif).  The GeoTiff files are tiled, pyramided, and compressed, just like our own format was.  So it has all the same benefits of the TMS files.  However, GeoTiff is a standard file format, which you can drag and drop into ArcGIS, or other software.  So for compatibility with other industry standard software, we have changed how we make and store terrain data.  We have also switched all of our output grids to the GeoTiff format to make it easier for user’s to get the results into a GIS or other piece of software.




      I have enclosed an updated version of the User's Manual on how to use the 2D modeling capabilities within HEC-RAS 5.0 Beta ("Combine 1D and 2D Modeling with HEC-RAS.pdf".  This document has been dramatically expanded.  If you really want to learn how to use the 2D modeling capabilities in HEC-RAS, Please Read This Manual.  I have spent a lot of time working on this document, and I think anyone who currently knows how to use HEC-RAS for 1D unsteady flow modeling will be able to learn how to use the new 2D unsteady flow modeling capabilities with just the software and this document.  Please give me some feedback on this User’s manual if you find mistakes or there is information you feel is missing, or could be explained better.




            There are two example data sets that come with the self extracting zip file: “Muncie.prj” and “BaldEagleDamBrk.prj”.  The Muncie data set is a 1D river with a 2D Flow Area inside of a Levee system.  The levee system is breached and flow goes into the protected area.  The BaldEagleDamBrk data set has seven different Plans in it.  This data set has examples of all the different ways to use 2D areas.  The purpose of this data set is just to demonstrate all the different Ways 2D areas can be linked to 1D elements, as well as modified computational mesh examples, and hydraulic structures inside of a 2D Flow Area.




            Our Plan is to have approximately a four month Beta test period, then release the Final HEC-RAS 5.0 version this fall.  During this time we hope to get feedback from Users on bugs, interface issues, usability, missing features, documentation, etc…  So, we need you to test this version of the software and provide us feedback.  Please send all comments on this version to me through hec.ras@usace.army.mil.




      Thank you for testing HEC-RAS, we look forward to your comments and feedback. 






Gary W. Brunner, P.E., D.WRE, M.ASCE


Senior Technical Hydraulic Engineer


Hydrologic Engineering Center. USACE








Monday, May 19, 2014

Exploring HEC-RAS: XS Interpolation Within a Reach

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

Copyright © The RAS Solution 2014.  All rights reserved.

I’m starting a new series called “Exploring HEC-RAS”.  Each post will discuss a feature in the menu items, starting with the Tools menu item in the Geometry Schematic.  Today’s topic is “XS Interpolation Within a Reach”.

image

There are two options for interpolating cross sections in HEC-RAS:  “Within a Reach…”, let’s call this Option A, and “Between 2 XS’s…”, Option B.  First, let’s briefly review why you may need to interpolate cross sections in HEC-RAS.  Cross Sections should be selected early on in your project to adequately define changes in geometry, roughness, bed slope, and discharge.  Also, cross sections are needed to properly define the expansion and contraction zones around bridges, culverts, and inline structures.  Additional cross sections are needed in areas of rapidly varying flow and/or significant grade breaks to avoid overestimation of energy loss (http://hecrasmodel.blogspot.com/2010/01/another-reason-for-interpolated-cross.html).  There’s also that pesky warning message that seems to always pop up:    

image 

Each of these warning messages suggest that more cross sections will provide a better solution.  Finally, in unsteady flow modeling, there’s a relationship between cross section spacing, wave speed, and computational time step that minimizes errors and numerical instabilities (Courant Condition).  Interpolating cross sections is a quick and convenient way to satisfy this relationship. 

The first interpolation method, Option A, is called Interpolation “Within a Reach…”.  This is also called “blind” interpolation, because you cannot see nor control how HEC-RAS interpolates new cross sections.  They are interpolated based on the internal interpolation scheme, with no user interaction, except for entering a maximum spacing value.   This method is good for testing whether the spacing of cross sections will help produce a more numerically stable simulation.  You can choose to interpolate over an entire river/reach, or a segment of a reach, based on your selection of the Upstream River Station and Downstream River Station. 

image

Here you can see there’s a single input box for the Maximum Distance between XS’s.  RAS will then determine the number of interpolated cross sections necessary between each set of original cross sections so that the main channel reach lengths never exceed that maximum distance.  There are a couple of other options to be aware of in this window:  Cut Line GIS Coordinates allows you to control whether HEC-RAS interpolates the cut line coordinates of the original cross sections, or simply displays the interpolated cross sections as perpendicular segments along the reach centerline.  Whatever you select here will have no bearing on the computations, but will only change how the cross sections are displayed in the geometry schematic.  If you have a georeferenced project with adequate initial spacing, the first option should display the interpolated cross sections just fine.  However, if you have a very sinuous river and the original cross sections are spaced too coarsely, the interpolated cross sections may not follow the stream centerline very well, sometimes resulting in interpolated cross sections laying off center or completely away from the stream centerline (see below). 

imageimage

In this case, to better display the layout of the interpolated cross sections, select the “Generate for display as perpendicular segments…” option.  This will lay the interpolated cross sections centered on their bank stations and perpendicular to the stream centerline.

image

Notice how the interpolated cross sections now follow the stream centerline.  However, be aware that these new interpolated cross sections are NOT georeferenced.  If you will be mapping your results on inundation maps, it would be better to cut new original cross sections around the bend section of the reach and use the “Linearly Interpolate cut lines…” option. 

The dropdown box “Decimal Places in interpolated Sta/Elev” simply directs HEC-RAS to how many decimal places to carry out the station elevation points for the interpolated cross sections.  The default is 2 and is generally left alone.  One case where you may want more precision in the decimal places is with extremely shallow reaches, where the resulting bed profile may look “stair stepped” due to rounding off of the channel invert point.  Adding more precision will help to smooth this out. 

A word of warning about Interpolation Option A, “Within a Reach…”.  The interpolated cross sections under this method are generated by built-in interpolation routines, that simply linearly interpolate station elevation points based on their proportional stationing within a subsection.  You have no control over the interpolation.  As such, it is very important that before you use these interpolated cross sections for your final RAS model, you verify that they accurately describe the geometry of the reach.  If important geometric features are not captured or are improperly defined, you’ll want to get real cross sections, or interpolate using Option B, “Between 2 XS’s”.  It is advised that blind interpolation (Option A) only be used to test the numerical adequacy of the cross section spacing.  More on Option B in the next post.  Stay tuned. 

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.