Thursday, May 23, 2019

HEC-RAS Pub and Grub in Portland-Save the Date!


For those of you who will be in the Portland Oregon area, I invite you to join me for this special event Kleinschmidt is hosting at the Lucky Lab on Hawthorne.  Krey Price will be in town from Australia and we along with Sean Welch of BPA will be giving fun and engaging presentations on HEC-RAS.  This will be an informal, casual gathering with lots of time for Q&A.  Hope to see you there!  No RSVP needed.  Just show up, get a pint, and grab a chair.  



Wednesday, April 24, 2019

Those Nuisance Cell Errors and Wedge Depressions


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

If you've been doing some 2D modeling, you most likely have run into what I call nuisance cell errors.  You see them while your model is running and they can really slow down your simulation as the RAS chugs through iterations to try to come to a solution.

The errors here are in the second to last column and are in units of feet.  So as you can see, they are quite small, and normally I wouldn't be too concerned with them.  However, if the errors persist, they can really slow down your simulation time.  Sometimes adding several hours to the overall time, in my experience.  So while the errors are small, there is a need to get rid of them, at least the ones that persist for many timesteps.  

A common cause of nuisance cell errors is what I call "wedge depressions".  In the following figure, notice the wedge of water that sits below a well defined ridge line.  The red arrow points to it.  


As you can see by the blue hydraulic connectivity lines that there is hydraulic connectivity between Cell 1 and Cell 2.  But water fills up cells from the lowest spot, and in Cell 2, this is below the ridge.  So you get a narrow wedge of water (wedge depression) that builds up causing some local fragmentation and a resulting error.  Notice the water just abruptly stops at the cell face between Cell 1 and Cell 2.  Wedge depression doesn't always cause an error (by error, I mean RAS cannot converge on a solution within the error tolerance in 20 iteration tries).  But it did in Cell 2.  Notice Cell 4 has the same wedge depression, but it was not producing errors in this simulation (ahhh, the mysteries of HEC-RAS!).  

Fortunately, the fix for this is easy.  You draw a breakline along the ridge line so that a cell face resides on the ridge line itself.  This removes the low spot (and thus the wedge depression) in Cell 2.  the next figure shows the placement of the breakline (but before enforcement).  In this case, to preserve the spacing of the cells on the north side of the line, I specified a cell center spacing of 55 feet on the breakline (actually, I started with 40 feet, then 50 feet, but these produced the dreaded "red dots".  55 feet worked.)


After a bit more tweaking of the breakline alignment, here is the result with the breakline enforced and the wedge depression eliminated.  Notice without the wedge depression, flow is able to move more naturally towards the upper left from what used to be Cell 1.  Oh yeah...and no more nuisance cell errors!  


Yes...there's still some more fragmentation that could be addressed, but this is early on in the simulation and my objective is to ultimately present the max ws maps.  So my concern at this point in the simulation is to have decent results with fast simulation times.  I'm not concerned with little bits of fragmentation that don't throw errors.  

Monday, March 25, 2019

HEC-RAS 1D-2D Course in Atlanta, Georgia

RAS Modelers-

This class is filling up fast!  Don't wait to register!  


Please come join me in Atlanta for a 3-day informative, workshop-oriented course in Atlanta Georgia this May 7-9.  This will be a great opportunity to learn everything you need to know to get started with combined 1D-2D HEC-RAS Modeling.  Please visit here for more information and to register:





Tuesday, March 19, 2019

HEC-RAS Version 5.0.7 is now available!

Fellow RAS Users:  Please take note that a new version of HEC-RAS, Version 5.0.7, is now available to download.  This is purely a bug fix release, so there are no new (advertised) features.  You may download the new version here:





Please read the following announcement from Gary Brunner and the list of bug fixes described below.
  
             "We have released a new version of HEC-RAS called version 5.0.7 today.  This version is a bug fix only version (i.e. No new features).  Unfortunately there were some bugs in version 5.0.6 that were significant enough to warrant a new release of the software.  Enclosed are the HEC-RAS 5.0.7 release notes describing the bugs that were fixed.

                We are sorry for any inconvenience this may have caused you while using HEC-RAS.  We hope you enjoy the new version of the software.  As always, please keep us informed on any bugs you find, or your ideas for new features.  Here is the link to the HEC-RAS 5.0.7 download area of our webpage:


Warning:  A few new software checks have been added for Lateral Structures and SA/2D Hydraulic Connections.  When you run version 5.0.7 of HEC-RAS these data checks may stop your data set from running, until you address the issues listed in the error messages."


The following is a list of bugs that were found in HEC-RAS Version 5.0.6 and fixed for Version 5.0.7:

Monday, February 25, 2019

Georeferencing hard copy or pdf maps

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

Using RAS Mapper as a GIS tool Part 3:
Georeferencing hard copy or pdf maps





Have you ever received your background data in hard copy or pdf format and wanted to view it in its georeferenced location? For this final topic in our three-part series on using RAS Mapper as a GIS tool, we'll cover the steps required to georeference a map using world files. [For additional background see the previous posts Part 1: Terrain modification and Part 2: Web imagery with world files.] 








Before you begin any georeferencing process, always check that you are using the correct projection (and confirm the desired projection with the client or end user of the data.) If you don't know which projection to use, you may need to check with the provider of your LiDAR data or other geospatial data. If your terrain file has been provided in geotif format, another option is to add the terrain file to RAS Mapper without assigning a projection, then double click on the name of the terrain, select the "Source Files" tab, and click on the "Info" button to view the GDAL metadata. The projection should show up under the "PROJCS" tag:


If you don't have the relevant projection file available, most projections (with the exception of local project grids) are available online for free download. Projections are typically catalogued according to European Petroleum Survey Group (EPSG) codes maintained by the International Association of Oil and Gas Producers. [When you think about it, it makes sense that the oil and gas industry would have a substantial interest in pinpointing global locations for exploratory wells and other critical geospatial data!]
Online repositories for projection files such as spatialreference.org include the EPSG code with each spatial reference system:


http://www.spatialreference.org


Projection files can also be copied from the prj file associated with any shape file that matches the target coordinate system. In any case, once I've got the correct prj files, I like to place it in a separate subfolder named "projection" that I create under my project directory, and then assign it a file name such as "GDA 94 MGA Zone 55 Projection.prj" that clearly distinguishes it is a projection file (as opposed to a HEC-RAS project prj file!) I also like to make sure that the projection folder includes only a single prj file so that anyone who picks up the project in the future knows the intended projection. [RAS Mapper sometimes loses the spatial reference system association and that can avoid confusion when it is re-assigned.]
Once you've confirmed that you are using the correct projection (typically by turning on web imagery and checking that it lines up with your terrain, shape files, or other geospatial data for your project) you can georeference any hard copy, scans, image files, or pdf files within the specified projection.
The georeferencing steps are covered on our new YouTube channel in this video walk-through beginning at 6:37:

https://youtu.be/5REWQ8Z_08I
Here are the steps covered in the video: 


1. For hard copies, scan your image to a raster format (commonly jpg or tif). For pdf files, use "save as" in Adobe Acrobat and select jpg (resolution can be adjusted under settings). For other file types, you may wish to use the Snipping tool that ships with Windows and save the screenshot as a jpg (best if it's on a high-resolution screen as you'll be stuck with the screen resolution and not the original source file's resolution).
2. Create a new file in Word, Notepad, Wordpad, or other text editor or word processor (or copy an existing world file and skip to Step #5).
3. Enter six lines of numerical text. Use dummy values from "original world file" column in the World File Calculator spreadsheet (available for free downloaded here) or take an initial guess at values based on the assumed coordinates of the upper left pixel.
4. Save file as plain text format (*.txt) using the same file name as the image file (select "default settings" if prompted).
5. Change file extension in Windows Explorer to *.tfw, *.jgw, *.bpw, etc. as appropriate to match your image file format (click yes if prompted with unusable file warning).




6. Under Map Layers in RAS Mapper, right-click and select "Add Existing Layer". Be sure to drag down file types to show all image files. Browse to file and select OK.
7. Using the measure tool in RAS Mapper, measure the distance between two points that are a known distance apart (preferably from a scale bar or coordinate tick marks on the map).
8. Open the World File Calculator spreadsheet (or create your own - there's really not that much to it!) and enter the measured and actual distances under Line #1 (cells D3 and E3) and again in Line #4 (cells D6 and E6).
9. Copy values from "New World File" column, open the world file in a text editor, and paste the updated values over the old values.
10. Right click on the image file and select "remove layer".
11. Re-add the image file and adjust transparency as needed.
12. Using the measure tool in RAS Mapper, click on a known point from the original image (with incorrect location), then double-click on the same known point based on the correct location.
13. Select "Copy coordinates to clipboard".
14. Paste the coordinates into Cell C10 in the spreadsheet (Note: values will be replaced in the cell range C10:F12 but only C10:D11 are used in the spreadsheet).
15. Copy "New World File" column over the previous values in the world file.
15. Remove and re-add the image file under map layers in RAS Mapper.
16. Adjust transparency as needed to confirm common points are now co-located. Measure the scale bar to confirm correct scaling.






Hopefully the first try will get you close enough for your purposes, but the process can be repeated to fine-tune the results as needed. You can also use these steps to convert geospatial data to or from a local project grid for which projection details are unavailable.


Keep in mind that these adjustments only provide a visual approximation and should be treated cautiously if the results are to be used for permitting or construction purposes. In that case, you'd want to get a surveyor on board with the proper tools to apply all of the required warping factors and address any other discrepancies. 




The full set of parameters in a projection file can get quite complex; projecting a curved surface to a flat plane comes with mathematical difficulties that have plagued mapmakers for centuries. Here's a great video explaining why all world maps are wrong.


www.surfacewater.biz/projection/




With these difficulties in mind, it is no surprise that even if you get two points to line up perfectly, a third point can still be shifted, particularly for points located a significant distance away from the alignment points. For manual georeferencing, I suggest using alignment points that are as far apart as possible for your selected zoom extent to avoid major discrepancies.
Note on rotation factors: The above steps assume that north is straight up in your hard copy or pdf map based on the applied projection (or at least close enough to straight up to suit your purposes). If not, rotation terms can be added to the world file, but in my experience this can lead to some confusion, as the pixels shift on the fly at different zoom levels.




Although rotation terms can be added to the world file by measuring the angular difference between lines drawn between two known points, my preference is to make rotation adjustments graphically before diving into any world file adjustments. Raster images can be rotated in a number of programs (Photoshop, Paintshop, Word, PowerPoint, etc.) to achieve a proper north alignment. [The "Z axis rotation" can be used in Microsoft products to apply specific sub-degree rotation factors.] The rotation terms can then remain as zero values in the world file.
We hope you have found this useful for your work. Please let us know if you have any comments or suggestions for improving these processes! Thanks for tuning in, and as always, let us know your recommendations for upcoming blog topics.



Collecting ideas for future posts: One subject we are working on for a future post is hacks for removing flow from HEC-RAS models. Internal boundary conditions are very useful for adding flow anywhere in your model, but removing flow can be a tedious process requiring a bit of creativity. Some new features coming in Version 5.1 may simplify the process, but in the meantime I've seen some clever workarounds being applied that we would like to share with this forum; please contact me if you have done this successfully so we can perhaps feature your method in an upcoming blog post.




And speaking of Version 5.1, right at the top of my wish list for HEC-RAS updates is for project files to be called *.ras files, *.hrp (HEC-RAS Project) files or any unique extension that doesn't happen to coincide with thousands of other files on my computer (in this case, of course the ESRI-format *.prj projection files). I understand the Corps may have been first in this case (calling their project files prj's well before ESRI did) but the rest of the geospatial industry is not about to change their format, so maybe HEC-RAS project files can get a unique identity in the next version - or at least a search tool within RAS that can recognize and distinguish HEC-RAS-format project files. Let us know if you agree and maybe we can turn this into a grass roots, crowd-based request!






Friday, February 15, 2019

HEC-RAS 1D-2D Course in Atlanta

Hey RAS Users-

This is a "Save the Date" notice for an upcoming 1D-2D HEC-RAS 3-day training course I'll be giving in Atlanta on May 7-9, 2019.  We'll be covering everything from setting up a 2D model, a 1D-2D combined model, RAS Mapper pre- and post-processing, viewing output, river restoration, to dam/levee breaching.  The class will consist of a mix of informative lectures focusing on practical aspects of 1D-2D HEC-RAS modeling and interactive exercises.


Come join me for a great opportunity to learn the tricks of 1D-2D modeling in HEC-RAS and to network with fellow HEC-RAS Users.

If you are interested, please follow the following link and express your interest.  We will send more details, including the venue and registration instructions as soon as they are available.






Chris Goodell
Kleinschmidt Associates
The RAS Solution



Monday, January 21, 2019

Shifting web imagery with world files for HEC-RAS


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

Using RAS Mapper as a GIS tool Part 2:
Shifting Web Imagery with World Files



Have you ever tried pulling web imagery into RAS Mapper only to find that it doesn't line up with your existing shape files, terrain surfaces, or other geospatial data?  In this second of a three-part series on using RAS Mapper as a GIS tool we'll cover the modification of world files for georeferencing.

Photo by Franck V. on Unsplash

In some cases, the misalignment of web imagery may result from an incorrectly applied projection file. If needed, projection files can be downloaded for free from spatialreference.org and other online data sources. You can check the projection of your terrain file by double-clicking on it in RAS Mapper, then select the "Source Files" tab and view the metadata using the Info column. 



If you have confirmed that the correct projection file is being used and you are still having issues, there are a few additional workarounds you may wish to try. One option is to select the "Alternate HEC-RAS Raster Warping Method" under "Tools | Options" in RAS Mapper. This method applies the gDAL OGR vector reprojection. I have found this method useful for resolving discrepancies in European data sets in particular.





In some cases, the alternate method doesn't do the trick either. RAS Mapper uses the ESRI projection file format, which as I understand it does not recognize TOWGS84 parameters and in some cases improperly applies the proj.4 projection parameters. In any case, you may find yourself stuck with misaligned web imagery.


One workaround is to save static images of your web imagery and then shift the image to the correct location by making adjustments to the world file (Wikipedia has a good summary of the six lines of code comprising a world file here).


Here's a video walk-through of the process:


https://youtu.be/5REWQ8Z_08I


The "World File Calculator" spreadsheet referenced in the video can be downloaded here:


http://www.surfacewater.biz/wp-content/uploads/2018/12/Surface-Water-Solutions-World-File-Calculator.xlsx


Here are the steps covered in the video:


1. Adjust transparency as needed so that you can see a known point in both the web imagery and in the survey or LiDAR data.
2. Using the measure tool in RAS Mapper, click on a known point from the web imagery (with incorrect location), then double-click on the the same known point based on the correct location.
3. Select "Copy coordinates to clipboard".
4. Zoom to preferred extents for results and save view (click here for further details on saved views and static imagery).
5. Right-click on web imagery and select "export layer". Note: RAS Mapper currently has two export options: tif and jpg. The tif format will embed the metadata and georeferencing information into the encoded text of a geotif file without generating a separate world file. A tfw file can still be created to override the embedded georeferencing, but I suggest using the jpg format so that the world file is automatically generated. Save the image (I suggest creating an "aerial imagery" subfolder within the current project's directory structure to store static images).
6. Open the world file calculator spreadsheet.
7. Paste the coordinates from RAS Mapper into the blue cell.
8. Open the newly created jgw file (jpg format world file) in a text editor and copy the values.
9. Paste the values into the "Original World File" column of the spreadsheet.
10. Copy the "New World File" values over the original values in the jgw file, save, and close.  
11. Under Map Layers in RAS Mapper, right-click and select "Add Existing Layer". Be sure to drag down file types to show all image files and browse to the newly created file.
12. Adjust transparency as needed to confirm common points are now co-located.

The process can be repeated to fine-tune the positioning. Because a static image won't be pyramided like web imagery, you will unfortunately need to complete these steps at every desired zoom level and view extent, the but the process of saving static images allows you to control the appearance of your figures without having to worry about losing your internet connection while presenting or viewing results.


Note that these steps assume the units and north alignment are the same (or close enough) between the data sets and that the static image can be simply shifted without scaling or rotation factors, which we'll cover in more detail in our next post.
Please let us know any feedback or suggestions for improvements or additional efficiencies in adjusting web imagery.


Wednesday, January 16, 2019

Bug Report for HEC-RAS 5.0.6

RAS Users:  Please give this "Known Issues" report a read if you're using Version 5.0.6.  If you've been doing a lot of 2D modeling, it's likely you have been affected by some of these.



This link includes a document of "Known Issues" found in version 5.0.6 of HEC-RAS to date.  The
document outlines all of the Issues (bugs) we have found so far.


Please look closely at this document, as there as a few issues that are potential computational problems.  Specifically issues 1, 2, 5, and 7.  Please review these issues closely.  If you have any of these situations use the suggested work around, or solution to get past the issue.  Everyone should look at issue 1 and 2, as they are possible in many models.

Sorry for any inconvenience this may cause you.  Keep letting us know if you find other problems with the software.


Gary W. Brunner, P.E., D. WRE, M. ASCE
Senior Technical Hydraulic Engineer
Hydrologic Engineering Center, USACE

Friday, January 11, 2019

Preview of the new Finite-Volume Approach for 1D Reaches

One of the most anticipated new features soon to come in the next major version of HEC-RAS (Version 5.1) is the option of running unsteady 1D reaches with a finite volume solution scheme.  This will be a fantastic addition to HEC-RAS.  Gary Brunner recently gave me a brief overview of the new finite volume feature we can expect.  But before you ask, there is no set release date for Version 5.1 yet.  But I'm hoping we'll see it within the next year or two.





1D Finite Volume Solution Algorithm

By Gary W. Brunner, P.E., D.WRE
Senior Technical Hydraulic Engineer
Hydrologic Engineering Center

A brand new solution algorithm has been developed for 1D modeling.  A Finite-Volume solution approach, similar to what was added for 2D modeling will be available for 1D modeling in HEC-RAS version 5.1.

The current 1D Finite Difference solution scheme has the following deficiencies:
  1. Cannot handle starting or going dry in a cross section
  2. Low flow model stability issues with irregular cross section data
  3. Extremely rapidly rising hydrographs can be difficult to get stable
  4. Mixed flow regime (i.e. flow transitions) approach is approximate
  5. Stream junctions do not transfer momentum

The new 1D Finite Volume approach has the following positive attributes:
  1. Can start with cross sections completely dry, or they can go dry during a simulation (wetting/drying)
  2. Very stable for low flow modeling
  3. Can handle extremely rapidly rising hydrographs without going unstable
  4. Handles subcritical to supercritical flow, and hydraulic jumps better.
  5. Junction analysis is performed as a single 2D cell when connecting 1D reaches (continuity and momentum is conserved through the junction).


Additionally, the new 1D Finite Volume approached is solved in the same matrix as the 2D equations.  Solving in the same matrix allows for faster 1D/2D model solutions and more accurate flow transfers between 1D and 2D elements.  The equations are solved together and all hydraulic connections are updated together on an iteration by iteration approach, rather than separately, as in previous versions of HEC-RAS.

Monday, January 7, 2019

Removing bridge decks from terrain surfaces

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

Using RAS Mapper as a GIS Tool Part 1:
Removing Bridge Decks from Terrain Surfaces


This is the first in a three-part series on using RAS Mapper as a GIS tool. In this post we'll cover the removal of bridge decks from terrain data.


This topic comes up fairly frequently, since LiDAR data may be inconsistent in terms of the inclusion or exclusion of bridge decks. Depending on how you would like to model a bridge, you may prefer to have the bridge deck represented as terrain or as a deck/roadway defined with station/elevation points (in which case the deck geometry might be best excluded from the terrain data). In either case, you may find yourself needing to modify terrain data to suit your modeling needs.


In a previous post on terrain modification, we covered how to burn channels, levees, buildings, basins, and other features into your terrain surface using RAS Mapper. One application we left off (because it is the example covered in the HEC-RAS manual) is the removal of bridge decks; given some of the feedback we received on the previous post, we thought it might be worth including bridge decks in the process as well.


The process of removing a bridge is actually quite simple, as is the process of inserting some basic deck geometry into your terrain data. We walk through the complete steps for both removing and adding a bridge in less than 5 minutes in this video walk-through:



https://youtu.be/MWYKW-6D0FU


Here's a screen shot of Page 2-11 in the HEC-RAS 2D User Manual showing a bridge deck included in the terrain data and then removed from the terrain data. Now you see it, now you don't:





The following images are courtesy of Cameron Paintin from Riley Consultants, who applied these steps for a project in New Zealand.


Here is the terrain surface with the bridge deck in it:






Here is a satellite image with the bridge:







In this screen shot, Cameron has drawn a river reach with cross sections on either side of the bridge:







This process can be repeated with additional reaches for any other bridges in your terrain. The following screen shot shows the interpolation surface created by the bounding cross sections:






And the final image shows interpolation surface on top of the terrain to blend out the bridge:







Let us know what you think or if you have other suggestions for improving these processes.



And a happy 2019 to all of the fellow HEC-RASlers around the world!