General

Sobek-RE models can be used in FEWS with a SobekRE model adapter. The adapter works with the NEFIS files which are created in the SOBEK user interface. The adapter updates the timeseries and the simulation period in the NEFIS files only. Of course also the simulation results are converted back to FEWS PI format.

Setup of the model configuration

A typical setup of the model configuration is:

directory

contains

FEWS_Region\Modules\SobekRE\bin

Sobek binaries

FEWS_Region\Modules\SobekRE\MyModel\Config

adapter configuration

FEWS_Region\Modules\SobekRE\MyModel\Input

FEWS PI input files (updated boundaries etc)

FEWS_Region\Modules\SobekRE\MyModel\Output

FEWS PI output files (simulation results)

FEWS_Region\Modules\SobekRE\MyModel\Model

NEFIS files

FEWS_Region\Modules\SobekRE\MyModel\diagnostics

logfiles

FEWS_Region\Modules\SobekRE\MyModel\States

state files

FEWS_Region\Modules\SobekRE\MyModel\Work

working directory for simulation

General Adapter configuration

A typical GA file looks like:

<general>
  <rootDir>$REGION_HOME$/Modules/SobekRE/MyModel</rootDir>
  <workDir>%ROOT_DIR%/work</workDir>
  <exportDir>%ROOT_DIR%/input</exportDir>
  <exportDataSetDir>%ROOT_DIR%</exportDataSetDir>
  <exportIdMap>IdSobekRE</exportIdMap>
  <importDir>%ROOT_DIR%/output</importDir>
  <importIdMap>IdSobekRE</importIdMap>
  <dumpFileDir>%REGION_HOME%/Dump</dumpFileDir>
  <dumpDir>%ROOT_DIR%</dumpDir>
  <diagnosticFile>%ROOT_DIR%/Output/diagnostics.xml</diagnosticFile>
  <missVal>NaN</missVal>
  <convertDatum>true</convertDatum>
</general>
<burnInProfile>
  <length unit="hour" multiplier="6"/>
  <timeSeries>
    <parameterId>H.merged</parameterId>
    <locationSetId>H_Boundaries</locationSetId>
    <initialValue>-0.42</initialValue>
  </timeSeries>
</burnInProfile>
<activities>
  <startUpActivities>
    <purgeActivity>
      <filter>%ROOT_DIR%/work/*.*</filter>
    </purgeActivity>
    <purgeActivity>
      <filter>%ROOT_DIR%/input/*.*</filter>
    </purgeActivity>
    <purgeActivity>
      <filter>%ROOT_DIR%/output/*.*</filter>
    </purgeActivity>
    <purgeActivity>
      <filter>%ROOT_DIR%/states/*.*</filter>
    </purgeActivity>
  </startUpActivities>
  <exportActivities>
    <exportStateActivity>
      <moduleInstanceId>MySobekREModel</moduleInstanceId>
      <stateExportDir>%ROOT_DIR%/States</stateExportDir>
      <stateConfigFile>%ROOT_DIR%/States/states.xml</stateConfigFile>
      <stateLocations type="file">
        <stateLocation>
          <readLocation>sobekrst.rda</readLocation>
          <writeLocation>sobekrst.nda</writeLocation>
        </stateLocation>
        <stateLocation>
          <readLocation>sobekrst.rdf</readLocation>
          <writeLocation>sobekrst.ndf</writeLocation>
        </stateLocation>
      </stateLocations>
      <stateSelection>
        <warmState>
          <stateSearchPeriod unit="hour" start="-96" end="0"/>
        </warmState>
      </stateSelection>
    </exportStateActivity>
    <exportTimeSeriesActivity>
      <exportFile>input.xml</exportFile>
      <exportBinFile>false</exportBinFile>
      <timeSeriesSets>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>H.merged</parameterId>
          <locationSetId>model_Hbnd</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <relativeViewPeriod unit="hour" end="120" startOverrulable="true" endOverrulable="true"/>
          <readWriteMode>read only</readWriteMode>
        </timeSeriesSet>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>Q.merged</parameterId>
          <locationSetId>model_Qbnd</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <relativeViewPeriod unit="hour" end="120" startOverrulable="true" endOverrulable="true"/>
          <readWriteMode>read only</readWriteMode>
        </timeSeriesSet>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>H.setpoint</parameterId>
          <locationSetId>model_setpoint</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <relativeViewPeriod unit="hour" end="120" startOverrulable="true" endOverrulable="true"/>
          <readWriteMode>read only</readWriteMode>
        </timeSeriesSet>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>Gate</parameterId>
          <locationSetId>model_gateheight</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <relativeViewPeriod unit="hour" end="120" startOverrulable="true" endOverrulable="true"/>
          <readWriteMode>read only</readWriteMode>
        </timeSeriesSet>
      </timeSeriesSets>
      <omitEmptyTimeSeries>false</omitEmptyTimeSeries>
    </exportTimeSeriesActivity>
  </exportActivities>
  <executeActivities>
    <executeActivity>
      <command>
        <className>nl.wldelft.fews.adapter.sobek.PreSobekModelAdapter</className>
      </command>
      <arguments>
        <argument>%ROOT_DIR%</argument>
        <argument>Config/sobekConfig.xml</argument>
      </arguments>
      <timeOut>60000</timeOut><!--1 min.-->
      <overrulingDiagnosticFile>%ROOT_DIR%/diagnostics/presobekmodeladapter.xml</overrulingDiagnosticFile>
    </executeActivity>
    <executeActivity>
      <command>
        <executable>%ROOT_DIR%/bin/sobeksim.exe</executable>
      </command>
      <arguments>
        <argument>%ROOT_DIR%/bin/sobeksim.fnm</argument>
      </arguments>
      <timeOut>600000</timeOut><!--10 min.-->
      <ignoreDiagnostics>true</ignoreDiagnostics>
    </executeActivity>
    <executeActivity>
      <command>
        <className>nl.wldelft.fews.adapter.sobek.PostSobekModelAdapter</className>
      </command>
      <arguments>
        <argument>%ROOT_DIR%</argument>
        <argument>Config/sobekConfig.xml</argument>
      </arguments>
      <timeOut>60000</timeOut><!--1 min.-->
      <overrulingDiagnosticFile>%ROOT_DIR%/diagnostics/postsobekmodeladapter.xml</overrulingDiagnosticFile>
    </executeActivity>
  </executeActivities>

  <importActivities>
    <!-- Import results-->
    <importTimeSeriesActivity>
      <importFile>flowmap.xml</importFile>
      <timeSeriesSets>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>H.sim</parameterId>
          <locationSetId>SobekREmodel</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <readWriteMode>add originals</readWriteMode>
        </timeSeriesSet>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>Q.sim</parameterId>
          <locationSetId>SobekREModel</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <readWriteMode>add originals</readWriteMode>
        </timeSeriesSet>
      </timeSeriesSets>
    </importTimeSeriesActivity>
    <importTimeSeriesActivity>
      <importFile>struchis.xml</importFile>
      <timeSeriesSets>
        <timeSeriesSet>
          <moduleInstanceId>MySobekREModel</moduleInstanceId>
          <valueType>scalar</valueType>
          <parameterId>Q.sim</parameterId>
          <locationSetId>structures</locationSetId>
          <timeSeriesType>simulated forecasting</timeSeriesType>
          <timeStep unit="hour"/>
          <readWriteMode>add originals</readWriteMode>
        </timeSeriesSet>
      </timeSeriesSets>
    </importTimeSeriesActivity>
  </importActivities>
</activities>

IdMapping

The idMapping from FEWS to SobekRE should be:

FEWS parameter

Sobek ParameterID

Water level boundary

H

Discharge boundary

Q

Salt concentration

S

Lateral flow

L

Gate height

GATE HEIGHT

Crest Level

CREST LEVEL

Crest Width

CREST WIDTH

Wind velocity

WIND VELOCITY

Wind direction

WIND DIRECTION

Trigger

TRIGGER

Setpoint

SETPOINT

The output parameters from SobekRE are:

file

parameter

flowmap.his

Water level

flowmap.his

Discharge Total

flowstruc.his

Discharge

flowstruc.his

Crest level

flowstruc.his

Gate height

Note that wind direction should be defined as the direction where the wind goes to. This is because we insert the time series directly into the numerical core, where the hydraulic equations use the wind as a positive force.
To convert the usual wind directions (where north=0 and defined as where the wind comes from) simply add 180 to the values:

direction = direction + 180

Note also that the wind can only be defined as a global series. Although Sobek allows for local definitions, the adapter does not handle that.

Adapter Configuration file

<?xml version="1.0" encoding="UTF-8"?>
<sobekModel 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/sobekModel.xsd" version="1.1">
  <description>String</description>
  <directories>
    <configDir>config</configDir>
    <workDir>work</workDir>
    <moduleDir>model</moduleDir>
    <importDir>input</importDir>
    <exportDir>output</exportDir>
  </directories>
  <adapterfiles>
    <stateFile>..\States\states.xml</stateFile>
    <diagnosticFile>diagnostic.xml</diagnosticFile>
  </adapterfiles>
  <modelFiles>
    <mdaFile>sobek.mda</mdaFile>
    <dataFile>sobekrst.rda</dataFile>
    <definitionFile>sobekrst.rdf</definitionFile>
    <mapFile>flowmap.his</mapFile>
    <returnFile>sobekhd.rtn</returnFile>
  </modelFiles>
</sobekModel>

Sobek Binaries

This directory should contain the next files:

  • DFORRT.DLL
  • Sobeksim.exe
  • sobeksim.fnm
  • stkkrds.dll

Sobeksim.fnm should be changed to:

[Restart Files]
NrOFiles=4
rda=..\states\sobekrst.rda
rdf=..\states\sobekrst.rdf
nda=..\states\sobekrst.nda
ndf=..\states\sobekrst.ndf
  • No labels