functionObject: Fixed bugs in function object time-step adjustment
The logic governing function objects' ability to change the time-step has been modified so that it is compatible with the time-step adjustment done in the Time class. The behaviour has been split into a method which sets the step directly, and another which moidifies the time until the next write operation (i.e., the time that the solver "aims" for). This fixes an issue where the adjustments in Time and the function objects interfere and cause the time step to decrease exponentially down to machine precision. It also means that the set-time-step function object now does not break the adjustable run-time setting. This resolves bug report https://bugs.openfoam.org/view.php?id=2820
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -230,8 +230,14 @@ public:
|
||||
// By default it simply calls execute().
|
||||
virtual bool end();
|
||||
|
||||
//- Called at the end of Time::adjustDeltaT() if adjustTime is true
|
||||
virtual bool adjustTimeStep();
|
||||
//- Called by Time::setDeltaT(). Allows the function object to override
|
||||
// the time-step value. Returns whether or not the value was overriden.
|
||||
virtual bool setTimeStep();
|
||||
|
||||
//- Called by Time::adjustTimeStep(). Allows the function object to
|
||||
// insert a write time earlier than that already in use by the run
|
||||
// time. Returns the write time, or vGreat.
|
||||
virtual scalar timeToNextWrite();
|
||||
|
||||
//- Update for changes of mesh
|
||||
virtual void updateMesh(const mapPolyMesh& mpm);
|
||||
|
||||
Reference in New Issue
Block a user