From 19c3584d4b563118d75d9509a14b20057b257290 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Fri, 18 Jan 2019 13:41:08 +0000 Subject: [PATCH] functionObject::timeControl: Rationalised naming timeStart -> startTime, timeEnd -> endTime Support for timeStart and timeEnd is maintained for backward-compatibility but these names are deprecated. --- .../functionObject/functionObject.H | 10 ++++----- .../timeControl/timeControlFunctionObject.C | 22 +++++++++++++------ .../timeControl/timeControlFunctionObject.H | 6 ++--- .../setTimeStep/setTimeStepFunctionObject.H | 4 ++-- .../RAS/DTCHullWave/system/controlDict | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index eb01e771f3..2a3f644579 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,8 +48,8 @@ Description libs ("libMyFunctionObjectlib.so"); region defaultRegion; enabled yes; - timeStart 0; - timeEnd 10; + startTime 0; + endTime 10; writeControl writeTime; writeInterval 1; ... @@ -65,8 +65,8 @@ Description region | Name of region for multi-region cases | no | enabled | On/off switch | no | yes log | Log information to standard output | no | yes - timeStart| Start time | no | - timeEnd | End time | no | + startTime| Start time | no | + endTime | End time | no | executeControl | See time controls below | no | timeStep executeInterval | Steps between each execute phase | no | writeControl | See time controls below | no | timeStep diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C index fd0d8f39d0..6fd3d21ef1 100644 --- a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,8 +43,16 @@ namespace functionObjects void Foam::functionObjects::timeControl::readControls() { - dict_.readIfPresent("timeStart", timeStart_); - dict_.readIfPresent("timeEnd", timeEnd_); + if (!dict_.readIfPresent("startTime", startTime_)) + { + dict_.readIfPresent("timeStart", startTime_); + } + + if (!dict_.readIfPresent("endTime", endTime_)) + { + dict_.readIfPresent("timeEnd", endTime_); + } + dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_); } @@ -52,8 +60,8 @@ void Foam::functionObjects::timeControl::readControls() bool Foam::functionObjects::timeControl::active() const { return - time_.value() >= timeStart_ - && time_.value() <= timeEnd_; + time_.value() >= startTime_ + && time_.value() <= endTime_; } @@ -69,8 +77,8 @@ Foam::functionObjects::timeControl::timeControl functionObject(name), time_(t), dict_(dict), - timeStart_(-vGreat), - timeEnd_(vGreat), + startTime_(-vGreat), + endTime_(vGreat), nStepsToStartTimeChange_ ( dict.lookupOrDefault("nStepsToStartTimeChange", 3) diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.H b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.H index a00111a1d7..5be8c67576 100644 --- a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,10 +71,10 @@ class timeControl // Optional user inputs //- Activation time - defaults to -vGreat - scalar timeStart_; + scalar startTime_; //- De-activation time - defaults to vGreat - scalar timeEnd_; + scalar endTime_; //- Number of steps before the dump-time during which deltaT // may be changed (valid for adjustableRunTime) diff --git a/src/functionObjects/utilities/setTimeStep/setTimeStepFunctionObject.H b/src/functionObjects/utilities/setTimeStep/setTimeStepFunctionObject.H index 1455a28ceb..fceb336614 100644 --- a/src/functionObjects/utilities/setTimeStep/setTimeStepFunctionObject.H +++ b/src/functionObjects/utilities/setTimeStep/setTimeStepFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ Description solvers with adjustTimeStep control (e.g. pimpleFoam). Makes no attempt to cooperate with other timeStep 'controllers' (maxCo, other functionObjects). Supports 'enabled' flag but none of the other ones - 'timeStart', 'timeEnd', 'writeControl' etc. + 'startTime', 'endTime', 'writeControl' etc. SourceFiles setTimeStepFunctionObject.C diff --git a/tutorials/multiphase/interFoam/RAS/DTCHullWave/system/controlDict b/tutorials/multiphase/interFoam/RAS/DTCHullWave/system/controlDict index 3c43f01e42..32d017fde2 100644 --- a/tutorials/multiphase/interFoam/RAS/DTCHullWave/system/controlDict +++ b/tutorials/multiphase/interFoam/RAS/DTCHullWave/system/controlDict @@ -63,7 +63,7 @@ functions writeControl adjustableRunTime; writeInterval 0.01; - timeStart 10; + startTime 10; surfaceFormat vtk; fields (p_rgh U);