Building a model#

This plugin allows to build a complete model from available data. Once the configuration and data libraries are set, you can build a model by using:

hydromt build dflowfm path/to/built_model -i dflowfm_build.yml -d data_sources.yml -vvv

Configuration file#

Settings to build or update a Delft3D FM model are managed in a configuration file. In this file, every option from each model method can be changed by the user in its corresponding section.

Note that the order in which the components are listed in the yml file is important:

  • When setting up a 1D model, one of the setup_rivers, setup_channels and setup_pipes should always be run first to determine the model topology.

  • When setting up a 2D model, setup_mesh2d should always be run first.

  • When setting up a 1D2D model, both of the above should be run first, before calling setup_link1d2d.

Below is an example yml file that can be used to build a complete Delft3D FM model .yml file. Each section corresponds to a model component with the same name.

modeltype: dflowfm

global:
  crs: 3857
  network_snap_offset: 25
  openwater_computation_node_distance: 40

steps:
  - setup_rivers_from_dem:
      region: 
        bbox: [12.4331, 46.4661, 12.5212, 46.5369]
      hydrography_fn: merit_hydro
      river_geom_fn: hydro_rivers_lin
      rivers_defaults_fn: rivers_defaults
      rivdph_method: gvf
      rivwth_method: geom
      river_upa: 25.0
      friction_type: "Manning"
      friction_value: 0.023
      rivbankq: 25

  - setup_pipes:
      region: 
        bbox: [12.4331, 46.4661, 12.5212, 46.5369]
      pipes_fn: grip_roads
      pipes_defaults_fn: pipes_defaults
      pipe_filter: pipe
      spacing: 50
      friction_type: WhiteColeBrook
      friction_value: 0.003
      crosssections_shape: circle
      crosssections_value: 0.5
      dem_fn: merit_hydro # [copdem30, merit]
      pipes_depth: 2.0
      snap_offset: 0.5
      pipes_invlev: 3. 

  - setup_manholes:
      manholes_fn:
      manholes_defaults_fn: manholes_defaults
      dem_fn: merit_hydro
      bedlevel_shift: 0.5

  - setup_1dboundary:
      boundary_value: -2.0
      branch_type: river
      boundary_type: waterlevel
      boundary_unit: m
      boundary_locs: both

  - setup_mesh2d:
      region: 
        bbox: [12.4331, 46.4661, 12.5212, 46.5369]
      res: 500

  - setup_maps_from_rasterdataset:
      raster_filename: merit_hydro
      variables: ["elevtn"]
      fill_method: nearest
      interpolation_method: nearestNb

  - setup_maps_from_raster_reclass:
      raster_filename: vito_2015
      reclass_table_filename: vito_mapping
      reclass_variables: ['roughness_manning', 'infiltcap']
      interpolation_method: triangulation

  - setup_rainfall_from_constant:
      constant_value: 150

  - setup_link1d2d:
      link_direction: 1d_to_2d

  - setup_config:
      geometry.bedlevuni: -5

Selecting data#

Data sources in HydroMT are provided in one of several yaml libraries. These libraries contain required information on the different data sources so that HydroMT can process them for the different models. There are three ways for the user to select which data libraries to use:

  • If no yaml file is selected, HydroMT will use the data stored in the hydromt-artifacts which contains an extract of global data for a small region around the Piave river in Northern Italy.

  • Another options for Deltares users is to select the deltares-data library (requires access to the Deltares P-drive). In the command lines examples below, this is done by adding either –dd or –deltares-data to the build / update command line.

  • Finally, the user can prepare its own yaml libary (or libraries) (see HydroMT documentation to check the guidelines). These user libraries can be added either in the command line using the -d option and path/to/yaml or in the yml/ini file with the data_libs option in the [global] sections.