From 86f2d8a40c782faa35fbe41f1578fcf846f0cf54 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 16 Jan 2020 11:34:35 +0000 Subject: [PATCH] reactingEulerFoam/.../populationBalanceModel: Reset source update counter on restart The source update counter is now always initialised to zero. Previously an attempt was made to determine the current number of iterations reached so that on restart the source updates occur at the same intervals as they would have had the simulation not been stopped. The problem with this is that the sources themselves are not stored to disk, so on restart a simulation could progress for quite some time before the sources were properly initialised at the next update. Resetting the counter to zero does not give a perfect restart (i.e., as if the simulation had continued without stopping), but it does provide a stable and consistent solution sequence. Perfect restart could only be achieved with this iteration procedure by writing all the sources to disk and reading them back in again. This is considered a worse compromise due to the amount of disk space that it would require. Patch contributed by Timo Niemi, VTT. --- .../populationBalanceModel/populationBalanceModel.C | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C index 8daba82be8..438ea9db76 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C +++ b/applications/solvers/multiphase/reactingEulerFoam/phaseSystems/populationBalanceModel/populationBalanceModel/populationBalanceModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -962,10 +962,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel alphas_(), dsm_(), U_(), - sourceUpdateCounter_ - ( - (mesh_.time().timeIndex()*nCorr())%sourceUpdateInterval() - ) + sourceUpdateCounter_(0) { this->registerVelocityGroups();