From 3f0a53dcaf052ffd686720581b4bac7aa620f4e6 Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Tue, 23 Apr 2024 14:52:08 +0200 Subject: [PATCH 1/2] Adapt outlet model --- python/ribasim_testmodels/ribasim_testmodels/basic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/ribasim_testmodels/ribasim_testmodels/basic.py b/python/ribasim_testmodels/ribasim_testmodels/basic.py index 271267b76..3fe92ebf8 100644 --- a/python/ribasim_testmodels/ribasim_testmodels/basic.py +++ b/python/ribasim_testmodels/ribasim_testmodels/basic.py @@ -323,7 +323,6 @@ def outlet_model(): starttime="2020-01-01", endtime="2021-01-01", crs="EPSG:28992", - solver=ribasim.Solver(saveat=0), ) # Set up the basins @@ -331,7 +330,7 @@ def outlet_model(): Node(3, Point(2.0, 0.0)), [ basin.Profile(area=[1000.0, 1000.0], level=[0.0, 1.0]), - basin.State(level=[1e-3]), + basin.State(level=[0.0]), ], ) From ba2f8dd4bb372d262485c7186918983e9861507f Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Tue, 23 Apr 2024 15:41:12 +0200 Subject: [PATCH 2/2] Add tstops for more timeseries --- core/src/model.jl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/core/src/model.jl b/core/src/model.jl index 6c20d31d6..602503dd6 100644 --- a/core/src/model.jl +++ b/core/src/model.jl @@ -78,12 +78,19 @@ function Model(config::Config)::Model end # tell the solver to stop when new data comes in - # TODO add all time tables here - time_flow_boundary = load_structvector(db, config, FlowBoundaryTimeV1) tstops = Vector{Float64}[] - push!(tstops, get_tstops(time_flow_boundary.time, config.starttime)) - time_user_demand = load_structvector(db, config, UserDemandTimeV1) - push!(tstops, get_tstops(time_user_demand.time, config.starttime)) + for schema_version in [ + FlowBoundaryTimeV1, + LevelBoundaryTimeV1, + UserDemandTimeV1, + LevelDemandTimeV1, + FlowDemandTimeV1, + TabulatedRatingCurveTimeV1, + PidControlTimeV1, + ] + time_schema = load_structvector(db, config, schema_version) + push!(tstops, get_tstops(time_schema.time, config.starttime)) + end # use state state = load_structvector(db, config, BasinStateV1)