Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh #38

Merged
merged 30 commits into from
Aug 25, 2023
Merged

Mesh #38

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
04f8bcb
adapt mesh2d
hboisgon Jul 10, 2023
e9582a5
start adapting mesh1d
hboisgon Jul 10, 2023
a8dcd26
adapt mesh1d
hboisgon Jul 14, 2023
8205bab
finalise mesh build functions
hboisgon Jul 24, 2023
9ce9ddc
move mesh conversion functions to mesh_utils.py
hboisgon Jul 24, 2023
b2ff449
update read_mesh
hboisgon Jul 24, 2023
370c11c
update tests
hboisgon Jul 24, 2023
019388f
Merge branch 'main' into mesh
hboisgon Jul 24, 2023
86077d7
update api docs
hboisgon Jul 24, 2023
5b23eaf
fix code smells
hboisgon Jul 27, 2023
b6b073b
update example config
hboisgon Jul 27, 2023
2b6937b
review + refactor add_branches, add_crosssections
xldeltares Jul 27, 2023
e7b2a09
pre-commit
xldeltares Jul 27, 2023
40ca89b
Merge branch 'mesh' of https://github.com/Deltares/hydromt_delft3dfm …
xldeltares Jul 27, 2023
b200a65
refactor boundary property
xldeltares Aug 3, 2023
319c5f7
review 1d
xldeltares Aug 4, 2023
42763cd
review 1d
xldeltares Aug 4, 2023
fe4490e
review 1d
xldeltares Aug 4, 2023
d62bf28
review 2d
xldeltares Aug 7, 2023
e9cbf00
review 2d
xldeltares Aug 7, 2023
b91a9f9
bug fix branches
xldeltares Aug 8, 2023
1d6534c
review link1d2d
xldeltares Aug 11, 2023
2278e29
fix test (in progress)
xldeltares Aug 11, 2023
6f5c9ca
bug fixing: set up manholes for diameter pipes only
xldeltares Aug 11, 2023
2942e57
fix branchorder
xldeltares Aug 11, 2023
cfb027c
update data folder
xldeltares Aug 11, 2023
91c0556
update api funcs
xldeltares Aug 11, 2023
07462a6
update examples
xldeltares Aug 11, 2023
3f6eccb
small updates
hboisgon Aug 23, 2023
b6aabdf
review last bit
xldeltares Aug 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 64 additions & 13 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ Setup components
:toctree: _generated

DFlowFMModel.setup_config
DFlowFMModel.setup_channels
DFlowFMModel.setup_rivers_from_dem
DFlowFMModel.setup_rivers
DFlowFMModel.setup_pipes
DFlowFMModel.setup_manholes
DFlowFMModel.setup_1dboundary
DFlowFMModel.setup_bridges
DFlowFMModel.setup_culverts
DFlowFMModel.setup_mesh2d
DFlowFMModel.setup_mesh2d_refine
DFlowFMModel.setup_link1d2d
DFlowFMModel.setup_maps_from_rasterdataset
DFlowFMModel.setup_maps_from_raster_reclass
DFlowFMModel.setup_2dboundary
DFlowFMModel.setup_rainfall_from_constant
DFlowFMModel.setup_rainfall_from_uniform_timeseries

Attributes
----------
Expand All @@ -36,15 +52,25 @@ Attributes
:toctree: _generated

DFlowFMModel.region
DFlowFMModel.bounds
DFlowFMModel.crs
DFlowFMModel.res
DFlowFMModel.root
DFlowFMModel.config
DFlowFMModel.staticmaps
DFlowFMModel.staticgeoms
DFlowFMModel.maps
DFlowFMModel.geoms
DFlowFMModel.forcing
DFlowFMModel.states
DFlowFMModel.results
DFlowFMModel.mesh
DFlowFMModel.dfmmodel
DFlowFMModel.dimr
DFlowFMModel.branches
DFlowFMModel.rivers
DFlowFMModel.channels
DFlowFMModel.pipes
DFlowFMModel.opensystem
DFlowFMModel.closedsystem


High level methods
Expand All @@ -58,6 +84,8 @@ High level methods
DFlowFMModel.build
DFlowFMModel.update
DFlowFMModel.set_root
DFlowFMModel._model_has_2d
DFlowFMModel._model_has_1d

General methods
---------------
Expand All @@ -72,18 +100,17 @@ General methods
DFlowFMModel.read_config
DFlowFMModel.write_config

DFlowFMModel.set_staticmaps
DFlowFMModel.read_staticmaps
DFlowFMModel.write_staticmaps
DFlowFMModel.clip_staticmaps
DFlowFMModel.set_staticgeoms
DFlowFMModel.read_staticgeoms
DFlowFMModel.write_staticgeoms
DFlowFMModel.set_maps
DFlowFMModel.read_maps
DFlowFMModel.write_maps

DFlowFMModel.set_geoms
DFlowFMModel.read_geoms
DFlowFMModel.write_geoms

DFlowFMModel.set_forcing
DFlowFMModel.read_forcing
DFlowFMModel.write_forcing
DFlowFMModel.clip_forcing

DFlowFMModel.set_states
DFlowFMModel.read_states
Expand All @@ -92,11 +119,22 @@ General methods
DFlowFMModel.set_results
DFlowFMModel.read_results

DFlowFMModel.set_mesh
DFlowFMModel.set_link1d2d
DFlowFMModel.read_mesh
DFlowFMModel.write_mesh

DFlowFMModel.read_dimr
DFlowFMModel.write_dimr


DFlowFMModel.get_model_time


.. _workflows:

Wflow workflows
===============
DFlowFMModel workflows
======================

.. autosummary::
:toctree: _generated
Expand All @@ -107,7 +145,7 @@ Wflow workflows
.. _methods:

DFlowFM low-level methods
=======================
=========================

Input/Output methods
---------------------
Expand All @@ -116,3 +154,16 @@ Input/Output methods
:toctree: _generated

utils.read_branches_gui

Mesh conversion methods
-----------------------

.. autosummary::
:toctree: _generated

mesh_utils.hydrolib_network_from_mesh
mesh_utils.mesh1d_network1d_from_hydrolib_network
mesh_utils.links1d2d_from_hydrolib_network
mesh_utils.mesh_from_hydrolib_network
mesh_utils.mesh1d_nodes_geodataframe
mesh_utils.network1d_nodes_geodataframe
7 changes: 4 additions & 3 deletions envs/hydromt-delft3dfm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ channels:
dependencies:
- black # linting
- flit>=3.4
- hydromt>=0.7.0
- jupyter # to run examples
- matplotlib # to run examples
- nbsphinx # docs notebook examples
Expand All @@ -32,6 +31,8 @@ dependencies:
- xarray
- xugrid
- networkx
- llvmlite>=0.39.1 # hydrolib-core
- pip:
- hydrolib-core
- meshkernel
- git+https://github.com/Deltares/hydromt.git
- hydrolib-core==0.5.2
- meshkernel==2.0.2 # temp pin because of hydrolib-core
56 changes: 0 additions & 56 deletions examples/dflowfm_build.ini

This file was deleted.

63 changes: 63 additions & 0 deletions examples/dflowfm_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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: rivers_lin2019_v1
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
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:
dem_fn: merit_hydro

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_fn: merit_hydro
variables: ["elevtn"]
fill_method: nearest
interpolation_method: nearestNb
split_dataset: True

setup_maps_from_raster_reclass:
raster_fn: vito
reclass_table_fn: vito_mapping
reclass_variables: ['roughness_manning', 'infiltcap']
interpolation_method: triangulation
split_dataset: True

setup_link1d2d:
link_direction: 1d_to_2d
66 changes: 0 additions & 66 deletions examples/dflowfm_build_local.ini

This file was deleted.

Loading
Loading