Skip to content

Commit ea1a82f

Browse files
vers-wJoostBuitink
andauthored
Support kinematic wave floodplain routing (#870)
* Add `floodplain` to kinematic river flow Initialized as `nothing`. * Move `floodplain` to separate file * Add `bankfull_storage` to kinematic wave river * Separate init kinwave and local inertial floodplain * Refactor surface flow routing Introduce one struct for riverflow routing `RiverFlowModel` and one struct for overlandflow routing `OverlandFlowModel`. The routing method (subtype of `AbstractRoutingMethod`) is used to differentiate between different routing approaches for river and overland flow. Extending to other routing methods is now easier. * Change abstract surface flow routing types Remove `AbstractRoutingMethod` from these abstract types and add the routing method as first field to `RiverFlowModel` and `OverlandFlowModel`. This simplifies dispatching a bit and looks a bit cleaner. * Update docstrings * Renaming of init functions surface flow routing Also add `slope` parameter that can be used by kinematic wave routing (as alternative to local inertial routing) using a staggered scheme. * Refactor init local inertial river flow parameters Use a separate function for reading river parameters that can also be used by kinematic wave routing with a staggered scheme. * Update info log message * Add init kinwave staggered river flow * Refactor init river flow staggered a bit * Use split up of local_inertial_river_update! function As implemented in PR#835. * Init parameter `h_thresh` staggered kinematic wave * Fix typo * Fix slope computation * Add update manning's river flow staggered grid Using the term kinematic wave is not entirely correct as the Manning's equation is used as an alternative for the local inertial approach on a staggered grid. * Refactor init staggered routing * Add `stable_timestep` function `ManningStaggered` For manning flow on a staggered grid. * Some fixes To run manning river and floodplain flow on a staggered grid. * Revert `river_routing` TOML setting change * Add TOML setting `alpha` staggered manning flow * Rename file `surface_local_inertial.jl` * Add test river and floodplain Manning's flow on staggered grid * Add missing toml file * Some ordering and renaming Edge/node variables and parameters. * Add floodplain model for kinematic wave * Simplify dispatching on floodplain model * Init manning flow parameters Remove update of `alpha` at each model timestep as dynamic input of manning roughness is not allowed. * Use separate structs river and overland flow variables For kinematic wave routing. * Add kinematic wave flood routing For routing type `KinematicWave` using a compound channel (not separate routing for floodplain) with a compound `alpha` value. * Use function for wetted perimeter channel * Refactor computation of floodplain variables * Use function for active floodplain cells * Move update kinematic wave floodplain to function * Separate routing for floodplain Making use of a simple routing scheme ( Manning flow and `accucapacityflux`) as kinematic wave routing gets quite slow for very small flows. * Support mass balance computation `ManningStaggered` * Consistent use of `at_edge` For parameter and variable names stored at edges that normally are stored at cell centres/nodes. * Explain `FloodPlainModel` `domain` * Address review comment Make use of const `LDD_PIT`. * Address review comment * Remove `Float64` `hydraulic_radius_pow` * Address review comment Remove `pow` from `celerity` computation. * Use constant `BETA_KINWAVE` for `celerity` computation * Compute stable timestep using variables at edges For `RiverFlowModel{<:ManningStaggered}`. * Remove magic number In `stable_timestep` functions. * Address review comment * Improve docstring for `FloodPlainModel` * Add docstrings related to `FloodPlainModel` * Update and add docstrings For routing on a staggered grid. Also removed `cell` from functions, for a staggered grid typically `node` and `edge` terms are used. * Some more docstrings * Update `stable_timestep` staggered scheme * Add small comment * Add docstring and renaming function * Update docs routing on staggered grid * Fix links staggered grid docs * Add docs floodplain routing kinematic wave * Update docs and introduce standard name `floodplain__slope` To support different slope values for river channel and floodplain for `kinematic_wave` routing. * Update routing_metadata json output * Update model_config docs * Small formatting * Update faq docs * Remove flow_area from test description * Use `floodplain__slope` for kinematic wave floodplain * Add unit test river flow with floodplain For river flow on a staggered grid using Manning's equation. * Small change comment in unit test * Add unit test kinematic wave routing with floodplain * Update model settings docs * Rename inds `EdgeConnectivity` Keeping `x` and `y` dir in the name, bit more generic than `left`/`right`. * Update struct model docs * Update changelog * Update docs model parameters staggered grid * Fix some doc tags model parameters * Formatting and typo docs routing parameters * Fix missing space in changelog * Rename routing method kinematic wave floodplain From `KinematicWave` to `Manning`, a better description as it uses the Manning equation and not the full kinematic wave equation. * Fix `NaN`/`Inf` values floodplain hydraulic radius Removed flow area and hydraulic radius fields of local inertial structs as these are used only internally (per function) and are not part of model output. Added check for hydraulic radius floodplain. * Remove check active floodplain index Already part of release/v1.0 branch: this check was based on `water_depth_at_edge` of river nodes and should be based on `water_depth_at_edge` of floodplain nodes. However, testing showed there is no performance benefit from this check and looping over active floodplain indices. * Fix large `q` fluctuations `manning_staggered` routing By using the "upwind"option (instead of "max" as used for local inertial routing) for water level and depth estimation at edge. * Address review comment * Small change "upwind" option `manning_staggered` For zero flows the maximum waterlevel between two adjacent cells was computed. For slope based mannings flow (one direction) this is not required. * Address review comment Fix floodplain states check. * Fix states kinematic wave flood routing The floodplain water depth was incorrect as it was based on the floodplain storage excluding river channel storage using the floodplain profile, while river channel storage should be included. This is now resolved by using the floodplain storage as state instead of the water depth. Additonally, for floodplain routing a check if the downstream floodplain is active (based on flow area) has been added. * Update docs Model structure * Update docs state kinematic wave floodplain * Update tests * Remove `hydraulic_radius` check floodplain * Fix `dt` input `update_floodplain_model!` * Fix reading `alpha_coefficient` `manning_staggered` * Revert small change used for testing --------- Co-authored-by: JoostBuitink <44062204+JoostBuitink@users.noreply.github.com>
1 parent a8955dc commit ea1a82f

37 files changed

Lines changed: 2487 additions & 1575 deletions

Wflow/src/Wflow.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ const VERSION =
7575
VersionNumber(TOML.parsefile(joinpath(@__DIR__, "..", "Project.toml"))["version"])
7676

7777
const GRAVITATIONAL_ACCELERATION = 9.80665 # m s⁻²
78+
# local drain direction pit [-]
79+
const LDD_PIT = 5
7880

7981
mutable struct Clock{T}
8082
time::T
@@ -139,7 +141,7 @@ include("routing/routing.jl")
139141
include("domain.jl")
140142

141143
"""
142-
Model{R <: Routing, L <: AbstractLandModel, M <: AbstractMassBalance, T <: AbstractModelType} <: AbstractModel{T}
144+
Model{R <: Routing, L <: AbstractLandModel, M <: AbstractMassBalance, W <: Writer, T <: AbstractModelType} <: AbstractModel{T}
143145
144146
Composite type that represents all different aspects of a Wflow Model, such as the network,
145147
parameters, clock, configuration and input and output.
@@ -209,8 +211,10 @@ include("routing/subsurface/lateral_subsurface_flow.jl")
209211
include("routing/subsurface/subsurface_process.jl")
210212
include("routing/subsurface/boundary_conditions.jl")
211213
include("routing/surface/reservoir.jl")
214+
include("routing/surface/floodplain.jl")
215+
include("routing/surface/surface_flow.jl")
212216
include("routing/surface/surface_kinwave.jl")
213-
include("routing/surface/surface_local_inertial.jl")
217+
include("routing/surface/surface_staggered_scheme.jl")
214218
include("routing/surface/surface_routing.jl")
215219
include("routing/surface/surface_process.jl")
216220
include("demand/water_demand.jl")

Wflow/src/bmi.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ function BMI.get_grid_edge_count(model::Model, grid::Int)
312312
if grid == 3
313313
return ne(domain.river.network.graph)
314314
elseif grid == 4
315-
return length(domain.land.network.edge_indices.idx_right)
315+
return length(domain.land.network.edge_indices.ind_x_up)
316316
elseif grid == 5
317-
return length(domain.land.network.edge_indices.idx_up)
317+
return length(domain.land.network.edge_indices.ind_y_up)
318318
elseif grid in 0:2 || grid == 6
319319
@warn("edges are not provided for grid type $grid (variables are located at nodes)")
320320
else
@@ -334,16 +334,16 @@ function BMI.get_grid_edge_nodes(model::Model, grid::Int, edge_nodes::Vector{Int
334334
edge_nodes[range(2, n; step = 2)] = nodes_at_edge.dst
335335
return edge_nodes
336336
elseif grid == 4
337-
idx_right = domain.land.network.edge_indices.idx_right
337+
ind_x_up = domain.land.network.edge_indices.ind_x_up
338338
edge_nodes[range(1, n; step = 2)] = 1:m
339-
idx_right[idx_right .== m + 1] .= -999
340-
edge_nodes[range(2, n; step = 2)] = idx_right
339+
ind_x_up[ind_x_up .== m + 1] .= -999
340+
edge_nodes[range(2, n; step = 2)] = ind_x_up
341341
return edge_nodes
342342
elseif grid == 5
343-
idx_up = domain.land.network.edge_indices.idx_up
343+
ind_y_up = domain.land.network.edge_indices.ind_y_up
344344
edge_nodes[range(1, n; step = 2)] = 1:m
345-
idx_up[idx_up .== m + 1] .= -999
346-
edge_nodes[range(2, n; step = 2)] = idx_up
345+
ind_y_up[ind_y_up .== m + 1] .= -999
346+
edge_nodes[range(2, n; step = 2)] = ind_y_up
347347
return edge_nodes
348348
elseif grid in 0:2 || grid == 6
349349
@warn("edges are not provided for grid type $grid (variables are located at nodes)")
@@ -408,7 +408,7 @@ Return the grid element type of a model variable (PropertyLens `var`) based on a
408408
function grid_element_type(
409409
::T,
410410
var::PropertyLens,
411-
) where {T <: Union{LocalInertialRiverFlowModel, LocalInertialOverlandFlowModel}}
411+
) where {T <: Union{RiverFlowModel{<:LocalInertial}, OverlandFlowModel{<:LocalInertial}}}
412412
vars = (PropertyLens(x) for x in (:q, :q_average, :qx, :qy))
413413
element_type = if var in vars
414414
"edge"

Wflow/src/config_structure.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For configuration files we use TOML.
66
=#
77

88
# Option enumerators
9-
@enumx RoutingType kinematic_wave local_inertial
9+
@enumx RoutingType kinematic_wave manning_staggered local_inertial
1010
@enumx ModelType sbm sbm_gwf sediment
1111
@enumx CalendarType standard gregorian proleptic_gregorian julian noleap _365_day all_leap _366_day _360_day
1212
@enumx GwfConductivityProfileType uniform exponential
@@ -91,11 +91,14 @@ end
9191
river_local_inertial_flow__alpha_coefficient::Float64 = 0.7
9292
land_local_inertial_flow__alpha_coefficient::Float64 = 0.7
9393
land_local_inertial_flow__theta_coefficient::Float64 = 1.0
94-
river_water_flow_threshold__depth = 1e-3
9594
land_surface_water_flow_threshold__depth = 1e-3
9695
river_water_flow__froude_limit_flag = true
9796
land_surface_water_flow__froude_limit_flag = true
97+
# Local inertial and staggered manning river flow routing
98+
river_water_flow_threshold__depth = 1e-3
9899
floodplain_1d__flag::Bool = false
100+
# Staggered manning river flow routing
101+
river_staggered_manning_flow__alpha_coefficient::Float64 = 0.7
99102
# Groundwater flow
100103
conductivity_profile::GwfConductivityProfileType.T = GwfConductivityProfileType.uniform
101104
drain__flag::Bool = false

Wflow/src/domain.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ function Domain(dataset::NCDataset, config::Config, ::Union{SbmModel, SbmGwfMode
107107
if river_routing == RoutingType.kinematic_wave
108108
@reset network_river.upstream_nodes =
109109
filter_upstream_nodes(network_river.graph, pits[network_river.indices])
110-
elseif river_routing == RoutingType.local_inertial
110+
elseif river_routing == RoutingType.local_inertial ||
111+
river_routing == RoutingType.manning_staggered
111112
nodes_at_edge, index_pit = NodesAtEdge(network_river)
112113
@reset network_river.nodes_at_edge = nodes_at_edge
113114
@reset network_river.pit_indices = network_river.indices[index_pit]

Wflow/src/mass_balance.jl

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,12 @@ function compute_total_storage!(
125125
end
126126

127127
"""
128-
get_storage(river_flow_model::LocalInertialRiverFlowModel, i)
129-
get_storage(river_flow_model::KinWaveRiverFlowModel, i)
128+
get_storage(river_flow_model::RiverFlowModel, i)
130129
131-
Return storage of a river flow model at index `i`. For `LocalInertialRiverFlowModel` floodplain
132-
storage is added to river storage if an optional floodplain is included.
130+
Return storage of a river flow model at index `i`, floodplain storage is added to river
131+
storage if an optional floodplain is included.
133132
"""
134-
function get_storage(river_flow_model::LocalInertialRiverFlowModel, i)
133+
function get_storage(river_flow_model::AbstractRiverFlowModel, i)
135134
(; storage) = river_flow_model.variables
136135
if isnothing(river_flow_model.floodplain)
137136
return storage[i]
@@ -140,8 +139,6 @@ function get_storage(river_flow_model::LocalInertialRiverFlowModel, i)
140139
return total_storage
141140
end
142141
end
143-
get_storage(river_flow_model::KinWaveRiverFlowModel, i) =
144-
river_flow_model.variables.storage[i]
145142

146143
"""
147144
Save river (+ floodplain) storage at previous time step as `storage_prev` of river
@@ -291,20 +288,24 @@ compute_flow_balance!(reservoir_model::Nothing, water_balance::NoMassBalance, dt
291288

292289
"Compute water mass balance error and relative error for river kinematic wave routing."
293290
function compute_flow_balance!(
294-
river_flow_model::KinWaveRiverFlowModel,
291+
river_flow_model::RiverFlowModel{<:KinematicWave},
295292
water_balance::MassBalance,
296293
network::NetworkRiver,
297294
dt::Float64,
298295
)
299296
(; storage_prev, error, relative_error) = water_balance
300297
(; inwater, external_inflow, actual_external_abstraction_average, abstraction) =
301298
river_flow_model.boundary_conditions
302-
(; qin_average, q_average, storage) = river_flow_model.variables
299+
(; qin_average, q_average) = river_flow_model.variables
303300

304301
for i in eachindex(storage_prev)
305302
total_in = inwater[i] + qin_average[i] + max(0.0, external_inflow[i])
306303
total_out = q_average[i] + actual_external_abstraction_average[i] + abstraction[i]
307-
storage_rate = (storage[i] - storage_prev[i]) / dt
304+
storage = river_flow_model.variables.storage[i]
305+
if !isnothing(river_flow_model.floodplain)
306+
storage += river_flow_model.floodplain.variables.storage[i]
307+
end
308+
storage_rate = (storage - storage_prev[i]) / dt
308309
error[i], relative_error[i] =
309310
compute_mass_balance_error(total_in, total_out, storage_rate)
310311
end
@@ -316,7 +317,7 @@ Compute water mass balance error and relative error for river (and floodplain) l
316317
inertial routing.
317318
"""
318319
function compute_flow_balance!(
319-
river_flow_model::LocalInertialRiverFlowModel,
320+
river_flow_model::RiverFlowModel{<:AbstractStaggeredRoutingMethod},
320321
water_balance::MassBalance,
321322
network::NetworkRiver,
322323
dt::Float64,
@@ -326,18 +327,17 @@ function compute_flow_balance!(
326327
river_flow_model.boundary_conditions
327328
(; edges_at_node) = network
328329

329-
q_av_average = river_flow_model.variables.q_average
330-
actual_external_abstraction_av_average = actual_external_abstraction_average
330+
(; q_average) = river_flow_model.variables
331331

332332
for i in river_flow_model.parameters.active_n
333333
total_in = 0.0
334334
total_out = 0.0
335-
q_src = sum_at(q_av_average, edges_at_node.src[i])
335+
q_src = sum_at(q_average, edges_at_node.src[i])
336336
total_in, total_out = add_inflow(total_in, total_out, [q_src, inwater[i]])
337337
total_in += max(0.0, external_inflow[i])
338-
q_dst = sum_at(q_av_average, edges_at_node.dst[i])
338+
q_dst = sum_at(q_average, edges_at_node.dst[i])
339339
total_in, total_out = add_outflow(total_in, total_out, q_dst)
340-
total_out += actual_external_abstraction_av_average[i] + abstraction[i]
340+
total_out += actual_external_abstraction_average[i] + abstraction[i]
341341
storage = river_flow_model.variables.storage[i]
342342

343343
if !isnothing(river_flow_model.floodplain)
@@ -380,7 +380,7 @@ Compute water mass balance error and relative error for overland flow kinematic
380380
routing.
381381
"""
382382
function compute_flow_balance!(
383-
overland_flow_model::KinWaveOverlandFlowModel,
383+
overland_flow_model::OverlandFlowModel{<:KinematicWave},
384384
water_balance::MassBalance,
385385
dt::Float64,
386386
)
@@ -404,8 +404,8 @@ Compute water mass balance error and relative error for 1D river local inertial
404404
computed for each land cell (total storage) considering both river and overland flow.
405405
"""
406406
function compute_flow_balance!(
407-
river_flow_model::LocalInertialRiverFlowModel,
408-
overland_flow_model::LocalInertialOverlandFlowModel,
407+
river_flow_model::RiverFlowModel{<:LocalInertial},
408+
overland_flow_model::OverlandFlowModel{<:LocalInertial},
409409
water_balance::MassBalance,
410410
domain::Domain,
411411
dt::Float64,
@@ -426,14 +426,14 @@ function compute_flow_balance!(
426426
qy_av_average = qy_average
427427

428428
for i in 1:(overland_flow_model.parameters.n)
429-
idx_down = indices.idx_down[i]
430-
idx_left = indices.idx_left[i]
429+
ind_y_down = indices.ind_y_down[i]
430+
ind_x_down = indices.ind_x_down[i]
431431
total_in = 0.0
432432
total_out = 0.0
433433
total_in, total_out = add_inflow(
434434
total_in,
435435
total_out,
436-
[qx_av_average[idx_left], qy_av_average[idx_down], runoff[i]],
436+
[qx_av_average[ind_x_down], qy_av_average[ind_y_down], runoff[i]],
437437
)
438438
total_in, total_out =
439439
add_outflow(total_in, total_out, [qx_av_average[i], qy_av_average[i]])
@@ -512,7 +512,9 @@ end
512512

513513
function compute_flow_routing_balance!(
514514
model::Model{R},
515-
) where {R <: Routing{<:LocalInertialOverlandFlowModel, <:LocalInertialRiverFlowModel}}
515+
) where {
516+
R <: Routing{<:OverlandFlowModel{<:LocalInertial}, <:RiverFlowModel{<:LocalInertial}},
517+
}
516518
(; river_flow, overland_flow, subsurface_flow) = model.routing
517519
(; reservoir) = river_flow.boundary_conditions
518520
(; overland_water_balance, reservoir_water_balance, subsurface_water_balance) =

Wflow/src/network.jl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# maps the fields of struct `EdgeConnectivity` to the defined Wflow cartesian indices of
22
# const `neighbors`.
3-
const DIRS = (:idx_down, :idx_left, :idx_right, :idx_up)
3+
const DIRS = (:ind_y_down, :ind_x_down, :ind_x_up, :ind_y_up)
44

55
"""
66
Struct for storing 2D staggered grid edge connectivity in `x` and `y` directions. For
@@ -15,19 +15,21 @@ Edges without neighbors are handled by an extra index (at `n + 1`, with `n` edge
1515
linear index `i` of the `EdgeConnectivity` fields represents the edge between node index `i`
1616
and the neighboring nodes in the CartesianIndex(-1,0) and CartesianIndex(0,-1) directions.
1717
The edges are defined as follows:
18-
- `idx_right` is the edge between node `i` and node `idx_right` in the `CartesianIndex(1,0)` direction.
19-
- `idx_left` is the edge between node `idx_left` in the `CartesianIndex(-1,0)` direction and the
20-
neighboring node (CartesianIndex(-2,0) direction).
21-
- `idx_up` is the edge between node `i` and node `idx_up` in the `CartesianIndex(0,1)` direction.
22-
- `idx_down` is the edge between node `idx_down` in the `CartesianIndex(0,-1)` direction and the
23-
neighboring node (`CartesianIndex(0,-2)` direction).
18+
- `ind_x_up` is the edge between node `i` and node `ind_x_up` in the `CartesianIndex(1,0)`
19+
direction.
20+
- `ind_x_down` is the edge between node `ind_x_down` in the `CartesianIndex(-1,0)` direction
21+
and the neighboring node (CartesianIndex(-2,0) direction).
22+
- `ind_y_up` is the edge between node `i` and node `ind_y_up` in the `CartesianIndex(0,1)`
23+
direction.
24+
- `ind_y_down` is the edge between node `ind_y_down` in the `CartesianIndex(0,-1)` direction
25+
and the neighboring node (`CartesianIndex(0,-2)` direction).
2426
"""
2527
@with_kw struct EdgeConnectivity
2628
n::Int
27-
idx_right::Vector{Int} = zeros(Int, n)
28-
idx_left::Vector{Int} = zeros(Int, n)
29-
idx_up::Vector{Int} = zeros(Int, n)
30-
idx_down::Vector{Int} = zeros(Int, n)
29+
ind_x_up::Vector{Int} = zeros(Int, n)
30+
ind_x_down::Vector{Int} = zeros(Int, n)
31+
ind_y_up::Vector{Int} = zeros(Int, n)
32+
ind_y_down::Vector{Int} = zeros(Int, n)
3133
end
3234

3335
"Struct for storing source `src` node and destination `dst` node of an edge."
@@ -115,7 +117,7 @@ nthreads > 1 to run the kinematic wave parallel, otherwise it is equal to the co
115117
domain.
116118
"""
117119
function network_subdomains(config::Config, network::NetworkLand)
118-
pit_inds = findall(x -> x == 5, network.local_drain_direction)
120+
pit_inds = findall(x -> x == LDD_PIT, network.local_drain_direction)
119121
order_of_subdomains, subdomain_inds, toposort_subdomain = kinwave_set_subdomains(
120122
network.graph,
121123
network.order,
@@ -261,7 +263,7 @@ nthreads > 1 to run the kinematic wave parallel, otherwise it is equal to the co
261263
domain.
262264
"""
263265
function network_subdomains(config::Config, network::NetworkRiver)
264-
pit_inds = findall(x -> x == 5, network.local_drain_direction)
266+
pit_inds = findall(x -> x == LDD_PIT, network.local_drain_direction)
265267
order_of_subdomains, subdomain_inds, toposort_subdomain = kinwave_set_subdomains(
266268
network.graph,
267269
network.order,
@@ -277,7 +279,7 @@ end
277279

278280
"Initialize `NodesAtEdge`"
279281
function NodesAtEdge(network::NetworkRiver)
280-
index_pit = findall(x -> x == 5, network.local_drain_direction)
282+
index_pit = findall(x -> x == LDD_PIT, network.local_drain_direction)
281283
add_vertex_edge_graph!(network.graph, index_pit)
282284
nodes_at_edge = NodesAtEdge(; adjacent_nodes_at_edge(network.graph)...)
283285
return nodes_at_edge, index_pit

Wflow/src/routing/initialize_routing.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ function initialize_overland_flow(dataset::NCDataset, config::Config, domain::Do
5252
(; land_routing) = config.model
5353

5454
if land_routing == RoutingType.kinematic_wave
55-
overland_flow = KinWaveOverlandFlowModel(dataset, config, domain.land)
55+
overland_flow = init_kinematic_wave_overland_flow(dataset, config, domain.land)
5656
elseif land_routing == RoutingType.local_inertial
57-
overland_flow = LocalInertialOverlandFlowModel(dataset, config, domain)
57+
overland_flow = init_local_inertial_overland_flow(dataset, config, domain)
5858
end
5959
return overland_flow
6060
end
@@ -71,9 +71,11 @@ function initialize_river_flow(dataset::NCDataset, config::Config, domain::Domai
7171
ReservoirModel(dataset, config, domain.reservoir.network) : nothing
7272

7373
if river_routing == RoutingType.kinematic_wave
74-
river_flow = KinWaveRiverFlowModel(dataset, config, domain.river, reservoir)
75-
elseif river_routing == RoutingType.local_inertial
76-
river_flow = LocalInertialRiverFlowModel(dataset, config, domain.river, reservoir)
74+
river_flow =
75+
init_kinematic_wave_river_flow(dataset, config, domain.river, reservoir)
76+
elseif river_routing == RoutingType.local_inertial ||
77+
river_routing == RoutingType.manning_staggered
78+
river_flow = init_staggered_river_flow(dataset, config, domain.river, reservoir)
7779
end
7880
end
7981

Wflow/src/routing/routing.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
abstract type AbstractSubsurfaceFlowModel end
2-
abstract type AbstractOverlandFlowModel end
31
abstract type AbstractRiverFlowModel end
2+
abstract type AbstractOverlandFlowModel end
3+
abstract type AbstractSubsurfaceFlowModel end
4+
5+
abstract type AbstractRoutingMethod end
6+
abstract type AbstractStaggeredRoutingMethod <: AbstractRoutingMethod end
7+
8+
struct Manning <: AbstractRoutingMethod end
9+
struct KinematicWave <: AbstractRoutingMethod end
10+
struct ManningStaggered <: AbstractStaggeredRoutingMethod end
11+
struct LocalInertial <: AbstractStaggeredRoutingMethod end
412

513
struct NoSubsurfaceFlow <: AbstractSubsurfaceFlowModel end
614
struct NoOverlandFlow <: AbstractOverlandFlowModel end

0 commit comments

Comments
 (0)