diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C index 8a288fe93c..543e6fe954 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/functionObjects/sizeDistribution/sizeDistribution.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -415,7 +415,6 @@ Foam::functionObjects::sizeDistribution::sizeDistribution binCmpt_(0) { read(dict); - resetName(name); switch (coordinateType_) { @@ -466,6 +465,8 @@ bool Foam::functionObjects::sizeDistribution::read(const dictionary& dict) geometric_ = dict.lookupOrDefault("geometric", false); maxOrder_ = dict.lookupOrDefault("maxOrder", 3); + resetName(name()); + return false; } diff --git a/src/OpenFOAM/db/functionObjects/logFiles/logFiles.C b/src/OpenFOAM/db/functionObjects/logFiles/logFiles.C index 48410d7b35..18e058583d 100644 --- a/src/OpenFOAM/db/functionObjects/logFiles/logFiles.C +++ b/src/OpenFOAM/db/functionObjects/logFiles/logFiles.C @@ -33,14 +33,13 @@ void Foam::functionObjects::logFiles::createFiles() { if (Pstream::master()) { - const word startTimeName = - fileObr_.time().timeName(fileObr_.time().startTime().value()); + const word timeName = fileObr_.time().timeName(); forAll(names_, i) { if (!filePtrs_.set(i)) { - const fileName outputDir(baseFileDir()/prefix_/startTimeName); + const fileName outputDir(baseFileDir()/prefix_/timeName); mkDir(outputDir); filePtrs_.set(i, new OFstream(outputDir/(names_[i] + ".dat"))); initStream(filePtrs_[i]); diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.C index 8080ec58fc..fe31465b08 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-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,19 +41,19 @@ namespace functionObjects // * * * * * * * * * * * * * * * Private Members * * * * * * * * * * * * * * // -void Foam::functionObjects::timeControl::readControls() +void Foam::functionObjects::timeControl::readControls(const dictionary& dict) { - if (!dict_.readIfPresent("startTime", startTime_)) + if (!dict.readIfPresent("startTime", startTime_)) { - dict_.readIfPresent("timeStart", startTime_); + dict.readIfPresent("timeStart", startTime_); } - if (!dict_.readIfPresent("endTime", endTime_)) + if (!dict.readIfPresent("endTime", endTime_)) { - dict_.readIfPresent("timeEnd", endTime_); + dict.readIfPresent("timeEnd", endTime_); } - dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_); + dict.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_); } @@ -76,7 +76,6 @@ Foam::functionObjects::timeControl::timeControl : functionObject(name), time_(t), - dict_(dict), startTime_(-vGreat), endTime_(vGreat), nStepsToStartTimeChange_ @@ -85,9 +84,9 @@ Foam::functionObjects::timeControl::timeControl ), executeControl_(t, dict, "execute"), writeControl_(t, dict, "write"), - foPtr_(functionObject::New(name, t, dict_)) + foPtr_(functionObject::New(name, t, dict)) { - readControls(); + read(dict); } @@ -174,32 +173,23 @@ Foam::scalar Foam::functionObjects::timeControl::timeToNextWrite() } -bool Foam::functionObjects::timeControl::read -( - const dictionary& dict -) +bool Foam::functionObjects::timeControl::read(const dictionary& dict) { - if (dict != dict_) - { - dict_ = dict; + writeControl_.read(dict); + executeControl_.read(dict); - writeControl_.read(dict); - executeControl_.read(dict); - readControls(); + readControls(dict); - return true; - } - else + if (active()) { - return false; + foPtr_->read(dict); } + + return true; } -void Foam::functionObjects::timeControl::updateMesh -( - const mapPolyMesh& mpm -) +void Foam::functionObjects::timeControl::updateMesh(const mapPolyMesh& mpm) { if (active()) { @@ -208,10 +198,7 @@ void Foam::functionObjects::timeControl::updateMesh } -void Foam::functionObjects::timeControl::movePoints -( - const polyMesh& mesh -) +void Foam::functionObjects::timeControl::movePoints(const polyMesh& mesh) { if (active()) { diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.H b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObject.H index 5638b481af..2f2a2916c6 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-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,9 +64,6 @@ class timeControl //- Reference to the time database const Time& time_; - //- Input dictionary - dictionary dict_; - // Optional user inputs @@ -94,7 +91,7 @@ class timeControl // Private Member Functions //- Read relevant dictionary entries - void readControls(); + void readControls(const dictionary& dict); //- Returns true if within time bounds bool active() const; @@ -127,9 +124,6 @@ public: //- Return time database inline const Time& time() const; - //- Return the input dictionary - inline const dictionary& dict() const; - //- Return the execute control object inline const Foam::timeControl& executeControl() const; diff --git a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H index 9c755612b2..2794a468ed 100644 --- a/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.H +++ b/src/OpenFOAM/db/functionObjects/timeControl/timeControlFunctionObjectI.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-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,12 +31,6 @@ inline const Foam::Time& Foam::functionObjects::timeControl::time() const } -inline const Foam::dictionary& Foam::functionObjects::timeControl::dict() const -{ - return dict_; -} - - inline const Foam::timeControl& Foam::functionObjects::timeControl::executeControl() const { diff --git a/src/functionObjects/field/fieldMinMax/fieldMinMax.C b/src/functionObjects/field/fieldMinMax/fieldMinMax.C index 019a183c4a..d31fca1f53 100644 --- a/src/functionObjects/field/fieldMinMax/fieldMinMax.C +++ b/src/functionObjects/field/fieldMinMax/fieldMinMax.C @@ -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-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,7 +110,6 @@ Foam::functionObjects::fieldMinMax::fieldMinMax fieldSet_() { read(dict); - resetName(typeName); } @@ -131,6 +130,8 @@ bool Foam::functionObjects::fieldMinMax::read(const dictionary& dict) mode_ = modeTypeNames_[dict.lookupOrDefault("mode", "magnitude")]; dict.lookup("fields") >> fieldSet_; + resetName(typeName); + return true; } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C index b08eeea6c1..0de8f6aa7f 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.C @@ -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-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,11 +52,11 @@ Foam::functionObjects::fieldValue::fieldValue fvMeshFunctionObject(name, runTime, dict), logFiles(obr_, name), dict_(dict), + valueType_(valueType), regionName_(word::null), resultDict_(fileName("name"), dictionary::null) { read(dict); - resetName(valueType); } @@ -71,11 +71,11 @@ Foam::functionObjects::fieldValue::fieldValue fvMeshFunctionObject(name, obr, dict), logFiles(obr_, name), dict_(dict), + valueType_(valueType), regionName_(word::null), resultDict_(fileName("name"), dictionary::null) { read(dict); - resetName(valueType); } @@ -99,6 +99,8 @@ bool Foam::functionObjects::fieldValue::read(const dictionary& dict) dict.lookup("fields") >> fields_; dict.lookup("writeFields") >> writeFields_; + resetName(valueType_); + return true; } diff --git a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H index cbd887b3e1..3652b5fcc4 100644 --- a/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,6 +73,9 @@ protected: //- Construction dictionary dictionary dict_; + //- The name of the type of value (volFieldValue, or surfaceFieldValue) + const word valueType_; + //- Name of region (patch, zone, etc.) word regionName_; diff --git a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C index e9ef925d69..1f2fb0bfe7 100644 --- a/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C +++ b/src/functionObjects/field/fieldValues/fieldValueDelta/fieldValueDelta.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,6 @@ Foam::functionObjects::fieldValues::fieldValueDelta::fieldValueDelta region2Ptr_(nullptr) { read(dict); - resetName(typeName); } @@ -155,6 +154,8 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::read operation_ = operationTypeNames_.read(dict.lookup("operation")); + resetName(typeName); + return true; } diff --git a/src/functionObjects/field/interfaceHeight/interfaceHeight.C b/src/functionObjects/field/interfaceHeight/interfaceHeight.C index 6805905896..7fd0eb5299 100644 --- a/src/functionObjects/field/interfaceHeight/interfaceHeight.C +++ b/src/functionObjects/field/interfaceHeight/interfaceHeight.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -224,7 +224,6 @@ Foam::functionObjects::interfaceHeight::interfaceHeight interpolationScheme_("cellPoint") { read(dict); - resetNames({"height", "position"}); } @@ -238,11 +237,15 @@ Foam::functionObjects::interfaceHeight::~interfaceHeight() bool Foam::functionObjects::interfaceHeight::read(const dictionary& dict) { + fvMeshFunctionObject::read(dict); + dict.readIfPresent("alpha", alphaName_); dict.readIfPresent("liquid", liquid_); dict.lookup("locations") >> locations_; dict.readIfPresent("interpolationScheme", interpolationScheme_); + resetNames({"height", "position"}); + return true; } diff --git a/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C b/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C index 3683191d67..d7a5796822 100644 --- a/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C +++ b/src/functionObjects/field/turbulenceIntensity/turbulenceIntensity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,8 +72,6 @@ Foam::functionObjects::turbulenceIntensity::turbulenceIntensity writeLocalObjects(obr_, log) { read(dict); - resetName(typeName); - resetLocalObjectName("I"); } @@ -90,6 +88,9 @@ bool Foam::functionObjects::turbulenceIntensity::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeLocalObjects::read(dict); + resetName(typeName); + resetLocalObjectName("I"); + return true; } diff --git a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C index 65eff7e322..a0a5cbde0e 100644 --- a/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C +++ b/src/functionObjects/field/wallHeatFlux/wallHeatFlux.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -120,8 +120,6 @@ Foam::functionObjects::wallHeatFlux::wallHeatFlux patchSet_() { read(dict); - resetName(typeName); - resetLocalObjectName(typeName); } @@ -185,6 +183,9 @@ bool Foam::functionObjects::wallHeatFlux::read(const dictionary& dict) patchSet_ = filteredPatchSet; } + resetName(typeName); + resetLocalObjectName(typeName); + return true; } diff --git a/src/functionObjects/field/wallHeatTransferCoeff/wallHeatTransferCoeff.C b/src/functionObjects/field/wallHeatTransferCoeff/wallHeatTransferCoeff.C index fad99fe1a8..a029356816 100644 --- a/src/functionObjects/field/wallHeatTransferCoeff/wallHeatTransferCoeff.C +++ b/src/functionObjects/field/wallHeatTransferCoeff/wallHeatTransferCoeff.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,15 +76,13 @@ Foam::functionObjects::wallHeatTransferCoeff::wallHeatTransferCoeff fvMeshFunctionObject(name, runTime, dict), logFiles(obr_, name), writeLocalObjects(obr_, log), + coeffModel_(wallHeatTransferCoeffModel::New(dict.name(), mesh_, dict)), rho_("rho", dimDensity, Zero), Cp_("Cp", dimArea/sqr(dimTime)/dimTemperature, Zero), runTime_(runTime), patchSet_() { - coeffModel_ = wallHeatTransferCoeffModel::New(dict.name(), mesh_, dict); read(dict); - resetName(typeName); - resetLocalObjectName(typeName); } @@ -162,6 +160,9 @@ bool Foam::functionObjects::wallHeatTransferCoeff::read(const dictionary& dict) coeffModel_->read(dict); + resetName(typeName); + resetLocalObjectName(typeName); + return true; } diff --git a/src/functionObjects/field/wallShearStress/wallShearStress.C b/src/functionObjects/field/wallShearStress/wallShearStress.C index 22ce4af7ac..e6672f50c2 100644 --- a/src/functionObjects/field/wallShearStress/wallShearStress.C +++ b/src/functionObjects/field/wallShearStress/wallShearStress.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,8 +105,6 @@ Foam::functionObjects::wallShearStress::wallShearStress patchSet_() { read(dict); - resetName(typeName); - resetLocalObjectName(typeName); } @@ -170,6 +168,9 @@ bool Foam::functionObjects::wallShearStress::read(const dictionary& dict) patchSet_ = filteredPatchSet; } + resetName(typeName); + resetLocalObjectName(typeName); + return true; } diff --git a/src/functionObjects/field/yPlus/yPlus.C b/src/functionObjects/field/yPlus/yPlus.C index 5b523844c8..6c1a1b84ed 100644 --- a/src/functionObjects/field/yPlus/yPlus.C +++ b/src/functionObjects/field/yPlus/yPlus.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,8 +138,6 @@ Foam::functionObjects::yPlus::yPlus phaseName_(dict.lookupOrDefault("phase", word::null)) { read(dict); - resetName(IOobject::groupName(typeName, phaseName_)); - resetLocalObjectName(IOobject::groupName(typeName, phaseName_)); } @@ -156,6 +154,9 @@ bool Foam::functionObjects::yPlus::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeLocalObjects::read(dict); + resetName(IOobject::groupName(typeName, phaseName_)); + resetLocalObjectName(IOobject::groupName(typeName, phaseName_)); + return true; } diff --git a/src/functionObjects/forces/forces/forces.C b/src/functionObjects/forces/forces/forces.C index 828021175f..6f12185675 100644 --- a/src/functionObjects/forces/forces/forces.C +++ b/src/functionObjects/forces/forces/forces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -559,7 +559,6 @@ Foam::functionObjects::forces::forces initialised_(false) { read(dict); - resetNames(createFileNames(dict)); } @@ -594,7 +593,6 @@ Foam::functionObjects::forces::forces initialised_(false) { read(dict); - resetNames(createFileNames(dict)); } @@ -739,6 +737,8 @@ bool Foam::functionObjects::forces::read(const dictionary& dict) moment_[2].setSize(1); } + resetNames(createFileNames(dict)); + return true; } diff --git a/src/functionObjects/lagrangian/cloudInfo/cloudInfo.C b/src/functionObjects/lagrangian/cloudInfo/cloudInfo.C index 495754d02c..d4042bdf61 100644 --- a/src/functionObjects/lagrangian/cloudInfo/cloudInfo.C +++ b/src/functionObjects/lagrangian/cloudInfo/cloudInfo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,8 +87,6 @@ bool Foam::functionObjects::cloudInfo::read(const dictionary& dict) { regionFunctionObject::read(dict); - logFiles::resetNames(dict.lookup("clouds")); - Info<< type() << " " << name() << ": "; if (names().size()) { @@ -104,6 +102,8 @@ bool Foam::functionObjects::cloudInfo::read(const dictionary& dict) Info<< "no clouds to be processed" << nl << endl; } + resetNames(dict.lookup("clouds")); + return true; } diff --git a/src/functionObjects/utilities/residuals/residuals.C b/src/functionObjects/utilities/residuals/residuals.C index d722be542d..894bddeb46 100644 --- a/src/functionObjects/utilities/residuals/residuals.C +++ b/src/functionObjects/utilities/residuals/residuals.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,6 @@ Foam::functionObjects::residuals::residuals fieldSet_() { read(dict); - resetName(typeName); } @@ -76,6 +75,8 @@ bool Foam::functionObjects::residuals::read(const dictionary& dict) dict.lookup("fields") >> fieldSet_; + resetName(typeName); + return true; } diff --git a/src/functionObjects/utilities/time/timeFunctionObject.C b/src/functionObjects/utilities/time/timeFunctionObject.C index 2611317a92..14c10acaf3 100644 --- a/src/functionObjects/utilities/time/timeFunctionObject.C +++ b/src/functionObjects/utilities/time/timeFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,8 +61,6 @@ Foam::functionObjects::time::time clockTime0_(time_.elapsedClockTime()) { read(dict); - resetName(typeName); - write(); } @@ -80,6 +78,8 @@ bool Foam::functionObjects::time::read(const dictionary& dict) dict.readIfPresent("perTimeStep", perTimeStep_); + resetName(typeName); + return true; } diff --git a/src/functionObjects/utilities/timeStep/timeStepFunctionObject.C b/src/functionObjects/utilities/timeStep/timeStepFunctionObject.C index 5bb1311a5f..33dfeb1661 100644 --- a/src/functionObjects/utilities/timeStep/timeStepFunctionObject.C +++ b/src/functionObjects/utilities/timeStep/timeStepFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,6 @@ Foam::functionObjects::timeStep::timeStep logFiles(obr_, name) { read(dict); - resetName(typeName); } @@ -74,6 +73,8 @@ bool Foam::functionObjects::timeStep::read(const dictionary& dict) { functionObject::read(dict); + resetName(typeName); + return true; } diff --git a/src/rigidBodyState/rigidBodyState.C b/src/rigidBodyState/rigidBodyState.C index 07615d5993..2e91eaafd1 100644 --- a/src/rigidBodyState/rigidBodyState.C +++ b/src/rigidBodyState/rigidBodyState.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,6 @@ Foam::functionObjects::rigidBodyState::rigidBodyState names_(motion().movingBodyNames()) { read(dict); - resetNames(names_); } @@ -86,8 +85,11 @@ Foam::functionObjects::rigidBodyState::motion() const bool Foam::functionObjects::rigidBodyState::read(const dictionary& dict) { fvMeshFunctionObject::read(dict); + angleFormat_ = dict.lookupOrDefault("angleFormat", "radians"); + resetNames(names_); + return true; } diff --git a/src/sixDoFRigidBodyState/sixDoFRigidBodyControl/sixDoFRigidBodyControl.C b/src/sixDoFRigidBodyState/sixDoFRigidBodyControl/sixDoFRigidBodyControl.C index 6fd18b6a4e..ee5928634c 100644 --- a/src/sixDoFRigidBodyState/sixDoFRigidBodyControl/sixDoFRigidBodyControl.C +++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyControl/sixDoFRigidBodyControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2018-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,6 @@ Foam::functionObjects::sixDoFRigidBodyControl::sixDoFRigidBodyControl meanAngularVelocity_(Zero) { read(dict); - resetName(typeName); } @@ -80,6 +79,8 @@ bool Foam::functionObjects::sixDoFRigidBodyControl::read(const dictionary& dict) dict.lookup("convergedVelocity") >> convergedVelocity_; dict.lookup("convergedAngularVelocity") >> convergedAngularVelocity_; + resetName(typeName); + return true; } diff --git a/src/sixDoFRigidBodyState/sixDoFRigidBodyState/sixDoFRigidBodyState.C b/src/sixDoFRigidBodyState/sixDoFRigidBodyState/sixDoFRigidBodyState.C index d7e3db4e3f..527f154e85 100644 --- a/src/sixDoFRigidBodyState/sixDoFRigidBodyState/sixDoFRigidBodyState.C +++ b/src/sixDoFRigidBodyState/sixDoFRigidBodyState/sixDoFRigidBodyState.C @@ -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-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,6 @@ Foam::functionObjects::sixDoFRigidBodyState::sixDoFRigidBodyState logFiles(obr_, name) { read(dict); - resetName(typeName); } @@ -75,8 +74,11 @@ Foam::functionObjects::sixDoFRigidBodyState::~sixDoFRigidBodyState() bool Foam::functionObjects::sixDoFRigidBodyState::read(const dictionary& dict) { fvMeshFunctionObject::read(dict); + angleFormat_ = dict.lookupOrDefault("angleFormat", "radians"); + resetName(typeName); + return true; } diff --git a/src/thermophysicalModels/chemistryModel/functionObjects/specieReactionRates/specieReactionRates.C b/src/thermophysicalModels/chemistryModel/functionObjects/specieReactionRates/specieReactionRates.C index e2c57a6d66..9c24006dcc 100644 --- a/src/thermophysicalModels/chemistryModel/functionObjects/specieReactionRates/specieReactionRates.C +++ b/src/thermophysicalModels/chemistryModel/functionObjects/specieReactionRates/specieReactionRates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2016-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,7 +89,7 @@ Foam::functionObjects::specieReactionRates::specieReactionRates ) ) { - resetName("specieReactionRates"); + read(dict); } @@ -103,7 +103,9 @@ Foam::functionObjects::specieReactionRates::~specieReactionRates() bool Foam::functionObjects::specieReactionRates::read(const dictionary& dict) { - regionFunctionObject::read(dict); + fvMeshFunctionObject::read(dict); + + resetName("specieReactionRates"); return true; }