From 6606dcc8e35faa4160b0cb0f5a03221f7ba14167 Mon Sep 17 00:00:00 2001 From: Lukas Riedel Date: Fri, 19 Oct 2018 17:55:07 +0000 Subject: [PATCH] Fix time variables applied to solver in Richards simulation --- CHANGELOG.md | 6 +++++- dune/dorie/model/richards/richards.cc | 14 ++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5cb3fc3..22369e10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,6 +111,10 @@ It dumps its data into a YAML file which is then loaded for writing the default configuration files and the cheat sheet. +### Fixed +* Solver in `RichardsSimulation` was using the wrong time variable. + [!116](https://ts-gitlab.iup.uni-heidelberg.de/dorie/dorie/merge_requests/116) + ### Deprecated * The configuration file key `[parameters.interpolation]` is deprecated due to the new scheme for storing parameterization data. DORiE now only supports @@ -198,4 +202,4 @@ ## 1.0.0 (2018-03-28) -First stable version. \ No newline at end of file +First stable version. diff --git a/dune/dorie/model/richards/richards.cc b/dune/dorie/model/richards/richards.cc index 9c2f883e..c62eebde 100644 --- a/dune/dorie/model/richards/richards.cc +++ b/dune/dorie/model/richards/richards.cc @@ -18,7 +18,9 @@ RichardsSimulation::RichardsSimulation ( gv(grid->leafGridView()), mbe_slop(estimate_mbe_entries( Traits::dim,Traits::GridGeometryType)), - mbe_tlop(1) + mbe_tlop(1), + time_before(0.0), + dt_before(0.0) { Dune::Timer timer; @@ -140,7 +142,7 @@ void RichardsSimulation::step() bool step_succeed = false; while(not step_succeed) { - const RF t = controller->getTime(); + const RF time = controller->getTime(); const RF dt = controller->getDT(); bool exception = false; const bool solver_warnings = verbose > 0 && helper.rank() == 0 ? @@ -153,7 +155,7 @@ void RichardsSimulation::step() if (not solver_warnings) dwarn.push(false); - osm->apply(time_before, dt, *u, *unext); + osm->apply(time, dt, *u, *unext); if (not solver_warnings) dwarn.pop(); @@ -173,9 +175,9 @@ void RichardsSimulation::step() } // saving last times for adaptivity - time_before = t; + time_before = time; dt_before = dt; - + // controller reacts to outcome of solution step_succeed = controller->validate(exception); } @@ -248,4 +250,4 @@ void RichardsSimulation::write_data () const } } // namespace Dorie -} // namespace Dune \ No newline at end of file +} // namespace Dune -- GitLab