Build a Delft3D FM 1D model from scratch#
This notebook demonstrates how to prepare a 1D Delft3D FM model from scratch using the command line interace (CLI).
All lines in this notebook which start with !
are executed from the command line. Within the notebook environment the logging messages are shown after completion. You can also copy these lines and paste these in your shell to get more direct feedback.
HydroMT CLI build interface#
Lets first check if the Delft3D FM model is recognized by HydroMT:
[1]:
# this should return "dflowfm" to build DFlowFM components of Delft3D FM
# as well as the generic HydroMT models "grid_model, lumped_model, mesh_model, network_model"
!hydromt --models
model plugins:
- dflowfm (hydromt_delft3dfm 0.3.1.dev0)
generic models (hydromt 0.10.1):
- grid_model
- vector_model
- mesh_model
- network_model
Using the HydroMT build API we can setup a complete model from scratch. Let’s get an overview of all the available options:
[2]:
!hydromt build --help
Usage: hydromt build [OPTIONS] MODEL MODEL_ROOT
Build models from scratch.
Example usage: --------------
To build a wflow model for a subbasin using a point coordinates snapped to
cells with upstream area >= 50 km2 hydromt build wflow /path/to/model_root
-i /path/to/wflow_config.yml -r "{'subbasin': [-7.24, 62.09], 'uparea':
50}" -d deltares_data -d /path/to/data_catalog.yml -v
To build a sfincs model based on a bbox hydromt build sfincs
/path/to/model_root -i /path/to/sfincs_config.yml -r "{'bbox':
[4.6891,52.9750,4.9576,53.1994]}" -d /path/to/data_catalog.yml -v
Options:
--opt TEXT Method specific keyword arguments, see the method
documentation of the specific model for more
information about the arguments.
-i, --config PATH Path to hydroMT configuration file, for the model
specific implementation.
-r, --region TEXT Set the region for which to build the model, e.g.
{'subbasin': [-7.24, 62.09]}
-d, --data TEXT Path to local yaml data catalog file OR name of
predefined data catalog.
--dd, --deltares-data Flag: Shortcut to add the "deltares_data" catalog
--fo, --force-overwrite Flag: If provided overwrite existing model files
--cache Flag: If provided cache tiled rasterdatasets
-v, --verbose Increase verbosity.
-q, --quiet Decrease verbosity.
--help Show this message and exit.
Data for model setup#
Most of the time, the <...>_fn
arguments correspond to a data source from the DataCatalog
which is based on a yml-file with references to the data paths/urls and how the data should be read. This file can be provided to HydroMT using -d <path_to_yml_file>
.
By default, the pre-defined artifact_data
catalog containing some example data for the Piave basin will be downloaded to ~/.hydromt_data/
which is also used for this example. An overview of the available example data is provided here. This example data is a based on the data which is available from the Deltares internal storage location: the p-drive. If you have acces to this drive, a pre-configured catalog
file can be loaded using the -d deltares_data
pre-defined catalog.
More information on how to write a data catalog yml file can be found in the HydroMT core docs
NOTE: In HydroMT-Delft3D FM, an additional data catalog with all default parameters values is always used parameters_data.yml. It contains default values for 1D network elements and structures as well as default 2D landuse parameter mapping tables.
Model setup configuration#
The HydroMT configuration file contains the model setup configuration and determines which methods are used to prepare the different components of a Delft3D FM model and in which order and optionally sets non-default arguments for each method. This configuration is passed to HydroMT using -i <path_to_configuration_file>
. We have prepared several example yml-files which are available in the model repository examples folder
and from the docs (building a model).
Each section, before indent, (e.g. setup_rivers_from_dem) corresponds to a model method. All model methods are explained in the docs (model components). The global
section contains direct model initialisation properties.
We will load the default dflowfm build 1D yaml file for inspection:
[3]:
fn_yml = "dflowfm_build1d.yml"
with open(fn_yml, "r") as f:
txt = f.read()
print(txt)
global:
crs: 3857
network_snap_offset: 25
openwater_computation_node_distance: 40
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.0
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
Looking at this file, you see that we will prepare the following information for our model:
global: Our model will be defined in the projected CRS WGS84 EPSG 3857. TO ensure the 1D network is connected, we will allow snapping of 25 meters using argument network_snap_offset. The 1D computational grid for the open water system will be created at 40 meters distance using argument openwater_computation_node_distance.
setup_rivers_from_dem: We will derive the 1D rivers lines based on the MERIT Hydro DEM and that intersects with the region bounding box [12.4331, 46.4661, 12.5212, 46.5369]. River roughness will be a Manning constant of 25.0 and we will use data from rivers_lin2019 database to prepare rectangular cross-sections.
setup_pipes: We will add pipes by assuming that they are located under the roads, with a standard length of 50 meters. The roads are defined in the grip_roads data and the standard length are defined in the argument spacing. Roughness will be a WhiteColeBrook constant of 0.003 and we will use a circular cross-sections of 0.5m. The pipes invert levels will be derived from the MERIT Hydro DEM assuming a constant depth of the pipe underground of 2 meters.
setup_manholes: For a pipe network, manholes are present at pipe connections. Here we do not have specific input data locations for our pipes, so manholes will be generated based on a set of standards specified in manholes_defaults_fn.
setup_1dboundary: Finally as a default, we will apply both upstream and downstream boundaries of our rivers with a constant waterlevel of -2.0 meter a.s.l
Feel free to use the links of each components to know more about how each function works and what are all the available settings.
NOTE: In this example, we apply region argument in both setup_rivers_from_dem and setup_pipes. They are identical in this example but one can alter them to have different region for rivers and for pipes. This allows the user to customize their model as much as possible, as the extent of the 1D river can differ from the extent of the 1D urban network or the 2D inundation grid. The region bbox are in WGS 84 as required, but the user should specify the dflowfm model destination CRS in the
global
section in order to allow to use grid definition data (rivers, pipes) from different data sources or CRS.
Building a 1D Delft3D FM model#
[4]:
# NOTE: copy this line (without !) to your shell for more direct feedback - should take about 1 minute or 2 to run
!hydromt build dflowfm "./build/dflowfm_1d" -i dflowfm_build1d.yml -d artifact_data --fo -vv
2025-05-19 09:45:08,728 - build - log - DEBUG - Writing log messages to new file /home/runner/work/hydromt_delft3dfm/hydromt_delft3dfm/docs/_examples/build/dflowfm_1d/hydromt.log.
2025-05-19 09:45:08,728 - build - log - INFO - HydroMT version: 0.10.1
2025-05-19 09:45:08,729 - build - main - INFO - Building instance of dflowfm model at /home/runner/work/hydromt_delft3dfm/hydromt_delft3dfm/docs/_examples/build/dflowfm_1d.
2025-05-19 09:45:08,729 - build - main - INFO - User settings:
2025-05-19 09:45:09,505 - build - data_catalog - INFO - Reading data catalog artifact_data latest
2025-05-19 09:45:09,505 - build - data_catalog - INFO - Parsing data catalog from /home/runner/.hydromt_data/artifact_data/v0.0.9/data_catalog.yml
2025-05-19 09:45:10,062 - build - model_api - INFO - Initializing dflowfm model from hydromt_delft3dfm (v0.3.1.dev0).
2025-05-19 09:45:10,062 - build - data_catalog - INFO - Parsing data catalog from /usr/share/miniconda/envs/test/lib/python3.12/site-packages/hydromt_delft3dfm/data/parameters_data.yml
2025-05-19 09:45:10,067 - build - dflowfm - INFO - Initialising empty mdu file
2025-05-19 09:45:10,072 - build - dflowfm - INFO - project crs: 3857
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.region: {'bbox': [12.4331, 46.4661, 12.5212, 46.5369]}
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.hydrography_fn: merit_hydro
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.river_geom_fn: hydro_rivers_lin
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.rivers_defaults_fn: rivers_defaults
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.rivdph_method: gvf
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.rivwth_method: geom
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.river_upa: 25.0
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.river_len: 1000
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.min_rivwth: 50.0
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.min_rivdph: 1.0
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.rivbank: True
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.rivbankq: 25
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.segment_length: 3000.0
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.smooth_length: 10000.0
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.friction_type: Manning
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.friction_value: 0.023
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.constrain_rivbed: True
2025-05-19 09:45:10,073 - build - model_api - INFO - setup_rivers_from_dem.constrain_estuary: True
2025-05-19 09:45:10,073 - build - dflowfm - INFO - Preparing river shape from hydrography data.
2025-05-19 09:45:10,079 - build - rasterdataset - INFO - Reading merit_hydro raster data from /home/runner/.hydromt_data/artifact_data/v0.0.9/data.tar/merit_hydro/{variable}.tif
2025-05-19 09:45:10,171 - build - rasterdataset - DEBUG - Clip to [12.433, 46.466, 12.521, 46.537] (epsg:4326))
2025-05-19 09:45:10,173 - build - geodataframe - INFO - Reading hydro_rivers_lin vector data from /home/runner/.hydromt_data/artifact_data/v0.0.9/data.tar/rivers_lin2019_v1.gpkg
2025-05-19 09:45:10,182 - build - geodataframe - DEBUG - Clip intersects [1384045.361, 5855358.290, 1393854.608, 5866810.259] (EPSG:3857)
2025-05-19 09:45:15,887 - build - dem - INFO - Deriving bankfull river surface elevation from its banks.
2025-05-19 09:45:22,752 - build - dem - INFO - Smoothing river width (n=2).
2025-05-19 09:45:24,282 - build - dataframe - INFO - Reading rivers_defaults csv data from /usr/share/miniconda/envs/test/lib/python3.12/site-packages/hydromt_delft3dfm/data/branches/rivers_defaults.csv
2025-05-19 09:45:24,293 - build - branches - INFO - Processing branches
2025-05-19 09:45:24,293 - build - branches - DEBUG - Cleaning up branches
2025-05-19 09:45:24,297 - build - branches - DEBUG - Exploding branches.
2025-05-19 09:45:24,298 - build - branches - DEBUG - Removing 0 branches which have duplicated geometry.
2025-05-19 09:45:24,298 - build - branches - DEBUG - Removing 1 branches that are shorter than 0.1 meter.
2025-05-19 09:45:24,301 - build - branches - DEBUG - Renaming 0 id_col duplicates. Convention:BRANCH_1, BRANCH_1 --> BRANCH_1, BRANCH_1-2.
2025-05-19 09:45:24,306 - build - branches - DEBUG - Reducing precision of the GeoDataFrame.Rounding precision (e-6) .
2025-05-19 09:45:24,308 - build - branches - DEBUG - Performing snapping at all branch ends, excluding intersections(To avoid messy results, please use a lower snap_offset)..
2025-05-19 09:45:24,308 - build - branches - DEBUG - Splitting branches based on spacing
2025-05-19 09:45:24,309 - build - branches - DEBUG - clipping branches into 5 segments
2025-05-19 09:45:24,309 - build - branches - DEBUG - Generating branchnodes
2025-05-19 09:45:24,315 - build - branches - INFO - Validating branches
2025-05-19 09:45:24,316 - build - crosssections - INFO - Adding/Filling branches attributes values
2025-05-19 09:45:24,318 - build - dflowfm - INFO - Preparing crossections from branch.
2025-05-19 09:45:24,326 - build - dflowfm - DEBUG - Adding crosssections vector to geoms.
2025-05-19 09:45:24,326 - build - dflowfm - DEBUG - Adding rivers and river_nodes vector to geoms.
2025-05-19 09:45:24,329 - build - model_api - WARNING - Replacing geom: rivers
2025-05-19 09:45:24,330 - build - dflowfm - DEBUG - Adding branches vector to geoms.
2025-05-19 09:45:24,330 - build - dflowfm - DEBUG - Updating branches in network.
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.region: {'bbox': [12.4331, 46.4661, 12.5212, 46.5369]}
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.pipes_fn: grip_roads
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.pipes_defaults_fn: pipes_defaults
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.pipe_filter: pipe
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.spacing: 50
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.friction_type: WhiteColeBrook
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.friction_value: 0.003
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.crosssections_shape: circle
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.crosssections_value: 0.5
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.dem_fn: merit_hydro
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.pipes_depth: 2.0
2025-05-19 09:45:24,388 - build - model_api - INFO - setup_pipes.pipes_invlev: 3.0
2025-05-19 09:45:24,389 - build - model_api - INFO - setup_pipes.snap_offset: 0.5
2025-05-19 09:45:24,389 - build - model_api - INFO - setup_pipes.allow_intersection_snapping: True
2025-05-19 09:45:24,389 - build - dflowfm - INFO - Preparing 1D pipes.
2025-05-19 09:45:24,391 - build - geodataframe - INFO - Reading grip_roads vector data from /home/runner/.hydromt_data/artifact_data/v0.0.9/data.tar/grip_roads.gpkg
2025-05-19 09:45:24,398 - build - geodataframe - DEBUG - Clip intersects [1384046.361, 5855359.290, 1393853.608, 5866809.259] (EPSG:3857)
2025-05-19 09:45:24,399 - build - dataframe - INFO - Reading pipes_defaults csv data from /usr/share/miniconda/envs/test/lib/python3.12/site-packages/hydromt_delft3dfm/data/branches/pipes_defaults.csv
2025-05-19 09:45:24,404 - build - branches - INFO - Processing branches
2025-05-19 09:45:24,406 - build - branches - DEBUG - Cleaning up branches
2025-05-19 09:45:24,414 - build - branches - DEBUG - Exploding branches.
2025-05-19 09:45:24,415 - build - branches - DEBUG - Removing 0 branches which have duplicated geometry.
2025-05-19 09:45:24,416 - build - branches - DEBUG - Removing 0 branches that are shorter than 0.1 meter.
2025-05-19 09:45:24,428 - build - branches - DEBUG - Renaming 0 id_col duplicates. Convention:BRANCH_1, BRANCH_1 --> BRANCH_1, BRANCH_1-2.
2025-05-19 09:45:24,459 - build - branches - DEBUG - Reducing precision of the GeoDataFrame.Rounding precision (e-6) .
2025-05-19 09:45:24,469 - build - branches - DEBUG - Performing snapping at all branch ends, including intersections(To avoid messy results, please use a lower snap_offset).
2025-05-19 09:45:24,470 - build - branches - DEBUG - Splitting branches based on spacing
2025-05-19 09:45:27,036 - build - branches - DEBUG - clipping branches into 2826 segments
2025-05-19 09:45:27,036 - build - branches - DEBUG - Generating branchnodes
2025-05-19 09:45:28,022 - build - branches - INFO - Validating branches
2025-05-19 09:45:28,024 - build - crosssections - INFO - Adding/Filling branches attributes values
2025-05-19 09:45:28,033 - build - dflowfm - INFO - grip_roads does not have columns [invlev_up, invlev_dn].Invert levels will be generated from dem_fn ordefault value 3.0
2025-05-19 09:45:28,033 - build - rasterdataset - INFO - Reading merit_hydro raster data from /home/runner/.hydromt_data/artifact_data/v0.0.9/data.tar/merit_hydro/{variable}.tif
2025-05-19 09:45:28,043 - build - rasterdataset - DEBUG - Clip to [12.433, 46.466, 12.521, 46.537] (epsg:4326))
2025-05-19 09:45:28,535 - build - dflowfm - INFO - Preparing crossections from branch.
2025-05-19 09:45:28,699 - build - dflowfm - DEBUG - Adding crosssections vector to geoms.
2025-05-19 09:45:28,716 - build - model_api - WARNING - Replacing geom: crosssections
2025-05-19 09:45:28,716 - build - dflowfm - DEBUG - Adding pipes and pipe_nodes vector to geoms.
2025-05-19 09:45:29,448 - build - model_api - WARNING - Replacing geom: rivers
2025-05-19 09:45:29,450 - build - model_api - WARNING - Replacing geom: pipes
2025-05-19 09:45:29,450 - build - dflowfm - DEBUG - Adding branches vector to geoms.
2025-05-19 09:45:29,450 - build - model_api - WARNING - Replacing geom: branches
2025-05-19 09:45:29,450 - build - dflowfm - DEBUG - Updating branches in network.
2025-05-19 09:45:30,219 - build - model_mesh - WARNING - Overwriting grid network1d and the corresponding data variables in mesh.
2025-05-19 09:45:30,258 - build - model_mesh - WARNING - Overwriting grid mesh1d and the corresponding data variables in mesh.
2025-05-19 09:45:30,499 - build - model_api - WARNING - Replacing geom: boundaries
2025-05-19 09:45:30,500 - build - model_api - INFO - setup_manholes.manholes_fn: None
2025-05-19 09:45:30,500 - build - model_api - INFO - setup_manholes.manholes_defaults_fn: manholes_defaults
2025-05-19 09:45:30,500 - build - model_api - INFO - setup_manholes.bedlevel_shift: 0.5
2025-05-19 09:45:30,500 - build - model_api - INFO - setup_manholes.dem_fn: merit_hydro
2025-05-19 09:45:30,500 - build - model_api - INFO - setup_manholes.snap_offset: 0.001
2025-05-19 09:45:30,500 - build - dflowfm - INFO - generating manholes locations and bedlevels.
2025-05-19 09:45:30,500 - build - manholes - INFO - Generating manholes on pipes and/or tunnels
2025-05-19 09:45:30,826 - build - manholes - INFO - Shifting manholes bedlevels based on bedlevel_shift = 0.5
2025-05-19 09:45:31,009 - build - model_api - WARNING - Replacing geom: rivers
2025-05-19 09:45:31,010 - build - model_api - WARNING - Replacing geom: pipes
2025-05-19 09:45:31,010 - build - dflowfm - DEBUG - Adding branches vector to geoms.
2025-05-19 09:45:31,011 - build - model_api - WARNING - Replacing geom: branches
2025-05-19 09:45:31,011 - build - dflowfm - DEBUG - Updating branches in network.
2025-05-19 09:45:31,011 - build - dataframe - INFO - Reading manholes_defaults csv data from /usr/share/miniconda/envs/test/lib/python3.12/site-packages/hydromt_delft3dfm/data/storages/manholes_defaults.csv
2025-05-19 09:45:31,020 - build - dflowfm - INFO - overwriting manholes street level from dem.
2025-05-19 09:45:31,021 - build - rasterdataset - INFO - Reading merit_hydro raster data from /home/runner/.hydromt_data/artifact_data/v0.0.9/data.tar/merit_hydro/{variable}.tif
2025-05-19 09:45:31,030 - build - rasterdataset - DEBUG - Clip to [12.433, 46.466, 12.521, 46.537] (epsg:4326))
2025-05-19 09:45:31,096 - build - dflowfm - DEBUG - street level mean is 863.6583862304688
2025-05-19 09:45:31,096 - build - dflowfm - DEBUG - dropping duplicated manholeid
2025-05-19 09:45:31,129 - build - dflowfm - DEBUG - Adding manholes vector to geoms.
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.boundaries_geodataset_fn: None
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.boundaries_timeseries_fn: None
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.boundary_value: -2.0
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.branch_type: river
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.boundary_type: waterlevel
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.boundary_unit: m
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.boundary_locs: both
2025-05-19 09:45:31,129 - build - model_api - INFO - setup_1dboundary.snap_offset: 1.0
2025-05-19 09:45:31,129 - build - dflowfm - INFO - Preparing 1D waterlevel boundaries for river.
2025-05-19 09:45:31,130 - build - boundaries - INFO - Using constant value -2.0 mfor all waterlevel boundaries.
2025-05-19 09:45:31,131 - build - dflowfm - INFO - Writing model data to /home/runner/work/hydromt_delft3dfm/hydromt_delft3dfm/docs/_examples/build/dflowfm_1d
2025-05-19 09:45:31,136 - build - model_api - DEBUG - Writing file geoms/crosssections.geojson
2025-05-19 09:45:31,190 - build - model_api - DEBUG - Writing file geoms/rivers.geojson
2025-05-19 09:45:31,193 - build - model_api - DEBUG - Writing file geoms/rivers_nodes.geojson
2025-05-19 09:45:31,195 - build - model_api - DEBUG - Writing file geoms/branches.geojson
2025-05-19 09:45:31,233 - build - model_api - DEBUG - Writing file geoms/boundaries.geojson
2025-05-19 09:45:31,237 - build - model_api - DEBUG - Writing file geoms/pipes.geojson
2025-05-19 09:45:31,273 - build - model_api - DEBUG - Writing file geoms/pipe_nodes.geojson
2025-05-19 09:45:31,313 - build - model_api - DEBUG - Writing file geoms/region.geojson
2025-05-19 09:45:31,314 - build - model_api - DEBUG - Writing file geoms/manholes.geojson
2025-05-19 09:45:31,344 - build - model_api - DEBUG - Writing file geoms/network1d.geojson
2025-05-19 09:45:31,357 - build - model_api - DEBUG - Writing file geoms/mesh1d.geojson
2025-05-19 09:45:31,378 - build - dflowfm - INFO - Writting cross-sections files crsdef and crsloc
2025-05-19 09:45:31,708 - build - dflowfm - INFO - Writting friction file(s)
2025-05-19 09:45:31,713 - build - dflowfm - INFO - Writting manholes file.
2025-05-19 09:45:31,986 - build - model_api - WARNING - Replacing geom: network1d
2025-05-19 09:45:31,987 - build - model_api - WARNING - Replacing geom: mesh1d
2025-05-19 09:45:32,000 - build - model_api - WARNING - Replacing geom: crosssections
2025-05-19 09:45:32,001 - build - model_api - WARNING - Replacing geom: rivers
2025-05-19 09:45:32,003 - build - model_api - WARNING - Replacing geom: rivers_nodes
2025-05-19 09:45:32,011 - build - model_api - WARNING - Replacing geom: branches
2025-05-19 09:45:32,013 - build - model_api - WARNING - Replacing geom: boundaries
2025-05-19 09:45:32,022 - build - model_api - WARNING - Replacing geom: pipes
2025-05-19 09:45:32,029 - build - model_api - WARNING - Replacing geom: pipe_nodes
2025-05-19 09:45:32,030 - build - model_api - WARNING - Replacing geom: region
2025-05-19 09:45:32,037 - build - model_api - WARNING - Replacing geom: manholes
2025-05-19 09:45:32,038 - build - model_api - WARNING - Replacing geom: network1d
2025-05-19 09:45:32,039 - build - model_api - WARNING - Replacing geom: mesh1d
2025-05-19 09:45:32,039 - build - model_api - DEBUG - Writing file geoms/crosssections.geojson
2025-05-19 09:45:32,094 - build - model_api - DEBUG - Writing file geoms/rivers.geojson
2025-05-19 09:45:32,097 - build - model_api - DEBUG - Writing file geoms/rivers_nodes.geojson
2025-05-19 09:45:32,100 - build - model_api - DEBUG - Writing file geoms/branches.geojson
2025-05-19 09:45:32,139 - build - model_api - DEBUG - Writing file geoms/boundaries.geojson
2025-05-19 09:45:32,143 - build - model_api - DEBUG - Writing file geoms/pipes.geojson
2025-05-19 09:45:32,180 - build - model_api - DEBUG - Writing file geoms/pipe_nodes.geojson
2025-05-19 09:45:32,221 - build - model_api - DEBUG - Writing file geoms/region.geojson
2025-05-19 09:45:32,223 - build - model_api - DEBUG - Writing file geoms/manholes.geojson
2025-05-19 09:45:32,254 - build - model_api - DEBUG - Writing file geoms/network1d.geojson
2025-05-19 09:45:32,268 - build - model_api - DEBUG - Writing file geoms/mesh1d.geojson
2025-05-19 09:45:32,439 - build - dflowfm - INFO - Writting branches.gui file
2025-05-19 09:45:32,746 - build - dflowfm - INFO - Writting forcing files.
2025-05-19 09:45:33,515 - build - dflowfm - INFO - Initialising empty dimr file
INFO:build:Initialising empty dimr file
2025-05-19 09:45:33,515 - build - dflowfm - INFO - Adding dflowfm component to dimr config
INFO:build:Adding dflowfm component to dimr config
2025-05-19 09:45:33,515 - build - dflowfm - INFO - Writing model dimr file to /home/runner/work/hydromt_delft3dfm/hydromt_delft3dfm/docs/_examples/build/dflowfm_1d/dimr_config.xml
INFO:build:Writing model dimr file to /home/runner/work/hydromt_delft3dfm/hydromt_delft3dfm/docs/_examples/build/dflowfm_1d/dimr_config.xml
The example above means the following: run hydromt build with:
dflowfm
: i.e. build a FM model./build/dflowfm_1d
: output model folder-i dflowfm_build1d.yml
: model build configuration file-d artifact_data
: data catalog to use. Here the default artifact data catalog with global data for Northern Italy.--fo
: force overwritting in case a model already exists in the output folder.-vv
: give some extra verbosity (2 * v) to display feedback on screen. Now debug and info messages are provided rather than only warnings and errors.
NOTE: You can use as many data catalogs as you need within the same command line, by repeating the
-d
options and name of the catalog to use several times.
Next we check the model files that have been created.
[5]:
import os
root = "./build/dflowfm_1d/"
for path, _, files in os.walk(root):
print(path)
for name in files:
print(f" - {name}")
./build/dflowfm_1d/
- hydromt.log
- hydromt_data.yml
- dimr_config.xml
./build/dflowfm_1d/maps
./build/dflowfm_1d/geoms
- branches.geojson
- region.geojson
- mesh1d.geojson
- pipe_nodes.geojson
- crosssections.geojson
- rivers_nodes.geojson
- network1d.geojson
- pipes.geojson
- rivers.geojson
- boundaries.geojson
- manholes.geojson
./build/dflowfm_1d/dflowfm
- nodeFile.ini
- DFlowFM.mdu
- branches.gui
- crsdef.ini
- roughness_Manning_0.023.ini
- fm_net.nc
- roughness_WhiteColeBrook_0.003.ini
- crsloc.ini
- bnd.ext
- boundarycondition1d.bc
The model root should contain three files and four folders:
dimr_config.xml: Configuration file to execute Delft3D FM in Deltares Integrated Model Runner (DIMR).
hydromt.log: log saved by HydroMT on model building steps.
hydromt_data.yml: information saved by HydroMT on used datasets for reproducibility.
dflowfm folder: dflowfm files, here for our 1D model. Contains all necessary information to run a 1D model including the mesh1d, roughness, cross-sections, 1D boundary forcing. The configuration MDU file is also created as well as a .gui file to visualize the 1D network in the Delft3D FM GUI.
geoms folder: folder containing a copy of the dflowfm data in an easily readable GIS format rather than the ini or UGRID netcdf file.
maps folder: folder containing regular gridded data that Delft3D FM can interpolate to the 2D mesh grid. Here empty as we have a 1D model only.
Visualize and/or inspect model schematization#
We can now load the dimr_config.xml into Delft3D FM GUI.
The dflowfm plot example notebook contains scripts to visualize your model in python: