Versions Compared

Key

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

...

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 DSS 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 a selection (output-dss-paths.txt) of output time series in the output RAS DSS file

Postprocessing 03

Write the time series to the output.xml

Postprocessing 04

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.

...

Communication between FEWS system and pre-/post- adapter strictly follows the FEWS Published Interface format.

...

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.

Example configuration of the HEC-RAS adapter:

Code Block
xml
xml

<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 Connecticut River</description>
		<rootDir>%REGION_HOME%/modules/hec-ras/</rootDir>
		<workDir>%ROOT_DIR%/connecticut/work</workDir>
		<exportDir>%ROOT_DIR%/connecticut/input</exportDir>
		<exportIdMap>IdExportHECRAS</exportIdMap>
		<importDir>%ROOT_DIR%/connecticut/output</importDir>

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 Block
xmlxml

<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 Connecticut River</description>
		<rootDir>%REGION_HOME%/modules/hec-ras/</rootDir>
		<workDir>%ROOT_DIR%/connecticut/work</workDir>
		<exportDir>%ROOT_DIR%/connecticut/input</exportDir>
		<exportIdMap>IdExportHECRAS</exportIdMap>
		<importDir>%ROOT_DIR%/connecticut/output</importDir>
		<importIdMap>IdImportHECRAS</importIdMap>
		<dumpFileDir>$GA_DUMPFILEDIR$</dumpFileDir>
		<dumpDir>%ROOT_DIR%/connecticut</dumpDir>
		<diagnosticFile>%ROOT_DIR%/connecticut/log/preadapter.xml</diagnosticFile>
		<convertDatum>true</convertDatum>
	</general>

	<activities>
		<startUpActivities>
			<purgeActivity>
				<filter>%ROOT_DIR%/connecticut/log/*.*</filter>
			</purgeActivity>
			<purgeActivity>
				<filter>%ROOT_DIR%/connecticut/input/*.*</filter>
			</purgeActivity>			
			<purgeActivity>
				<filter>%ROOT_DIR%/connecticut/output/*.*</filter>
			</purgeActivity>			
			<purgeActivity>
				<filter>%ROOT_DIR%/connecticut/work/*.dss</filter>
			</purgeActivity>			
		</startUpActivities>
		
		<exportActivities>
			<exportStateActivity>
				<moduleInstanceId>hecras_connecticut_Historical</moduleInstanceId>
				<stateExportDir>%ROOT_DIR%/connecticut/work</stateExportDir>
				<stateConfigFile>%ROOT_DIR%/connecticut/work/state.xml</stateConfigFile>
				<stateLocations type="file">
					<stateLocation>
						<readLocation>ctfld2ras.p05.rst</readLocation>
						<writeLocation>ctfld2ras.p05.rst</writeLocation>
					</stateLocation>
				</stateLocations>
				<stateSelection>
					<warmState>
						<stateSearchPeriod unit="day" start="-10" end="0"/>
					</warmState>
				</stateSelection>
			</exportStateActivity>
			<exportTimeSeriesActivity>
				<exportFile>inputs.xml</exportFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>HFDC3FLW_6to1_ChangeT_Forecast</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>QINE</parameterId>
				
						<locationId>TMVC3</locationId>
						<timeSeriesType>external forecasting</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<relativeViewPeriod unit="hour" start="0" end="48" endOverrulable="true"/>
						<readWriteMode>read only</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>HFDC3FLW_ChangeT_Forecast</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>QINE</parameterId>
						<locationId>TARC3</locationId>
						<timeSeriesType>external forecasting</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<relativeViewPeriod unit="hour" start="0" end="48" endOverrulable="true"/>
						<readWriteMode>read only</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>PRTN6GRL_Q2STG_STAGEQ_Forecast</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>SSTG</parameterId>
						<locationId>PRTN6GRL</locationId>
						<timeSeriesType>simulated forecasting</timeSeriesType>
						<timeStep unit="hour" multiplier="6"/>
						<relativeViewPeriod unit="hour"  end="120" endOverrulable="true"/>
						<readWriteMode>read only</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</exportTimeSeriesActivity>
		</exportActivities>
		

		
		
		<executeActivities>
                        <!-- run pre-adapter, converts time series from FEWS-PI to HEC-RAS data files -->				
		        <executeActivity>
			        <command>
				        <className>nl.wldelft.fews.adapter.hec.HecRasPreAdapter</className>
				</command>
				<arguments>
					<argument>--project-file=%ROOT_DIR%/connecticut/work/ctfld2ras.prj</argument>
					<argument>--dss-file=%ROOT_DIR%/connecticut/work/ctfld2ras.dss</argument>
					<argument>--time-step=1MIN</argument>
				</arguments>
				<timeOut>120000</timeOut>
			</executeActivity>

                        <!-- run HEC-RAS model using script -->
			<executeActivity>
				<description></description>
				<command>
					<executable>%ROOT_DIR%/connecticut/work/run.cmd</executable>
				</command>
				<arguments />
 				<timeOut>1500000</timeOut>
				<ignoreDiagnostics>true</ignoreDiagnostics>
			</executeActivity>
			
			<!-- Convert HEC-RAS results from DSS to FEWS PI XML -->
			<executeActivity>
				<command>
					<className>nl.wldelft.fews.adapter.hec.HecRasPostAdapter</className>
				</command>
				<arguments>
					<argument>--project-file=%ROOT_DIR%/connecticut/work/ctfld2ras.prj</argument>
					<argument>--output-log-file=%ROOT_DIR%/connecticut/log/postadapter.xml</argument>
					<argument>--output-pi-file=%ROOT_DIR%/connecticut/output/output.xml</argument>
					<argument>--output-binary-file=%ROOT_DIR%/connecticut/work/ctfld2ras.O01</argument>
					<argument>--output-binary-pi-file=%ROOT_DIR%/connecticut/output/binary-output.xml</argument>
				</arguments>
				
				<timeOut>1500000</timeOut>
			</executeActivity>
		</executeActivities>
		
		<!-- import converted FEWS PIXML time series -->
		<importActivities>
			<importStateActivity>
				<stateConfigFile>%ROOT_DIR%/connecticut/work/state.xml</stateConfigFile>
			</importStateActivity>
			<importTimeSeriesActivity>
				<importFile>results.xml</importFile>
				<timeSeriesSets>
					<timeSeriesSet>
						<moduleInstanceId>hecras_connecticut_Forecast</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>SSTG</parameterId>
						<locationId>MDDC3</locationId>
						<locationId>TMVC3</locationId>
						<locationId>LYMC3</locationId>
						<locationId>SAYC3</locationId>
						<timeSeriesType>simulated forecasting</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
					<timeSeriesSet>
						<moduleInstanceId>hecras_connecticut_Forecast</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>SQIN</parameterId>
						<locationId>MDDC3</locationId>
						<locationId>TMVC3</locationId>
						<locationId>LYMC3</locationId>
						<locationId>SAYC3</locationId>
						<timeSeriesType>simulated forecasting</timeSeriesType>
						<timeStep unit="hour" multiplier="1"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</timeSeriesSets>
			</importTimeSeriesActivity>
		</importActivities>
	</activities>
</generalAdapterRun>

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)

...

 

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

...

.hyd01

...

input file for geometry preprocessor

...

 

...

 

...

 

...

Running model from FEWS

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

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:

...