diff --git a/core/src/solve.jl b/core/src/solve.jl index febdaf195..6e28a7f32 100644 --- a/core/src/solve.jl +++ b/core/src/solve.jl @@ -736,11 +736,12 @@ Directed graph: outflow is positive! function formulate_flow!( tabulated_rating_curve::TabulatedRatingCurve, p::Parameters, + storage::AbstractVector, current_level::AbstractVector, flow::AbstractMatrix, t::Float64, )::Nothing - (; connectivity) = p + (; basin, connectivity) = p (; graph_flow) = connectivity (; node_id, active, tables) = tabulated_rating_curve for (i, id) in enumerate(node_id) @@ -990,7 +991,7 @@ function formulate_flows!( formulate_flow!(linear_resistance, p, current_level, flow, t) formulate_flow!(manning_resistance, p, current_level, flow, t) - formulate_flow!(tabulated_rating_curve, p, current_level, flow, t) + formulate_flow!(tabulated_rating_curve, p, storage, current_level, flow, t) formulate_flow!(flow_boundary, p, flow, t) formulate_flow!(fractional_flow, flow, p) formulate_flow!(pump, p, flow, storage) diff --git a/core/test/run_models.jl b/core/test/run_models.jl index 466bbe2bc..1658824de 100644 --- a/core/test/run_models.jl +++ b/core/test/run_models.jl @@ -86,7 +86,7 @@ end model = Ribasim.run(toml_path) @test model isa Ribasim.Model @test successful_retcode(model) - @test model.integrator.sol.u[end] ≈ Float32[5.951445, 727.9898] skip = Sys.isapple() + @test model.integrator.sol.u[end] ≈ Float32[8.41143, 725.5068] skip = Sys.isapple() # the highest level in the dynamic table is updated to 1.2 from the callback @test model.integrator.p.tabulated_rating_curve.tables[end].t[end] == 1.2 end