Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents

Table of Contents

Introduction

Note: The Delft-FEWS HEC-RAS adapter is maintained by RMA

The conceptual solution for the interface between HEC-RAS and FEWS has been illustrated in Figure 1. Two modes of working are identified that each support a basic use case. The modes of working are:

  • Operational forecasting mode
  • Calibration mode

The technical implementations for both modes of working are quite different. For running HEC-RAS in operational forecasting mode from FEWS, a software interface will be required that directly controls the model runs.

Calibration is considered as an activity that should be carried out offline from the forecasting system. This means that no direct control from FEWS will be required but a user will need to be able to migrate model datasets (calibrated schematizations) from the HEC-RAS calibration environment to the forecasting environment.

Present documentation will describe the first mode of operation. For details about operating model in the calibration mode please check standard HEC-RAS documentation.

Operating Forecasting Model

Image Added
Figure 1 Components used to run forecasts using HEC-RAS model in the FEWS/CHPS system

Operating HEC-RAS Model and FEWS Adapter

The HEC-RAS model provides the compute engine for running a hydraulic model schematization for a section of a river or a part of a river system. The HEC-RAS Adapter forms the interface between the FEWS Forecasting Shell and the HEC-RAS model.

The HEC-RAS compute engine is, as its name suggests, the component that actually performs the HEC-RAS simulation. This simulation is controlled from the FEWS Adapter, and all run time data such as initial and boundary conditions, and parameter settings are passed through the adapter from and to the FEWS Forecasting Shell.

Download

Download of the model adapter is not available here: pls contact the adapter owner RMA or e-mail the Delft-FEWS Product Management for more information.
Configuration Manual for HEC-RAS versions 4.1: Config manual RAS 4.1

Configuration Manual for HEC-RAS versions 5.0.3: Config manual RAS 5.0.3.

Configuration Manual for HEC-RAS versions 5.0.7: Config manual RAS 5.0.7 and RAS Mapper

Configuration Manual for HEC-RAS version 6.0: Config manual RAS 6.0

Interface between FEWS and HEC-RAS

The FEWS Adapter for HEC-RAS forms the interface between the FEWS Forecasting Shell and the HEC-RAS model. The adapter accepts the request from the Forecasting Shell to run HEC-RAS, and imports the required data provided by the Forecasting Shell.

This data shall be provided in a standardized XML interface format, the FEWS Published Interface. Once a HEC-RAS run has been completed, relevant results are passed back to the Forecasting Shell in the form of the standardized XML interface format.

A schematic representation of the communication between the Forecasting Shell and the HEC-RAS model via the FEWS Adapter is shown in the diagram below.

Image Added
Figure 2 Data flows involved during run of HEC-RAS model FEWS adapter

The FEWS Adapter allows running of HEC-RAS by FEWS. The FEWS Adapter should be considered as a thin communication (software) layer on top the existing HEC-RAS engine. The adapter is tightly connected to the model engine. For longer term consistency, a FEWS adapter should therefore preferably be maintained by the owner of the model code, in this case HEC. The FEWS Adapter for HEC-RAS shall be developed by HEC or handed over to HEC upon completion.

The features of the are listed in the tables below.

Preprocessing 01

Clean up work and output folder

Preprocessing 02

Create module diagnostics file in Published Interface (PI) format

Preprocessing 03

Read the time series from PI time series

Preprocessing 04

Convert input PI time series into RAS *.b01 files

Launcher 01

Run HEC-RAS with run period and model alternative

Postprocessing 01

Open/create module diagnostics file in PI format

Postprocessing 02

Read the output time series from the RAS DSS and binary output files

Postprocessing 03

Write the time series to the output.xml

Postprocessing 04

Write the time series to the binary-output.xml

Postprocessing 05

Write the updated PI state file to export folder

ID Mapping

The location parameters used in FEWS can be coupled to HEC-RAS DSS path names through ID-mapping. The configuration files for ID-mapping should be created separately for each HEC-RAS model. Please consult 08 Mapping Id's flags and units for more information on how to configure id mapping in FEWS system.

Directory structure

The data directories and configuration files that are required for operating the FEWS Adapter for HEC-RAS have been shown below.

Note that only binary and configuration files relevant to the HEC-RAS adapter are included, in a real configuration a lot more files can be involved used by another modules of the FEWS system.

No Format
Wiki Markup
h2. Contents

{toc}

h2. Introduction

The conceptual solution for the interface between HEC-RAS and FEWS has been illustrated in Figure 1. Two modes of working are identified that each support a basic use case. The modes of working are: 

* Operational forecasting mode
* Calibration mode

The technical implementations for both modes of working are quite different. For running HEC-RAS in operational forecasting mode from FEWS, a software interface will be required that directly controls the model runs.

Calibration is considered as an activity that should be carried out offline from the forecasting system. This means that no direct control from FEWS will be required but a user will need to be able to migrate model datasets (calibrated schematizations) from the HEC-RAS calibration environment to the forecasting environment.

Present documentation will describe the first mode of operation. For details about operating model in the calibration mode please check standard HEC-RAS documentation.

h2. Operating Forecasting Model

!HEC-RAS-adapter-architecture.png!
{color:#4f81bd}*Figure 1*{color} {color:#4f81bd}*Components used to run forecasts using HEC-RAS model in the FEWS/CHPS system*{color}

h2. Operating HEC-RAS Model and FEWS Adapter

The HEC-RAS model provides the compute engine for running a hydraulic model schematization for a section of a river or a part of a river system. The HEC-RAS Adapter forms the interface between the FEWS Forecasting Shell and the HEC-RAS model.

The HEC-RAS compute engine is, as its name suggests, the component that actually performs the HEC-RAS simulation. This simulation is controlled from the FEWS Adapter, and all run time data such as initial and boundary conditions, and parameter settings are passed through the adapter from and to the FEWS Forecasting Shell. 

{hidden}
h2. Download

Example of the HEC-RAS adapter configuration, including model binary files can be found in the following zip file:
{attachments:patterns=.*zip}
{hidden}

h2. Interface between FEWS and HEC-RAS

The FEWS Adapter for HEC-RAS forms the interface between the FEWS Forecasting Shell and the HEC-RAS model. The adapter accepts the request from the Forecasting Shell to run HEC-RAS, and imports the required data provided by the Forecasting Shell.

This data shall be provided in a standardized XML interface format, the FEWS Published Interface. Once a HEC-RAS run has been completed, relevant results are passed back to the Forecasting Shell in the form of the standardized XML interface format.

A schematic representation of the communication between the Forecasting Shell and the HEC-RAS model via the FEWS Adapter is shown in the diagram below.

!HEC-RAS-adapter-architecture2.png!
{color:#4f81bd}*Figure 2*{color} {color:#4f81bd}*Data flows involved during run of HEC-RAS model FEWS adapter*{color}

The FEWS Adapter allows running of HEC-RAS by FEWS. The FEWS Adapter should be considered as a thin communication (software) layer on top the existing HEC-RAS engine. The adapter is tightly connected to the model engine. For longer term consistency, a FEWS adapter should therefore preferably be maintained by the owner of the model code, in this case HEC. The FEWS Adapter for HEC-RAS shall be developed by HEC or handed over to HEC upon completion.

The features of the are listed in the tables below.

|Preprocessing 01|Clean up work and output folder |
|Preprocessing 02|Create module diagnostics file in Published Interface (PI) format |
|Preprocessing 03|Read the time series from PI time series |
|Preprocessing 04|Convert input PI time series into RAS *.b01 files |
|Launcher 01  |Run HEC-RAS with run period and model alternative |
|Postprocessing 01|Open/create module diagnostics file in PI format |
|Postprocessing 02|Read the output time series from the RAS DSS and binary output files|
|Postprocessing 03|Write the time series to the output.xml|
|Postprocessing 04|Write the time series to the binary-output.xml|
|Postprocessing 05|Write the updated PI state file to export folder|

h2. ID Mapping

The location parameters used in FEWS can be coupled to HEC-RAS DSS path names through ID-mapping. The configuration files for ID-mapping should be created separately for each HEC-RAS model. Please consult [08 Mapping Id's flags and units] for more information on how to configure id mapping in FEWS system.

h2. Directory structure

The data directories and configuration files that are required for operating the FEWS Adapter for HEC-RAS have been shown below.

Note that only binary and configuration files relevant to the HEC-RAS adapter are included, in a real configuration a lot more files can be involved used by another modules of the FEWS system.

{noformat}
+---bin
|       <FEWS binaries>
\---nerfc_sa

    |
    +---ColdStates
 Config
    |   +---ColdStateFiles
    |   |       hecrasHECRAS_connecticutCONNECTICTUT_HistoricalUpdateStates Default.zip...... cold state files
    |   |
    
|    +---Config
    |   +---IdMapFiles
    |   |       IdExportHECRAS.xml.......................... custom mappings for the HEC-RAS variables and locations
    |   |       
    |   \+---ModuleConfigFiles
    |   |        hecrasHECRAS_ConnecticutCONNECTICTUT_Forecast.xml............ main configuration file of the adapter
    |   |
    |   +---ModuleDataSetFiles
    |   |        
    \---Models HECRAS_CONNECTICTUT_UpdateStates.xml.........zipped hecras files, transported to Models directory
    |   |
    |   \---hecrasModuleParFiles
    |            +---binHECRAS_CONNECTICUT_Parameters.............. configuration file which allows to override some model and structure parameters
    |
    \---Models
        \---hec/hecras
            +---bin........................................ directory which contains all HEC-RAS executables for Windows and Linux platforms
            |       DSSWriter.exe.......................... generates binary file containing detailed model output
            |       dss_writer
            |       GeomPreprocessor.exe................... converts geometry files from GUI ASCII format to binary
            |       geo_pre
            |       Steady.exe............................. performs steady flow simulations
            |       steady
            |       Unsteady.exe........................... performs unsteady flow simulations
            |       unsteady
            |       DFORMD.DLL
            |       DFORMDD.DLL
            |       MSVCRTD.DLL
            |       libmtsk.so.1
            |       libwldelft_native.so
            |       module-adapter-hec-ras.jar............. pre- and pos- adapter, Coverts HEC-RAS data files to/from FEWS-PI format
            |       nwsras.jar............................. main library used by the adapter, reads and writes HEC-RAS data files
            |       heclib6-pc.dll
            |       javaHeclib.dll
            |       castor-0.9.5p.jar...................... the rest of the files below are FEWS dependencies used by adapter
            |       commons-cli-1.1.jar
            |       Delft_FEWS_castor.jar
            |       Delft_FEWS_schemas.jar
            |       Delft_PI.jar
            |       Delft_PI_castor.jar
            |       Delft_Util.jar
            |       jaxp-api-1_3.jar
            |       jaxp-dom-1-3.jar
            |       jaxp-sax-1_3.jar
            |       jaxp-xalan-1_3.jar
            |       jaxp-xercesImpl-1_3.jar
            |       log4j-1.2.14.jar
            |       serializer.jar
            |       TimeSeriesImport.jar
            |       xalan.jar
            |       xerces-c_2_8.dll
            |       xercesImpl.jar
            |       xml-apis.jar
            |
       
            \\---connecticut
                |    run_info.xml.......................... a file generated by FEWS containing paths, run options
                |
                +---input.................................. input directory of the adapter, input FEWS-PI time series files
                |       inputs.xml
                |       
                +---log.................................... log messages written by the hec-ras adapter
                |       adapter.xml
                |       
                +---output................................. contains HEC-RAS output converted from the binary and dss output files
                |       output.xml
                |       
                \---work................................... working directory of the adapters
                        ctfld2ras.b01
                        ctfld2ras.b02
                        ctfld2ras.b03
                        ctfld2ras.c02
                        ctfld2ras.f04
                        ctfld2ras.g02
                        ctfld2ras.p01
                        ctfld2ras.p02
                        ctfld2ras.p05
                        ctfld2ras.prj
                        ctfld2ras.r01
                        ctfld2ras.r02
                        ctfld2ras.r03
                        ctfld2ras.r05
                        ctfld2ras.u01
                        ctfld2ras.u02
                        ctfld2ras.x02
{noformat}

Communication between FEWS system and 

Technical details about communication between HEC-RAS adapter and DELFT-FEWS system.

Communication between FEWS system and pre-/post-

...

adapter

...

strictly

...

follows

...

the

...

FEWS

...

Published

...

Interface

...

format.

...

Current

...

implementation

...

of

...

the

...

HEC-RAS

...

adater

...

has

...

all

...

files

...

required

...

to

...

run

...

it

...

(even

...

in

...

a

...

stand-alone

...

mode,

...

without

...

DELFT-FEWS

...

system).

...

The

...

diagram

...

below

...

shows

...

all

...

dependencies

...

from

...

the

...

FEWS libraries.

Image Added

An adapter itself works only as a bridge between nwsras.jar library and DELFT-FEWS system. nwsras.jar provides a set of functions which allow to read/write all required HEC-RAS data files, including files used by the graphical user interface of HEC-RAS model.

For more technical details about functionality used by the adapter see nwsras.doc and nwsras.tester.java files in attachment.

Note

Current version of HEC-RAS adapter is able to update all required HEC-RAS GUI files automatically when model is started from DELFT-FEWS. As result the user is able to get a complete model input generated by the DELFT-FEWS. This allows user to analyze model input in details using HEC-RAS GUI.

Description of the HEC-RAS data files

Table 1 List of files to be read and written by adapter

Extension

Description

pre-adapter input

pre-adapter output

post-adapter input

post-adapter output

.prj

project file

(tick)


(tick)


.p01

plan files

(tick)


(tick)


.g01

geometry files

(tick)


(tick)


.f01

flow files





.u01

unsteady flow files





.b01

unsteady run files

(tick)

(tick)

(tick)


.x01

input file for geometry preprocessor





.r01

steady run file





.O01

binary output file



(tick)


.bco

model log file



(tick)


.c01

output of geometry preprocessor





.dss

input / output files



(tick)


.hyd01

input file for geometry preprocessor





Configuring HEC-RAS adapter

HEC-RAS model adapter follows standard way of integrating external models into the Delft-FEWS system by use of General Adapter. For more details about configuration of General Adapter please check 05 General Adapter Module.

A very important part of the configuration is defined under the <exportRunFileActivity> element. It contains path to the RAS project file, location of the RAS binary files and list of variables to be written into the output files. Additionally user may override logging level of the adapter to DEBUG in order to see more detailed output from the adapter. This is useful during configuration of the adapter since list of possible output variables that model can produce or list of input variables that can be consumed by the adapter are also printed to the log file.

Note

List of output variables is defined under outputTimeSeriesParametersFilter and outputLongtitudionalProfileParametersFilter items use Regular Expressions. In most cases it is a list of variable names delimited with '|' character and for those variables where name can occur in another variable names (e.g. FLOW and FLOW AT GATE) it is necessary to use ^ as a prefix and $$ as a suffix of the variable. For example:

Code Block
languagexml
         <string key="outputTimeSeriesParametersFilter" value="^STAGE$$|^FLOW$$|Hydr Radius R|Hydr Radius L|^Flow Area$$" />


Example configuration of the HEC-RAS adapter:

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<generalAdapterRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/generalAdapterRun. libraries.

!fews-hec-ras.cmd.png|thumbnail!

h2. Description of the HEC-RAS data files

{color:#4f81bd}*Table 1 List of files to be read and written by adapter*{color}
||Extension||Description|| pre-adapter input || pre-adapter output || post-adapter input || post-adapter output ||
|*.prj*|_project file_| (/) | | (/) | |
|*.p01*|_plan files_| (/)  | | (/)  | |
|*.g01*|_geometry files_| (/)  | | (/) | |
|*.f01*|_flow files_| | | | |
|*.u01*|_unsteady flow files_| | | | |
|*.b01*|_unsteady run files_| (/) | (/) | (/) | |
|*.x01*|_input file for geometry preprocessor_| | | | |
|*.r01*|_steady run file_| | | | |
|*.O01*|_binary output file_| | | (/) | |
|*.bco*|_model log file_| | | (/) | |
|*.c01*|output of geometry preprocessor | | | | |
|*.dss*|input / output files| | | (/) | |
|*.hyd01*|input file for geometry preprocessor | | | | |

h2. Configuring HEC-RAS adapter

HEC-RAS model adapter follows standard way of integrating external models into the Delft-FEWS system by use of *General Adapter*. For more details about configuration of General Adapter please check [05 General Adapter Module].

Example configuration of the HEC-RAS adapter:

{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<generalAdapterRun xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/generalAdapterRun.xsd">
	<general>
		<description>hecras Model for Kennebec River</description>
		<rootDir>%REGION_HOME%/Models/hecras/</<rootDir>$HECRASMODELDIR$/kennebec</rootDir>
		<workDir>%ROOT_DIR%/kennebec/work</workDir>
		<exportDir>%ROOT_DIR%/kennebec/input</exportDir>
		<exportDataSetDir>%ROOT_DIR%/kennebec/work</exportDataSetDir>
		<exportIdMap>IdExportHECRAS</exportIdMap>
		<exportUnitConversionsId>displayEnglishUnits<<exportUnitConversionsId>ExportHECRAS</exportUnitConversionsId>
		<importDir>%ROOT_DIR%/kennebecDIR%output</output</importDir>
		<importIdMap>IdImportHECRAS</importIdMap>
		<importUnitConversionsId>ImportEnglishUnits<<importUnitConversionsId>ImportHECRAS</importUnitConversionsId>
		<dumpFileDir>$GA_DUMPFILEDIR$</dumpFileDir>
		<dumpDir>%ROOT_DIR%/kennebec<DIR%</dumpDir>
		<diagnosticFile>%ROOT_DIR%/kennebec/log/preadapter.xml</diagnosticFile>
	</general>
	<activities>
		<startUpActivities>
			<purgeActivity>
				<filter>%ROOT_DIR%/kennebec/log/*.*</filter>
			</purgeActivity>
			<purgeActivity>
				<filter>%ROOT_DIR%/kennebec/input/*.*</filter>
			</purgeActivity>
			<purgeActivity>
				<filter>%ROOT_DIR%/kennebec/output/*.*</filter>
			</purgeActivity>
			<purgeActivity>
				<filter>%ROOT_DIR%/kennebec/work/*.*</filter>
			</purgeActivity>
		</startUpActivities>
		<exportActivities>
			<exportStateActivity>
				<moduleInstanceId>HECRAS_KENNEBEC_UpdateStates</moduleInstanceId>
				<stateExportDir>%ROOT_DIR%/kennebec/work</stateExportDir>
				<stateConfigFile>%ROOT_DIR%/kennebec/work/state.xml</stateConfigFile>
				<stateLocations type="file">
					<stateLocation>
						<readLocation>Augusta.p02.rst</readLocation>
						<writeLocation>Augusta.p02.rst</writeLocation>
					</stateLocation>
				</stateLocations>
				<stateSelection>
					<warmState>
						<stateSearchPeriod unit="day" start="-10" end="0-1"/>
					</warmState>
				</stateSelection>
			</exportStateActivity>
			<exportTimeSeriesActivity>
				<exportFile>input<exportFile>%ROOT_DIR%/input/input.xml</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>HECRAS_KENNEBEC_Preprocessing_Forecast<UpdateStates</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>QINE</parameterId>
						<locationId>SIDM1ME</locationId>
						<timeSeriesType>simulated forecasting<historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<relativeViewPeriod unit="hour" end="0" endOverrulable="true"/>
						<readWriteMode>read only</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>HECRAS_KENNEBEC_Preprocessing_Forecast<UpdateStates</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>STID</parameterId>
						<locationId>CASM1ME</locationId>
						<timeSeriesType>simulated forecasting<historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<relativeViewPeriod unit="hour" end="0" endOverrulable="true"/>
						<readWriteMode>read only</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportTimeSeriesActivity>
			<exportDataSetActivity>
				<moduleInstanceId>HECRAS_KENNEBEC_UpdateStates</moduleInstanceId>
			</exportDataSetActivity>
		</exportActivities>
		<!-- RAS execution -->	<exportParameterActivity>
		<executeActivities>
			<executeActivity><fileName>params.xml</fileName>
				<command>
					<className>nl.wldelft.fews.adapter.hec.HecRasPreAdapter</className>
	<moduleInstanceId>HECRAS_KENNEBEC_UpdateStates</moduleInstanceId>
			</command>exportParameterActivity>
				<arguments><exportRunFileActivity>
					<argument>--project-file=%ROOT<exportFile>%ROOT_DIR%/kennebec/work/Augusta.prj</argument>run_info.xml</exportFile>
					<argument>--dss-file=%ROOT_DIR%/kennebec/work/Augusta.dss</argument>
				</arguments>
				<timeOut>120000</timeOut>
			</executeActivity>
			<executeActivity>
				<command>
					<executable>%ROOT_DIR%/kennebec/work/run.sh</executable>
				</command>
				<timeOut>120000</timeOut>
			</executeActivity>
			<executeActivity>
				<command>
					<className>nl.wldelft.fews.adapter.hec.HecRasPostAdapter</className>
				</command>
				<arguments>
					<argument>--project-file=%ROOT_DIR%/kennebec/work/Augusta.prj</argument>
					<argument>--output-log-file=%ROOT_DIR%/kennebec/log/postadapter.xml</argument>
					<argument>--output-pi-file=%ROOT_DIR%/kennebec/output/output.xml</argument>
					<argument>--output-binary-file=%ROOT_DIR%/kennebec/work/Augusta.IC.O02</argument>
					<argument>--output-binary-pi-file=%ROOT_DIR%/kennebec/output/binary-output<properties>
	                        <string key="hecRasProjectFile" value="%ROOT_DIR%/work/Augusta.prj"/>
	                        <string key="hecRasBinDirectory" value="$HECRASBINDIR$"/>
	                        <string key="outputTimeSeriesParametersFilter" value="^STAGE$$|^FLOW$$"/>
	                        <string key="outputLongtitudionalProfileParametersFilter" value="^STAGE$$|Hydr Radius L"/>
	                        <string key="logLevel" value="DEBUG"/>
	                        <string key="skipBinaryOutput" value="false"/>
                                <string key="hecRasEnvironment" value="LD_LIBRARY_PATH=$HECRASBINDIR$:$LD_LIBRARY_PATH"/>
				</properties>
			</exportRunFileActivity>
		</exportActivities>
		<executeActivities>
			<executeActivity>
				<command>
					<className>nl.wldelft.fews.adapter.hec.HecRasAdapter</className>
					<binDir>$HECRASBINDIR$</binDir>
				</command>
				<arguments>
					<argument>%ROOT_DIR%/run_info.xml</argument>
				</arguments>
				<timeOut>1500000</timeOut>
			</executeActivity>
		</executeActivities>
		<importActivities>
			<importTimeSeriesActivity><importStateActivity>
				<importFile>output<stateConfigFile>%ROOT_DIR%/work/state.xml</stateConfigFile>
				<synchLevel>20</synchLevel>
			</importStateActivity>
			<importTimeSeriesActivity>
				<importFile>%ROOT_DIR%/output/output.xml</importFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>HECRAS_KENNEBEC_Forecast<UpdateStates</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>SSTG</parameterId>
						<locationId>AUGM1ME</locationId>
						<timeSeriesType>simulated forecasting<historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>HECRAS_KENNEBEC_Forecast<UpdateStates</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>SQIN</parameterId>
						<locationId>AUGM1ME</locationId>
						<timeSeriesType>simulated forecasting<historical</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importTimeSeriesActivity>
		</importActivities>
	</activities>
</generalAdapterRun>

{code}

The

...

hecras

...

files

...

(b01,prj,u01,x01,run.sh

...

etc.)are

...

saved

...

in

...

the

...

/Config/ModuleDataSet

...

directory.

...

These

...

are

...

copied

...

to

...

the

...

/Model/hecras/<model>/work

...

directory

...

during

...

the

...

exportDataSet

...

activity

...

in

...

the

...

General

...

Adapter file.

Add global properties for hecras model and binaries

The $HECRASBINDIR$ property is defined in the global.properties at the same level of the Config and Models directory:

HECRASMODELDIR=%REGION_HOME%/Models/hec/hecras
HECRASBINDIR=$HECRASMODELDIR$/bin

Overriding gate, levee breach settings

In a current version of the HEC-RAS adapter the user may also override computational interval of the model as well as structure parameters.

This can be done using parameters file which need to be also referenced by the HEC-RAS module config file. See <exportParameterActivity> element in the general adapter configuration above.

An example belows shows list of the parameters which are supported for now.

Note

Name of the structure defined in the HEC-RAS must exactly match group id and location of the structure (station, river, chainage) must be the same as locationId.


Code Block
xml
xml
<parameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.wldelft.nl/fews/PI" xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_modelparameters.xsd" version="1.5">
    <modifierType>HECRAS</modifierType>
    <group id="default" name="hec-ras run parameters">
        <parameter id="ComputationInterval">
            <description>Computation interval in minutes. Does not change interval of output data.</description>
            <intValue>5</intValue>
        </parameter>
    </group>

    <!-- Gate name and locationId should be equal to what is defined in the HEC-RAS gui -->
    <group id="Gate #1" name="hec-ras gate parameters">
        <locationId>CT River R1/18100</locationId> file.

h2. List of input and output variables which can be exchanged with the Delft-FEWS system and HEC-RAS adapter

Whe HEC-RAS adapter is configured properly and forecast is performed from the Delft-FEWS system - a list of input and output variables will be written into the standard log file of the system. The location and variables are based on the active *<region>.b01* file of the HEC-RAS model configured in the GUI of HEC-RAS. Pre-adapter of the HEC-RAS will provide list of all possible input variables and locations in the following part of the log file:

{code}
...
156 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Found input at locations:
156 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  -     CT River, R1, 334752.0, Flow Hydrograph
156 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  -     CT River, R1, 0.00, Stage Hydrograph
...
{code}

Locations and variables listed after the line *Found input at locations:* can be configured in the Delft-FEWS as a part of adapter input, e.g. *input.xml* in this case may contain something like the lines below:

{code:title=input.xml}
<TimeSeries
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <timeZone>0.0</timeZone>
    <series>
        <header><!--

            <type>instantaneous</type>
 Gate parameters depend on the mode selected in the RAS configuration files (gui),

  <locationId>CT RIVER R1 334752.0</locationId>
        Posssible modes which can <parameterId>Flow Hydrograph</parameterId>
    te set in the gui are:

        <timeStep unit="second" multiplier="3600"/>
          based on <startDate date="2008-11-06" time="12:00:00"/>
upstream WS (default)
               <endDate date="2008-11-08" time="12:00:00"/>
   based on specified reference
      <missVal>-999.0</missVal>
            <stationName>Connicut River at Thompsonville</stationName>
   based on difference in stage
         <units>cms</units>-->

        </header>
    !-- parameters valid all modes -->
    <event date="2008-11-06" time="12:00:00" value="14.98" flag="0"/    <parameter id="RateOpen">
        <event date="2008-11-06" time="13:00:00" value="14.705" flag="0"/>    <dblValue>0.05</dblValue>
        <event date="2008-11-06" time="14:00:00" value="14.43" flag="0"/</parameter>

        <parameter id="RateClose">
        <event date="2008-11-06" time="15:00:00" value="14.155" flag="0"/>
       <dblValue>0.05</dblValue>
        </parameter>

     <event date="2008-11-06" time="16:00:00" value="13.88" flag="0"/ <parameter id="MaxOpen">
        <event date="2008-11-06" time="17:00:00" value="13.605" flag="0"/>    <dblValue>20.0</dblValue>
        ...
{code}

Note that *<parameterId>* and *<locationId>* are exactly the same as the variables and locations listed in the log file.

In the same way list of all output variables and locations can be found in the post-adapter log output, for example:

{code}
...
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Profile, Profile number.,  
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.S. Elev, Calculated water surface from energy equation., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - E.G. Elev, Energy gradeline for given WSEL., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Max Chl Dpth, Maximum main channel depth., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Min Ch El, Minimum Channel Elevation., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Left, Flow in left overbank., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Channel, Flow in main channel., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Right, Flow in right overbank., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Total, Total flow in cross section., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area, Total area of cross section active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area L, Area of left overbank active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area Ch, Area of main channel active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area R, Area of right overbank active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.P. Total, Wetted perimeter of total cross section., (ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.P. Left, Wetted perimeter of left overbank., (ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.P. Channel, Wetted perimeter of main channel., (ft)
...
{code}

Note that parameter names to be written into the output FEWS-PI file will contain only the short name of the parameter, e.g.: *Q Right* and not *Flow in right overbank., (cfs)*.

The variables listed here will be written into the file specified as a "--output-binary-pi-file=<path>" argument of the post-adapter. Example of the resulting FEWS-PI xml can be found below:

{code:xml|title=Example of the FEWS-PI containing binary output of the HEC-RAS model}
<TimeSeries
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <timeZone>0.0</timeZone>
    <series>
        <header></parameter>

        <parameter id="MinOpen">
            <dblValue>0.0</dblValue>
        </parameter>

        <parameter id="InitOpen">
            <dblValue>3.0</dblValue>
        </parameter>

        <!-- parameters specific for "based on upstream WS" -->
        <parameter id="ZOpen">
            <description></description>
            <dblValue>4.0</dblValue>
        </parameter>

        <parameter id="ZClose">
            <description></description>
            <dblValue>3.0</dblValue>
        </parameter>

        <!-- parameters specific for "based on specified reference" -->
        <!--
        <parameter id="ReferenceWSType">
            <description>Valid values: Reach, RiverStation, StorageArea</description>
            <stringValue>Reach</stringValue>
        </parameter>

        <parameter id="ReferenceWS">
            <description>Depending on the ReferenceWSType parameter</description>
            <stringValue>R1</stringValue>
        </parameter>

        <parameter id="referenceWSOpen">
            <description>Reference elevation at which gate begins to open</description>
            <dblValue>4.0</dblValue>
        </parameter>

        <parameter id="referenceWSClose">
            <description>Reference elevation at which gate begins to close</description>
            <dblValue>3.0</dblValue>
        </parameter>
        -->

       <!-- parameters specific for "based on difference in stage" -->
       <!--
        <parameter id="stageDiffUSType">
            <type>instantaneous</type>
        <description>Upstream Reach, RiverStation or StorageArea location for stage difference computation</description>
    <locationId>CT River R1 334752.0</locationId>
     <stringValue>Reach</stringValue>
       <parameterId>W.S. Elev<</parameterId>parameter>

        <parameter id="stageDiffUS">
    <timeStep unit="second" multiplier="3600"/>        <description>Depends on the stageDiffUSType parameter</description>
            <startDate date="2008-11-06" time="00:00:00"/>
<stringValue>Reach</stringValue>
        </parameter>


       <endDate date="2008-11-08" time="00:00:00"/>
 <parameter id="stageDiffDSType">
             <missVal>NaN</missVal>
        <description>Downstream River, Reach, RiverStation or StorageArea location for stage difference computation</description>
    <units>[?]</units>
        <<stringValue>Reach</header>stringValue>
        <event date="2008-11-06" time="00:00:00" value="32.06013" flag="0"/></parameter>

        <event<parameter dateid="2008-11-06" time="01:00:00" value="32.06013" flag="0"/>
stageDiffDS">
            <event date="2008-11-06" time="02:00:00" value="32.034" flag="0"/><description>Depends on the stageDiffDSType parameter</description>
        <event date="2008-11-06" time="03:00:00" value="32.03394" flag="0"/> <stringValue>R1</stringValue>
        ...</parameter>

        <event<parameter dateid="2008-11-07" time="23:00:00" value="32.03618" flag="0"/stageDiffOpen">
        <event date="2008-11-08" time="00:00:00" value="32.03598" flag="0"/>
    </series>
    <series> <description>Stage difference at which gate begins to open</description>
        <header>
    <dblValue>0.1</dblValue>
        <type>instantaneous<</type>parameter>

        <parameter id="stageDiffClose">
   <locationId>CT River R1 334752.0</locationId>
      <description>Stage difference at which gate begins <parameterId>E.G. Elev</parameterId>
to close</description>
            <dblValue>0.1</dblValue>
 <timeStep unit="second" multiplier="3600"/>
     </parameter>
       <startDate date="2008-11-06" time="00:00:00"/>
    </group>

    <group id="Levee   <endDate dateBreach" name="2008-11-08" time="00:00:00"/hec-ras levee breach parameters">
        <locationId>CT River   <missVal>NaN</missVal>
R1/248658</locationId>

        <parameter id="IsActive">
             <units>[?]</units>
        </header><description>true when breach is activated, otherwise model skips it during computations</description>
        <event date="2008-11-06" time="00:00:00" value="32.06734" flag="0"/> <boolValue>false</boolValue>
        <event date="2008-11-06" time="01:00:00" value="32.06734" flag="0"/</parameter>

        <parameter id="IsWSStart">
        <event date="2008-11-06" time="02:00:00" value="32.056885" flag="0"/>
        ...
{code}

Additionally to the variables available in the binary output of the HEC-RAS, usually called <file>.O01, a DSS output is available. In most cases it contains FLOW and STAGE variables. Example of the FEWS-PI generated from the DSS file is given below:

{code:xml|title=Example of the FEWS-PI containing DSS output of the HEC-RAS model}
<TimeSeries
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <timeZone>0.0</timeZone>
    <series> <description>true if trigger for failure is WS elevation</description>
            <boolValue>true</boolValue>
        </parameter>

        <parameter id="ThresholdWS">
            <description>water surface elevation for breaching</description>
            <dblValue>3.4028E38</dblValue>
        </parameter>

        <parameter id="ThresholdDuration">
            <description>threshold time (hours) for breaching</description>
        <header>
    <dblValue>3.4028E38</dblValue>
        <type>instantaneous<</type>parameter>

        <parameter id="StartDate">
   <locationId>CT RIVER R1/0.00</locationId>
       <description>Start date for breaching  <parameterId>FLOW</parameterId>(e.g. 01MAR2001)</description>
            <timeStep unit="second" multiplier="3600"/><stringValue></stringValue>
            <startDate date="2008-11-06" time="00:00:00"/></parameter>

            <endDate date="2008-11-08" time="00:00:00"/<parameter id="StartTime">
            <missVal>NaN</missVal>
<description>Start time for breaching (e.g. 1630)</description>
       <units>CFS</units>     <stringValue></stringValue>
        </header>parameter>

        <event<parameter dateid="2008-11-06" time="00:00:00" value="24.38823" flag="0"/>
CenterStation">
            <description>Center of <event date="2008-11-06" time="01:00:00" value="-5.8442316" flag="0"/>
breach (XS station / location)</description>
          <event date="2008-11-06" time="02:00:00" value="68.705124" flag="0"/  <dblValue>8800.0</dblValue>
        </parameter>

        <parameter id="BottomWidth">
        <event date="2008-11-06" time="03:00:00" value="391.09784" flag="0"/>
    <description>Final bottom width</description>
            <dblValue>500...0</dblValue>
        </parameter>

   <event date="2008-11-07" time="23:00:00" value="438.6425" flag="0"/>
     <parameter id="BottomElevation">
          <event date="2008-11-08" time="00:00:00" value="-5259.6562" flag="0"/> <description>Final bottom elevation</description>
    </series>
    <series>
    <dblValue>-10.0</dblValue>
    <header>
    </parameter>

        <type>instantaneous</type><parameter id="LeftSideSlope">
            <locationId>CT<description>Left RIVERside R1/0.00</locationId>slope</description>
            <parameterId>STAGE<<dblValue>2.0</parameterId>dblValue>
        </parameter>

     <timeStep unit="second" multiplier="3600"/   <parameter id="RightSideSlope">
            <startDate date="2008-11-06" time="00:00:00"/><description>Right side slope</description>
            <endDate date="2008-11-08" time="00:00:00"/><dblValue>2.0</dblValue>
        </parameter>

    <missVal>NaN</missVal>
    <parameter id="BreachTime">
       <units>FEET</units>
     <description>Full formation time (hours)</header>description>
        <event date="2008-11-06" time="00:00:00" value="5.0" flag="0"/>   <dblValue>1.0</dblValue>
        <event date="2008-11-06" time="01:00:00" value="5.0" flag="0"/</parameter>

        <parameter id="WeirCoef">
        <event date="2008-11-06" time="02:00:00" value="5.0" flag="0"/>
    <description>Breach weir coefficient</description>
           <event date="2008-11-06" time="03:00:00" value="5.0" flag="0"/> <dblValue>2.6</dblValue>
        ...
{code}



h2. Running model from FEWS

Check [Delft-FEWS User Guide] on how to run configured model from the Delft-FEWS system.

h2. Running model using command-line

For testing purposes and also to simplify configuration of the HEC-RAS adapter the following command-line scripts were created:

* run.cmd - allows to run HEC-RAS model using command-line
* run.sh
* clean.cmd - cleans model working directory, all temporary or output files of the HEC-RAS model
* clean.sh

Scripts are available for Windows and Linux OS, .cmd and .sh extensions correspondingly.

{note}Note that all files names and extensions used in the run.cmd or run.sh scripts *must* be defined correctly based on used input data files of the HEC-RAS model in the HEC-RAS GUI.{note}

{code:title=run.cmd}
@echo on

set RAS_BIN_HOME=..\..\bin

echo Processing geometry ... 
%RAS_BIN_HOME%\GeomPreprocessor.exe ctfld2ras.x02 runnext=1

echo Running Unsteady.exe ... 
%RAS_BIN_HOME%\Unsteady.exe ctfld2ras.c02 b03 runnext=1

echo Running Steady.exe (also produces binary output, after Unsteady.exe) ... 
%RAS_BIN_HOME%\Steady.exe ctfld2ras.r03 runnext=1 

echo Writing DSS ... 
%RAS_BIN_HOME%\DSSWriter.exe ctfld2ras.c02 p03 runnext=1

set RESTART_FILE=ctfld2ras.p03.rst

if exist %RESTART_FILE% del /f %RESTART_FILE%

for /f "delims=" %%I in ('dir /b ^| find ".rst"') do (
    copy "%%I" "%RESTART_FILE%"
)
{code}

{code:title=clean.cmd}
del *.hyd*
del *.IC*
del *.O0*
del Steady_CRASHED
del *scratch*
del *bco
del *blf
del *.xrj
del *.a0*
del *.hto*
del *.t*
del *.c
del ctfld2ras.dsc
del ctfld2ras.dss
del GeomPreprocessor_CRASHED
del *.bco*
del *.rst
{code}

{code:title=run.sh}
#!/bin/sh

RAS_BIN_PATH=../../bin

export LD_LIBRARY_PATH=$RAS_BIN_PATH:$LD_LIBRARY_PATH

echo "Running Geometry Preprocessor ..."
$RAS_BIN_PATH/geo_pre ctfld2ras.x02

echo "Running Unsteady ..."
$RAS_BIN_PATH/unsteady ctfld2ras.c02 b02

echo "Running Steady ..."
$RAS_BIN_PATH/steady ctfld2ras.r01

echo "Running DSS Writer ..."
$RAS_BIN_PATH/dss_writer ctfld2ras.c02 p02
{code}

{code:title=clean.sh}
rm -f ./*.hyd*
rm -f ./*.IC*
rm -f ./*.O0*
rm -f ./Steady_CRASHED
rm -f ./*scratch*
rm -f ./*bco
rm -f ./*blf
rm -f ./*.xrj
rm -f ./*.a0*
rm -f ./*.hto*
rm -f ./*.t*
rm -f ./*.c
rm -f ./ctfld2ras.dsc
rm -f ./ctfld2ras.dss
rm -f ./GeomPreprocessor_CRASHED
rm -f ./*.bco*
{code}

</parameter>

        <!-- parameter below are used only when IsPipe = true -->
        <parameter id="IsPipe">
            <description>true if piping failure, false if overtopping</description>
            <boolValue>true</boolValue>
        </parameter>

        <parameter id="PipingCoefficient">
            <description>Piping coefficient (default is .8)</description>
            <dblValue>0.8</dblValue>
        </parameter>

        <parameter id="InitialPipingElevation">
            <description>Initial piping elevation</description>
            <dblValue>-0.5</dblValue>
        </parameter>
    </group>
</parameters>

List of input and output variables which can be exchanged with the Delft-FEWS system and HEC-RAS adapter

The HEC-RAS adapter is configured properly and forecast is performed from the Delft-FEWS system - a list of input and output variables will be written into the standard log file of the system. The location and variables are based on the active <region>.b01 file of the HEC-RAS model configured in the GUI of HEC-RAS. Pre-adapter of the HEC-RAS will provide list of all possible input variables and locations in the following part of the log file:

Code Block
...
156 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Found input at locations:
156 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  -     CT River, R1, 334752.0, Flow Hydrograph
156 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  -     CT River, R1, 0.00, Stage Hydrograph
...

Locations and variables listed after the line Found input at locations: can be configured in the Delft-FEWS as a part of adapter input, e.g. input.xml in this case may contain something like the lines below:

Code Block
languagexml
titleinput.xml
<TimeSeries
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <timeZone>0.0</timeZone>
    <series>
        <header>
            <type>instantaneous</type>
            <locationId>CT RIVER R1/334752.0</locationId>
            <parameterId>Flow Hydrograph</parameterId>
            <timeStep unit="second" multiplier="3600"/>
            <startDate date="2008-11-06" time="12:00:00"/>
            <endDate date="2008-11-08" time="12:00:00"/>
            <missVal>-999.0</missVal>
            <stationName>Connicut River at Thompsonville</stationName>
            <units>cms</units>
        </header>
        <event date="2008-11-06" time="12:00:00" value="14.98" flag="0"/>
        <event date="2008-11-06" time="13:00:00" value="14.705" flag="0"/>
        <event date="2008-11-06" time="14:00:00" value="14.43" flag="0"/>
        <event date="2008-11-06" time="15:00:00" value="14.155" flag="0"/>
        <event date="2008-11-06" time="16:00:00" value="13.88" flag="0"/>
        <event date="2008-11-06" time="17:00:00" value="13.605" flag="0"/>
        ...

Note that <parameterId> and <locationId> are exactly the same as the variables and locations listed in the log file.

In the same way list of all output variables and locations can be found in the post-adapter log output, for example:

Code Block
...
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Profile, Profile number.,
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.S. Elev, Calculated water surface from energy equation., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - E.G. Elev, Energy gradeline for given WSEL., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Max Chl Dpth, Maximum main channel depth., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Min Ch El, Minimum Channel Elevation., (ft)
84843 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Left, Flow in left overbank., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Channel, Flow in main channel., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Right, Flow in right overbank., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Q Total, Total flow in cross section., (cfs)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area, Total area of cross section active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area L, Area of left overbank active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area Ch, Area of main channel active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - Flow Area R, Area of right overbank active flow., (sq ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.P. Total, Wetted perimeter of total cross section., (ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.P. Left, Wetted perimeter of left overbank., (ft)
84859 [main] INFO nl.wldelft.fews.adapter.hec.HecRasDataAccessFacadeImpl  - W.P. Channel, Wetted perimeter of main channel., (ft)
...

Note that parameter names to be written into the output FEWS-PI file will contain only the short name of the parameter, e.g.: Q Right and not Flow in right overbank., (cfs).

The variables listed here will be written into the file specified as a "--output-binary-pi-file=<path>" argument of the post-adapter. Example of the resulting FEWS-PI xml can be found below:

Code Block
xml
xml
titleExample of the FEWS-PI containing binary output of the HEC-RAS model
<TimeSeries
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <timeZone>0.0</timeZone>
    <series>
        <header>
            <type>instantaneous</type>
            <locationId>CT River R1/334752.0</locationId>
            <parameterId>W.S. Elev</parameterId>
            <timeStep unit="second" multiplier="3600"/>
            <startDate date="2008-11-06" time="00:00:00"/>
            <endDate date="2008-11-08" time="00:00:00"/>
            <missVal>NaN</missVal>
            <units>[?]</units>
        </header>
        <event date="2008-11-06" time="00:00:00" value="32.06013" flag="0"/>
        <event date="2008-11-06" time="01:00:00" value="32.06013" flag="0"/>
        <event date="2008-11-06" time="02:00:00" value="32.034" flag="0"/>
        <event date="2008-11-06" time="03:00:00" value="32.03394" flag="0"/>
        ...
        <event date="2008-11-07" time="23:00:00" value="32.03618" flag="0"/>
        <event date="2008-11-08" time="00:00:00" value="32.03598" flag="0"/>
    </series>
    <series>
        <header>
            <type>instantaneous</type>
            <locationId>CT River R1/334752.0</locationId>
            <parameterId>E.G. Elev</parameterId>
            <timeStep unit="second" multiplier="3600"/>
            <startDate date="2008-11-06" time="00:00:00"/>
            <endDate date="2008-11-08" time="00:00:00"/>
            <missVal>NaN</missVal>
            <units>[?]</units>
        </header>
        <event date="2008-11-06" time="00:00:00" value="32.06734" flag="0"/>
        <event date="2008-11-06" time="01:00:00" value="32.06734" flag="0"/>
        <event date="2008-11-06" time="02:00:00" value="32.056885" flag="0"/>
        ...

Additionally to the variables available in the binary output of the HEC-RAS, usually called <file>.O01, a DSS output is available. In most cases it contains FLOW and STAGE variables. Example of the FEWS-PI generated from the DSS file is given below:

Code Block
xml
xml
titleExample of the FEWS-PI containing DSS output of the HEC-RAS model
<TimeSeries
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_timeseries.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <timeZone>0.0</timeZone>
    <series>
        <header>
            <type>instantaneous</type>
            <locationId>CT RIVER R1/0.00</locationId>
            <parameterId>FLOW</parameterId>
            <timeStep unit="second" multiplier="3600"/>
            <startDate date="2008-11-06" time="00:00:00"/>
            <endDate date="2008-11-08" time="00:00:00"/>
            <missVal>NaN</missVal>
            <units>CFS</units>
        </header>
        <event date="2008-11-06" time="00:00:00" value="24.38823" flag="0"/>
        <event date="2008-11-06" time="01:00:00" value="-5.8442316" flag="0"/>
        <event date="2008-11-06" time="02:00:00" value="68.705124" flag="0"/>
        <event date="2008-11-06" time="03:00:00" value="391.09784" flag="0"/>
        ...
        <event date="2008-11-07" time="23:00:00" value="438.6425" flag="0"/>
        <event date="2008-11-08" time="00:00:00" value="-5259.6562" flag="0"/>
    </series>
    <series>
        <header>
            <type>instantaneous</type>
            <locationId>CT RIVER R1/0.00</locationId>
            <parameterId>STAGE</parameterId>
            <timeStep unit="second" multiplier="3600"/>
            <startDate date="2008-11-06" time="00:00:00"/>
            <endDate date="2008-11-08" time="00:00:00"/>
            <missVal>NaN</missVal>
            <units>FEET</units>
        </header>
        <event date="2008-11-06" time="00:00:00" value="5.0" flag="0"/>
        <event date="2008-11-06" time="01:00:00" value="5.0" flag="0"/>
        <event date="2008-11-06" time="02:00:00" value="5.0" flag="0"/>
        <event date="2008-11-06" time="03:00:00" value="5.0" flag="0"/>
        ...

Beste Practise Considerations

The HEC-RAS adapter requires quite some synergy between FEWS, Java and the actual HEC-RAS software versions. While a FEWS General Adapter config that uses embedded Java adapters is technically preferred above a custom JRE, it very sensitive to any software update. From past implementations we experience that using old models that run with older RAS versions, do not run anymore with actual adapter and Java versions. Therefore from an organizational and robustness perspective, it is preferred to have your both softwares as independent as possible, so with a custom JRE.

So instead of using the below default config:

Code Block
languagexml
titleEmbedded GA execute activity, running with FEWS 2016.02 and HEC-RAS v5
<executeActivity>
	<command>
		<className>nl.wldelft.fews.adapter.hec.HecRasAdapter</className>
    		<binDir>$HECRASBINDIR$</binDir>
	</command>
	<arguments>
    		<argument>%ROOT_DIR%/run_info.xml</argument>
	</arguments>
 	<timeOut>3600000</timeOut>
</executeActivity> 

one can better use a config like:

Code Block
languagexml
titleIndependent GA execute activity running with FEWS 2023.02 and HEC-RAS v5
<executeActivity>
	<command>
		<className>nl.wldelft.fews.adapter.hec.HecRasAdapter</className>
		<binDir>$HECRASBINDIR$</binDir>
		<!-- use old Java 8, while 2023.02 uses 11-->
		<customJreDir>$CUSTOMJRE_64B_DIR$</customJreDir>
 		<!-- in case of custom JRE, pass correct default Parser definition-->
         <jvmArg>-Dorg.xml.sax.parser=com.sun.org.apache.xerces.internal.parsers.SAXParser</jvmArg>
	</command>
	<arguments>
		<argument>%ROOT_DIR%/run_info.xml</argument>
	</arguments>
     <console>
   		<!-- dump console in txt file, so in case of a crash, you see what happend-->
         <redirectToLogFile>%ROOT_DIR%/log/adapter_console_logging.txt</redirectToLogFile>
	</console>
	<timeOut>3600000</timeOut>
</executeActivity>


Running model from FEWS

Check Using Delft-FEWS - User Guide on how to run configured model from the Delft-FEWS system.