Transect for Extracting Flow in a 2D Area

Written by Chris Goodell | September 30, 2015


*Update:  Version 5.0.2 now does flow transects in RAS Mapper with profile lines.  No longer necessary to use a 2D Area Connection to do this.

A very common output request in 2D modeling is for flow over (through) a transect line.  HEC-RAS 5.0 does not have a specific tool for extracting flow data along a line in a 2D area, however it CAN be done.  Here’s how you do it.
Inside your 2D area, draw a 2D Area Connection where you would like to extract flow.  In the figure below, I’ve drawn my 2D Area Connection line from bottom to top, which represents left to right, looking in the downstream direction.
image
Notice that with the completely orthogonal cell orientation, but with a skewed 2D Area Connection line, the black and red striped connection line is “jagged”, following cell faces between the connecting cells.   To fix this, we need to use a breakline.  You could draw a break line on top of the 2D Area Connection (click the 2D Area Break Lines button on the top of the Geometric Data window), however, HEC-RAS also has a short cut for putting breaklines on 2D Area Connections.  If you right click on the 2D Area Connection (I’ve named if “Flow Line”), you’ll see an option to “Create 2D Flow Area Breakline”.  Select this for quick cell re-orientation around the 2D Area Connection Line.
image
image
Now you’re ready to enter data to the 2D Area Connection that you’ll use for extracting flow.  Click the SA/2D Area Conn button on the left side of the Geometric Data window.
Make sure you connect “From” and “To” to the same 2D flow area.  Then choose “Normal 2D Equation Domain”.  This will force RAS to use the same 2D St. Venant equations over the terrain under the 2D Connection line as if the connection line wasn’t there.  BUT…you still have to define the Structure Type as a Weir and provide station-elevation data to define the crest of the weir, even though RAS will not use it.  Maybe this gets fixed in a later version.  HEC makes this easy though as you can extract the terrain profile from the 2D Connection cutline by clicking the button “Terrain Profile” as shown below.  Just copy and paste the terrain profile into your station-elevation table and you will  have defined a “zero-height” weir.  I guess it’s possible to use any crest definition, since RAS shouldn’t use the weir equation-it will use the normal 2D equation domain, but I haven’t tried it.
image
Now you are ready to compute.  After computing, go to the Stage and Flow Hydrographs output window.
image
Make sure you select Type…Storage Area Connections (yes, it is technically an SA/2D Area Connection, but HEC hasn’t gotten around to renaming this yet in this window).  Now you can see the flow hydrograph for the flow line you’ve drawn.  You can check, but you’ll see the results are exactly the same as before including the flow line.

image

Comments

  1. Chris Chatfield

    on October 30, 2015

    In using this method, the weir created from copying the table is slightly lower than the cells that surround them in some locations….leading to an error when the model is run. However, when I add about 0.007 to each elevation value, then it runs well. Perhaps this is a rounding issue because the table is only up to 0.01?

  2. Chris Goodell

    on October 30, 2015

    I think you may be correct.

  3. jmaynard90

    on January 12, 2016

    Hey Chris,

    I'm having some issues getting the hydrograph outputs for the 2D storage areas. Is there some setting I'm missing to turn on storage of that output? I've used this in other models and it's worked before. The one I'm currently working on has two 2D area connections with the grid aligned to them and when I run the model, they produce no results in the Stage and Flow Hydrographs output window or in the DSS files.

    Any thoughts?

    Thanks

  4. Chris Goodell

    on January 12, 2016

    2D areas do not get stage and flow output hydrographs. There's just too many cells which can all potentially have different stages and flow. If you would like to define a transect line inside of your 2D area where you can get stage and flow hydrograph output, read this post: http://hecrasmodel.blogspot.com/2015/09/transect-for-extracting-flow-in-2d-area.html

    If you want to get stage for an individual cell, you can do that by highlighting the 2D Flow Areas layer in RAS Mapper under your Results and then right-clicking on the cell you are interested in. Then look at your time-series plots.

  5. jmaynard90

    on January 12, 2016

    I apologize. I meant the 2D Area Connection isn't yielding a hydrograph for some reason. Not the 2D storage area. As I said, I've used this transect method before and it's worked well. For this particular model, I run the unsteady model and get results for everything but the 2D area connections that I'm using as transects.

    Like I said, the model has two 2D area connections, but it doesn't store results for them (I've checked the DSS and neither of them are saved there).

  6. Chris Goodell

    on January 12, 2016

    No worries. But with that, I'm stumped. If the 2D area connection is properly connected, you've run through the simulation (without crashing), and flow is going over or through it, I can't see why it wouldn't have a stage and flow hydrograph available. I would try saving, closing RAS, reopening RAS, and rerunning. It's a stretch, but I can't think of anything else at the moment. Let me know if you figure it out.

  7. jmaynard90

    on January 12, 2016

    I tried closing and re-opening, and unfortunately it didn't work. It's very odd. We're stuck too.

    Thank you though. I'll post again if we work it out.

  8. Chris Goodell

    on January 12, 2016

    Can you send me your dataset? I'd be happy to take a look and see if I can make any sense of it. Let me know which version you are using also.

  9. Nathan

    on January 20, 2016

    Chris,

    I put two 2D Area Connections in my model as described in your post “Transect for Extracting Flow in a 2D Area”, but when I attempt to run the model I receive an error. The error calls out one of the 2D Area Connections and states “there is an error with the model data. Error Accepting the processor files.” If I delete one of the 2D Area Connection, then the model runs fine. Any ideas as to why I’m getting an error when I have two 2D Area Connections?

    Thanks,
    Nathan

  10. Chris Goodell

    on January 20, 2016

    Nathan-

    I'm not sure. I haven't actually tried 2 in one 2D area yet. It's possible there is some bug that only allows 1. Try deleting the bad one and starting over with a new 2nd one and see if it works. Otherwise, I'm not sure what the problem could be.

  11. Emmanuel Jjunju

    on January 22, 2016

    Hello, How do i include the transects and other connections in the standard output tables. I am trying to extract velocity at different transects.

  12. Chris Goodell

    on January 22, 2016

    You can try opening the standard table "Connection with Culverts" or "Connection with Weir and Gates".

  13. Emmanuel Jjunju

    on January 24, 2016

    I have tried that but the table is empty.

  14. Emmanuel Jjunju

    on January 24, 2016

    I am running a model with only 2D (no 1D)

  15. Unknown

    on April 25, 2016

    I have added a few SA/SD locations within my 2D geometry, as instructed above. After I save geometry, and compute. the program freezes during Geoemtry Processing. There error in red says "review your data at this location (ie the SA/SD location) for completeness and consistency".

  16. Unknown

    on April 25, 2016

    I have added a few SA/SD locations within my 2D geometry, as instructed above. After I save geometry, and compute. the program freezes during Geoemtry Processing. There error in red says "review your data at this location (ie the SA/SD location) for completeness and consistency".

  17. Chris Goodell

    on April 26, 2016

    Go through the steps in the manual for setting up a 2D area. Make sure you have not missed anything.

  18. Thomas Gail Haws

    on January 27, 2017

    You said, "Version 5.0.2 now does flow transects in RAS Mapper with profile lines." Please add a link so we can see how to access this important improvement.

  19. Chris Goodell

    on January 27, 2017

    Now we're up to 5.0.3. There's a link to it on the side bar on The RAS Solution.

  20. Anonymous

    on December 1, 2017

    In the table on the right side of Stage and Flow Hydrographs are reported HW and TW max values. To which cell are they related?

  21. Bill Mullen

    on December 7, 2017

    Chris, I believe that HEC-RAS 5.0.3 measures flow along the jagged edges of the cells along the profile line drawn in a 2D flow area and not directly along the profile line itself. I think that there still is need for 2D flow area breaklines (and storage area connection) as previously-described if you want flow directly along a profile line. I can send a screenshot of how HEC-RAS shows both the profile line and the jagged line along cell faces after you right-click on the profile line and select "Time Series" –> "Flow". A funny thing is that HEC-RAS shows only the profile line when right-clicking and getting a plot of WSE.

  22. Chris Goodell

    on December 7, 2017

    Bill, I'm not surprised by that. My guess is that RAS extracts flow through cell faces. If those faces don't line up on the profile line you draw, then you get the "jagged line" output. I assume you could still forego the old method of using a SA/2D area connection by just drawing a breakline where you have your profile line drawn.

  23. Alex

    on January 16, 2018

    You can also use DSSVue to retrieve TW HW stages and peak discharges. This is a great idea, thanks for sharing Chris.

  24. Unknown

    on February 3, 2018

    I have the same issue as you jmaynard. Did you manage to solve this problem?

  25. Martin Rosén

    on February 3, 2018

    I have the same issue jmaynard. Did you manage to solve this?

  26. Alex

    on February 9, 2018

    That would be the values associated with the upstream (HW) and downstream (TW) flow depths. These values would depend upon how you draw your SA/2D Connection.

  27. Alex

    on February 9, 2018

    The 2D area can be sampled 2 ways. The first way (recomended) is to generate breaklines and in RASMapper transform them into "Profiles Lines". Once these are set as "profile lines", you can sample hydrographs. You would have to load a new result layer for a given "Unsteady Profile" other than maximum/minimum. You can select any, and you can modify the time in the time bar. Once you have this layer loaded and displayed, all you have to do is to right click on the 'profile line" to get a stage hydrograph, a flow hydrograph, velocity, depth…
    A second method (not recomended) would be to pre-set SA/2D connections in the locations that you would like to sample hydrographs. This can be effective, but it can conflict with the configuration of other structures in the 2D Area.

  28. Cameron Paintin

    on February 11, 2018

    Hey Chris, I've experimented with putting in nominal weirs that sit above the terrain and they do have an effect on the flow. The flow backs up behind the weir, the 2D Eqn domain is only used for the water that overflows the weir crest. So you do need to profile the terrain, filter it down to 500 points and normally add 10mm so the cell faces are lower than the weir elevation on the headwater (HW) and tailwater (TW) sides.

    I'm having to use the SA/2D area connection method to measure flows throughout the model, as the profile lines cannot compute the flow for large models. It's a bit painful to set up if you want many flow transects

  29. Cameron Paintin

    on February 11, 2018

    Hi Chris, I did try using a nominal weir that was 30m above the channel invert, but the weir actually has an impact on the flow by retaining it. The 2D equation option only works when the weir is being overtopped unfortunately. So you need to copy the terrain profile, filter it down to 500 points or less, and add 0.01 so the weir is above the headwater (HW) and tailwater (TW) cells. I wish if the 2D option was selected that you wouldn't need to input all this weir data, as it can give you quite a lot of errors.

    It's quite a time consuming process but unfortunately I haven't managed to get the profile lines to compute flows or volume accumulation on the larger projects, so the SA/2D area connections are the best way to compare how the flow attenuates as it moves downstream.

  30. Chris Goodell

    on February 11, 2018

    Interesting. I haven’t had issues using profile lines on larger projects.aybe they’ll have this tightened up better for the next version. Cheers-
    Chris

  31. Stuart Blyton

    on February 13, 2018

    Hi Chris,
    I did the Hec-Ras 2D modelling course back in 2016 when you were in Melbourne and have been really enjoying using it since. I am doing a flowpath assessment in an urban environment and after running my model I was concerned that the flow depths / extent were too large, so I setup cross section breaklines as described in your post mentioned above from 2015. Based on the results of this run, the peak flows are significantly higher than the inflow hydrographs that I have entered. I have many different inflow hydrographs due to the length of the catchment and various incoming points of flow, however even if I were to combine all of these at the same time to peak (unrealistic) the flows shown on the transect are way too high (sometimes by many magnitudes). Can you think of any reason why this would be occurring ?
    Thank you in advance

  32. Chris Goodell

    on February 13, 2018

    Hi Stuart. Melbourne was awesome! Nice to hear from you. From what you've described, I bet the model is unstable in the 2D mesh. While it's very easy to spot instabilities in 1D reaches using the profile plot, they are not so obvious in 2D areas, unless you check the numbers. Though subtle, there are some visual hints that can reveal an instability. Look for a "pulsing" effect while animating your depth map. Also, look for pixelation in the depth map, particularly at the front end of a flood wave. But of course, the numbers are the real test, as you know. My suggestion would be to try getting your Courant numbers down below 3, but as close to 1 as is practical. see if that helps resolve instability issues. Good luck!

  33. Stuart Blyton

    on February 13, 2018

    Thanks very much Chris. Yep that was the problem. Changed grid space to 2m and time step to 0.5secs and all looks pretty good.

  34. Chris Goodell

    on February 14, 2018

    Nice!

  35. Cameron Paintin

    on February 15, 2018

    Hi Chris,

    I ran the simulations using the 2D Area connections. A time consuming process but successful. I did draw some profile lines in the RAS Mapper that followed the same alignment as the 2D area connections in the geometry and was able to compute flow and volume accumulation (yay)!

    I did try extending the profile lines beyond where I'd drawn the 2D area connections (as they hadn't captured all the flow) and I got the error I have seen many times before when plotting time series of flow / volume. The error states:

    "Unhandled exception has occurred in a component in your application. If you click Continue, the application will ignore this error and attempt to continue.

    Exception of type 'System.OutOfMemoryException' was thrown"

    I believe now that this error shows up when trying to do these time series calcs where the cells do not align with the profile lines. What I'll do in future simulations is not draw 2D area connections but breaklines (to align the cells) and convert breaklines to profile lines in RAS Mapper. It's not the size of the simulation or the profile line thats the issue (I tried it with the breakline that represents the centreline of my river and it eventually calculated the flow across it) but if you're trying to calculate along a profile line that does not align with the cell faces

  36. Alex

    on February 19, 2018

    Cameron – try restarting the RasMapper. Sometimes it runs out of memory when reading the hdf files.

  37. Chris Goodell

    on May 6, 2018

    I feel your pain 😉

  38. Mario Brischetto

    on November 7, 2018

    Thank you for taking the time to share your findings, which often saves "trying to find a needle in a haystack" and inspired me to share. I know this is an old thread, but it seems this issue still exists in the current version of HEC-RAS (I am using v5.0.5 for 2D unsteady flow analysis). I have found that the discrepancy can require more than 0.007 (perhaps due to the steepness of terrain versus the cell mesh spacing), however I am adjusting individual points in the weir profile which minimises the impact on the model. (Method = copy terrain profile, paste into weir profile, run unsteady flow analysis with a long time step for quick turn-around. The erroneous points are listed in the run log. Typically there are only a few erroneous points each time so I simply paste the relevant terrain profile into MS-Excel, and then increase by the error amount plus 0.001 the level of the user-inputted weir station on either side of the erroneous station, and then paste as the weir profile and rerun to unsteady flow analysis which fixes the problem. The erroneous station seems to be the point where weir profile crosses the mesh surface and therefore fall between the manual stations).

  39. Mario Brischetto

    on November 8, 2018

    ***The blog is so helpful thank you for making the effort and inspiring others to do the same*** Hey Chris C and Chris G, it seems the problem still exists for HEC-RAS ver 5.0.5. The method I have adopted is to: 1. copy the name of the SA station and the list of erroneous stations from the "Computation Messages" window, then paste to MS-Excel for ease of reference; 2. copy the weir profile for the given SA-2D connection,then paste to MS-Excel; 3. adjust the weir profile ONLY at stations immediately adjacent to the listed erroneous stations … it seems the erroneous station occurs between weir stations at the intersection the weir profile and mesh surface … adjacent stations adjustment = error amount plus 0.001. 4. paste the weir profile back into HEC-RAS. ***

  40. Mario Brischetto

    on November 8, 2018

    Whoops … I just noticed the update note at the top of this blog ie. "*Update: Version 5.0.2 now does flow transects in RAS Mapper with profile lines. No longer necessary to use a 2D Area Connection to do this". I am using ver 5.0.5 – the "Profile Lines" tab resides in the lower left-hand side of the "RAS Mapper" window. Excellent!

  41. Anonymous

    on December 19, 2018

    Hi Chris. Great post as always- thanks very much. Is there a way to extract the flow at profile lines (I'm using Version 5.0.5) through the HEC RAS controller? The "OutputDSS_GetStageFlow" function does not seem suitable in a purely 2D model?

  42. Chris Goodell

    on December 19, 2018

    No, unfortunately there’s not a lot the hecrascontroller can do with 2D. But you might explore writing code to read from the hdf file.

  43. Li Lilin

    on March 12, 2019

    I find some improvement in version 5.0.6. Now you can see a new button called " clip weir profile to 2D cell…" in Lateral Structure Editor and SA/2D Editor. It uses minimum elevation of 2D cell connected to weir and elevates the line some height specified by you as weir profile. I think this could eliminate connected error due to some location of weir profile lower than cell minimum elevation and reduce our efforts.

Add Your Comment

Leave a Reply

five − 1 =


Related Posts

SEE ALL BLOG POSTS