Skip to content

Commit

Permalink
Add floodplain discharge to inflow reservoirs and lakes (#368)
Browse files Browse the repository at this point in the history
* Add floodplain discarge to inflow reservoir and lake

* Update changelog

* Change order update reservoir and lake `ShallowWaterRiver`
This way the inflow can be based on the current `q` instead of `q0` (`q` at the previous time step). Moved inflow computation of reservoir and lake to separate function for `ShallowWaterRiver`.

* Fix inflow water body local inertial routing river flow
For local inertial routing the inflow has been corrected: it  should also include the `to_river` variable (from subsurface and overland flow), because the water body cell is not included in the local inertial routing solution (boundary condition).

* Update changelog

* Update Wflow ZMQ Server tests

* Update tests because of merge `master`

* Fix client.jl tests
  • Loading branch information
vers-w authored Mar 13, 2024
1 parent 7be5558 commit faba526
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 107 deletions.
4 changes: 4 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
lake storage. The variable `actevap` has also been added to the reservoir module.
- The `set_states` function for model type `sbm` with local inertial routing for river and
land component.
- Inflow to reservoir and lake locations for local inertial routing: 1) with floodplain
routing, the floodplain discharge was not added to the inflow of these locations, 2) the
`to_river` variable from overland flow and lateral subsurface flow was not added to the
inflow of these locations.

### Changed
- Stop exposing scalar variables through BMI. The `BMI.get_value_ptr` function was
Expand Down
8 changes: 4 additions & 4 deletions server/test/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ end

@testset "model information functions" begin
@test request((fn = "get_component_name",)) == Dict("component_name" => "sbm")
@test request((fn = "get_input_item_count",)) == Dict("input_item_count" => 181)
@test request((fn = "get_output_item_count",)) == Dict("output_item_count" => 181)
@test request((fn = "get_input_var_names",))["input_var_names"][[1, 5, 151, 175]] == [
@test request((fn = "get_input_item_count",)) == Dict("input_item_count" => 192)
@test request((fn = "get_output_item_count",)) == Dict("output_item_count" => 192)
@test request((fn = "get_input_var_names",))["input_var_names"][[1, 6, 161, 186]] == [
"vertical.nlayers",
"vertical.θᵣ",
"lateral.river.q",
"lateral.river.reservoir.outflow",
]
@test request((fn = "get_output_var_names",))["output_var_names"][[1, 5, 151, 175]] == [
@test request((fn = "get_output_var_names",))["output_var_names"][[1, 6, 161, 186]] == [
"vertical.nlayers",
"vertical.θᵣ",
"lateral.river.q",
Expand Down
Loading

0 comments on commit faba526

Please sign in to comment.