diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C index d3667c5204dd6d8aada4066069085768afc1784c..048ac18ad02d1087ad196b484bb51c810d3c3deb 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C @@ -68,19 +68,12 @@ Foam::multiphaseEuler::diameterModels::constant::constant Foam::tmp<Foam::volScalarField> Foam::multiphaseEuler::diameterModels::constant::d() const { - return tmp<Foam::volScalarField> + return volScalarField::New ( - new volScalarField - ( - IOobject - ( - "d", - phase_.U().time().timeName(), - phase_.U().mesh() - ), - phase_.U().mesh(), - d_ - ) + "d", + IOobject::NO_REGISTER, + phase_.U().mesh(), + d_ ); } diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/interface/interface.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/interface/interface.C index 4f4e171057193510d485491e3513f5afeb502fba..1138db3704cd849ce4557ce080fc7e957ad8610e 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/interface/interface.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/interfacialModels/dragModels/interface/interface.C @@ -70,17 +70,10 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseEuler::dragModels::interface::K const volScalarField& Ur ) const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "K", - Ur.mesh().time().timeName(), - Ur.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + "K", + IOobject::NO_REGISTER, Ur.mesh(), dimensionedScalar(dimDensity/dimTime, Zero) ); diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C index c8142628ac59f39d0909458d0413686dc17c79b5..c19e5e5ef8440b4046c1c44e278066a895f474c8 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C @@ -536,19 +536,12 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::Cvm const phaseModel& phase ) const { - tmp<volScalarField> tCvm + auto tCvm = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "Cvm", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar(dimDensity, Zero) - ) + "Cvm", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimDensity, Zero) ); for (const phaseModel& phase2 : phases_) @@ -584,23 +577,15 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm const phaseModel& phase ) const { - tmp<volVectorField> tSvm + auto tSvm = volVectorField::New ( - new volVectorField + "Svm", + IOobject::NO_REGISTER, + mesh_, + dimensionedVector ( - IOobject - ( - "Svm", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedVector - ( - "Svm", - dimensionSet(1, -2, -2, 0, 0), - Zero - ) + dimensionSet(1, -2, -2, 0, 0), + Zero ) ); @@ -653,7 +638,7 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm Foam::autoPtr<Foam::multiphaseSystem::dragCoeffFields> Foam::multiphaseSystem::dragCoeffs() const { - autoPtr<dragCoeffFields> dragCoeffsPtr(new dragCoeffFields); + auto dragCoeffsPtr = autoPtr<dragCoeffFields>::New(); forAllConstIters(dragModels_, iter) { @@ -708,24 +693,12 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::dragCoeff const dragCoeffFields& dragCoeffs ) const { - tmp<volScalarField> tdragCoeff + auto tdragCoeff = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "dragCoeff", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar - ( - "dragCoeff", - dimensionSet(1, -3, -1, 0, 0), - 0 - ) - ) + "dragCoeff", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimensionSet(1, -3, -1, 0, 0), Zero) ); dragModelTable::const_iterator dmIter = dragModels_.begin(); @@ -756,24 +729,12 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension const phaseModel& phase1 ) const { - tmp<surfaceScalarField> tSurfaceTension + auto tSurfaceTension = surfaceScalarField::New ( - new surfaceScalarField - ( - IOobject - ( - "surfaceTension", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar - ( - "surfaceTension", - dimensionSet(1, -2, -2, 0, 0), - 0 - ) - ) + "surfaceTension", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), Zero) ); tSurfaceTension.ref().setOriented(); @@ -805,19 +766,12 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::nearInterface() const { - tmp<volScalarField> tnearInt + auto tnearInt = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "nearInterface", - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar("nearInterface", dimless, 0.0) - ) + "nearInterface", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimless, Zero) ); for (const phaseModel& phase : phases_) @@ -872,7 +826,7 @@ void Foam::multiphaseSystem::solve() mesh_ ), mesh_, - dimensionedScalar("0", dimensionSet(0, 3, -1, 0, 0), 0) + dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero) ) ); diff --git a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/phaseModel/phaseModel.C b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/phaseModel/phaseModel.C index 0da2401b99054c3db4841a4e65f1585cdf775633..48df9c09f5bbaff192f8e4dbce3f975bed872155 100644 --- a/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/phaseModel/phaseModel.C +++ b/src/phaseSystemModels/multiphaseEuler/multiphaseSystem/phaseModel/phaseModel.C @@ -118,39 +118,27 @@ Foam::phaseModel::phaseModel { alphaPhi_.setOriented(); - const word phiName = IOobject::groupName("phi", name_); - - IOobject phiHeader + IOobject io ( - phiName, + IOobject::groupName("phi", name_), mesh.time().timeName(), mesh, - IOobject::NO_READ + IOobject::MUST_READ, + IOobject::AUTO_WRITE, + IOobject::REGISTER ); - if (phiHeader.typeHeaderOk<surfaceScalarField>(true)) + if (io.typeHeaderOk<surfaceScalarField>(true)) { - Info<< "Reading face flux field " << phiName << endl; + Info<< "Reading face flux field " << io.name() << endl; - phiPtr_.reset - ( - new surfaceScalarField - ( - IOobject - ( - phiName, - mesh.time().timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ) - ); + phiPtr_.reset(new surfaceScalarField(io, mesh)); } else { - Info<< "Calculating face flux field " << phiName << endl; + Info<< "Calculating face flux field " << io.name() << endl; + + io.readOpt(IOobject::NO_READ); wordList phiTypes ( @@ -175,14 +163,7 @@ Foam::phaseModel::phaseModel ( new surfaceScalarField ( - IOobject - ( - phiName, - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), + io, fvc::flux(U_), phiTypes ) diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/InterfaceCompositionModel/InterfaceCompositionModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/InterfaceCompositionModel/InterfaceCompositionModel.C index 4c15779cc33c73fc0754d0bd9a2b1f7b8d1fdc4b..6a91b7313633d2e389e44bddcbf22469e5b0983b 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/InterfaceCompositionModel/InterfaceCompositionModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/InterfaceCompositionModel/InterfaceCompositionModel.C @@ -78,21 +78,14 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getSpecieMassFraction { const fvMesh& mesh = fromThermo_.p().mesh(); - auto tY = tmp<volScalarField>::New + auto tY = volScalarField::New ( - IOobject - ( - "tY", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "tY", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimless, Zero), fvPatchFieldBase::zeroGradientType() ); - auto& Ys = tY.ref(); Ys = mixture.Y(speciesName); @@ -112,16 +105,10 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::getSpecieMassFraction { const fvMesh& mesh = fromThermo_.p().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "tY", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "tY", + IOobject::NO_REGISTER, mesh, scalar(1), dimless, @@ -140,16 +127,10 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::MwMixture { const fvMesh& mesh = fromThermo_.p().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "tM", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "tM", + IOobject::NO_REGISTER, mesh, dimensionedScalar ( @@ -230,18 +211,13 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::Dto const volScalarField& T = toThermo_.T(); - auto tmpD = tmp<volScalarField>::New + auto tmpD = volScalarField::New ( - IOobject - ( - IOobject::groupName("D", pair_.name()), - p.time().timeName(), - p.mesh() - ), + IOobject::groupName("D", pair_.name()), + IOobject::NO_REGISTER, p.mesh(), dimensionedScalar(dimArea/dimTime, Zero) ); - auto& D = tmpD.ref(); forAll(p, celli) @@ -276,18 +252,13 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::Dfrom const volScalarField& T(fromThermo_.T()); - auto tmpD = tmp<volScalarField>::New + auto tmpD = volScalarField::New ( - IOobject - ( - IOobject::groupName("D", pair_.name()), - p.time().timeName(), - p.mesh() - ), + IOobject::groupName("D", pair_.name()), + IOobject::NO_REGISTER, p.mesh(), dimensionedScalar(dimArea/dimTime, Zero) ); - auto& D = tmpD.ref(); forAll(p, celli) @@ -319,19 +290,14 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L const volScalarField& p(fromThermo_.p()); - auto tmpL = tmp<volScalarField>::New + auto tmpL = volScalarField::New ( - IOobject - ( - IOobject::groupName("L", pair_.name()), - p.time().timeName(), - p.mesh() - ), + IOobject::groupName("L", pair_.name()), + IOobject::NO_REGISTER, p.mesh(), dimensionedScalar(dimEnergy/dimMass, Zero), fvPatchFieldBase::zeroGradientType() ); - auto& L = tmpL.ref(); // from Thermo (from) to Thermo (to) diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/MassTransferPhaseSystem/MassTransferPhaseSystem.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/MassTransferPhaseSystem/MassTransferPhaseSystem.C index 9bdd167d898a9b591b2747d7209d98f996edcacd..c1a2aca8cf7804fac9d51813b906841a4e50337b 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/MassTransferPhaseSystem/MassTransferPhaseSystem.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/MassTransferPhaseSystem/MassTransferPhaseSystem.C @@ -62,7 +62,8 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::MassTransferPhaseSystem this->mesh().time().timeName(), this->mesh(), IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), this->mesh(), dimensionedScalar(dimDensity/dimTime, Zero) @@ -85,16 +86,10 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::calculateL const volScalarField& T ) const { - auto tL = tmp<volScalarField>::New + auto tL = volScalarField::New ( - IOobject - ( - "tL", - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), + "tL", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimEnergy/dimMass, Zero) ); @@ -137,14 +132,10 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::dmdt const phasePairKey& key ) const { - auto tdmdt = tmp<volScalarField>::New + auto tdmdt = volScalarField::New ( - IOobject - ( - "dmdt", - this->mesh().time().timeName(), - this->mesh() - ), + "dmdt", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimDensity/dimTime, Zero) ); @@ -188,40 +179,28 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::heatTransfer const phasePairKey keyki(phasek.name(), phasei.name(), true); // Net mass transfer from k to i phase - auto tdmdtNetki = tmp<volScalarField>::New + auto tdmdtNetki = volScalarField::New ( - IOobject - ( - "tdmdtYki", - this->mesh().time().timeName(), - this->mesh() - ), + "tdmdtYki", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimDensity/dimTime, Zero) ); auto& dmdtNetki = tdmdtNetki.ref(); - auto tSp = tmp<volScalarField>::New + auto tSp = volScalarField::New ( - IOobject - ( - "Sp", - this->mesh().time().timeName(), - this->mesh() - ), + "Sp", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimDensity/dimTime/dimTemperature, Zero) ); auto& Sp = tSp.ref(); - auto tSu = tmp<volScalarField>::New + auto tSu = volScalarField::New ( - IOobject - ( - "Su", - this->mesh().time().timeName(), - this->mesh() - ), + "Su", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimDensity/dimTime, Zero) ); @@ -311,27 +290,19 @@ Foam::MassTransferPhaseSystem<BasePhaseSystem>::volTransfer auto teqn = tmp<fvScalarMatrix>::New(p, dimVolume/dimTime); auto& eqn = teqn.ref(); - auto tSp = tmp<volScalarField>::New + auto tSp = volScalarField::New ( - IOobject - ( - "Sp", - this->mesh().time().timeName(), - this->mesh() - ), + "Sp", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimless/dimTime/dimPressure, Zero) ); auto& Sp = tSp.ref(); - auto tSu = tmp<volScalarField>::New + auto tSu = volScalarField::New ( - IOobject - ( - "Su", - this->mesh().time().timeName(), - this->mesh() - ), + "Su", + IOobject::NO_REGISTER, this->mesh(), dimensionedScalar(dimless/dimTime, Zero) ); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C index bb4970e78fee42d8d6f174f2d9fcec06665c18fa..ec2730a096e0473d22222cb2427867de59246a3a 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C @@ -70,20 +70,15 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseInter::surfaceTensionModels::constantSurfaceTensionCoefficient:: sigma() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return - tmp<volScalarField>::New - ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), - mesh, - sigma_ - ); + const fvMesh& mesh = this->pair_.phase1().mesh(); + + return volScalarField::New + ( + "zero", + IOobject::NO_REGISTER, + mesh, + sigma_ + ); } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/diffusionGasEvaporation/diffusionGasEvaporation.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/diffusionGasEvaporation/diffusionGasEvaporation.C index 6a7e10ec02d1e62fa33d3341d847dfdadfc7dd7c..af1f1fd26042cb219afff67a6cc65d391759bf7c 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/diffusionGasEvaporation/diffusionGasEvaporation.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/diffusionGasEvaporation/diffusionGasEvaporation.C @@ -144,32 +144,26 @@ Foam::meltingEvaporationModels::diffusionGasEvaporation<Thermo, OtherThermo> updateInterface(T); - auto tRhog = tmp<volScalarField>::New + auto tRhog = volScalarField::New ( - IOobject - ( - "tRhog", - mesh.time().timeName(), - mesh - ), + "tRhog", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimDensity, Zero) ); - volScalarField& rhog = tRhog.ref(); + auto& rhog = tRhog.ref(); + rhog = this->pair().to().rho(); - auto tDvg = tmp<volScalarField>::New + auto tDvg = volScalarField::New ( - IOobject - ( - "tDvg", - mesh.time().timeName(), - mesh - ), + "tDvg", + IOobject::NO_REGISTER, mesh, dimensionedScalar(sqr(dimLength)/dimTime, Zero) ); - volScalarField& Dvg = tDvg.ref(); + auto& Dvg = tDvg.ref(); + Dvg = this->Dto(speciesName); tmp<volScalarField> tpSat = saturationModelPtr_->pSat(T); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceHeatResistance/interfaceHeatResistance.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceHeatResistance/interfaceHeatResistance.C index 0dfd7e8b117b3af5044a07a8b66ace78ca4e79c5..a4934d3c3d8ab85b513c6cb60e9de44892e9cd64 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceHeatResistance/interfaceHeatResistance.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceHeatResistance/interfaceHeatResistance.C @@ -195,14 +195,10 @@ Foam::meltingEvaporationModels::interfaceHeatResistance<Thermo, OtherThermo> updateInterface(T); - auto tdeltaT = tmp<volScalarField>::New + auto tdeltaT = volScalarField::New ( - IOobject - ( - "tdeltaT", - mesh.time().timeName(), - mesh - ), + "tdeltaT", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimTemperature, Zero) ); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceOxideRate/interfaceOxideRate.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceOxideRate/interfaceOxideRate.C index 617940487b7ad847d8aca9a8d0b88c20fc325b43..e052f6f3b173e6dfce8e23fad80b5ac95eef2ff2 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceOxideRate/interfaceOxideRate.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/interfaceOxideRate/interfaceOxideRate.C @@ -152,18 +152,14 @@ Foam::meltingEvaporationModels::interfaceOxideRate<Thermo, OtherThermo>::Kexp const labelUList& fc = mesh.boundary()[patchi].faceCells(); tmp<scalarField> tsb = pp.source(); - auto tRhoto = tmp<volScalarField>::New + auto tRhoto = volScalarField::New ( - IOobject - ( - "tRhoto", - mesh.time().timeName(), - mesh - ), + "tRhoto", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimDensity, Zero) ); - volScalarField& rhoto = tRhoto.ref(); + auto& rhoto = tRhoto.ref(); rhoto = this->pair().to().rho(); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/kineticGasEvaporation/kineticGasEvaporation.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/kineticGasEvaporation/kineticGasEvaporation.C index 83f0d399d43aeffa0ddfe921957865dc242bbe1e..1b42747e0aa501d79db36d832c0db65797ca253f 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/kineticGasEvaporation/kineticGasEvaporation.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/massTransferModels/kineticGasEvaporation/kineticGasEvaporation.C @@ -167,37 +167,23 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo> updateInterface(T); - tmp<volScalarField> tRhov + auto tRhov = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "tRhov", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar(dimDensity, Zero) - ) + "tRhov", + IOobject::NO_REGISTER, + mesh, + dimensionedScalar(dimDensity, Zero) ); - volScalarField& rhov = tRhov.ref(); + auto& rhov = tRhov.ref(); - tmp<volScalarField> tdeltaT + auto tdeltaT = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "tdeltaT", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar(dimTemperature, Zero) - ) + "tdeltaT", + IOobject::NO_REGISTER, + mesh, + dimensionedScalar(dimTemperature, Zero) ); - volScalarField& deltaT = tdeltaT.ref(); + auto& deltaT = tdeltaT.ref(); dimensionedScalar T0("T0", dimTemperature, Zero); @@ -216,7 +202,7 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo> mDotc_ = htc_*deltaT*interfaceArea_; - return tmp<volScalarField>(new volScalarField(mDotc_)); + return tmp<volScalarField>::New(mDotc_); } @@ -241,10 +227,8 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>::KSp return(coeff*pos(Tactivate_ - refValue)); } } - else - { - return tmp<volScalarField> (); - } + + return nullptr; } @@ -269,10 +253,8 @@ Foam::meltingEvaporationModels::kineticGasEvaporation<Thermo, OtherThermo>::KSu return(coeff*pos(Tactivate_ - refValue)); } } - else - { - return tmp<volScalarField> (); - } + + return nullptr; } diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseInterSystem/multiphaseInterSystem.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseInterSystem/multiphaseInterSystem.C index 69d2927d8762d7b497ac7edeedcb56acf2ffe9ac..2a7fb6670ebdab4463813c7411608d32bd69f5a6 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseInterSystem/multiphaseInterSystem.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseInterSystem/multiphaseInterSystem.C @@ -94,9 +94,10 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseInterSystem::generatePhi { auto iter = phaseModels.cbegin(); - auto tmpPhi = tmp<surfaceScalarField>::New + auto tmpPhi = surfaceScalarField::New ( "phi", + IOobject::NO_REGISTER, fvc::interpolate(iter()()) * iter()->phi() ); @@ -925,12 +926,10 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseInterSystem::nuEff() const Foam::tmp<Foam::volScalarField> Foam::multiphaseInterSystem::kappaEff() const { - const volScalarField kappaEff + return ( this->kappa() + this->Cp()*turb_->mut()/Prt_ ); - - return tmp<volScalarField>::New(kappaEff); } @@ -1075,14 +1074,10 @@ const Foam::fvMesh& Foam::multiphaseInterSystem::mesh() const Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseInterSystem::surfaceTensionForce() const { - auto tstf = tmp<surfaceScalarField>::New + auto tstf = surfaceScalarField::New ( - IOobject - ( - "surfaceTensionForce", - mesh_.time().timeName(), - mesh_ - ), + "surfaceTensionForce", + IOobject::NO_REGISTER, mesh_, dimensionedScalar({1, -2, -2, 0, 0, 0}, Zero) ); @@ -1125,14 +1120,10 @@ Foam::multiphaseInterSystem::surfaceTensionForce() const Foam::tmp<Foam::volVectorField> Foam::multiphaseInterSystem::U() const { - auto tstf = tmp<volVectorField>::New + auto tstf = volVectorField::New ( - IOobject - ( - "U", - mesh_.time().timeName(), - mesh_ - ), + "U", + IOobject::NO_REGISTER, mesh_, dimensionedVector(dimVelocity, Zero) ); @@ -1232,14 +1223,10 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseInterSystem::nearInterface Foam::tmp<Foam::volScalarField> Foam::multiphaseInterSystem::nearInterface() const { - auto tnearInt = tmp<volScalarField>::New + auto tnearInt = volScalarField::New ( - IOobject - ( - "nearInterface", - mesh_.time().timeName(), - mesh_ - ), + "nearInterface", + IOobject::NO_REGISTER, mesh_, dimensionedScalar(dimless, Zero) ); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C index 4cf91a30e38faa9f6492a36d4716718eadfc99ee..7e2538f96428c57bae77c602ccd09568c57e4a6c 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/multiphaseSystem/multiphaseSystem.C @@ -84,36 +84,22 @@ Foam::multiphaseInter::multiphaseSystem::multiphaseSystem { const multiphaseInter::phaseModel& pm = iter()(); - Su_.insert + Su_.emplace ( pm.name(), - volScalarField::Internal - ( - IOobject - ( - "Su" + pm.name(), - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar(dimless/dimTime, Zero) - ) + // volScalarField::Internal + mesh_.newIOobject("Su" + pm.name()), + mesh_, + dimensionedScalar(dimless/dimTime, Zero) ); - Sp_.insert + Sp_.emplace ( pm.name(), - volScalarField::Internal - ( - IOobject - ( - "Sp" + pm.name(), - mesh_.time().timeName(), - mesh_ - ), - mesh_, - dimensionedScalar(dimless/dimTime, Zero) - ) + // volScalarField::Internal + mesh_.newIOobject("Sp" + pm.name()), + mesh_, + dimensionedScalar(dimless/dimTime, Zero) ); } } @@ -138,12 +124,7 @@ void Foam::multiphaseInter::multiphaseSystem::solve() { surfaceScalarField rhoPhiSum ( - IOobject - ( - "rhoPhiSum", - mesh_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("rhoPhiSum"), mesh_, dimensionedScalar(rhoPhi_.dimensions(), Zero) ); @@ -323,12 +304,7 @@ void Foam::multiphaseInter::multiphaseSystem::solveAlphas() volScalarField sumAlpha ( - IOobject - ( - "sumAlpha", - mesh_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("sumAlpha"), mesh_, dimensionedScalar(dimless, Zero) ); @@ -386,12 +362,7 @@ void Foam::multiphaseInter::multiphaseSystem::solveAlphas() { volScalarField sumAlpha ( - IOobject - ( - "sumAlpha", - mesh_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("sumAlpha"), mesh_, dimensionedScalar(dimless, Zero) ); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C index efe8c61a6a078a2c758c300bef5f95befccb7d24..773bc831b5b6e9fce3782e96e0555629865f4444 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -124,14 +124,10 @@ template<class BasePhaseModel> Foam::tmp<Foam::surfaceScalarField> Foam::MovingPhaseModel<BasePhaseModel>:: diffNo() const { - return tmp<surfaceScalarField>::New + return surfaceScalarField::New ( - IOobject - ( - IOobject::groupName("diffNo", multiphaseInter::phaseModel::name()), - U_.mesh().time().timeName(), - U_.mesh() - ), + IOobject::groupName("diffNo", multiphaseInter::phaseModel::name()), + IOobject::NO_REGISTER, U_.mesh(), dimensionedScalar(dimless, Zero) ); diff --git a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C index b86c773cc70bbee40be252aa8319ade8581fccf8..74e80086dc186edc3d302006b813bb695cf49208 100644 --- a/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C +++ b/src/phaseSystemModels/multiphaseInter/phasesSystem/phaseModel/StaticPhaseModel/StaticPhaseModel.C @@ -87,14 +87,10 @@ template<class BasePhaseModel> Foam::tmp<Foam::surfaceScalarField> Foam::StaticPhaseModel<BasePhaseModel>::phi() const { - return tmp<surfaceScalarField>::New + return surfaceScalarField::New ( - IOobject - ( - IOobject::groupName("phi", multiphaseInter::phaseModel::name()), - U_.mesh().time().timeName(), - U_.mesh() - ), + IOobject::groupName("phi", multiphaseInter::phaseModel::name()), + IOobject::NO_REGISTER, U_.mesh(), dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero) ); @@ -114,18 +110,14 @@ template<class BasePhaseModel> Foam::tmp<Foam::surfaceScalarField> Foam::StaticPhaseModel<BasePhaseModel>::alphaPhi() const { - return tmp<surfaceScalarField>::New + return surfaceScalarField::New ( - IOobject + IOobject::groupName ( - IOobject::groupName - ( - "alphaPhi", - multiphaseInter::phaseModel::name() - ), - U_.mesh().time().timeName(), - U_.mesh() + "alphaPhi", + multiphaseInter::phaseModel::name() ), + IOobject::NO_REGISTER, U_.mesh(), dimensionedScalar(dimensionSet(0, 3, -1, 0, 0), Zero) ); @@ -145,14 +137,10 @@ template<class BasePhaseModel> Foam::tmp<Foam::volVectorField> Foam::StaticPhaseModel<BasePhaseModel>::U() const { - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - IOobject::groupName("U", multiphaseInter::phaseModel::name()), - U_.mesh().time().timeName(), - U_.mesh() - ), + IOobject::groupName("U", multiphaseInter::phaseModel::name()), + IOobject::NO_REGISTER, U_.mesh(), dimensionedVector(dimVelocity, Zero) ); diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C index 1ecb0a60cf2f26e58d89a152d64a9498eaaa9dd1..cafe46b30fe0166cc8dc39d067be7ecbbbceb79b 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -125,22 +125,12 @@ Foam::BlendedInterfacialModel<ModelType>::evaluate ); } - tmp<typeGeoField> x + auto x = typeGeoField::New ( - new typeGeoField - ( - IOobject - ( - ModelType::typeName + ":" + name, - phase1_.mesh().time().timeName(), - phase1_.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - phase1_.mesh(), - dimensioned<Type>(dims, Zero) - ) + IOobject::scopedName(ModelType::typeName, name), + IOobject::NO_REGISTER, + phase1_.mesh(), + dimensioned<Type>(dims, Zero) ); if (model_) diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C index 9057336a1591d7175f97364922c81ad49c41db76..d53f32bef250723a5297bf2e1ab604dea77f0c10 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C @@ -73,13 +73,15 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f1 const phaseModel& phase2 ) const { - const fvMesh& mesh(phase1.mesh()); + const fvMesh& mesh = phase1.mesh(); return volScalarField::New ( "f", + IOobject::NO_REGISTER, mesh, - dimensionedScalar("one", dimless, phase2.name() == continuousPhase_) + scalar(phase2.name() == continuousPhase_), // value 0/1 + dimless ); } @@ -90,13 +92,15 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f2 const phaseModel& phase2 ) const { - const fvMesh& mesh(phase1.mesh()); + const fvMesh& mesh = phase1.mesh(); return volScalarField::New ( "f", + IOobject::NO_REGISTER, mesh, - dimensionedScalar("one", dimless, phase1.name() == continuousPhase_) + scalar(phase1.name() == continuousPhase_), // value 0/1 + dimless ); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C index fb7c537721100643df81a6a10378ac9bdb616a2c..53b1551bb2e5afab4b3111055a72158beb92059e 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,15 +61,14 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd { return dragModels_[key]->K(); } - else - { - return volScalarField::New - ( - dragModel::typeName + ":K", - this->mesh_, - dimensionedScalar(dragModel::dimK) - ); - } + + return volScalarField::New + ( + IOobject::scopedName(dragModel::typeName, "K"), + IOobject::NO_REGISTER, + this->mesh_, + dimensionedScalar(dragModel::dimK) + ); } @@ -84,15 +83,14 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kdf { return dragModels_[key]->Kf(); } - else - { - return surfaceScalarField::New - ( - dragModel::typeName + ":K", - this->mesh_, - dimensionedScalar(dragModel::dimK) - ); - } + + return surfaceScalarField::New + ( + IOobject::scopedName(dragModel::typeName, "K"), + IOobject::NO_REGISTER, + this->mesh_, + dimensionedScalar(dragModel::dimK) + ); } @@ -107,15 +105,14 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Vm { return virtualMassModels_[key]->K(); } - else - { - return volScalarField::New - ( - virtualMassModel::typeName + ":K", - this->mesh_, - dimensionedScalar(virtualMassModel::dimK) - ); - } + + return volScalarField::New + ( + IOobject::scopedName(virtualMassModel::typeName, "K"), + IOobject::NO_REGISTER, + this->mesh_, + dimensionedScalar(virtualMassModel::dimK) + ); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C index 8ec8a8be023cbb26768f7a151bc689a4faa2ae19..45a96bc20dd26f8ea1892b41b7c205f4d0d366b2 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/diameterModels/constantDiameter/constantDiameter.C @@ -70,19 +70,12 @@ Foam::diameterModels::constant::~constant() Foam::tmp<Foam::volScalarField> Foam::diameterModels::constant::d() const { - return tmp<Foam::volScalarField> + return volScalarField::New ( - new volScalarField - ( - IOobject - ( - "d", - phase_.time().timeName(), - phase_.mesh() - ), - phase_.mesh(), - d_ - ) + "d", + IOobject::NO_REGISTER, + phase_.mesh(), + d_ ); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C index 9b38688cdc9649b4f72c18d84f7c4b19949b8217..78c69f65b5d39c1b2af46993bb53b544dbd779d0 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2018 OpenFOAM Foundation + Copyright (C) 2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -70,11 +71,12 @@ Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio() Foam::tmp<Foam::volScalarField> Foam::aspectRatioModels::constantAspectRatio::E() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); return volScalarField::New ( - aspectRatioModel::typeName + ":E", + IOobject::scopedName(aspectRatioModel::typeName, "E"), + IOobject::NO_REGISTER, mesh, E0_ ); diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C index e232ec1e39738a4db475bcf35cbeabac45ebfccf..19e4979a3e935f46f62d31df09bcbf4b33698a4a 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/multiphaseSystem/multiphaseSystem.C @@ -557,14 +557,12 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension const phaseModel& phase1 ) const { - tmp<surfaceScalarField> tSurfaceTension + auto tSurfaceTension = surfaceScalarField::New ( - surfaceScalarField::New - ( - "surfaceTension", - mesh_, - dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), Zero) - ) + "surfaceTension", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), Zero) ); tSurfaceTension.ref().setOriented(); @@ -600,14 +598,12 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::nearInterface() const { - tmp<volScalarField> tnearInt + auto tnearInt = volScalarField::New ( - volScalarField::New - ( - "nearInterface", - mesh_, - dimensionedScalar(dimless, Zero) - ) + "nearInterface", + IOobject::NO_REGISTER, + mesh_, + dimensionedScalar(dimless, Zero) ); forAll(phases(), phasei) diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/InertPhaseModel/InertPhaseModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/InertPhaseModel/InertPhaseModel.C index 275f2faa9e0bc16a8d53fffacfff369d1302049f..5497620c46deb9137150a566362b5b36a42af202 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/InertPhaseModel/InertPhaseModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/InertPhaseModel/InertPhaseModel.C @@ -58,10 +58,7 @@ Foam::InertPhaseModel<BasePhaseModel>::R volScalarField& Yi ) const { - return tmp<fvScalarMatrix> - ( - new fvScalarMatrix(Yi, dimMass/dimTime) - ); + return tmp<fvScalarMatrix>::New(Yi, dimMass/dimTime); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C index 4ffe5c6f659fbb6de5282d4fed33a28b9085c518..8a0cbd79568cf55b74cfe7f1d0f039c2fcb440e0 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/IsothermalPhaseModel/IsothermalPhaseModel.C @@ -50,15 +50,13 @@ void Foam::IsothermalPhaseModel<BasePhaseModel>::correctThermo() BasePhaseModel::correctThermo(); // Correct the thermo, but make sure that the temperature remains the same - tmp<volScalarField> TCopy + auto TCopy = volScalarField::New ( - volScalarField::New - ( - this->thermo().T().name() + ":Copy", - this->thermo().T() - ) + IOobject::scopedName(this->thermo().T().name(), "Copy"), + IOobject::NO_REGISTER, + this->thermo().T() ); - this->thermo_->he() = this->thermo().he(this->thermo().p(), TCopy); + this->thermo_->he() = this->thermo().he(this->thermo().p(), TCopy()); this->thermo_->correct(); this->thermo_->T() = TCopy; } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C index c8d030117d053d18b66cc5c6acb9d7ca63913e3f..8d616263308316fa2990e0012f7857c8c70c3682 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseModel/MovingPhaseModel/MovingPhaseModel.C @@ -48,41 +48,29 @@ template<class BasePhaseModel> Foam::tmp<Foam::surfaceScalarField> Foam::MovingPhaseModel<BasePhaseModel>::phi(const volVectorField& U) const { - word phiName(IOobject::groupName("phi", this->name())); - - IOobject phiHeader + IOobject io ( - phiName, + IOobject::groupName("phi", this->name()), U.mesh().time().timeName(), U.mesh(), - IOobject::NO_READ + IOobject::MUST_READ, + IOobject::AUTO_WRITE, + IOobject::REGISTER ); - if (phiHeader.typeHeaderOk<surfaceScalarField>(true)) + if (io.typeHeaderOk<surfaceScalarField>(true)) { - Info<< "Reading face flux field " << phiName << endl; + Info<< "Reading face flux field " << io.name() << endl; - return tmp<surfaceScalarField> - ( - new surfaceScalarField - ( - IOobject - ( - phiName, - U.mesh().time().timeName(), - U.mesh(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - U.mesh() - ) - ); + return tmp<surfaceScalarField>::New(io, U.mesh()); } else { - Info<< "Calculating face flux field " << phiName << endl; + Info<< "Calculating face flux field " << io.name() << endl; + + io.readOpt(IOobject::NO_READ); - wordList phiTypes + wordList patchTypes ( U.boundaryField().size(), fvsPatchFieldBase::calculatedType() @@ -97,25 +85,15 @@ Foam::MovingPhaseModel<BasePhaseModel>::phi(const volVectorField& U) const || isA<partialSlipFvPatchVectorField>(U.boundaryField()[i]) ) { - phiTypes[i] = fixedValueFvPatchScalarField::typeName; + patchTypes[i] = fixedValueFvPatchScalarField::typeName; } } - return tmp<surfaceScalarField> + return tmp<surfaceScalarField>::New ( - new surfaceScalarField - ( - IOobject - ( - phiName, - U.mesh().time().timeName(), - U.mesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - fvc::flux(U), - phiTypes - ) + io, + fvc::flux(U), + patchTypes ); } } @@ -140,7 +118,8 @@ Foam::MovingPhaseModel<BasePhaseModel>::MovingPhaseModel fluid.mesh().time().timeName(), fluid.mesh(), IOobject::MUST_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), fluid.mesh() ), diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseSystem/phaseSystem.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseSystem/phaseSystem.C index bee5a74ba85bca8e2a4878fa62a24bf4616f5f4e..91335c81878a7d2401569b6c74aa1c2eeef4ab0e 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseSystem/phaseSystem.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/phaseSystem/phaseSystem.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2015-2018 OpenFOAM Foundation - Copyright (C) 2019-2022 OpenCFD Ltd. + Copyright (C) 2019-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -53,13 +53,11 @@ Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::calcPhi const phaseModelList& phaseModels ) const { - tmp<surfaceScalarField> tphi + auto tphi = surfaceScalarField::New ( - surfaceScalarField::New - ( - "phi", - fvc::interpolate(phaseModels[0])*phaseModels[0].phi() - ) + "phi", + IOobject::NO_REGISTER, + fvc::interpolate(phaseModels[0])*phaseModels[0].phi() ); for (label phasei=1; phasei<phaseModels.size(); ++phasei) @@ -136,8 +134,9 @@ Foam::phaseSystem::phaseSystem "phaseProperties", mesh.time().constant(), mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE + IOobject::READ_MODIFIED, + IOobject::NO_WRITE, + IOobject::REGISTER ) ), @@ -156,7 +155,7 @@ Foam::phaseSystem::phaseSystem mesh ), mesh, - dimensionedScalar("zero", dimPressure/dimTime, 0) + dimensionedScalar(dimPressure/dimTime, Zero) ), MRF_(mesh_) @@ -303,15 +302,14 @@ Foam::phaseSystem::E(const phasePairKey& key) const { return aspectRatioModels_[key]->E(); } - else - { - return volScalarField::New - ( - aspectRatioModel::typeName + ":E", - this->mesh_, - dimensionedScalar("one", dimless, 1) - ); - } + + return volScalarField::New + ( + IOobject::scopedName(aspectRatioModel::typeName, "E"), + IOobject::NO_REGISTER, + this->mesh_, + dimensionedScalar("one", dimless, 1) + ); } @@ -322,19 +320,21 @@ Foam::phaseSystem::sigma(const phasePairKey& key) const { return surfaceTensionModels_[key]->sigma(); } - else - { - return volScalarField::New + + return volScalarField::New + ( + IOobject::scopedName ( - reactingMultiphaseEuler::surfaceTensionModel::typeName + ":sigma", - this->mesh_, - dimensionedScalar - ( - reactingMultiphaseEuler::surfaceTensionModel::dimSigma, - 0 - ) - ); - } + reactingMultiphaseEuler::surfaceTensionModel::typeName, "sigma" + ), + IOobject::NO_REGISTER, + this->mesh_, + dimensionedScalar + ( + reactingMultiphaseEuler::surfaceTensionModel::dimSigma, + Zero + ) + ); } @@ -346,8 +346,9 @@ Foam::tmp<Foam::volScalarField> Foam::phaseSystem::dmdt return volScalarField::New ( IOobject::groupName("dmdt", phasePairs_[key]->name()), + IOobject::NO_REGISTER, this->mesh_, - dimensionedScalar("zero", dimDensity/dimTime, 0) + dimensionedScalar(dimDensity/dimTime, Zero) ); } diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/populationBalanceModel/populationBalanceModel.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/populationBalanceModel/populationBalanceModel.C index e3e046cf44d4747c82393cfda3d4ae947a60c0ae..9aac84604c34a378c7546ed86a767e78dc2b6721 100644 --- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/populationBalanceModel/populationBalanceModel.C +++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/populationBalanceModel/populationBalanceModel/populationBalanceModel.C @@ -148,31 +148,23 @@ void Foam::diameterModels::populationBalanceModel::registerSizeGroups Su_.append ( - new volScalarField + volScalarField::New ( - IOobject - ( - "Su", - fluid_.time().timeName(), - mesh_ - ), + "Su", + IOobject::NO_REGISTER, mesh_, - dimensionedScalar("zero", inv(dimTime), 0) + dimensionedScalar(inv(dimTime), Zero) ) ); SuSp_.append ( - new volScalarField + volScalarField::New ( - IOobject - ( - "SuSp", - fluid_.time().timeName(), - mesh_ - ), + "SuSp", + IOobject::NO_REGISTER, mesh_, - dimensionedScalar("zero", inv(dimTime), 0) + dimensionedScalar(inv(dimTime), Zero) ) ); } @@ -957,14 +949,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "coalescenceRate", - mesh_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("coalescenceRate"), mesh_, - dimensionedScalar("zero", dimVolume/dimTime, Zero) + dimensionedScalar(dimVolume/dimTime, Zero) ) ); } @@ -975,14 +962,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "breakupRate", - fluid_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("breakupRate"), mesh_, - dimensionedScalar("zero", inv(dimTime), Zero) + dimensionedScalar(inv(dimTime), Zero) ) ); } @@ -993,19 +975,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "binaryBreakupRate", - fluid_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("binaryBreakupRate"), mesh_, - dimensionedScalar - ( - "binaryBreakupRate", - inv(dimVolume*dimTime), - Zero - ) + dimensionedScalar(inv(dimVolume*dimTime), Zero) ) ); } @@ -1016,14 +988,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "driftRate", - fluid_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("driftRate"), mesh_, - dimensionedScalar("zero", dimVolume/dimTime, Zero) + dimensionedScalar(dimVolume/dimTime, Zero) ) ); @@ -1031,14 +998,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "r", - fluid_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("rx"), mesh_, - dimensionedScalar("zero", dimless, Zero) + dimensionedScalar(dimless, Zero) ) ); @@ -1046,14 +1008,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "r", - fluid_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("rdx"), mesh_, - dimensionedScalar("zero", dimless, Zero) + dimensionedScalar(dimless, Zero) ) ); } @@ -1064,19 +1021,9 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel ( new volScalarField ( - IOobject - ( - "nucleationRate", - fluid_.time().timeName(), - mesh_ - ), + mesh_.newIOobject("nucleationRate"), mesh_, - dimensionedScalar - ( - "nucleationRate", - inv(dimTime*dimVolume), - Zero - ) + dimensionedScalar(inv(dimTime*dimVolume), Zero) ) ); } @@ -1093,10 +1040,11 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel fluid_.time().timeName(), mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), mesh_, - dimensionedScalar("zero", dimless, Zero) + dimensionedScalar(dimless, Zero) ) ); @@ -1110,10 +1058,11 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel fluid_.time().timeName(), mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), mesh_, - dimensionedScalar("zero", dimLength, Zero) + dimensionedScalar(dimLength, Zero) ) ); @@ -1127,7 +1076,8 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel fluid_.time().timeName(), mesh_, IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), mesh_, dimensionedVector(dimVelocity, Zero) diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index d0c5de3052afbab0a99c4e15ee2e5eed80a6314c..3f8066a18cb50a88f4c9f5d05688608b90e1233e 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -120,25 +120,14 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu { const volScalarField& alpha = phase; - tmp<volScalarField> tnu + auto tnu = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "Schaeffer:nu", - phase.mesh().time().timeName(), - phase.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - phase.mesh(), - dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) - ) + IOobject::scopedName("Schaeffer", "nu"), + IOobject::NO_REGISTER, + phase.mesh(), + dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) ); - - volScalarField& nuf = tnu.ref(); + auto& nuf = tnu.ref(); forAll(D, celli) { diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 84a80a1a1cbe89d367d3487404d53177a01863b8..b8bc3af38f265169015d18a772aadb1bd62537ee 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -113,7 +113,8 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel U.time().timeName(), U.mesh(), IOobject::MUST_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), U.mesh() ), @@ -168,7 +169,8 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel U.time().timeName(), U.mesh(), IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), U.mesh(), dimensionedScalar(dimViscosity, Zero) @@ -244,18 +246,11 @@ Foam::RASModels::kineticTheoryModel::omega() const Foam::tmp<Foam::volSymmTensorField> Foam::RASModels::kineticTheoryModel::R() const { - return tmp<volSymmTensorField> + return volSymmTensorField::New ( - new volSymmTensorField + IOobject::groupName("R", U_.group()), + IOobject::NO_REGISTER, ( - IOobject - ( - IOobject::groupName("R", U_.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - (nut_)*devTwoSymm(fvc::grad(U_)) - (lambda_*fvc::div(phi_))*symmTensor::I ) @@ -323,20 +318,13 @@ Foam::RASModels::kineticTheoryModel::devRhoReff const volVectorField& U ) const { - return tmp<volSymmTensorField> + return volSymmTensorField::New ( - new volSymmTensorField + IOobject::groupName("devRhoReff", U.group()), + IOobject::NO_REGISTER, ( - IOobject - ( - IOobject::groupName("devRhoReff", U.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - (rho_*nut_) - *devTwoSymm(fvc::grad(U)) + * devTwoSymm(fvc::grad(U)) - ((rho_*lambda_)*fvc::div(phi_))*symmTensor::I ) ); diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index bf6fbd3316ddb2a91058505c34430e3ada383257..0f04837778f1d6d787a4d21279acce9adf37b139 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -123,21 +123,12 @@ Foam::RASModels::phasePressureModel::omega() const Foam::tmp<Foam::volSymmTensorField> Foam::RASModels::phasePressureModel::R() const { - return tmp<volSymmTensorField> + return volSymmTensorField::New ( - new volSymmTensorField - ( - IOobject - ( - IOobject::groupName("R", U_.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero) - ) + IOobject::groupName("R", U_.group()), + IOobject::NO_REGISTER, + mesh_, + dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero) ); } @@ -155,8 +146,7 @@ Foam::RASModels::phasePressureModel::pPrime() const ) ); - volScalarField::Boundary& bpPrime = - tpPrime.ref().boundaryFieldRef(); + auto& bpPrime = tpPrime.ref().boundaryFieldRef(); forAll(bpPrime, patchi) { @@ -183,8 +173,7 @@ Foam::RASModels::phasePressureModel::pPrimef() const ) ); - surfaceScalarField::Boundary& bpPrime = - tpPrime.ref().boundaryFieldRef(); + auto& bpPrime = tpPrime.ref().boundaryFieldRef(); forAll(bpPrime, patchi) { @@ -211,25 +200,15 @@ Foam::RASModels::phasePressureModel::devRhoReff const volVectorField& U ) const { - return tmp<volSymmTensorField> + return volSymmTensorField::New ( - new volSymmTensorField + IOobject::groupName("devRhoReff", U.group()), + IOobject::NO_REGISTER, + mesh_, + dimensioned<symmTensor> ( - IOobject - ( - IOobject::groupName("devRhoReff", U.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensioned<symmTensor> - ( - "R", - rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), - Zero - ) + rho_.dimensions()*dimensionSet(0, 2, -2, 0, 0), + Zero ) ); } @@ -241,13 +220,10 @@ Foam::RASModels::phasePressureModel::divDevRhoReff volVectorField& U ) const { - return tmp<fvVectorMatrix> + return tmp<fvVectorMatrix>::New ( - new fvVectorMatrix - ( - U, - rho_.dimensions()*dimensionSet(0, 4, -2, 0, 0) - ) + U, + rho_.dimensions()*dimensionSet(0, 4, -2, 0, 0) ); } diff --git a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystem.C b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystem.C index d554ea70fe996b03e34519a1c88f666ea19e1427..9c10f71961b1b40d26cbabb46fbff03f0d33b650 100644 --- a/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystem.C +++ b/src/phaseSystemModels/reactingEuler/twoPhaseSystem/twoPhaseSystem.C @@ -121,8 +121,6 @@ Foam::twoPhaseSystem::Vm() const void Foam::twoPhaseSystem::solve() { - const Time& runTime = mesh_.time(); - volScalarField& alpha1 = phase1_; volScalarField& alpha2 = phase2_; @@ -195,24 +193,14 @@ void Foam::twoPhaseSystem::solve() { volScalarField::Internal Sp ( - IOobject - ( - "Sp", - runTime.timeName(), - mesh_ - ), + mesh_.newIOobject("Sp"), mesh_, - dimensionedScalar(dimless/dimTime) + dimensionedScalar(dimless/dimTime, Zero) ); volScalarField::Internal Su ( - IOobject - ( - "Su", - runTime.timeName(), - mesh_ - ), + mesh_.newIOobject("Su"), // Divergence term is handled explicitly to be // consistent with the explicit transport solution fvc::div(phi_)*min(alpha1, scalar(1)) diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C index 170d0d4df3d72532533f5a5bf94ee18b9d12fad1..cc8302f7c4a728ff5353dcd0c1f3e37bde5b0807 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/JohnsonJacksonSchaeffer/JohnsonJacksonSchaefferFrictionalStress.C @@ -130,25 +130,14 @@ JohnsonJacksonSchaeffer::nu { const volScalarField& alpha = phase; - tmp<volScalarField> tnu + auto tnu = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "JohnsonJacksonSchaeffer:nu", - phase.mesh().time().timeName(), - phase.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - phase.mesh(), - dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) - ) + IOobject::scopedName("JohnsonJacksonSchaeffer", "nu"), + IOobject::NO_REGISTER, + phase.mesh(), + dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) ); - - volScalarField& nuf = tnu.ref(); + auto& nuf = tnu.ref(); forAll(D, celli) { diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C index ccb2ff83fc1b6a3e2d074d604887b953a255a43f..26679d97d2c15b0584e2c06e7ba6eafc82c61ff4 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C @@ -120,25 +120,14 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu { const volScalarField& alpha = phase; - tmp<volScalarField> tnu + auto tnu = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "Schaeffer:nu", - phase.mesh().time().timeName(), - phase.mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - phase.mesh(), - dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) - ) + IOobject::scopedName("Schaeffer", "nu"), + IOobject::NO_REGISTER, + phase.mesh(), + dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), Zero) ); - - volScalarField& nuf = tnu.ref(); + auto& nuf = tnu.ref(); forAll(D, celli) { diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 53f76222a66b110df56cd7752d4c05faff7905e5..e4228cf5a0764f11e82fb7450f185fcfee2c9ee2 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -113,7 +113,8 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel U.time().timeName(), U.mesh(), IOobject::MUST_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), U.mesh() ), @@ -168,7 +169,8 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel U.time().timeName(), U.mesh(), IOobject::NO_READ, - IOobject::AUTO_WRITE + IOobject::AUTO_WRITE, + IOobject::REGISTER ), U.mesh(), dimensionedScalar(dimViscosity, Zero) @@ -244,18 +246,11 @@ Foam::RASModels::kineticTheoryModel::omega() const Foam::tmp<Foam::volSymmTensorField> Foam::RASModels::kineticTheoryModel::R() const { - return tmp<volSymmTensorField> + return volSymmTensorField::New ( - new volSymmTensorField + IOobject::groupName("R", U_.group()), + IOobject::NO_REGISTER, ( - IOobject - ( - IOobject::groupName("R", U_.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - (nut_)*devTwoSymm(fvc::grad(U_)) - (lambda_*fvc::div(phi_))*symmTensor::I ) @@ -322,20 +317,13 @@ Foam::RASModels::kineticTheoryModel::devRhoReff const volVectorField& U ) const { - return tmp<volSymmTensorField> + return volSymmTensorField::New ( - new volSymmTensorField + IOobject::groupName("devRhoReff", U.group()), + IOobject::NO_REGISTER, ( - IOobject - ( - IOobject::groupName("devRhoReff", U.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - (rho_*nut_) - *devTwoSymm(fvc::grad(U)) + * devTwoSymm(fvc::grad(U)) - ((rho_*lambda_)*fvc::div(phi_))*symmTensor::I ) ); diff --git a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C index 42fa6cfbac522dc77c6c26b54080c8d55263c950..3534b0abe37150e9c40b22fe287366d13fdaecca 100644 --- a/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/phaseCompressibleTurbulenceModels/phasePressureModel/phasePressureModel.C @@ -106,7 +106,7 @@ Foam::tmp<Foam::volScalarField> Foam::RASModels::phasePressureModel::k() const { NotImplemented; - return nut_; + return nullptr; } @@ -114,7 +114,7 @@ Foam::tmp<Foam::volScalarField> Foam::RASModels::phasePressureModel::epsilon() const { NotImplemented; - return nut_; + return nullptr; } @@ -129,16 +129,10 @@ Foam::RASModels::phasePressureModel::omega() const Foam::tmp<Foam::volSymmTensorField> Foam::RASModels::phasePressureModel::R() const { - return tmp<volSymmTensorField>::New + return volSymmTensorField::New ( - IOobject - ( - IOobject::groupName("R", U_.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + IOobject::groupName("R", U_.group()), + IOobject::NO_REGISTER, mesh_, dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero) ); @@ -214,16 +208,10 @@ Foam::RASModels::phasePressureModel::devRhoReff const volVectorField& U ) const { - return tmp<volSymmTensorField>::New + return volSymmTensorField::New ( - IOobject - ( - IOobject::groupName("devRhoReff", U.group()), - runTime_.timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + IOobject::groupName("devRhoReff", U.group()), + IOobject::NO_REGISTER, mesh_, dimensioned<symmTensor> ( @@ -239,13 +227,10 @@ Foam::RASModels::phasePressureModel::divDevRhoReff volVectorField& U ) const { - return tmp<fvVectorMatrix> + return tmp<fvVectorMatrix>::New ( - new fvVectorMatrix - ( - U, - rho_.dimensions()*dimensionSet(0, 4, -2, 0, 0) - ) + U, + rho_.dimensions()*dimensionSet(0, 4, -2, 0, 0) ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C index c9f207655d1c1829a965465ac90a01e014cfb33d..6f32ceb265e2fab19530e351517cce42498ba66a 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/BlendedInterfacialModel.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2014-2016 OpenFOAM Foundation - Copyright (C) 2020 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -39,8 +39,7 @@ void Foam::BlendedInterfacialModel<modelType>::correctFixedFluxBCs GeometricField& field ) const { - typename GeometricField::Boundary& fieldBf = - field.boundaryFieldRef(); + auto& fieldBf = field.boundaryFieldRef(); forAll(pair_.phase1().phi().boundaryField(), patchi) { @@ -140,22 +139,12 @@ Foam::BlendedInterfacialModel<modelType>::K() const f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } - tmp<volScalarField> x + auto x = volScalarField::New ( - new volScalarField - ( - IOobject - ( - modelType::typeName + ":K", - pair_.phase1().mesh().time().timeName(), - pair_.phase1().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - pair_.phase1().mesh(), - dimensionedScalar(modelType::dimK, Zero) - ) + IOobject::scopedName(modelType::typeName, "K"), + IOobject::NO_REGISTER, + pair_.phase1().mesh(), + dimensionedScalar(modelType::dimK, Zero) ); if (model_) @@ -208,22 +197,11 @@ Foam::BlendedInterfacialModel<modelType>::Kf() const ); } - tmp<surfaceScalarField> x + auto x = surfaceScalarField::New ( - new surfaceScalarField - ( - IOobject - ( - modelType::typeName + ":Kf", - pair_.phase1().mesh().time().timeName(), - pair_.phase1().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - pair_.phase1().mesh(), - dimensionedScalar(modelType::dimK, Zero) - ) + IOobject::scopedName(modelType::typeName, "Kf"), + pair_.phase1().mesh(), + dimensionedScalar(modelType::dimK, Zero) ); if (model_) @@ -271,17 +249,10 @@ Foam::BlendedInterfacialModel<modelType>::F() const f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } - auto x = tmp<GeometricField<Type, fvPatchField, volMesh>>::New + auto x = GeometricField<Type, fvPatchField, volMesh>::New ( - IOobject - ( - modelType::typeName + ":F", - pair_.phase1().mesh().time().timeName(), - pair_.phase1().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + IOobject::scopedName(modelType::typeName, "F"), + IOobject::NO_REGISTER, pair_.phase1().mesh(), dimensioned<Type>(modelType::dimF, Zero) ); @@ -336,17 +307,10 @@ Foam::BlendedInterfacialModel<modelType>::Ff() const ); } - auto x = tmp<surfaceScalarField>::New + auto x = surfaceScalarField::New ( - IOobject - ( - modelType::typeName + ":Ff", - pair_.phase1().mesh().time().timeName(), - pair_.phase1().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + IOobject::scopedName(modelType::typeName, "Ff"), + IOobject::NO_REGISTER, pair_.phase1().mesh(), dimensionedScalar(modelType::dimF*dimArea, Zero) ); @@ -397,22 +361,12 @@ Foam::BlendedInterfacialModel<modelType>::D() const f2 = blending_.f2(pair1In2_.dispersed(), pair2In1_.dispersed()); } - tmp<volScalarField> x + auto x = volScalarField::New ( - new volScalarField - ( - IOobject - ( - modelType::typeName + ":D", - pair_.phase1().mesh().time().timeName(), - pair_.phase1().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - pair_.phase1().mesh(), - dimensionedScalar(modelType::dimD, Zero) - ) + IOobject::scopedName(modelType::typeName, "D"), + IOobject::NO_REGISTER, + pair_.phase1().mesh(), + dimensionedScalar(modelType::dimD, Zero) ); if (model_) diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C index 3f3dfe09aac99d29f469722b93e3e2612069fc8b..4ba27735706d30d3bbdbe32f5e1819b34a1a357b 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/BlendedInterfacialModel/blendingMethods/noBlending/noBlending.C @@ -73,28 +73,16 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f1 const phaseModel& phase2 ) const { - const fvMesh& mesh(phase1.mesh()); - - return - tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "f", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar - ( - "f", - dimless, - phase2.name() != continuousPhase_ - ) - ) - ); + const fvMesh& mesh = phase1.mesh(); + + return volScalarField::New + ( + "f", + IOobject::NO_REGISTER, + mesh, + scalar(phase2.name() != continuousPhase_), // value 0/1 + dimless + ); } @@ -104,28 +92,16 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f2 const phaseModel& phase2 ) const { - const fvMesh& mesh(phase1.mesh()); - - return - tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "f", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar - ( - "f", - dimless, - phase1.name() == continuousPhase_ - ) - ) - ); + const fvMesh& mesh = phase1.mesh(); + + return volScalarField::New + ( + "f", + IOobject::NO_REGISTER, + mesh, + scalar(phase1.name() == continuousPhase_), // value 0/1 + dimless + ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C index d0e2dfda5bef458720ff6cc98894dcc731b254b5..65f6012b924eced98b482413a274338b53350f56 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/dummy/dummy.C @@ -48,14 +48,10 @@ namespace IATEsources Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsources::dummy::R() const { - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "R", - iate_.phase().U().time().timeName(), - iate_.phase().mesh() - ), + "R", + IOobject::NO_REGISTER, iate_.phase().U().mesh(), dimensionedScalar(dimless/dimTime, Zero) ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C index 39ee3276dbb064c65d259e42b833e3a260facb02..6f80349065f5936ae15351b2e6076d268773d86f 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/randomCoalescence/randomCoalescence.C @@ -64,22 +64,14 @@ randomCoalescence Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsources::randomCoalescence::R() const { - tmp<volScalarField> tR + auto tR = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "R", - iate_.phase().U().time().timeName(), - iate_.phase().mesh() - ), - iate_.phase().U().mesh(), - dimensionedScalar(dimless/dimTime, Zero) - ) + "R", + IOobject::NO_REGISTER, + iate_.phase().U().mesh(), + dimensionedScalar(dimless/dimTime, Zero) ); - - volScalarField R = tR(); + auto& R = tR.ref(); scalar Crc = Crc_.value(); scalar C = C_.value(); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C index f8129e55eda896a94c6a70de36700213df5be95f..f7f4921c4475678198424e9e72d33ec1a68cb50f 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/IATE/IATEsources/turbulentBreakUp/turbulentBreakUp.C @@ -63,22 +63,14 @@ turbulentBreakUp Foam::tmp<Foam::volScalarField> Foam::diameterModels::IATEsources::turbulentBreakUp::R() const { - tmp<volScalarField> tR + auto tR = volScalarField::New ( - new volScalarField - ( - IOobject - ( - "R", - iate_.phase().U().time().timeName(), - iate_.phase().mesh() - ), - iate_.phase().U().mesh(), - dimensionedScalar(dimless/dimTime, Zero) - ) + "R", + IOobject::NO_REGISTER, + iate_.phase().U().mesh(), + dimensionedScalar(dimless/dimTime, Zero) ); - - volScalarField R = tR(); + auto R = tR(); const scalar Cti = Cti_.value(); const scalar WeCr = WeCr_.value(); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C index c6f0a03f7b9e97b4b78d4a204e9acca04d9d09f6..dce8516716f49450d1434c881bd894e6f7e398db 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/diameterModels/constantDiameter/constantDiameter.C @@ -69,22 +69,12 @@ Foam::diameterModels::constant::~constant() Foam::tmp<Foam::volScalarField> Foam::diameterModels::constant::d() const { - return tmp<Foam::volScalarField> + return volScalarField::New ( - new volScalarField - ( - IOobject - ( - "d", - phase_.U().time().timeName(), - phase_.U().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - phase_.U().mesh(), - d_ - ) + "d", + IOobject::NO_REGISTER, + phase_.U().mesh(), + d_ ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C index 790c071fcab592eb383ba9ae757f67f3a5580b1b..c4ec68bc6a40ad632e15f20943d8618921716cf1 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/aspectRatioModels/constantAspectRatio/constantAspectRatio.C @@ -70,16 +70,12 @@ Foam::aspectRatioModels::constantAspectRatio::~constantAspectRatio() Foam::tmp<Foam::volScalarField> Foam::aspectRatioModels::constantAspectRatio::E() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", + IOobject::NO_REGISTER, mesh, E0_ ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C index d606d0dc6af17d0b3905b27ac0547f2e89b8d326..c17e6f9573d6b2e61aaac5f15580271079a71978 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/constantLiftCoefficient/constantLiftCoefficient.C @@ -65,16 +65,12 @@ Foam::liftModels::constantLiftCoefficient::~constantLiftCoefficient() Foam::tmp<Foam::volScalarField> Foam::liftModels::constantLiftCoefficient::Cl() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", + IOobject::NO_REGISTER, mesh, Cl_ ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/noLift/noLift.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/noLift/noLift.C index 2b540ed3fa15d055b045cfffdafb9d609df3cb05..d36090c36dd7ae9c72c59f17445a68094c25c278 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/noLift/noLift.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/liftModels/noLift/noLift.C @@ -63,19 +63,12 @@ Foam::liftModels::noLift::~noLift() Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "Cl", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + "Cl", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimless, Zero) ); @@ -84,19 +77,12 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "noLift:F", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + IOobject::scopedName("noLift", "F"), + IOobject::NO_REGISTER, mesh, dimensionedVector(dimF, Zero) ); @@ -105,19 +91,12 @@ Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F() const Foam::tmp<Foam::surfaceScalarField> Foam::liftModels::noLift::Ff() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<surfaceScalarField>::New + return surfaceScalarField::New ( - IOobject - ( - "noLift:Ff", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + IOobject::scopedName("noLift", "Ff"), + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimF*dimArea, Zero) ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/noSwarm/noSwarm.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/noSwarm/noSwarm.C index e799cca4473326c3f85dba00d50477fe293835d3..86192abec2afdd480e75187d0f5e26fd72974eff 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/noSwarm/noSwarm.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/swarmCorrections/noSwarm/noSwarm.C @@ -63,23 +63,15 @@ Foam::swarmCorrections::noSwarm::~noSwarm() Foam::tmp<Foam::volScalarField> Foam::swarmCorrections::noSwarm::Cs() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); - - return - tmp<volScalarField> - ( - new volScalarField - ( - IOobject - ( - "one", - mesh.time().timeName(), - mesh - ), - mesh, - dimensionedScalar("one", dimless, 1) - ) - ); + const fvMesh& mesh = this->pair_.phase1().mesh(); + + return volScalarField::New + ( + "one", + IOobject::NO_REGISTER, + mesh, + dimensionedScalar("one", dimless, 1) + ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C index 2d3180152d363ea5095035a7027f2a8203cf776b..cbd4aaa3b117d14ad712a43f5a0f57888dc54d99 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/turbulentDispersionModels/noTurbulentDispersion/noTurbulentDispersion.C @@ -70,19 +70,12 @@ Foam::turbulentDispersionModels::noTurbulentDispersion:: Foam::tmp<Foam::volScalarField> Foam::turbulentDispersionModels::noTurbulentDispersion::D() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + "zero", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimD, Zero) ); @@ -92,16 +85,12 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::D() const Foam::tmp<Foam::volVectorField> Foam::turbulentDispersionModels::noTurbulentDispersion::F() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", + IOobject::NO_REGISTER, mesh, dimensionedVector(dimF, Zero) ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C index 0c8a3bff3394fb6cfe03319e87c798650d7e263b..74380463b5ffbb60fcdd50b3d72064386eba59d6 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/constantVirtualMassCoefficient/constantVirtualMassCoefficient.C @@ -73,24 +73,14 @@ Foam::virtualMassModels::constantVirtualMassCoefficient:: Foam::tmp<Foam::volScalarField> Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volScalarField> + return volScalarField::New ( - new volScalarField - ( - IOobject - ( - "Cvm", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), - mesh, - Cvm_ - ) + "Cvm", + IOobject::NO_REGISTER, + mesh, + Cvm_ ); } diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C index a135d5d88774df680ff7407eee00ba73ae7a5a90..a9f4c9f1086bbc998bbd7d26ba462514acc1c931 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/virtualMassModels/noVirtualMass/noVirtualMass.C @@ -65,16 +65,12 @@ Foam::virtualMassModels::noVirtualMass::~noVirtualMass() Foam::tmp<Foam::volScalarField> Foam::virtualMassModels::noVirtualMass::Cvm() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volScalarField>::New + return volScalarField::New ( - IOobject - ( - "zero", - mesh.time().timeName(), - mesh - ), + "zero", + IOobject::NO_REGISTER, mesh, dimensionedScalar(dimless, Zero) ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C index 4eb415f7e4f2c01f09b68eef320c13a05accad54..d9a23e9ab308eefe5c3893e26c2360872b920082 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/interfacialModels/wallLubricationModels/noWallLubrication/noWallLubrication.C @@ -69,19 +69,12 @@ Foam::wallLubricationModels::noWallLubrication::~noWallLubrication() Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::noWallLubrication::Fi() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "noWallLubrication:Fi", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + IOobject::scopedName("noWallLubrication", "Fi"), + IOobject::NO_REGISTER, mesh, dimensionedVector(dimF, Zero) ); @@ -91,19 +84,12 @@ Foam::wallLubricationModels::noWallLubrication::Fi() const Foam::tmp<Foam::volVectorField> Foam::wallLubricationModels::noWallLubrication::F() const { - const fvMesh& mesh(this->pair_.phase1().mesh()); + const fvMesh& mesh = this->pair_.phase1().mesh(); - return tmp<volVectorField>::New + return volVectorField::New ( - IOobject - ( - "noWallLubrication:F", - mesh.time().timeName(), - mesh, - IOobject::NO_READ, - IOobject::NO_WRITE, - IOobject::NO_REGISTER - ), + IOobject::scopedName("noWallLubrication", "F"), + IOobject::NO_REGISTER, mesh, dimensionedVector(dimF, Zero) ); diff --git a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/twoPhaseSystem/twoPhaseSystem.C b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/twoPhaseSystem/twoPhaseSystem.C index fdb52fea29c308129913b8aca7ac4cddf14fb118..ac5bc45b9d9dcedf734a32e373c363c766eeb2a2 100644 --- a/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/twoPhaseSystem/twoPhaseSystem.C +++ b/src/phaseSystemModels/twoPhaseEuler/twoPhaseSystem/twoPhaseSystem/twoPhaseSystem.C @@ -110,7 +110,7 @@ Foam::twoPhaseSystem::twoPhaseSystem IOobject::AUTO_WRITE ), mesh, - dimensionedScalar("dgdt", dimless/dimTime, Zero) + dimensionedScalar(dimless/dimTime, Zero) ) { phase2_.volScalarField::operator=(scalar(1) - phase1_); @@ -351,8 +351,6 @@ Foam::tmp<Foam::volScalarField> Foam::twoPhaseSystem::D() const void Foam::twoPhaseSystem::solve() { - const Time& runTime = mesh_.time(); - volScalarField& alpha1 = phase1_; volScalarField& alpha2 = phase2_; @@ -396,24 +394,14 @@ void Foam::twoPhaseSystem::solve() { volScalarField::Internal Sp ( - IOobject - ( - "Sp", - runTime.timeName(), - mesh_ - ), + mesh_.newIOobject("Sp"), mesh_, - dimensionedScalar("Sp", dgdt_.dimensions(), 0.0) + dimensionedScalar(dgdt_.dimensions(), Zero) ); volScalarField::Internal Su ( - IOobject - ( - "Su", - runTime.timeName(), - mesh_ - ), + mesh_.newIOobject("Su"), // Divergence term is handled explicitly to be // consistent with the explicit transport solution fvc::div(phi_)*min(alpha1, scalar(1))