Wednesday, September 30, 2015

Transect for Extracting Flow in a 2D Area

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

*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

33 comments:

  1. 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?

    ReplyDelete
  2. 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

    ReplyDelete
    Replies
    1. 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.

      Delete
    2. 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

      Delete
    3. 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!

      Delete
    4. 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.

      Delete
  3. 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).

    ReplyDelete
    Replies
    1. 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.

      Delete
    2. 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.

      Delete
    3. 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.

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

      Delete
    5. 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.

      Delete
  4. 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

    ReplyDelete
    Replies
    1. 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.

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

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

      Delete
  6. I have tried that but the table is empty.

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

      Delete
  7. 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".

    ReplyDelete
  8. 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".

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

      Delete
  9. 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.

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

      Delete
    2. 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.

      Delete
    3. 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.

      Delete
  10. 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?

    ReplyDelete
  11. 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.

    ReplyDelete
  12. 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.

    ReplyDelete
    Replies
    1. 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

      Delete
    2. 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

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

      Delete