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.
This commit is contained in:
Will Bainbridge
2020-01-16 11:34:35 +00:00
parent aedb440750
commit 86f2d8a40c

View File

@ -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();