diff --git a/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.H b/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.H index 05d32cffe5..1a37f53c04 100644 --- a/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.H +++ b/src/TurbulenceModels/turbulenceModels/Base/kOmegaSST/kOmegaSSTBase.H @@ -7,7 +7,7 @@ ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation Copyright (C) 2022 Upstream CFD GmbH - Copyright (C) 2017-2022 OpenCFD Ltd. + Copyright (C) 2017-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -131,15 +131,6 @@ class kOmegaSSTBase : public BasicEddyViscosityModel { - // Private Member Functions - - //- No copy construct - kOmegaSSTBase(const kOmegaSSTBase&) = delete; - - //- No copy assignment - void operator=(const kOmegaSSTBase&) = delete; - - protected: // Protected Data @@ -239,7 +230,7 @@ protected: { return tmp::New ( - this->type() + ":beta", + IOobject::scopedName(this->type(), "beta"), blend(F1, beta1_, beta2_) ); } @@ -251,7 +242,7 @@ protected: { return tmp::New ( - this->type() + ":gamma", + IOobject::scopedName(this->type(), "gamma"), blend(F1, gamma1_, gamma2_) ); } @@ -313,6 +304,15 @@ public: typedef typename BasicEddyViscosityModel::transportModel transportModel; + // Generated Methods + + //- No copy construct + kOmegaSSTBase(const kOmegaSSTBase&) = delete; + + //- No copy assignment + void operator=(const kOmegaSSTBase&) = delete; + + // Constructors //- Construct from components diff --git a/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C b/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C index bfe502275b..a3f8a1ecdd 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/RNGkEpsilon/RNGkEpsilon.C @@ -264,7 +264,7 @@ void RNGkEpsilon::correct() tmp tgradU = fvc::grad(U); const volScalarField::Internal GbyNu ( - this->type() + ":GbyNu", + IOobject::scopedName(this->type(), "GbyNu"), tgradU().v() && dev(twoSymm(tgradU().v())) ); tgradU.clear(); diff --git a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C index 547d4cf47b..4fc4215d2d 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/kEpsilon/kEpsilon.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -245,7 +245,7 @@ void kEpsilon::correct() tmp tgradU = fvc::grad(U); const volScalarField::Internal GbyNu ( - this->type() + ":GbyNu", + IOobject::scopedName(this->type(), "GbyNu"), tgradU().v() && dev(twoSymm(tgradU().v())) ); const volScalarField::Internal G(this->GName(), nut()*GbyNu); diff --git a/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/strainRateFunction/strainRateFunction.C b/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/strainRateFunction/strainRateFunction.C index e86523348a..04d3792a9d 100644 --- a/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/strainRateFunction/strainRateFunction.C +++ b/src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/strainRateFunction/strainRateFunction.C @@ -103,12 +103,11 @@ nu const volScalarField& strainRate ) const { - auto tnu = - volScalarField::New - ( - IOobject::groupName(type() + ":nu", nu0.group()), - nu0.mesh(), - dimensionedScalar(dimViscosity, Zero) + auto tnu = volScalarField::New + ( + IOobject::scopedName(type(), IOobject::groupName("nu", nu0.group())), + nu0.mesh(), + dimensionedScalar(dimViscosity, Zero) ); tnu.ref().primitiveFieldRef() = strainRateFunction_->value(strainRate); diff --git a/src/TurbulenceModels/turbulenceModels/turbulenceModel.H b/src/TurbulenceModels/turbulenceModels/turbulenceModel.H index 3e7a07eccb..03b68befa2 100644 --- a/src/TurbulenceModels/turbulenceModels/turbulenceModel.H +++ b/src/TurbulenceModels/turbulenceModels/turbulenceModel.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2015 OpenFOAM Foundation - Copyright (C) 2019-2020 OpenCFD Ltd. + Copyright (C) 2019-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -38,8 +38,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef turbulenceModel_H -#define turbulenceModel_H +#ifndef Foam_turbulenceModel_H +#define Foam_turbulenceModel_H #include "IOdictionary.H" #include "primitiveFieldsFwd.H" @@ -138,7 +138,7 @@ public: //- Helper function to return the name of the turbulence G field inline word GName() const { - return word(type() + ":G"); + return IOobject::scopedName(type(), "G"); } //- Access function to velocity field diff --git a/src/atmosphericModels/fvOptions/atmAmbientTurbSource/atmAmbientTurbSourceTemplates.C b/src/atmosphericModels/fvOptions/atmAmbientTurbSource/atmAmbientTurbSourceTemplates.C index 600e411a15..e1dcf80748 100644 --- a/src/atmosphericModels/fvOptions/atmAmbientTurbSource/atmAmbientTurbSourceTemplates.C +++ b/src/atmosphericModels/fvOptions/atmAmbientTurbSource/atmAmbientTurbSourceTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2020 ENERCON GmbH - Copyright (C) 2020 OpenCFD Ltd + Copyright (C) 2020-2023 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,7 +71,7 @@ void Foam::fv::atmAmbientTurbSource::atmAmbientTurbSourceOmega const volScalarField::Internal& beta = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":beta") + IOobject::scopedName(turbPtr->type(), "beta") ); // (RS:Eq. 4, rhs-term:5) diff --git a/src/atmosphericModels/fvOptions/atmBuoyancyTurbSource/atmBuoyancyTurbSourceTemplates.C b/src/atmosphericModels/fvOptions/atmBuoyancyTurbSource/atmBuoyancyTurbSourceTemplates.C index 054d2ec09c..468266ee3e 100644 --- a/src/atmosphericModels/fvOptions/atmBuoyancyTurbSource/atmBuoyancyTurbSourceTemplates.C +++ b/src/atmosphericModels/fvOptions/atmBuoyancyTurbSource/atmBuoyancyTurbSourceTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2020 ENERCON GmbH - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,7 +52,7 @@ void Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSourceEpsilon const volScalarField::Internal& GbyNu = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":GbyNu") + IOobject::scopedName(turbPtr->type(), "GbyNu") ); const volScalarField::Internal G(GbyNu*Cmu_*sqr(k())/epsilon()); @@ -82,18 +82,18 @@ void Foam::fv::atmBuoyancyTurbSource::atmBuoyancyTurbSourceOmega const volScalarField::Internal& GbyNu = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":GbyNu") + IOobject::scopedName(turbPtr->type(), "GbyNu") ); const volScalarField::Internal G(GbyNu*Cmu_*k()/omega()); const volScalarField::Internal& gamma = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":gamma") + IOobject::scopedName(turbPtr->type(), "gamma") ); const volScalarField::Internal& beta = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":beta") + IOobject::scopedName(turbPtr->type(), "beta") ); // (ARAL:Eq. 5, rhs-term:3) diff --git a/src/atmosphericModels/fvOptions/atmLengthScaleTurbSource/atmLengthScaleTurbSourceTemplates.C b/src/atmosphericModels/fvOptions/atmLengthScaleTurbSource/atmLengthScaleTurbSourceTemplates.C index 507bbd3578..8b9354df62 100644 --- a/src/atmosphericModels/fvOptions/atmLengthScaleTurbSource/atmLengthScaleTurbSourceTemplates.C +++ b/src/atmosphericModels/fvOptions/atmLengthScaleTurbSource/atmLengthScaleTurbSourceTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2020 ENERCON GmbH - Copyright (C) 2020 OpenCFD Ltd + Copyright (C) 2020-2023 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,7 +52,7 @@ void Foam::fv::atmLengthScaleTurbSource::atmLengthScaleTurbSourceEpsilon const volScalarField::Internal& GbyNu = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":GbyNu") + IOobject::scopedName(turbPtr->type(), "GbyNu") ); eqn += alpha()*rho()*calcC1Star(k, epsilon)*GbyNu*Cmu_*k; @@ -80,17 +80,17 @@ void Foam::fv::atmLengthScaleTurbSource::atmLengthScaleTurbSourceOmega const volScalarField::Internal& GbyNu = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":GbyNu") + IOobject::scopedName(turbPtr->type(), "GbyNu") ); const volScalarField::Internal& gamma = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":gamma") + IOobject::scopedName(turbPtr->type(), "gamma") ); const volScalarField::Internal& beta = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":beta") + IOobject::scopedName(turbPtr->type(), "beta") ); eqn += alpha()*rho()*calcGammaStar(k, omega, gamma, beta)*GbyNu; diff --git a/src/atmosphericModels/fvOptions/atmPlantCanopyTurbSource/atmPlantCanopyTurbSourceTemplates.C b/src/atmosphericModels/fvOptions/atmPlantCanopyTurbSource/atmPlantCanopyTurbSourceTemplates.C index 0f95c35536..0627313a52 100644 --- a/src/atmosphericModels/fvOptions/atmPlantCanopyTurbSource/atmPlantCanopyTurbSourceTemplates.C +++ b/src/atmosphericModels/fvOptions/atmPlantCanopyTurbSource/atmPlantCanopyTurbSourceTemplates.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2020 ENERCON GmbH - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -71,12 +71,12 @@ void Foam::fv::atmPlantCanopyTurbSource::atmPlantCanopyTurbSourceOmega const volScalarField::Internal& gamma = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":gamma") + IOobject::scopedName(turbPtr->type(), "gamma") ); const volScalarField::Internal& beta = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":beta") + IOobject::scopedName(turbPtr->type(), "beta") ); eqn -= fvm::Sp(alpha()*rho()*(gamma - beta)*calcPlantCanopyTerm(U), omega); diff --git a/src/fvOptions/sources/derived/buoyancyTurbSource/buoyancyTurbSource.C b/src/fvOptions/sources/derived/buoyancyTurbSource/buoyancyTurbSource.C index 742c1617da..844da73278 100644 --- a/src/fvOptions/sources/derived/buoyancyTurbSource/buoyancyTurbSource.C +++ b/src/fvOptions/sources/derived/buoyancyTurbSource/buoyancyTurbSource.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2020-2021 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -103,7 +103,7 @@ void Foam::fv::buoyancyTurbSource::buoyancyTurbSourceOmega const auto& gamma = mesh_.lookupObjectRef ( - word(turbPtr->type() + ":gamma") + IOobject::scopedName(turbPtr->type(), "gamma") ); // (Heuristic approximation to BMA:Eq. 6) diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C index 5a729f981f..fa14a61899 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/interRegionHeatTransferModel/interRegionHeatTransferModel.C @@ -131,7 +131,7 @@ Foam::fv::interRegionHeatTransferModel::interRegionHeatTransferModel ( IOobject ( - type() + ":htc", + IOobject::scopedName(type(), "htc"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -169,19 +169,11 @@ void Foam::fv::interRegionHeatTransferModel::addSup const auto& T = mesh_.lookupObject(TName_); - auto tTmapped = tmp::New + auto tTmapped = volScalarField::New ( - IOobject - ( - type() + ":Tmapped", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + IOobject::scopedName(type(), "Tmapped"), T ); - auto& Tmapped = tTmapped.ref(); const auto& nbrMesh = mesh_.time().lookupObject(nbrRegionName_); diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/StochasticCollision/SuppressionCollision/SuppressionCollision.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/StochasticCollision/SuppressionCollision/SuppressionCollision.C index 53d29080ea..3137b2fbdf 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/StochasticCollision/SuppressionCollision/SuppressionCollision.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/StochasticCollision/SuppressionCollision/SuppressionCollision.C @@ -43,9 +43,14 @@ void Foam::SuppressionCollision::collide lookupObject(suppressionCloud_); volScalarField vDotSweep(sc.vDotSweep()); - dimensionedScalar Dt("dt", dimTime, dt); - volScalarField P(type() + ":p", 1.0 - exp(-vDotSweep*Dt)); + + auto tP = volScalarField::New + ( + IOobject::scopedName(type(), "p"), + 1.0 - exp(-vDotSweep*Dt) + ); + const auto& P = tP(); for (typename CloudType::parcelType& p : this->owner()) { diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.C index 82ad7014cf..0a8a370015 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.C @@ -1066,7 +1066,7 @@ void adjointkOmegaSST::updatePrimalRelatedFields() ( IOobject ( - type() + ":G", + IOobject::scopedName(type(), "G"), mesh_.time().timeName(), mesh_, IOobject::NO_READ, diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.H b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.H index 479595936b..7b8ec749ee 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.H +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/incompressibleAdjoint/adjointRAS/adjointkOmegaSST/adjointkOmegaSST.H @@ -50,8 +50,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef adjointkOmegaSST_H -#define adjointkOmegaSST_H +#ifndef Foam_adjointkOmegaSST_H +#define Foam_adjointkOmegaSST_H #include "adjointRASModel.H" #include "wallDist.H" @@ -247,7 +247,7 @@ protected: { return tmp::New ( - this->type() + ":beta", + IOobject::scopedName(this->type(), "beta"), blend(F1, beta1_, beta2_) ); } @@ -259,7 +259,7 @@ protected: { return tmp::New ( - this->type() + ":beta", + IOobject::scopedName(this->type(), "beta"), blend(F1, beta1_, beta2_) ); } @@ -271,7 +271,7 @@ protected: { return tmp::New ( - this->type() + ":gamma", + IOobject::scopedName(this->type(), "gamma"), blend(F1, gamma1_, gamma2_) ); } @@ -283,7 +283,7 @@ protected: { return tmp::New ( - this->type() + ":gamma", + IOobject::scopedName(this->type(), "gamma"), blend(F1, gamma1_, gamma2_) ); } diff --git a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/kOmegaSST/kOmegaSST.C b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/kOmegaSST/kOmegaSST.C index 1d393e3113..12c386a526 100644 --- a/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/kOmegaSST/kOmegaSST.C +++ b/src/optimisation/adjointOptimisation/adjoint/turbulenceModels/turbulenceModelVariables/RAS/kOmegaSST/kOmegaSST.C @@ -113,9 +113,11 @@ tmp kOmegaSST::computeG() tmp tgradU = fvc::grad(U); volScalarField::Internal GbyNu0 ( - this->type() + ":GbyNu", + IOobject::scopedName(this->type(), "GbyNu"), (tgradU() && dev(twoSymm(tgradU()))) ); + + // NB: leave tmp registered (for correctBoundaryConditions) auto tG = tmp::New ( diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/phaseChange/phaseChange.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/phaseChange/phaseChange.C index 4ec234f049..994b90ac3e 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/phaseChange/phaseChange.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/driftModels/phaseChange/phaseChange.C @@ -72,7 +72,7 @@ Foam::diameterModels::driftModels::phaseChange::phaseChange ( IOobject ( - IOobject::groupName(type() + ":W", pair.name()), + IOobject::scopedName(type(), IOobject::groupName("W", pair.name())), popBal_.mesh().time().timeName(), popBal_.mesh() ),