hydromt_delft3dfm.DFlowFMModel.setup_2dboundary#

DFlowFMModel.setup_2dboundary(boundaries_fn: str = None, boundaries_timeseries_fn: str = None, boundary_value: float = 0.0, boundary_type: str = 'waterlevel', tolerance: float = 3.0)[source]#

Prepare the 2D boundaries from line geometries.

The values can either be a spatially-uniform constant using boundaries_fn and boundary_value (default), or spatially-varying timeseries using boundaries_fn and boundaries_timeseries_fn The boundary_type can either be “waterlevel” or “discharge”.

If boundaries_timeseries_fn has missing values, the constant boundary_value will be used.

The dataset/timeseries are clipped to the model region (see below note), and model time based on the model config tstart and tstop entries.

Note that: (1) Only line geometry that are contained within the distance of

tolenrance to grid cells are allowed.

  1. Because of the above, this function must be called before the mesh refinement. #FIXME: check this after deciding on mesh refinement being a workflow or function

  2. when using constant boundary, the output forcing will be written to time series with constant values.

Adds/Updates model layers:

  • boundary2d_{boundary_name} forcing: 2D boundaries DataArray

Parameters:
  • boundaries_fn (str Path) –

    Path or data source name for line geometry file.

    • Required variables if a combined time series data csv file:

      [“boundary_id”] with type int

  • boundaries_timeseries_fn (str, Path) – Path to tabulated timeseries csv file with time index in first column and location index with type int in the first row, matching “boundary_id” in ``boundaries_fn`. see hydromt.get_dataframe(), for details. NOTE: Require equidistant time series

  • boundary_value (float, optional) – Constant value to use for all boundaries, and to fill in missing data. By default 0.0 m.

  • boundary_type (str, optional) – Type of boundary tu use. One of [“waterlevel”, “discharge”]. By default “waterlevel”.

  • tolerance (float, optional) – Search tolerance factor between boundary polyline and grid cells. Unit: in cell size units (i.e., not meters) By default, 3.0

Raises:

AssertionError – if “boundary_id” in “boundaries_fn” does not match the columns of boundaries_timeseries_fn.