Skip to content
Snippets Groups Projects
Commit a992eafb authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents 54882987 196a4ea4
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -103,7 +103,16 @@ bool Foam::setTimeStepFunctionObject::adjustTimeStep() ...@@ -103,7 +103,16 @@ bool Foam::setTimeStepFunctionObject::adjustTimeStep()
// Wanted timestep // Wanted timestep
scalar newDeltaT = timeStepPtr_().value(time_.timeOutputValue()); scalar newDeltaT = timeStepPtr_().value(time_.timeOutputValue());
const_cast<Time&>(time()).setDeltaT(newDeltaT, false); static label index = -1;
if (time().timeIndex() != index)
{
// Store current time so we don't get infinite recursion (since
// setDeltaT calls adjustTimeStep() again)
index = time().timeIndex();
// Set time, allow deltaT to be adjusted for writeInterval purposes
const_cast<Time&>(time()).setDeltaT(newDeltaT, true);
}
return true; return true;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -34,6 +34,10 @@ Description ...@@ -34,6 +34,10 @@ Description
functionObjects. Supports 'enabled' flag but none of the other options functionObjects. Supports 'enabled' flag but none of the other options
'timeStart', 'timeEnd', 'outputControl' etc. 'timeStart', 'timeEnd', 'outputControl' etc.
Note that any 'writeControl adjustableRunTime' will still be in
operation and will limit the wanted time step to account for the
- write interval and - timestep adjustment speed (time step cannot
change too quickly).
Example of function object specification to manipulate the time step: Example of function object specification to manipulate the time step:
\verbatim \verbatim
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment