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

Offline coupling with Delwaq #1137

Merged
merged 45 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c61348e
Implement external timeseries and adds concentration field to Basin.
evetion Feb 12, 2024
a22631b
Code dump for Delwaq coupling.
evetion Feb 16, 2024
2ab71b5
Generate correct substances.
evetion Feb 16, 2024
4494cb0
Parse Delwaq output and save back to Ribasim model.
evetion Feb 17, 2024
fbdd56d
Merged main.
evetion Mar 4, 2024
5d7b84f
Merged main.
evetion Mar 13, 2024
0e3659e
Merged main.
evetion Mar 13, 2024
bb85cfe
Merge main.
evetion Mar 13, 2024
d51e422
New tables.
evetion Mar 14, 2024
44f562f
Add dependencies to pixi.
evetion Mar 15, 2024
632804d
Fix boundaries Delwaq.
evetion Mar 15, 2024
6fe6e5c
Allow running gen_delwaq.py from other dirs
visr Mar 18, 2024
ea655de
Merge branch 'main' into feat/delwaq-coupling
visr Mar 18, 2024
8bf8923
Reset pixi files to main
visr Mar 18, 2024
e7c3cba
Add jinja2 again
visr Mar 18, 2024
0072b09
No need for MeshKernel
visr Mar 18, 2024
f3366ff
Don't use node index
visr Mar 18, 2024
b0d870a
Fix network for node ordering
visr Mar 19, 2024
b9658e4
Add extra timestep at the end
visr Mar 19, 2024
c0798a0
Merge main.
evetion Apr 18, 2024
04b23d0
Merge main.
evetion Apr 20, 2024
17d8adf
Merge main.
evetion May 6, 2024
d1d38e7
Happy mypy.
evetion May 6, 2024
cf81086
Simplify network.
evetion May 8, 2024
9a74fd4
refine readme.md
Jingru923 May 13, 2024
97a9e8f
Merge main.
evetion May 16, 2024
04f0050
Run Delwaq on Teamcity.
evetion May 16, 2024
d5b7e59
Add parsing test.
evetion May 16, 2024
ed9faa9
Merge main.
evetion May 16, 2024
dc1a748
Merge main.
evetion May 16, 2024
64362b4
Merge main.
evetion May 16, 2024
c8b033d
Merge main.
evetion May 16, 2024
e5cd1bb
Fix some errors.
evetion May 16, 2024
de9052c
Merge main.
evetion May 17, 2024
2ae4fd6
Merge main.
evetion May 17, 2024
9cf68ec
Merge main.
evetion May 17, 2024
077b6fb
Merge remote-tracking branch 'origin/main' into feat/delwaq-coupling
evetion May 17, 2024
80d160a
Change input path on Windows. Allow selection of test model.
evetion May 17, 2024
333e2ac
Removed debug line.
evetion May 17, 2024
44fb105
Make mypy happy.
evetion May 17, 2024
8ea2149
Update coupling/delwaq/README.md
evetion May 17, 2024
6b97f73
Apply suggestions from code review
evetion May 17, 2024
4762e4a
Further addressed comments.
evetion May 17, 2024
e27bb59
Update lock.
evetion May 17, 2024
faf3374
Add documentation.
evetion May 17, 2024
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
5 changes: 5 additions & 0 deletions coupling/delwaq/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
model
*.map
*.nc
*.pdf
*.out
37 changes: 37 additions & 0 deletions coupling/delwaq/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Ribasim Delwaq coupling


## Steps
Choose a testmodel and run it. For example, running the basic model with ribasim_cli:
```bash
./build/ribasim_cli/bin/ribasim generated_testmodels/basic/ribasim.toml
```

Run `gen_delwaq.py` to couple the models. Open a terminal in the directory of Ribasim
```python
python ./coupling/delwaq/gen_delwaq.py
```
The script can:
- Open an existing Ribasim model (hardcoded to `generated_testmodels/basic/ribasim.toml` for now)
- Convert the metadata, topology and substances to Delwaq format and put it into the `model` folder

You now should manually run Delwaq. You can do so with the Docker image.
First install WSL and install docker in WSL, then create a CLI secret and log into the Deltares containers. To install docker in WSL and create a CLI secret for the following steps, follow this guide https://publicwiki.deltares.nl/display/Delft3DContainers/.

Log into Deltares containers in docker:
```bash
docker login containers.deltares.nl # use your deltares email + token
```

You can now run the Delwaq model from this directory.
```bash
docker run --mount type=bind,source="$(pwd)/model",target=/mnt/myModel \
--workdir /mnt/myModel containers.deltares.nl/delft3d/delft3dfm run_dimr.sh
```

If everything worked out, there's now a new netcdf output. We'll use this to update the Ribasim model.
Run `parse_delwaq.py` again to update the Ribasim model with the new concentrations.

## Notes
I've tested this with a basic model, and the latest ribasim-nl (hws) model.
In the latter I've set a (static) concentration on the Rijn and Maas FlowBoundaries, which will create individual tracers for these nodes (named FlowBoundary_#node_id). For the LevelBoundaries, I've set a concentration of 34 for all North Sea nodes, assuming Cl as substance.
Loading
Loading