Automating data extraction from HEC-RAS

Posted in: Energy, Water


automating hec-ras data helps projectsCalibrating a complex HEC-RAS model with multiple historic geometries is no easy task. I know this firsthand; I am currently calibrating a large 1D/2D HEC-RAS model as part of a multi-year dam relicensing study. My calibration dataset includes numerous surveyed high-water marks and multiple USGS gages. I am not only calibrating the model to the most recent bathymetric conditions, but also two historic conditions. On top of that, I developed a 1D version of the model that will be used for sedimentation transport modeling, and the 1D results need to match the 1D/2D results closely.

All that goes to say: I am running many, many simulations.

To efficiently calibrate the model, I set up an Excel workbook with various plots and statistical analyses. This allows me to quickly determine if my latest set of model runs is getting me closer to my goal. Sometimes I run a dozen or more simulations overnight. Some results are extracted from 1D cross-sections while others are extracted from the 2D flow areas. Moving all this data from HEC-RAS to my workbook would be monotonous and time consuming. Luckily, HEC-RAS has an application programming interface (API) to automate this task.

HEC-RAS Controller is a powerful feature of HEC-RAS. It allows the user to open plan files, run simulations, and even modify input data. With just a basic understanding of programming, a whole new HEC-RAS world is open to you.

I ended up writing VBA and Python code to extract the 1D and 2D simulation results from a user-defined set of plans that I can modify as needed and import into my calibration workbook. With just a few text inputs and the click of a button, all the relevant output data from last night’s HEC-RAS simulations can be ready for assessment while I drink my morning coffee.

With a bit of up-front work, you can create tools that will reliably perform HEC-RAS tasks for you, speeding up repetitive processes and reducing the chance of error. Thinking bigger, you can even use HEC-RAS Controller to implement probabilistic methods like a Monte Carlo analysis. Ultimately, incorporating advanced technologies into our solutions leads to more effective, efficient solutions for clients.


Jesse Piotrowski, PE, CFM

About the Author

Jesse Piotrowski, PE, CFM is adept at finding creative water resource solutions to the toughest client challenges. He has taught HEC-RAS classes around the country on behalf of ASCE. “It’s important to me to be able to provide successful, cost-effective solutions to each client. I try to tailor my approach to meet the needs of each project.” In his time away from the world of water resources, Jesse enjoys running, skiing, and getting tackled by his kids.

Read more posts by Jesse Piotrowski, PE, CFM

Leave a Reply

Your email address will not be published. Required fields are marked *