hydromt_delft3dfm.DFlowFMModel.setup_rivers#

DFlowFMModel.setup_rivers(region: dict, rivers_fn: str, rivers_defaults_fn: str = 'rivers_defaults', river_filter: str = None, friction_type: str = 'Manning', friction_value: float = 0.023, crosssections_fn: int | list = None, crosssections_type: int | list = None, snap_offset: float = 0.0, maxdist: float = 1.0, allow_intersection_snapping: bool = True)[source]#

Prepare the 1D rivers and adds to 1D branches.

1D rivers must contain valid geometry, friction and crosssections.

The river geometry is read from rivers_fn. If defaults attributes [branchorder, spacing, material, shape, width, t_width, height, bedlev, closed] are not present in rivers_fn, they are added from defaults values in rivers_defaults_fn. For branchid and branchtype, they are created on the fly if not available in rivers_fn (“river” for Type and “river_{i}” for Id).

Friction attributes are either taken from rivers_fn or filled in using friction_type and friction_value arguments. Note for now only branch friction or global friction is supported.

Crosssections are read from crosssections_fn based on the crosssections_type. If there is no crosssections_fn values are derived at the centroid of each river line based on defaults. If there are multiple types of crossections, specify them as lists.

Adds/Updates model layers:

  • rivers geom: 1D rivers vector

  • branches geom: 1D branches vector

  • crosssections geom: 1D crosssection vector

Parameters:
  • region (dict, optional) –

    Dictionary describing region of interest for extracting 1D rivers, e.g.:

    • {‘bbox’: [xmin, ymin, xmax, ymax]}

    • {‘geom’: ‘path/to/polygon_geometry’}

  • rivers_fn (str) –

    Name of data source for rivers parameters, see data/data_sources.yml. Note only the lines that intersect with the region polygon will be used.

    • Optional variables: [branchid, branchtype, branchorder, material,

    friction_type, friction_value]

  • rivers_defaults_fn (str Path) – Path to a csv file containing all defaults values per ‘branchtype’. By default None.

  • river_filter (str, optional) – Keyword in branchtype column of rivers_fn used to filter river lines. If None all lines in rivers_fn are used (default).

  • friction_type (str, optional) – Type of friction to use. One of [“Manning”, “Chezy”, “wallLawNikuradse”, “WhiteColebrook”, “StricklerNikuradse”, “Strickler”, “deBosBijkerk”]. By default “Manning”.

  • friction_value (float, optional.) – Units corresponding to [friction_type] are [“Chézy C [m 1/2 /s]”, “Manning n [s/m 1/3 ]”, “Nikuradse k_n [m]”, “Nikuradse k_n [m]”, “Nikuradse k_n [m]”, “Strickler k_s [m 1/3 /s]”, “De Bos-Bijkerk γ [1/s]”] Friction value. By default 0.023.

  • crosssections_fn (str, Path, or a list of str or Path, optional) –

    Name of data source for crosssections, see data/data_sources.yml. One or a list corresponding to crosssections_type . If crosssections_type = “branch” crosssections_fn should be None If crosssections_type = “xyz”

    • Required variables: [crsid, order, z]

    If crosssections_type = “point”

    • Required variables: [crsid, shape, shift]

    By default None, crosssections will be set from branches

  • crosssections_type (str, or a list of str, optional) – Type of crosssections read from crosssections_fn. One or a list of [“branch”, “xyz”, “point”]. By default None.

  • snap_offset (float, optional) – Snapping tolerance to automatically connecting branches. By default 0.0, no snapping is applied.

  • maxdist (float, optional) – Maximum distance allowed for crosssections to be applied on branches. Only used for crosssections_type = point. By default 1.0.

  • allow_intersection_snapping (bool, optional) – Switch to choose whether snapping of multiple branch ends are allowed when snap_offset is used. By default True.

See also

dflowfm._setup_branches, dflowfm._setup_crosssections