SlideShare a Scribd company logo
1 of 11
Download to read offline
Automating HEC-RAS with Excel
Virginia Lakes and Watersheds Conference, March 2015
Thomas Williams, PE
Amec Foster Wheeler
+ = ?
Contents
1. What is HEC-RAS? (brief intro)
2. The HECRASController API
3. Excel VBA Demos
1. Multi-Model Run
2. RAS Output Extraction
3. Manning’s ‘n’ Calibration (sort of)
4. Tips
5. Conclusion
2
1. What is HEC-RAS?
3
Hydrologic
Engineering
Centers
River
Analysis
System
“HEC-RAS allows you to
perform one-dimensional
steady flow, unsteady flow,
sediment transport/mobile
bed computations, and water
temperature modeling.”
- USACE
What is an API?
API = Application Programmer Interface
“In computer programming, an application programmer interface (API) is
a set of routines, protocols, and tools for building software
applications. An API expresses a software component in terms of its
operations, inputs, outputs, and underlying types.”
- Wikipedia
2. The HECRASController API
4
Their Program
Your
Program API
2. The HECRASController API (cont’d)
The HECRASController API
“The current version of the HECRASController has a wealth of
procedures that will allow a programmer to manipulate HEC-RAS
externally by setting input data, retrieving input or output data, and
performing common [HEC-RAS] functions…”
- Christopher Goodell, PE, D.WRE, Breaking the HEC-RAS Code, 2014
5
HEC-RAS
Excel
API
2. The HECRASController API (cont’d)
Accessing the API from Microsoft Excel
1. Click the Visual Basic button (on the Developer tab)
2. Create a new VBA module
3. Go to Tools > References, check “HEC River Analysis System”,
and click OK.
4. Write code!
6
2. The HECRASController API (cont’d)
A simple program…
7
Sub RunHECRAS()
' Opens and runs a HEC-RAS model
' Declare variables
Dim ras As New HECRASController
Dim nmsg As Long
Dim strMessages() As String
Dim prjFilePath As String
' Open the model
prjFilePath = "C:MyHecRasModel.prj"
ras.Project_Open (prjFilePath)
' Run the model
ras.Compute_CurrentPlan nmsg, strMessages
End Sub
2. The HECRASController API (cont’d)
Some example HECRASController
fuctions and subroutines:
• Project_Open
Opens a HEC-RAS model.
• Compute_CurrentPlan
Runs the current flow/geometry
regime.
• ExportGIS
Exports an *.sdf file that can be
read into ArcGIS using HEC-
GeoRAS.
• Output_NodeOutput
Returns an output value for a
given node and profile.
8
• Geometry_SetMann
Sets the Manning’s ‘n’ values for
a cross section, horizontally
varied.
• Add_BC
Adds a bridge/culvert.
• Edit_BC
Opens the Bridge/Culvert Editor
and displays the selected station.
• PlotPF
Displays the water surface profile
for a given River/Reach.
3. Excel VBA Demos
9
1. Multi-Model Run
2. RAS Output Extraction
3. Manning’s ‘n’ Calibration (sort of)
Cross your fingers!
4. Tips
• Breaking the HEC-RAS Code
by Christopher Goodell, PE, D.WRE
• The API is a little rough around the edges.
• Provides a lot of functionality, but not everything
• Inconsistencies:
• Parameter names and types
• Function / subroutine behavior
• No “official” API documentation
• HEC-RAS is public domain software, but not open source
• HEC-RAS project (*.prj), geometry (*.g##), flow (*.f##), and plan
(*.p##) files are plain text.
• Sometimes that’s easier than using the API.
• HEC-RAS output files (*.O##) are binary. 
10
5. Conclusion
1. The HECRASController API is really useful…
2. …but it takes a little work to figure out.
3. Happy coding!
Questions?
Contact Info
Thomas Williams, PE
Amec Foster Wheeler
thomas.williams@amecfw.com
11

More Related Content

What's hot

FlatBayou.HEC-RAS.1D2D.Markwood_
FlatBayou.HEC-RAS.1D2D.Markwood_FlatBayou.HEC-RAS.1D2D.Markwood_
FlatBayou.HEC-RAS.1D2D.Markwood_David R. Markwood
 
SILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdf
SILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdfSILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdf
SILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdfR K DHIMAN
 
Rule level & gate operation
Rule level & gate operationRule level & gate operation
Rule level & gate operationTushar Dholakia
 
Modelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOWModelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOWC. P. Kumar
 
050218 chapter 7 spillways and energy dissipators
050218 chapter 7 spillways and energy dissipators050218 chapter 7 spillways and energy dissipators
050218 chapter 7 spillways and energy dissipatorsBinu Karki
 
Rainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMS
Rainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMSRainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMS
Rainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMSAnkit Balyan MBA, B.Tech.
 
Concrete dam lecture 4
Concrete dam lecture 4Concrete dam lecture 4
Concrete dam lecture 4Vidhi Khokhani
 
Using HEC-RAS to assess flash floods risk in arid regions
Using HEC-RAS to assess flash floods risk in arid regionsUsing HEC-RAS to assess flash floods risk in arid regions
Using HEC-RAS to assess flash floods risk in arid regionsAhmed Saleh, Ph.D
 
Introduction to River Engineering
Introduction to River EngineeringIntroduction to River Engineering
Introduction to River EngineeringManamnoBeza1
 
Canal drop notch type -design steps
Canal drop notch type -design stepsCanal drop notch type -design steps
Canal drop notch type -design stepsNirmala Krrishnan
 
Chapter 14 bridge hydraulics
Chapter 14 bridge hydraulicsChapter 14 bridge hydraulics
Chapter 14 bridge hydraulicsmarco tacco
 
APPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELS
APPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELSAPPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELS
APPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELSAM Publications
 
seminar report of " Introduction to HEC RAS "
seminar report  of " Introduction  to HEC RAS "seminar report  of " Introduction  to HEC RAS "
seminar report of " Introduction to HEC RAS "ankit jain
 
Chapter 7 spillway and energy dissipators
Chapter 7 spillway and energy dissipatorsChapter 7 spillway and energy dissipators
Chapter 7 spillway and energy dissipatorsMohsin Siddique
 
Flood Mapping via HEC-RAS Model and ArcGIS
Flood Mapping via HEC-RAS Model and ArcGISFlood Mapping via HEC-RAS Model and ArcGIS
Flood Mapping via HEC-RAS Model and ArcGISLengthong KIM
 

What's hot (20)

FlatBayou.HEC-RAS.1D2D.Markwood_
FlatBayou.HEC-RAS.1D2D.Markwood_FlatBayou.HEC-RAS.1D2D.Markwood_
FlatBayou.HEC-RAS.1D2D.Markwood_
 
Hec ras
Hec rasHec ras
Hec ras
 
SILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdf
SILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdfSILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdf
SILT FACTOR FOR SCOUR CALCULATION AROUND BRIDGE FOUNDATION.pdf
 
Rule level & gate operation
Rule level & gate operationRule level & gate operation
Rule level & gate operation
 
Design of barrages
Design of barragesDesign of barrages
Design of barrages
 
Modelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOWModelling of a Coastal Aquifer using FEFLOW
Modelling of a Coastal Aquifer using FEFLOW
 
050218 chapter 7 spillways and energy dissipators
050218 chapter 7 spillways and energy dissipators050218 chapter 7 spillways and energy dissipators
050218 chapter 7 spillways and energy dissipators
 
Rainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMS
Rainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMSRainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMS
Rainfall Runoff Modelling on the Lower Tapi Basin using HEC-HMS
 
Thesis Report
Thesis ReportThesis Report
Thesis Report
 
CH-2.pptx
CH-2.pptxCH-2.pptx
CH-2.pptx
 
Design of a channel Reach
Design of a channel ReachDesign of a channel Reach
Design of a channel Reach
 
Concrete dam lecture 4
Concrete dam lecture 4Concrete dam lecture 4
Concrete dam lecture 4
 
Using HEC-RAS to assess flash floods risk in arid regions
Using HEC-RAS to assess flash floods risk in arid regionsUsing HEC-RAS to assess flash floods risk in arid regions
Using HEC-RAS to assess flash floods risk in arid regions
 
Introduction to River Engineering
Introduction to River EngineeringIntroduction to River Engineering
Introduction to River Engineering
 
Canal drop notch type -design steps
Canal drop notch type -design stepsCanal drop notch type -design steps
Canal drop notch type -design steps
 
Chapter 14 bridge hydraulics
Chapter 14 bridge hydraulicsChapter 14 bridge hydraulics
Chapter 14 bridge hydraulics
 
APPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELS
APPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELSAPPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELS
APPLICATION OF 1-D HEC-RAS MODEL IN DESIGN OF CHANNELS
 
seminar report of " Introduction to HEC RAS "
seminar report  of " Introduction  to HEC RAS "seminar report  of " Introduction  to HEC RAS "
seminar report of " Introduction to HEC RAS "
 
Chapter 7 spillway and energy dissipators
Chapter 7 spillway and energy dissipatorsChapter 7 spillway and energy dissipators
Chapter 7 spillway and energy dissipators
 
Flood Mapping via HEC-RAS Model and ArcGIS
Flood Mapping via HEC-RAS Model and ArcGISFlood Mapping via HEC-RAS Model and ArcGIS
Flood Mapping via HEC-RAS Model and ArcGIS
 

Viewers also liked

Ctn 762-guide hec-ras-h2009
Ctn 762-guide hec-ras-h2009Ctn 762-guide hec-ras-h2009
Ctn 762-guide hec-ras-h2009Sanae Jeffali
 
5 c 1-hec-georas_part1
5 c 1-hec-georas_part15 c 1-hec-georas_part1
5 c 1-hec-georas_part1Taoufik Byou
 
Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod
 Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod
Download-manuals-surface water-software-estimationofdischargebyarea-slopemethodhydrologyproject0
 
Network and mandates of wq monitoring
Network and mandates of wq monitoringNetwork and mandates of wq monitoring
Network and mandates of wq monitoringhydrologyproject0
 
Download-manuals-surface water-manual-illustrations-hydrologicalobservations
 Download-manuals-surface water-manual-illustrations-hydrologicalobservations Download-manuals-surface water-manual-illustrations-hydrologicalobservations
Download-manuals-surface water-manual-illustrations-hydrologicalobservationshydrologywebsite1
 
Hp wq study of ground water quality characteristics in industrially predomina...
Hp wq study of ground water quality characteristics in industrially predomina...Hp wq study of ground water quality characteristics in industrially predomina...
Hp wq study of ground water quality characteristics in industrially predomina...hydrologyproject2
 
Download-manuals-surface water-software-investigation&selectionofhydrologica...
 Download-manuals-surface water-software-investigation&selectionofhydrologica... Download-manuals-surface water-software-investigation&selectionofhydrologica...
Download-manuals-surface water-software-investigation&selectionofhydrologica...hydrologyproject0
 
Readers guide sw his documents v2
Readers guide sw his documents v2Readers guide sw his documents v2
Readers guide sw his documents v2hydrologywebsite1
 
Download-manuals-surface water-software-introductiontoadvanceddischargemeasu...
 Download-manuals-surface water-software-introductiontoadvanceddischargemeasu... Download-manuals-surface water-software-introductiontoadvanceddischargemeasu...
Download-manuals-surface water-software-introductiontoadvanceddischargemeasu...hydrologyproject0
 
Upstream Suburban Philadelphia Sub-Watershed Cluster Modeling Overview
Upstream Suburban Philadelphia Sub-Watershed Cluster Modeling OverviewUpstream Suburban Philadelphia Sub-Watershed Cluster Modeling Overview
Upstream Suburban Philadelphia Sub-Watershed Cluster Modeling OverviewKim Beidler
 
Ch sw study of reservoir sedimentation, impact assessment and development of ...
Ch sw study of reservoir sedimentation, impact assessment and development of ...Ch sw study of reservoir sedimentation, impact assessment and development of ...
Ch sw study of reservoir sedimentation, impact assessment and development of ...hydrologywebsite1
 
Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts
 Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts
Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconceptshydrologyproject0
 

Viewers also liked (20)

Ctn 762-guide hec-ras-h2009
Ctn 762-guide hec-ras-h2009Ctn 762-guide hec-ras-h2009
Ctn 762-guide hec-ras-h2009
 
Minitutorial Hec-Ras
Minitutorial Hec-RasMinitutorial Hec-Ras
Minitutorial Hec-Ras
 
5 c 1-hec-georas_part1
5 c 1-hec-georas_part15 c 1-hec-georas_part1
5 c 1-hec-georas_part1
 
Hec ras 4.1-applications_guide[1]
Hec ras 4.1-applications_guide[1]Hec ras 4.1-applications_guide[1]
Hec ras 4.1-applications_guide[1]
 
Aras tutorial
Aras tutorialAras tutorial
Aras tutorial
 
Ekons HecRas Model_01
Ekons HecRas Model_01Ekons HecRas Model_01
Ekons HecRas Model_01
 
Odisha sw wb mission-may14
Odisha sw wb mission-may14Odisha sw wb mission-may14
Odisha sw wb mission-may14
 
Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod
 Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod
Download-manuals-surface water-software-estimationofdischargebyarea-slopemethod
 
Network and mandates of wq monitoring
Network and mandates of wq monitoringNetwork and mandates of wq monitoring
Network and mandates of wq monitoring
 
Download-manuals-surface water-manual-illustrations-hydrologicalobservations
 Download-manuals-surface water-manual-illustrations-hydrologicalobservations Download-manuals-surface water-manual-illustrations-hydrologicalobservations
Download-manuals-surface water-manual-illustrations-hydrologicalobservations
 
Hp wq study of ground water quality characteristics in industrially predomina...
Hp wq study of ground water quality characteristics in industrially predomina...Hp wq study of ground water quality characteristics in industrially predomina...
Hp wq study of ground water quality characteristics in industrially predomina...
 
Download-manuals-surface water-software-investigation&selectionofhydrologica...
 Download-manuals-surface water-software-investigation&selectionofhydrologica... Download-manuals-surface water-software-investigation&selectionofhydrologica...
Download-manuals-surface water-software-investigation&selectionofhydrologica...
 
Readers guide sw his documents v2
Readers guide sw his documents v2Readers guide sw his documents v2
Readers guide sw his documents v2
 
Download-manuals-surface water-software-introductiontoadvanceddischargemeasu...
 Download-manuals-surface water-software-introductiontoadvanceddischargemeasu... Download-manuals-surface water-software-introductiontoadvanceddischargemeasu...
Download-manuals-surface water-software-introductiontoadvanceddischargemeasu...
 
Final wq handbook 180514
Final wq handbook 180514Final wq handbook 180514
Final wq handbook 180514
 
Upstream Suburban Philadelphia Sub-Watershed Cluster Modeling Overview
Upstream Suburban Philadelphia Sub-Watershed Cluster Modeling OverviewUpstream Suburban Philadelphia Sub-Watershed Cluster Modeling Overview
Upstream Suburban Philadelphia Sub-Watershed Cluster Modeling Overview
 
Ch sw study of reservoir sedimentation, impact assessment and development of ...
Ch sw study of reservoir sedimentation, impact assessment and development of ...Ch sw study of reservoir sedimentation, impact assessment and development of ...
Ch sw study of reservoir sedimentation, impact assessment and development of ...
 
Final sw handbook 180514
Final sw handbook 180514Final sw handbook 180514
Final sw handbook 180514
 
Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts
 Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts
Download-manuals-water quality-wq-manuals-27surfacewaterqualityplanningconcepts
 
Punjab 8.4.14 edt
Punjab 8.4.14 edtPunjab 8.4.14 edt
Punjab 8.4.14 edt
 

Similar to Automating HEC-RAS with Excel

Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...
Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...
Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...jsvetter
 
Migration from Rails2 to Rails3
Migration from Rails2 to Rails3Migration from Rails2 to Rails3
Migration from Rails2 to Rails3Umair Amjad
 
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Qualcomm Developer Network
 
water-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdfwater-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdfEnriqueBonet3
 
water-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdfwater-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdfEnriqueBonet3
 
Managing Hydrodynamic Models With PHP
Managing Hydrodynamic Models With PHPManaging Hydrodynamic Models With PHP
Managing Hydrodynamic Models With PHPAndrew Goodwin
 
Swift Parallel Scripting for High-Performance Workflow
Swift Parallel Scripting for High-Performance WorkflowSwift Parallel Scripting for High-Performance Workflow
Swift Parallel Scripting for High-Performance WorkflowDaniel S. Katz
 
SponchiadoDavide_Pubblication
SponchiadoDavide_PubblicationSponchiadoDavide_Pubblication
SponchiadoDavide_PubblicationDavide Sponchiado
 
Apache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Big Data EU 2016: Building Streaming Applications with Apache ApexApache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Big Data EU 2016: Building Streaming Applications with Apache ApexApache Apex
 
Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)Sangjin Lee
 
Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016Vrushali Channapattan
 
Source Code Analysis with SAST
Source Code Analysis with SASTSource Code Analysis with SAST
Source Code Analysis with SASTBlueinfy Solutions
 

Similar to Automating HEC-RAS with Excel (20)

ICUR Poster
ICUR PosterICUR Poster
ICUR Poster
 
Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...
Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...
Exploring Emerging Technologies in the Extreme Scale HPC Co-Design Space with...
 
Migration from Rails2 to Rails3
Migration from Rails2 to Rails3Migration from Rails2 to Rails3
Migration from Rails2 to Rails3
 
Api RESTFull
Api RESTFullApi RESTFull
Api RESTFull
 
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
Power-Efficient Programming Using Qualcomm Multicore Asynchronous Runtime Env...
 
water-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdfwater-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdf
 
water-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdfwater-10-01382-v2 (2).pdf
water-10-01382-v2 (2).pdf
 
HEC-RAS 5.0.5 Release Notes
HEC-RAS 5.0.5 Release NotesHEC-RAS 5.0.5 Release Notes
HEC-RAS 5.0.5 Release Notes
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Lecture3
Lecture3Lecture3
Lecture3
 
Managing Hydrodynamic Models With PHP
Managing Hydrodynamic Models With PHPManaging Hydrodynamic Models With PHP
Managing Hydrodynamic Models With PHP
 
Swift Parallel Scripting for High-Performance Workflow
Swift Parallel Scripting for High-Performance WorkflowSwift Parallel Scripting for High-Performance Workflow
Swift Parallel Scripting for High-Performance Workflow
 
SponchiadoDavide_Pubblication
SponchiadoDavide_PubblicationSponchiadoDavide_Pubblication
SponchiadoDavide_Pubblication
 
Apache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Big Data EU 2016: Building Streaming Applications with Apache ApexApache Big Data EU 2016: Building Streaming Applications with Apache Apex
Apache Big Data EU 2016: Building Streaming Applications with Apache Apex
 
Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)Timeline Service v.2 (Hadoop Summit 2016)
Timeline Service v.2 (Hadoop Summit 2016)
 
Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016Timeline service V2 at the Hadoop Summit SJ 2016
Timeline service V2 at the Hadoop Summit SJ 2016
 
Ajax
AjaxAjax
Ajax
 
SWEET - A Tool for WCET Flow Analysis - Björn Lisper
SWEET - A Tool for WCET Flow Analysis - Björn LisperSWEET - A Tool for WCET Flow Analysis - Björn Lisper
SWEET - A Tool for WCET Flow Analysis - Björn Lisper
 
Source Code Analysis with SAST
Source Code Analysis with SASTSource Code Analysis with SAST
Source Code Analysis with SAST
 
SCDJWS 5. JAX-WS
SCDJWS 5. JAX-WSSCDJWS 5. JAX-WS
SCDJWS 5. JAX-WS
 

Recently uploaded

Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptxrouholahahmadi9876
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaOmar Fathy
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...jabtakhaidam7
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 

Recently uploaded (20)

Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 

Automating HEC-RAS with Excel

  • 1. Automating HEC-RAS with Excel Virginia Lakes and Watersheds Conference, March 2015 Thomas Williams, PE Amec Foster Wheeler + = ?
  • 2. Contents 1. What is HEC-RAS? (brief intro) 2. The HECRASController API 3. Excel VBA Demos 1. Multi-Model Run 2. RAS Output Extraction 3. Manning’s ‘n’ Calibration (sort of) 4. Tips 5. Conclusion 2
  • 3. 1. What is HEC-RAS? 3 Hydrologic Engineering Centers River Analysis System “HEC-RAS allows you to perform one-dimensional steady flow, unsteady flow, sediment transport/mobile bed computations, and water temperature modeling.” - USACE
  • 4. What is an API? API = Application Programmer Interface “In computer programming, an application programmer interface (API) is a set of routines, protocols, and tools for building software applications. An API expresses a software component in terms of its operations, inputs, outputs, and underlying types.” - Wikipedia 2. The HECRASController API 4 Their Program Your Program API
  • 5. 2. The HECRASController API (cont’d) The HECRASController API “The current version of the HECRASController has a wealth of procedures that will allow a programmer to manipulate HEC-RAS externally by setting input data, retrieving input or output data, and performing common [HEC-RAS] functions…” - Christopher Goodell, PE, D.WRE, Breaking the HEC-RAS Code, 2014 5 HEC-RAS Excel API
  • 6. 2. The HECRASController API (cont’d) Accessing the API from Microsoft Excel 1. Click the Visual Basic button (on the Developer tab) 2. Create a new VBA module 3. Go to Tools > References, check “HEC River Analysis System”, and click OK. 4. Write code! 6
  • 7. 2. The HECRASController API (cont’d) A simple program… 7 Sub RunHECRAS() ' Opens and runs a HEC-RAS model ' Declare variables Dim ras As New HECRASController Dim nmsg As Long Dim strMessages() As String Dim prjFilePath As String ' Open the model prjFilePath = "C:MyHecRasModel.prj" ras.Project_Open (prjFilePath) ' Run the model ras.Compute_CurrentPlan nmsg, strMessages End Sub
  • 8. 2. The HECRASController API (cont’d) Some example HECRASController fuctions and subroutines: • Project_Open Opens a HEC-RAS model. • Compute_CurrentPlan Runs the current flow/geometry regime. • ExportGIS Exports an *.sdf file that can be read into ArcGIS using HEC- GeoRAS. • Output_NodeOutput Returns an output value for a given node and profile. 8 • Geometry_SetMann Sets the Manning’s ‘n’ values for a cross section, horizontally varied. • Add_BC Adds a bridge/culvert. • Edit_BC Opens the Bridge/Culvert Editor and displays the selected station. • PlotPF Displays the water surface profile for a given River/Reach.
  • 9. 3. Excel VBA Demos 9 1. Multi-Model Run 2. RAS Output Extraction 3. Manning’s ‘n’ Calibration (sort of) Cross your fingers!
  • 10. 4. Tips • Breaking the HEC-RAS Code by Christopher Goodell, PE, D.WRE • The API is a little rough around the edges. • Provides a lot of functionality, but not everything • Inconsistencies: • Parameter names and types • Function / subroutine behavior • No “official” API documentation • HEC-RAS is public domain software, but not open source • HEC-RAS project (*.prj), geometry (*.g##), flow (*.f##), and plan (*.p##) files are plain text. • Sometimes that’s easier than using the API. • HEC-RAS output files (*.O##) are binary.  10
  • 11. 5. Conclusion 1. The HECRASController API is really useful… 2. …but it takes a little work to figure out. 3. Happy coding! Questions? Contact Info Thomas Williams, PE Amec Foster Wheeler thomas.williams@amecfw.com 11