Wednesday, August 24, 2016

Specifying a plant factor and generation pattern for hydropower in HEC-ResSim

This post will detail the coding of a plant factor and a generation pattern for hydropower in ResSim.

This example was created using a simple one reservoir model.

Before I coded in the hydropower rules, I ran the model without any rules.  Once the simulation begins on January 10, 2015, ResSim sets the release (green line in bottom plot) to zero since the pool is below the top of conservation (elevation 50 ft) as is shown by the green line in the top plot.  The release increases to match inflow on January 14, 2015, to hold the pool at the top of conservation.  This figure will aid us in seeing the impact of the hydropower rule.  The internal logic of ResSim wants to hold all inflow when the pool is below top of conservation.  The power rule will not allow this to happen.




The image below shows the development of the hydropower rule.  The plant factor in this example is set to 100% for the entire conservation pool.  It can vary with varying conservation pool levels if that is desired.



In the hydropower rule, we also want to specify a generation pattern.  In the image below, I have specified two 3-hour patterns, one in the morning and one in the afternoon (shown by the 1.0 value in the second column).



Below is the result from that simulation.  In this simulation, there are two defined generation periods per day.  Also, notice that the pool elevation is dropping due to the power generation requirement.



In the image below, I have changed the plant factor to 50% for all conservation pool levels.



This changed the flow in the first few days of the simulation since ResSim is trying to generate 50% of the installed capacity of the power plant.  With the higher pool elevation, less release is required to generate 50%.  However, as the pool continues to fall, the hydraulic capacity of the plant is set to its maximum in an attempt to generation 50% of the installed capacity.




For the 50% plant factor simulation, I have also included the power plot.  I have set the installed capacity to 10 MW.  In the plot below (referring to the top plot for this explanation), you can see that 50% (or 5 MW) is generated on January 10 and January 11 along with a portion of January 12.  After that, a declining pool elevation causes a lower head differential.  With the hydraulic capacity of the power plant limited to a value of 5,000 cfs, ResSim cannot meet the 50% generation requirement.  So, it releases up to the hydraulic capacity and generates as much as it can.  The dashed red line is showing the desired generation while the dotted-dashed green line is showing the generating capability.  You can see on January 10 and January 11 that there is the capability to generate power above 5 MW.  However, beginning on January 12, the green dotted-dashed line intersects the red dashed line indicating that the generating capability has fallen below the desired generation.




One final image showing a plant factor of 20%.  In this simulation, we have enough inflow to cause a rebound in the pool elevation.  It can be seen that higher pool elevations lead to less release being required to achieve 20% of the installed capacity.





Time step determination in HEC-ResSim

This post covers two issues:

1.)  Can daily data be used for a 1-hour time step simulation in ResSim?

2.)  What is the difference in using period average and instantaneous in the alternative editor?

To answer the first question, it is important to understand how ResSim will handle simulation time step and input data.

  • If the computation time step is less than the original interval of the input time series data (in other words, using an hourly time step with daily data), then the input data will be interpolated at the new desired interval.
  • If the computation time step is an interval greater than the original interval of the input time series data, the computation time step will become the interval at which data input is read.  So, a six hour simulation time step using hourly inflow data will read the inflow data every 6 hours.  
The figure below shows the inflow data given at one time each day.


The model, however, is run on an hourly time step.


This model simulated with no errors.  In the figure above, notice that "Period Average" is selected.  With this option selected, the inflow data is constant over the entire time step giving a stair step presentation of the data.  The inflow data is the dark line.  It becomes coincident with the release (green line) on 14Jan2015.



When instantaneous is selected as the flow computation method, the stair step pattern goes away.


Due to this difference in how the data is interpolated, the inflow values vary slightly at each time step.  Below is a table of a small portion of the inflow time series.



From this table, we can see that the inflow is 400 cfs at midnight on January 14 and 800 cfs at midnight on January 15.  So, we would expect to see inflow values between 400 cfs and 800 cfs throughout January 15 when using an hourly time step.  The table below show the differences in the values when using period average and instantaneous.



Note that the average of the instantaneous values gives the period average value.  In other words, the average of 566.7 cfs (10:00 instantaneous value) and 583.3 cfs (11:00 instantaneous value) is 575.0 cfs (11:00 period average value).



Friday, August 19, 2016

Developing Stream Alignment in HEC-ResSim

Special thanks to Joan Klipsch of HEC for providing information about this topic.  

Setting up a stream alignment can be challenging in HEC-ResSim.  In my examples so far on the blog, I have used simple stick diagrams for my examples.  This doesn't affect the ResSim computations, but you will typically import a GIS shapefile for your stream alignment.  Below, I have included Joan's recommendations (in Bold) along with my suggestions (in Italics).  I would also recommend that you refer to the August 10, 2015 post describing how to develop a model.


  • Each river in your stream alignment should be represented by a single continuous line.  If you created the stream alignment by importing from a shapefile, verify that the flow direction of each stream is correct (the zero tick mark should be at the downstream end).  Each confluence (stream junction) should be checked to be sure it is truly connected - look for the bright green halos.  Additionally, you will get an error message when you try to draw in your reservoir if the direction of the stream alignment is incorrect.  You will think you are drawing in the reservoir upstream to downstream, but ResSim will inform you that you are trying to draw them in downstream to upstream.  
  • In the figure below, you can see that the individual stream segments are not one continuous line due to the presence of numerous green halos.  Normally, the green dots (stream nodes) should only show up at the top and bottom of a river or at a confluence with a tributary (confluences should have those bright green halos; the halos indicate properly connected "stream junctions").  I would send the alignment shown in the figure below back to my GIS staff for corrections.



  • The above alignment will still work, but it can be a challenge to draw the routing reaches on it and you are stuck with the stream alignment's discretization for the maximum length of your reaches since you will not be able to draw a reach across the stream junction that connects the pieces.  Additionally, if this is going to be used in a CWMS (Corps Water Management System) model, I want to control where reaches begin and end rather than it being a function of how the shapefile was developed.  The location of the reaches should be controlled by where the routing parameters change or by the location where inflow has been computed by a model such as HEC-HMS.

  • Another potential issue with drawing reaches occurs when the Junction element that you are trying to connect your reach to is not exactly located at the stream junction beneath it (sometimes, they are ever so slightly upstream of the stream junction).  To avoid this problem, I employ one or both of the following techniques:
    • Create a watershed configuration and draw computation points in the watershed setup module at all stream junction.  I would draw in all my reservoirs here as well.  When you place a computation point at or very near a stream junction, ResSim will prompt you to identify where the computation point should be located.  I always answer "at the stream junction".  Once I have all the computation points defined, I can then create a network in the reservoir network module based on my configuration.  When I do this, all my computation points become Junction elements in the network and they are located exactly where they belong.  I have also added the junctions in the reservoir network directly by zooming in tight on the confluence and putting the junction there.  Even doing it that way it still seems to miss the confluence at times.  I like Joan's recommendation better.
    • When I draw my reaches, I start from the bottom of the watershed and work my way up.  I realize this my be counter intuitive, since the reaches are drawn from upstream to downstream, but by working my way from bottom up, I usually avoid most the reach draw problems caused by the junctions not being in exactly the right place.  This draw order usually place new junctions (as needed) in the most right place for the reach to connect to.  Note that the individual reaches are still drawn from the upstream end of the reach to the downstream end of the reach, but Joan is recommending to start with the most downstream reach first, then the second most downstream reach, etc.  
  • Create your network based on the configuration.  If, while drawing in your reaches in your network, you find problems, go back to watershed setup, fix what is causing the problem, then start over with a new network or update your network from the configuration.  Once you have all your reaches and diversion added to the network, put in the pool data for your reservoirs and create at least one outlet.  Then create a "zones only" operation set (no rules).  Next, identify inflows at the headwater junctions and create an alternative.  Set the time step, operation sets, initial conditions, and then map a dummy inflow time series (use a constant value that can be passed by your single outlet) to each inflow location.  Finally, create a short simulation in which to test your alternative.  Once you have the alternative computing, follow the water…work your way from upstream to down verifying that the flows are summing up correctly and water is not appearing or disappearing unexpectedly.  This is a major step in model development.  It helps you verify the connectivity and gives you a chance to find potential problems and “fix things” without too much getting in your way, especially “operations”.   I consider it important when developing any model, simple or complex, but the bigger or more complex the model, the more vital this step becomes.  I would also add that you want to set your reservoir elevation to the top of conservation in the lookback period.  This will avoid having ResSim hold or release some of the constant inflow.  Once you have this "no rules" model working, I recommend building and testing the model one rule at a time.  This allows for a better understanding of how each rule impacts the system and makes debugging the model much faster.  For information about how to do this, see the July 19, 2016 post (with linked video) discussing "Replace from base" and "Save to base".  These options are useful for model development in the simulation module.