Monday, October 8, 2018

Using the HEC-RAS Controller with the R programming environment


Hey all HEC-RAS Controllers-

Charlie Ferguson of the University of Cambridge recently emailed me about some questions about automating HEC-RAS using the HECRASController and the R programming environment.  While "Breaking the HEC-RAS Code" was written around use of VBA for automating HEC-RAS, there are several other programming languages out there that will work.  R is a powerful programming language for statistical computing and graphics.  I've seen it used before and it is quite impressive.  In talking with folks interested in automating HEC-RAS, besides VBA and Visual Studio, Python and R seem to be the programming languages/platforms most people are talking about.  You can read up more on R here.  


Unfortunately I don't have experience using R (yet).  So I'm opening this up to the HECRASController community out there for assistance.  The following is Mr. Ferguson's call for help and collaboration regarding automating HEC-RAS using R.  Please comment below and respond directly to Mr. Ferguson if you wish to share ideas.


The HEC RAS Controller has been used in several different environments (VBA, Matlab etc.) and I am trying to establish how to get it working in R. From what I can find online, there have already been several attempts and would really appreciate any advice or collaboration.

So far I have followed a similar process to ‘Toby’ in this post on the online HEC RAS Controller help forum. The process relies on an R package called R-DCOMClient. A slight difference in my script is to construct the variable ‘strMessages’ as an empty character matrix;
-------
strMessages<-matrix(character())
--------
which appears to satisfy the data type required by the underlying COM method (Compute_CurrentPlan).

However, I’ve then found another error stemming from R-DCOMClient requiring a related R package called ‘R-DCOMServer’. Unfortunately, as far as I’m aware, this package and its prerequisites are no longer available (also, for separate reasons, I need to use an R version no older than 3.1.).  This means I’ve hit a dead-end.

I am wondering whether anyone has found a way past this problem OR has found an entirely different solution for running controller in R?

Any advice or offers to collaborate would be welcome!

Wednesday, September 26, 2018

Participate in the Development of HEC-RAS-Spatial Precipitation and Infiltration

Here's an opportunity to have a direct impact on the development of spatial precipitation and infiltration methods in HEC-RAS.  Please read the message from Gary Brunner, Lead Developer of HEC-RAS, and if you would like to provide feedback to his questions, please do so in the comments section at the bottom of this post.  If you would rather email me your response, you can send them to Chris.Goodell@KleinschmidtGroup.com.


Image credit: ubiSafe.org


I will close the poll on October 3rd, so please have your responses in by then.  

This poll is now closed.  Thanks to all who participated.  


From Gary:
"I need some help from all of you.  We are working on adding spatial precipitation and infiltration methods into HEC-RAS for our version 5.1 release.  I need to ask the HEC-RAS users some questions in order to make better decisions as to which infiltration methods should be put into HEC-RAS.  Right now we are planning on adding three methods into HEC-RAS:

Image result for infiltration
Image credit: sumagroulx.com
  • Initial and Constant, with an option for re-instating the initial loss after a dry period
  • SCS Curve Number.  However modified to allow for the following:  User entered initial loss; separating Impervious from pervious surfaces, so curve number will only be applied to pervious surfaces; and re-instating initial loss after a dry period.
  • Green and Ampt.  During periods of no or low rainfall, the soil moisture is redistributed and the infiltration capacity is recovered."

Please answer the following questions and post in the comments section below or email to Chris.Goodell@KleinschmidtGroup.com.

1.  Do you think it is a good idea to put infiltration methods into HEC-RAS?

2.  If so, what methods would you like to see?

3.  Have you used the SCS Curve number method in any hydrologic modeling investigations?

4.  If you have used the SCS method, was it successful in calibrating the model?  Or did you need to switch to a different method?




Wednesday, August 22, 2018

HEC-RAS 2D and Sediment Dynamics Course in Portland Oregon

Please join me this October for a fantastic opportunity to learn 2D HEC-RAS and Sediment Dynamics. 


Both courses are open to all and will be hosted by River Restoration Northwest and Portland State University.   Take one or both courses!  This was very popular last year and sold out so don't wait too long to register.  Please visit the River Restoration Northwest website for more information and to register. 

Course #1:  Hydraulics Analysis using HEC-RAS 2D  (Oct 2nd to 4th, 2018)


Location: Mercy Corps, Portland, OR – Aceh Community Room, 8AM – 5PM
Instructors: Chris Goodell, Kleinschmidt & Gary Wolff, OTAK
Course fee: $825 (includes coffee, tea, and snacks. Lunch on-your-own)
Description:  This intensive 3-day workshop will instruct students on the use of HEC-RAS for two-dimensional hydraulic modeling. The course will include an overview of 2-D flow theory, RAS Mapper, and the differences between 1-D and 2-D modeling. There will be a focus on the applicability and use of 2-D modeling for river restoration design. The use of the model is taught through hands-on exercises and real-world project examples. Students should have an existing working knowledge of HEC-RAS.

Course #2:  River Sediment Dynamics (Oct 10th to 12th)

Location: Mercy Corps, Portland, OR – Aceh Community Room, 8AM – 5PM
Lead Instructor: Dr. Colin Thorne, University of Nottingham
Course fee: $825 (includes coffee, tea, and snacks. Lunch on-your-own)
Description:  This short course covers the fluvial processes responsible for erosion, transport and deposition of sediment within rivers, providing a fundamental understanding of how sediment dynamics drive channel formation, adjustment and evolution. The course focuses on how sediment dynamics can be investigated and modeled in the contexts of practical river management and restoration projects.

Wednesday, August 8, 2018

Terrain modification and direct rainfall: video walk-through

Written by Krey Price  |  Surface Water Solutions
Copyright © The RAS Solution 2018.  All rights reserved.

Terrain Modification


Two previous blog posts have addressed terrain modification in HEC-RAS (the December 2014 article entitled Including Channel Bathymetry into your Terrain and the June 2015 article entitled Lifting Terrain in HEC-RAS 5.0). These have been some of the most popular posts to date, each having generated almost 10,000 views over the years!

Interchangeably referred to as terrain interpolation, terrain lifting, terrain modification, or terrain manipulation, it is simply an export option in RAS Mapper that can be applied using any 1D geometry in your model.


We do still get a lot of questions about how to apply the technique to incorporate various structures, especially concerning the application of new features available in RAS Mapper. Can you use the terrain modification process, for example, to construct the following?
  • Buildings and building pads
  • Detention basins and ponds
  • Levees, bunds, and weirs
  • Dams, spillways, and outlet works
  • Canals and diversion drains
  • Roadways and bridge decks
  • Floodways or ford crossings
  • Channel dredging or excavation
The tool may have initially been intended for the interpolation of bathymetric cross sections, but as long as your feature can be represented with cross-sectional data, the answer is yes! This dam, for example, was constructed using a 1D HEC-RAS geometry, which was then exported as a geotif:




Rather than creating features, one of the most common uses of terrain modification is to remove features (such as a dam, levee, roadway, or bridge deck) from the terrain associated with a 2D model. This allows the feature to be modeled as a 1D element within a 2D flow area. A dam or levee in a 2D model, for example, cannot be breached unless the erodible or temporary portion of the terrain has first been removed.


Another common use of the terrain modification process is to lower the digital elevation model around a culvert. Because LiDAR data typically misses the actual invert elevation at a culvert inlet or outlet location (due to debris, vegetation, sedimentation, or inadequate resolution), and because HEC-RAS cannot accommodate the negative depths that would result from a below-ground culvert invert in a 2D Flow Area, the terrain around the inlet and outlet must typically be lowered before the plan will run. This can be done outside of HEC-RAS using GIS or 3D civil design software, or we can do it directly in HEC-RAS by exporting a geotif using a 1D geometry.
Here are the basic steps for modifying terrain in HEC-RAS, with RAS Mapper steps shown in red and Geometry Editor/Plan steps shown in blue: [Scroll down to the links below if you'd prefer to follow along with a video rather than following written instructions.]


  1. Create a new geometry in RAS Mapper (right-click on Geometry, select :Add New Geometry")
  2. Expand Rivers and start editing (right-click on Rivers, select "Edit Geometry")
  3. Delineate the centerline of the structure or feature you wish to incorporate
  4. Start editing Bank Lines by toggling on the layer and clicking on the layer name to make it active (magenta)
  5. Without crossing over any lines, delineate the bank lines on both sides of the centerline to cover the extents of your desired terrain modification (Note: you can omit this step, in which case HEC-RAS will automatically assign bank stations following the ends of the cross sections)
  6. Start editing Cross Sections by toggling on the layer and clicking on the layer name so that it appears in magenta
  7. Delineate at least two cross sections (cross all three of the lines once and only once with each section, delineating from left to right in the "downstream" direction)
  8. Right click on the geometry, select "Stop Editing" and save edits
  9. Close RAS Mapper
  10. Open Geometry Editor, select "File | Open", and browse to the newly created geometry file
  11. Select one of the cross section and choose "Edit Cross Section"
  12. Edit station-elevation points between bank lines manually or graphically (using icon or "Tools | Graphical Cross Section Editor")
  13. Repeat for each cross section that requires changes, save edits and close geometry editor
  14. Open RAS Mapper, right-click on geometry name and select "Export | Create terrain geotif from XS's (channel only)"
  15. Enter resolution (this does not need to be the same resolution as your LiDAR unless you're trying to get rid of no-data values, in which case it helps to have the resolutions match) and click ok
  16. Right-click on terrains and select "Create New RAS Terrain"
  17. Add the original and new terrains, adjusting the order to ensure the overriding terrain is on top (unless you're trying to get rid of no-data values, in which case the "underriding" terrain goes to the bottom)
  18. Rename hdf file with a descriptive name using the folder icon and select "Create"
  19. Right-click on the geometry that you wish to use with this terrain, select "Manage Terrain Associations" and use the drop-down menu to select the newly merged terrain file
  20. If you want to compare results with and without the change, save a new plan and geometry(keeping the original plan's geometry associated with the unedited terrain), and re-run the new plan
With those steps complete, you can compare the results with and without the changes. If you are working on an impact assessment, for example, you can then make further adjustments to your mitigating features (such as the size of a detention basin) to compensate for the impacts of development as required.


In the steps above, we could have exported a geotif for the entire cross section extent (in which case you wouldn't need to create bank lines) but my preference is to use the "channel only" option with bank lines as it gives you more control over what portion of the terrain will get adjusted between cross sections.


Also keep in mind that the 1D terrain modification geometry can be a complete, "runnable" 1D geometry, or it can exist solely for refinement of the digital elevation model (as highlighted below, it can essentially be an orphan file that is not associated with any flow or plan files).










Video Walk-through


Following are some instructional videos that step you through the process of modifying terrain in HEC-RAS:
  • Part 1 covers the addition of bathymetry
https://youtu.be/QyrOhkJZPhI


  • Part 2 covers the removal of no-data values
https://youtu.be/OzZQKBbaC2A


  • Part 3 covers the incorporation of dams, levees, buildings, etc. into the terrain
https://youtu.be/x4jWLjMx8zQ






[And just for fun, if you want to see some results where we've used terrain modification to sever Denmark from mainland Europe by slicing a big canal from the North Sea to the Baltic Sea (while also answering the question of how big a tsunami would be needed to be to reach the Alps!) have a look at the results here.]
http://www.surfacewater.biz/terrain/










Direct Rainfall


On to our next topic of the day: Continuing improvements to hardware, software, and meteorological data availability are allowing the increased application of direct precipitation or rain-on-grid modeling around the world, blurring the lines between hydrological and hydraulic software applications.


Adding direct rainfall to your 2D Area is quite a simple process in HEC-RAS. Here is a demonstration of a very basic rain-on-grid model setup:


https://youtu.be/c2rL8zvLvuE

Getting meaningful results out of a rain-on-grid model, however, can be a bit more tedious. Here are a few considerations to keep in mind:
  • Rain-on-grid models typically take a very long time to run, because every cell in your 2D Flow Area gets wet (as opposed to inflow-based flood models that can have many dry cells)
  • Simulation time windows can be very long, since they need to capture the entire time of concentration for the catchment or watershed
  • The steepness of the hill slopes within the watershed or catchment can sometimes exceed maximum limitations for 1D and 2D models (as covered in the discussion associated with this blog post about boundary conditions
  • Roughness values in sheet flow areas with shallow depths can vary significantly from typical values
  • Infiltration and other losses must be removed from rainfall depths (entered as rainfall excess only) before being applied in HEC-RAS
Additional Considerations


If you try to combine terrain modification with direct rainfall, there are some further considerations to be aware of. If you have used terrain modification to incorporate a building or bridge face with vertical walls, for instance, the rain falling on the flat surface would then need to flow over a vertical surface to transfer to the ground. This obviously exceeds HEC-RAS slope thresholds, and the velocities associated with a vertical drop will be erroneous. The presence of vertical faces in rain-on-grid models can give substantial errors, so it may not be suitable for these settings. (You could alternatively represent the buildings as polygons with really, really high roughness values).


That said, direct precipitation modeling is becoming increasingly common, and with proper calibration, the catchment response can be modeled in much more detail than in a typical rainfall-runoff model.


Free rain-on-grid webinar


So what are the latest rain-on-grid developments in HEC-RAS?




Coming up on August 14 (15th in Asia and Europe) ICE WaRM will be hosting a free webinar covering the use of direct rainfall in HEC-RAS. Registration links to the webinar along with recordings of previous webinars can be accessed here. The webinar will address the following topics:




* Basic demonstration and animation of a rain-on-grid model setup and results
* Discussion of rain-on-grid principles and how it is conceptually different from regular flood modeling (including considerations for roughness, tolerances, sheet flow paths, etc.)
* Introduction of what is under development with HEC-RAS Version 5.1 to improve rainfall-runoff modeling capabilities (including infiltration, spatially varying precipitation, depth-varying roughness, etc.)
* Where the industry is heading with the use of hydraulic models as rainfall-runoff models, including the application of radar-based gridded rainfall data.
Thanks for tuning in and be sure to let us know how you're using HEC-RAS and if there are suggestions for future blog topics!

For anyone interest who didn't get a chance to catch it live, the rain-on-grid webinar recording is now available here: https://youtu.be/mi-x52-0Id4





















Thursday, July 19, 2018

EuroRAS 2018: Upcoming courses in Munich and Paris + new HEC-RAS developments across Europe


Written by Krey Price  |  Surface Water Solutions
Copyright © The RAS Solution 2018.  All rights reserved.


With European teams having dominated the final rounds of this year's World Cup, and with the World Cup having dominated European headlines for the last few months, we thought it would be a good time to highlight some of the recent HEC-RAS developments across Europe!

HEC-RAS authors and developers Gary Brunner and Cameron Ackerman have just returned from a whirlwind trip to Europe, where they taught a well-attended London course hosted by JBA for the third straight year. In addition to the singular opportunity to interact directly with the developers themselves, attendees were treated to poster presentations about recent international HEC-RAS projects along with the chance to cheer on their favorite World Cup teams from the nearby pubs in the evenings! Read more details about the course and register your interest for next year’s London training with the links in this article by JBA’s Frank O’Connell.
HEC's Gary Brunner and Cameron Ackerman conducting HEC-RAS training in London


As for any other European HEC-RAS fans who missed out on the training, don’t fret – there are still some additional opportunities to catch up with courses across Europe this year:

  • The Technical University of Munich will be the venue for the first German HEC-RAS course, which (entirely by coincidence) happens to coincide with Oktoberfest...where the Germans may still be drinking away their sorrows after their early elimination in the group stage! Register your interest for the 24-25 September 2018 Munich course here.

  • The first HEC-RAS 5 course in France (at least as far as we’re aware) will also be held in September at G2C Ingénierie in Paris...where the World Cup victory celebrations may well still be going on! Registration details for the 27-28 Paris course can be found here.




Both courses will be taught in English to facilitate international attendees and will highlight all of the latest additions to HEC-RAS, so why not pack your bags for a European Vacation and get your certified PDH hours to boot!

In other news across Europe, HEC-RAS is still getting lots of use in Italy following Chris Goodell’s 2015 course which attracted over 40 attendees and was hosted by Antonio Cotroneo. Chris has just returned from some HEC-RAS consulting work in Portugal and he gave a presentation "Adventures in HEC-RAS Modeling" to his Alma Mater IHE-Delft in The Netherlands.  Chris and Antonio are planning a follow-up to the Italian course in Milan next year; stay tuned for further details!


We do expect to see increasing use of HEC-RAS across Europe going forward, especially now that Flood Modeller, which was originally developed in the U.K. and is very commonly used across Europe, has been updated to allow cloud computing for HEC-RAS. Watch the free webinar by Jon Wicks here to find out more on the topic.



In another European connection, the U.K. Environment Agency benchmarking tests have become standard protocol for comparing results and capabilities of a range of 2D modeling packages, including the most commonly used European models; although the original studies were conducted before HEC-RAS had 2D capabilities, HEC-RAS has now been tested against all of the applicable European benchmarking models. As shown in Gary Brunner’s HEC-RAS Benchmarking report, HEC-RAS provides consistent results on par with the other tested models and is now receiving increasing recognition across Europe for its speed and accuracy.
We've also been very excited to hear about the growing use of HEC-RAS on major European projects. The hydraulic modeling team at the Sarajevo-based HEIS group, for example, is currently using HEC-RAS 1D and 2D to undertake floodplain modelling of nearly 5,000 km of river length in areas identified as being under high flood risk in Bosnia and Herzogovinia. I was thrilled to spend a few days in Sarajevo helping to kick off the project earlier this month, and I look forward to further developments.
The modeling team at the Hydro-Engineering Institute Sarajevo

If you are aware of other major projects across Europe or elsewhere around the globe that have been using HEC-RAS, we'd love to hear about them and to feature the findings and lessons learned here on the blog.  

In the meantime, we hope to see you in Europe in September!

[And on behalf of the International Community of Freeloaders, I’d like to personally express my thanks to the U.S. taxpayers who - despite a few shortcomings on the world soccer scene - continue to fund HEC-RAS as a great modeling tool!  J Given the pace of recent advances, I can only imagine what HEC-RAS will be capable of in a few short years - and who knows, maybe we can at least hope for a U.S. showing in Qatar 2022 as well! ]






Tuesday, July 17, 2018

HEC-RAS Primer for New Users


Written by Chris Goodell  |  Kleinschmidt Associates
Copyright © The RAS Solution 2018.  All rights reserved

Are you a new HEC-RAS user?  Or maybe you've used HEC-RAS before, but it's been a while.  Maybe you have no idea where to start.  Steady or Unsteady?  1D or 2D?  Subcritical or Supercritical?

OK, for all you Newbies out there, I'm going to walk you through some steps to take to get you up and running with your first HEC-RAS model.  
1.    Take a HEC-RAS Training Course.  There is no better and faster way to get the knowledge you need to start right in on a HEC-RAS model than to attend an in-person HEC-RAS training course. 
 

If you are brand new, start with a Basic 1D Steady Flow HEC-RAS Course.  There are several of these types of courses out there.  Some may be close to where you live, but be prepared to have to travel-and spend some money.  You can Google “HEC-RAS Training” and find a bunch of options.  Here are a few regular offerings that I can recommend:
·         ASCE Continuing Education.   Typically only available in the US, and expensive.  But the quality is top notch.  Click the link to see where classes are currently scheduled. 
·         National Highway Institute.  Only available in the US.  Courses are not always offered, and when they are you’ll have to get on a waiting list, unless you work for the Federal Highway Administration
·         Hydrologic Engineering Center.  Expensive and priority given to U.S. Government Employees.  Non-government employees can sign up, but only if space is available.  Also, courses are held in Davis, California.  But hey, these are the folks that develop the software, so if you can get in, take it!
You may also hear from time to time about a HEC-RAS course hosted by a local professional organization or government agency.  Keep your eyes and ears open for these.  One option near me is River Restoration Northwest, which hosts HEC-RAS classes in the Northwest USA every couple of years. 
Aside from pre-scheduled courses, you can always bring an instructor to you.  This only pencils out if you have multiple folks that you need to train.  Usually 6 to 10 and the price per student drops below the pre-scheduled courses.  I am able to provide this training as can my friend and colleague Krey Price, who is located in Western Australia.  WEST Consultants is also able to provide custom course training. 
2.    Read the HEC-RAS Manuals.  Please please please read through the HEC-RAS manuals before you try to do any HEC-RAS modeling.  Don’t take my polite use of the word “please” three times as a suggestion.  Think of it as the First Commandment of HEC-RAS Modeling.  I guarantee that if you adopt the strategy of “When all else fails, read the manual”, you will end up wasting a lot of your time. 
At the very least read through the HEC-RAS User’s Manual.   All of the HEC-RAS manuals are very well written, easy to follow, and packed with information.  They come with the installation of HEC-RAS, but if you don’t have them, you can get them from the HEC website.  HEC offers the following manuals for HEC-RAS:
·         User’s Manual.  Start here.  At the very least, read through this manual before any HEC-RAS modeling.
·         Hydraulic Reference Manual.  As the name implies, a good reference resource.  This is where I go to learn about the “guts” of HEC-RAS…the theory behind it.  And to see what’s happening under the hood.  You do not need to read this cover to cover to get a HEC-RAS model running, but it’s good to check in for certain features in HEC-RAS that you’d like to know more about-specifically the theory and computational schemes behind the feature. 
·         Applications Guide.  A fantastic collection of example data sets with instructions on how to set them up. 
·         Two-Dimensional Modeling User’s Manual.  Definitely read this if you plan on doing any 2D modeling. 
·         5.0 Supplemental User’s Manual.  Good to read if you want to learn about the new features in Version 5.0.  Especially give this a read if you wish to take advantage of the new RAS Mapper preprocessing editing tools. 
·         BSTEM Technical Reference & User’s Manual.  If you don’t know what BSTEM is, there is no need for you to read this manual.
3.    Example Projects and Applications Guide.  When you download HEC-RAS, you not only get the software, but you get all of the manuals listed above, plus some other useful documentation.  You also have the option to download a larger install package that contains the Example Data Sets.  DO THIS!!!  These example data sets are invaluable.  As you can see in the figure below, the example projects are organized into 5 folders after you download them and unzip them to your computer.  Notice the fourth folder called “Applications Guide”.  These are all of the HEC-RAS projects documented in the Applications Guide manual.  If you want to do some self-training, there is no better way than to go through each of these Application Guide Examples one by one.  In fact, I highly recommend going through at least a handful of them before taking a training course.
The Applications Guide is designed to provide example projects for you to work through alongside instructions for a wide variety of HEC-RAS applications.  In fact, the manual has examples that cover just about every kind of geometric element you may want to use, including bridges, culverts, dams, lateral structures, storage areas, junctions, etc.  Unfortunately, the current Applications Guide does not have any 2D examples, but there are 2D examples in the HEC-RAS Example Data Sets. 

4.     Online Resources.  Since you’re reading this, you’ve already found The RAS Solution, the best online resource for all things HEC-RAS.  With over 200 posts about HEC-RAS, you are bound to find the information you are looking for (for example…this post 😊).  There is a search bar near the top of The RAS Solution, where you can enter in some key words to help you find articles on topics you are interested in.  The RAS Solution also has a very widely used forum, where you can ask questions, but also give back to the HEC-RAS community by posting answers.
There are a number of social media sites out there dedicated to HEC-RAS.  These are great ways to not only get the latest information about HEC-RAS (e.g. upcoming courses, new version releases), but also to post questions about HEC-RAS.
https://www.facebook.com/TheRASSolution.  This is the Facebook site for The RAS Solution.  When a new post goes up on The RAS Solution, a link to it goes on this site. 

https://www.facebook.com/groups/90473474105/.  This is an all-purpose HEC-RAS User’s site on Facebook.  With nearly 2000 members, there is a lot of interaction on this site.  Great place to pose questions and get answers. 
https://www.facebook.com/groups/571614272961250/.  For my HEC-RAS friends from Italy, this is an Italian language HEC-RAS help site run by my friend and colleague Antonio Cotroneo. 
https://www.facebook.com/groups/906806026048714/.  This is a Brazilian HEC-RAS site that generally caters to our Portuguese-speaking friends.  This site is administered by my friend and colleague Pedro Sydorak.
https://www.linkedin.com/groups/7065494.  This is the LinkedIn site for The RAS Solution.  When a new post goes up on The RAS Solution, a link to it goes on this site. 
https://www.linkedin.com/groups/1908568.  This LinkedIn site has over 5000 members.  A lot of great RAS modelers participate on this site.  Unfortunately the administrator of this site doesn’t participate and so it tends to get a lot of spam and advertisements, and the “About” section is about 10 years out of date.  Still, there are some pretty good discussions on here with lots of participation.   
https://twitter.com/RASModel.  This is my twitter feed.  I post links to all of The RAS Solution posts up here as well as other useful HEC-RAS information.  I also occasionally post about some of my favorite sports teams.