functionObject::timeControl: Rationalised naming timeStart -> startTime, timeEnd -> endTime

Support for timeStart and timeEnd is maintained for backward-compatibility but
these names are deprecated.
This commit is contained in:
Henry Weller
2019-01-18 13:41:08 +00:00
parent c9648f972b
commit 19c3584d4b
5 changed files with 26 additions and 18 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,8 +48,8 @@ Description
libs ("libMyFunctionObjectlib.so"); libs ("libMyFunctionObjectlib.so");
region defaultRegion; region defaultRegion;
enabled yes; enabled yes;
timeStart 0; startTime 0;
timeEnd 10; endTime 10;
writeControl writeTime; writeControl writeTime;
writeInterval 1; writeInterval 1;
... ...
@ -65,8 +65,8 @@ Description
region | Name of region for multi-region cases | no | region | Name of region for multi-region cases | no |
enabled | On/off switch | no | yes enabled | On/off switch | no | yes
log | Log information to standard output | no | yes log | Log information to standard output | no | yes
timeStart| Start time | no | startTime| Start time | no |
timeEnd | End time | no | endTime | End time | no |
executeControl | See time controls below | no | timeStep executeControl | See time controls below | no | timeStep
executeInterval | Steps between each execute phase | no | executeInterval | Steps between each execute phase | no |
writeControl | See time controls below | no | timeStep writeControl | See time controls below | no | timeStep

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,8 +43,16 @@ namespace functionObjects
void Foam::functionObjects::timeControl::readControls() void Foam::functionObjects::timeControl::readControls()
{ {
dict_.readIfPresent("timeStart", timeStart_); if (!dict_.readIfPresent("startTime", startTime_))
dict_.readIfPresent("timeEnd", timeEnd_); {
dict_.readIfPresent("timeStart", startTime_);
}
if (!dict_.readIfPresent("endTime", endTime_))
{
dict_.readIfPresent("timeEnd", endTime_);
}
dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_); dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_);
} }
@ -52,8 +60,8 @@ void Foam::functionObjects::timeControl::readControls()
bool Foam::functionObjects::timeControl::active() const bool Foam::functionObjects::timeControl::active() const
{ {
return return
time_.value() >= timeStart_ time_.value() >= startTime_
&& time_.value() <= timeEnd_; && time_.value() <= endTime_;
} }
@ -69,8 +77,8 @@ Foam::functionObjects::timeControl::timeControl
functionObject(name), functionObject(name),
time_(t), time_(t),
dict_(dict), dict_(dict),
timeStart_(-vGreat), startTime_(-vGreat),
timeEnd_(vGreat), endTime_(vGreat),
nStepsToStartTimeChange_ nStepsToStartTimeChange_
( (
dict.lookupOrDefault("nStepsToStartTimeChange", 3) dict.lookupOrDefault("nStepsToStartTimeChange", 3)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,10 +71,10 @@ class timeControl
// Optional user inputs // Optional user inputs
//- Activation time - defaults to -vGreat //- Activation time - defaults to -vGreat
scalar timeStart_; scalar startTime_;
//- De-activation time - defaults to vGreat //- De-activation time - defaults to vGreat
scalar timeEnd_; scalar endTime_;
//- Number of steps before the dump-time during which deltaT //- Number of steps before the dump-time during which deltaT
// may be changed (valid for adjustableRunTime) // may be changed (valid for adjustableRunTime)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -29,7 +29,7 @@ Description
solvers with adjustTimeStep control (e.g. pimpleFoam). Makes no attempt solvers with adjustTimeStep control (e.g. pimpleFoam). Makes no attempt
to cooperate with other timeStep 'controllers' (maxCo, other to cooperate with other timeStep 'controllers' (maxCo, other
functionObjects). Supports 'enabled' flag but none of the other ones functionObjects). Supports 'enabled' flag but none of the other ones
'timeStart', 'timeEnd', 'writeControl' etc. 'startTime', 'endTime', 'writeControl' etc.
SourceFiles SourceFiles
setTimeStepFunctionObject.C setTimeStepFunctionObject.C

View File

@ -63,7 +63,7 @@ functions
writeControl adjustableRunTime; writeControl adjustableRunTime;
writeInterval 0.01; writeInterval 0.01;
timeStart 10; startTime 10;
surfaceFormat vtk; surfaceFormat vtk;
fields (p_rgh U); fields (p_rgh U);