hydromt_delft3dfm.DFlowFMModel.setup_pipes#
- DFlowFMModel.setup_pipes(region: dict, pipes_fn: str, pipes_defaults_fn: str = 'pipes_defaults', pipe_filter: str | None = None, spacing: float = inf, friction_type: str = 'WhiteColebrook', friction_value: float = 0.003, crosssections_shape: str = 'circle', crosssections_value: int | list = 0.5, dem_fn: str | None = None, pipes_depth: float = 2.0, pipes_invlev: float = -2.5, snap_offset: float = 0.0, allow_intersection_snapping: bool = True)[source]#
Prepare the 1D pipes and adds to 1D branches.
Note that 1D manholes must also be set-up when setting up 1D pipes.
1D pipes must contain valid geometry, friction and crosssections.
The pipe geometry is read from
pipes_fn
.If branchtype is present in
pipes_fn
, it is possible to filter pipe geometry using an additional filter specificed in``pipe_filter``. If defaults attributes [“branchorder”] are not present inpipes_fn
, they are added from defaults values inpipes_defaults_fn
. For branchid and branchtype, if they are not present inpipes_fn
, they are created on the fly (“pipe” for branchtype and “pipe_{i}” for branchid).The pipe geometry can be processed using splitting based on
spacing
.Friction attributes [“branchid”, “frictionvalue”] are either taken from
pipes_fn
or filled in usingfriction_type
andfriction_value
arguments. Note for now only branch friction or global friction is supported.Crosssections definition attributes [“shape”, “diameter”, “width”, “height”, “closed”] are either taken from
pipes_fn
or filled in usingcrosssections_shape
andcrosssections_value
.Crosssections location attributes [“invlev_up”, “invlev_dn”] are either taken from
pipes_fn
, or derived fromdem_fn
minus a fixed depthpipe_depth
[m], or from a constantpipe_invlev
[m asl] (not recommended! should be edited before a model run).Adds/Updates model layers:
pipes geom: 1D pipes vector
branches geom: 1D branches vector
crosssections geom: 1D crosssection vector
- Parameters:
region (dict, optional) –
Dictionary describing region of interest for extracting 1D pipes, e.g.:
{‘bbox’: [xmin, ymin, xmax, ymax]}
{‘geom’: ‘path/to/polygon_geometry’}
Note that only manholes within the region are kept.
pipes_fn (str) –
Name of data source for pipes parameters, see data/data_sources.yml. Note only the lines that are within the region polygon will be used.
Optional variables: [branchid, branchtype, branchorder, spacing, branchid,
frictionvalue, shape, diameter, width, height, closed, invlev_up, invlev_dn] #TODO: material table is used for friction which is not implemented
pipes_defaults_fn (str Path) – Path to a csv file containing all defaults values per “branchtype”’”.
pipe_filter (str, optional) – Keyword in branchtype column of pipes_fn used to filter pipe lines. If None all lines in pipes_fn are used (default).
spacing (float, optional) – Spacing value in meters to split the long pipelines lines into shorter pipes. By default inf - no splitting is applied.
friction_type (str, optional) – Type of friction to use. One of [“Manning”, “Chezy”, “wallLawNikuradse”, “WhiteColebrook”, “StricklerNikuradse”, “Strickler”, “deBosBijkerk”]. By default “WhiteColeBrook”.
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.003.
crosssections_shape (str, optional) – Shape of pipe crosssections. Either “circle” (default) or “rectangle”.
crosssections_value (int or list of int, optional) – Crosssections parameter value. If
crosssections_shape
= “circle”, expects a diameter (default with 0.5 m) [m] Ifcrosssections_shape
= “rectangle”, expects a list with [width, height] (e.g. [1.0, 1.0]) [m]. closed rectangle by default.dem_fn (str, optional) –
Name of data source for dem data. Used to derive default invert levels values (DEM - pipes_depth - pipes diameter/height).
Required variables: [elevtn]
pipes_depth (float, optional) – Depth of the pipes underground [m] (default 2.0 m). Used to derive defaults invert levels values (DEM - pipes_depth - pipes diameter/height).
pipes_invlev (float, optional) – Constant default invert levels of the pipes [m asl] (default -2.5 m asl). This method is recommended to be used together with the dem method to fill remaining nan values. It slone is not a recommended method.
snap_offset (float, optional) – Snapping tolenrance to automatically connecting branches. Tolenrance must be smaller than the shortest pipe length. By default 0.0, no snapping is applied.
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