ENH: use tmp field factory methods [6] (#2723)

- src/functionObjects
This commit is contained in:
Mark Olesen
2024-01-23 10:08:35 +01:00
parent 995a9705e2
commit 71d4a23ec0
17 changed files with 130 additions and 248 deletions

View File

@ -79,16 +79,10 @@ bool Foam::functionObjects::PecletNo::calc()
const dictionary& model = const dictionary& model =
mesh_.lookupObject<dictionary>("transportProperties"); mesh_.lookupObject<dictionary>("transportProperties");
nuEff = tmp<volScalarField>::New nuEff = volScalarField::New
(
IOobject
( (
"nuEff", "nuEff",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar("nu", dimViscosity, model) dimensionedScalar("nu", dimViscosity, model)
); );

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015-2020 OpenCFD Ltd. Copyright (C) 2015-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -531,9 +531,10 @@ bool Foam::functionObjects::extractEulerianParticles::execute()
const volScalarField& alpha = const volScalarField& alpha =
mesh_.lookupObject<volScalarField>(alphaName_); mesh_.lookupObject<volScalarField>(alphaName_);
const surfaceScalarField alphaf auto talphaf = surfaceScalarField::New
( (
typeName + ":alphaf", IOobject::scopedName(typeName, "alphaf"),
IOobject::NO_REGISTER,
fvc::interpolate(alpha) fvc::interpolate(alpha)
); );
@ -546,7 +547,7 @@ bool Foam::functionObjects::extractEulerianParticles::execute()
// Set the blocked faces, i.e. where alpha > alpha threshold value // Set the blocked faces, i.e. where alpha > alpha threshold value
boolList blockedFaces(fz.size(), false); boolList blockedFaces(fz.size(), false);
setBlockedFaces(alphaf, fz, blockedFaces); setBlockedFaces(talphaf(), fz, blockedFaces);
// Split the faceZone according to the blockedFaces // Split the faceZone according to the blockedFaces
// - Returns a list of (disconnected) region index per face zone face // - Returns a list of (disconnected) region index per face zone face
@ -567,7 +568,7 @@ bool Foam::functionObjects::extractEulerianParticles::execute()
// Process latest region information // Process latest region information
tmp<surfaceScalarField> tphi = phiU(); tmp<surfaceScalarField> tphi = phiU();
accumulateParticleInfo(alphaf, tphi(), regionFaceIDs, fz); accumulateParticleInfo(talphaf(), tphi(), regionFaceIDs, fz);
Log << " Collected particles : " << nCollectedParticles_ << nl Log << " Collected particles : " << nCollectedParticles_ << nl
<< " Collected volume : " << collectedVolume_ << nl << " Collected volume : " << collectedVolume_ << nl

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2019 OpenCFD Ltd. Copyright (C) 2019-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -49,22 +49,36 @@ bool Foam::functionObjects::limitFields::limitField(const word& fieldName)
if (withBounds_ & limitType::CLAMP_MIN) if (withBounds_ & limitType::CLAMP_MIN)
{ {
volScalarField mField(typeName + ":mag" + field.name(), mag(field)); auto tmField = volScalarField::New
(
IOobject::scopedName(typeName, "mag" + field.name()),
IOobject::NO_REGISTER,
mag(field)
);
auto& mField = tmField.ref();
Log << " min(|" << gMin(mField) << "|)"; Log << " min(|" << gMin(mField) << "|)";
//field.normalise(); //field.normalise();
field /= mag(field) + eps; field /= mag(field) + eps;
mField.clamp_min(min_); mField.clamp_min(min_);
field *= mField; field *= tmField;
} }
if (withBounds_ & limitType::CLAMP_MAX) if (withBounds_ & limitType::CLAMP_MAX)
{ {
volScalarField mField(typeName + ":mag" + field.name(), mag(field)); auto tmField = volScalarField::New
(
IOobject::scopedName(typeName, "mag" + field.name()),
IOobject::NO_REGISTER,
mag(field)
);
auto& mField = tmField.ref();
Log << " max(|" << gMax(mField) << "|)"; Log << " max(|" << gMax(mField) << "|)";
//field.normalise(); //field.normalise();
field /= mag(field) + eps; field /= mag(field) + eps;
mField.clamp_max(max_); mField.clamp_max(max_);
field *= mField; field *= tmField;
} }
return true; return true;

View File

@ -131,17 +131,10 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::rhoScale
{ {
if (p.dimensions() == dimPressure) if (p.dimensions() == dimPressure)
{ {
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"rhoScale", "rhoScale",
p.mesh().time().timeName(), IOobject::NO_REGISTER,
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p, p,
fvPatchFieldBase::calculatedType() fvPatchFieldBase::calculatedType()
); );
@ -236,21 +229,14 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::calcPressure
) const ) const
{ {
// Initialise to the pressure reference level // Initialise to the pressure reference level
auto tresult = auto tresult = volScalarField::New
tmp<volScalarField>::New
(
IOobject
( (
scopedName("p"), scopedName("p"),
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ
),
mesh_, mesh_,
dimensionedScalar("p", dimPressure, pRef_) dimensionedScalar("p", dimPressure, pRef_)
); );
auto& result = tresult.ref();
volScalarField& result = tresult.ref();
addHydrostaticContribution(p, result); addHydrostaticContribution(p, result);
@ -304,7 +290,7 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::coeff
if (mode_ & COEFF) if (mode_ & COEFF)
{ {
tmp<volScalarField> tpCoeff(tp.ptr()); tmp<volScalarField> tpCoeff(tp.ptr());
volScalarField& pCoeff = tpCoeff.ref(); auto& pCoeff = tpCoeff.ref();
pCoeff -= dimensionedScalar("pInf", dimPressure, pInf_); pCoeff -= dimensionedScalar("pInf", dimPressure, pInf_);
@ -325,21 +311,16 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::pressure::coeff
bool Foam::functionObjects::pressure::calc() bool Foam::functionObjects::pressure::calc()
{ {
if (foundObject<volScalarField>(fieldName_)) const auto* pptr = cfindObject<volScalarField>(fieldName_);
{
const volScalarField& p = lookupObject<volScalarField>(fieldName_);
auto tp = tmp<volScalarField>::New if (pptr)
( {
IOobject const auto& p = *pptr;
auto tp = volScalarField::New
( (
resultName_, resultName_,
p.mesh().time().timeName(), IOobject::REGISTER,
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::REGISTER
),
coeff(calcPressure(p, rhoScale(p))) coeff(calcPressure(p, rhoScale(p)))
); );

View File

@ -87,15 +87,10 @@ Foam::functionObjects::proudmanAcousticPower::a() const
return sqrt(thermo.gamma()*thermo.p()/thermo.rho()); return sqrt(thermo.gamma()*thermo.p()/thermo.rho());
} }
return return volScalarField::New
tmp<volScalarField>::New
(
IOobject
( (
scopedName("a"), scopedName("a"),
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_
),
mesh_, mesh_,
aRef_ aRef_
); );

View File

@ -80,20 +80,14 @@ calculateSpeciesRR
const basicChemistryModel& basicChemistry const basicChemistryModel& basicChemistry
) )
{ {
auto RRt = tmp<DimensionedField<scalar, volMesh>>::New auto tRR = volScalarField::Internal::New
(
IOobject
( (
"RR", "RR",
time_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimMass/dimVolume/dimTime, Zero) dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
); );
auto& RR = RRt.ref(); auto& RR = tRR.ref();
scalar dt = time_.deltaTValue(); scalar dt = time_.deltaTValue();

View File

@ -449,7 +449,8 @@ bool Foam::functionObjects::regionSizeDistribution::write()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobjectOption::MUST_READ, IOobjectOption::MUST_READ,
IOobjectOption::NO_WRITE IOobjectOption::NO_WRITE,
IOobjectOption::NO_REGISTER
), ),
mesh_ mesh_
) )
@ -535,18 +536,11 @@ bool Foam::functionObjects::regionSizeDistribution::write()
{ {
volScalarField region volScalarField region
( (
IOobject mesh_.newIOobject("region"),
(
"region",
mesh_.time().timeName(),
mesh_,
IOobjectOption::NO_READ,
IOobjectOption::NO_WRITE,
IOobjectOption::NO_REGISTER
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero) dimensionedScalar(dimless, Zero)
); );
Info<< " Dumping region as volScalarField to " Info<< " Dumping region as volScalarField to "
<< region.name() << endl; << region.name() << endl;

View File

@ -45,17 +45,10 @@ namespace Foam
Foam::tmp<Foam::volScalarField> Foam::resolutionIndexModel::V() const Foam::tmp<Foam::volScalarField> Foam::resolutionIndexModel::V() const
{ {
auto tV = tmp<volScalarField>::New auto tV = volScalarField::New
(
IOobject
( (
"V", "V",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_, mesh_,
dimVolume, dimVolume,
fvPatchFieldBase::zeroGradientType() fvPatchFieldBase::zeroGradientType()

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2017-2020 OpenCFD Ltd. Copyright (C) 2017-2023 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -240,7 +240,7 @@ bool Foam::functionObjects::setFlow::execute()
const volVectorField& C = mesh_.C(); const volVectorField& C = mesh_.C();
const volVectorField d const volVectorField d
( (
typeName + ":d", IOobject::scopedName(typeName, "d"),
C - dimensionedVector("origin", dimLength, origin_) C - dimensionedVector("origin", dimLength, origin_)
); );
const scalarField x(d.component(vector::X)); const scalarField x(d.component(vector::X));
@ -286,7 +286,7 @@ bool Foam::functionObjects::setFlow::execute()
const volVectorField d const volVectorField d
( (
typeName + ":d", IOobject::scopedName(typeName, "d"),
C - dimensionedVector("origin", dimLength, origin_) C - dimensionedVector("origin", dimLength, origin_)
); );
const scalarField x(d.component(vector::X)); const scalarField x(d.component(vector::X));
@ -350,7 +350,7 @@ bool Foam::functionObjects::setFlow::execute()
const volVectorField d const volVectorField d
( (
typeName + ":d", IOobject::scopedName(typeName, "d"),
C - dimensionedVector("origin", dimLength, origin_) C - dimensionedVector("origin", dimLength, origin_)
); );
const scalarField x(d.component(vector::X)); const scalarField x(d.component(vector::X));

View File

@ -321,16 +321,10 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
<< exit(FatalError); << exit(FatalError);
} }
auto tmagGradCC = tmp<volScalarField>::New auto tmagGradCC = volScalarField::New
(
IOobject
( (
"magGradCC", "magGradCC",
time_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
fvPatchFieldBase::zeroGradientType() fvPatchFieldBase::zeroGradientType()
@ -340,20 +334,16 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
for (direction i=0; i<vector::nComponents; i++) for (direction i=0; i<vector::nComponents; i++)
{ {
// Create field with zero grad // Create field with zero grad
volScalarField cci auto tcci = volScalarField::New
(
IOobject
( (
"cc" + word(vector::componentNames[i]), "cc" + word(vector::componentNames[i]),
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimLength, Zero), dimensionedScalar(dimLength, Zero),
fvPatchFieldBase::zeroGradientType() fvPatchFieldBase::zeroGradientType()
); );
auto& cci = tcci.ref();
cci = mesh_.C().component(i); cci = mesh_.C().component(i);
cci.correctBoundaryConditions(); cci.correctBoundaryConditions();
magGradCC += mag(fvc::grad(cci)).ref(); magGradCC += mag(fvc::grad(cci)).ref();
@ -394,21 +384,14 @@ bool Foam::functionObjects::stabilityBlendingFactor::init(bool first)
<< exit(FatalError); << exit(FatalError);
} }
auto CoPtr = tmp<volScalarField>::New auto CoPtr = volScalarField::New
(
IOobject
( (
"Co", "Co",
time_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero), dimensionedScalar(dimless, Zero),
fvPatchFieldBase::zeroGradientType() fvPatchFieldBase::zeroGradientType()
); );
auto& Co = CoPtr.ref(); auto& Co = CoPtr.ref();
Co.primitiveFieldRef() = Co.primitiveFieldRef() =
@ -533,17 +516,10 @@ Foam::functionObjects::stabilityBlendingFactor::stabilityBlendingFactor
read(dict); read(dict);
setResultName(typeName, ""); setResultName(typeName, "");
auto faceBlendedPtr = tmp<surfaceScalarField>::New auto faceBlendedPtr = surfaceScalarField::New
(
IOobject
( (
resultName_, resultName_,
time_.timeName(), IOobject::REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero) dimensionedScalar(dimless, Zero)
); );

View File

@ -77,9 +77,10 @@ Foam::functionObjects::turbulenceFields::nuTilda
{ {
const dimensionedScalar omega0(dimless/dimTime, SMALL); const dimensionedScalar omega0(dimless/dimTime, SMALL);
return tmp<volScalarField>::New return volScalarField::New
( (
"nuTilda.tmp", "nuTilda.tmp",
IOobject::NO_REGISTER,
model.k()/(model.omega() + omega0) model.k()/(model.omega() + omega0)
); );
} }
@ -96,9 +97,10 @@ Foam::functionObjects::turbulenceFields::L
const scalar Cmu = 0.09; const scalar Cmu = 0.09;
const dimensionedScalar eps0(sqr(dimVelocity)/dimTime, SMALL); const dimensionedScalar eps0(sqr(dimVelocity)/dimTime, SMALL);
return tmp<volScalarField>::New return volScalarField::New
( (
"L.tmp", "L.tmp",
IOobject::NO_REGISTER,
pow(Cmu, 0.75)*pow(model.k(), 1.5)/(model.epsilon() + eps0) pow(Cmu, 0.75)*pow(model.k(), 1.5)/(model.epsilon() + eps0)
); );
} }
@ -116,9 +118,10 @@ Foam::functionObjects::turbulenceFields::I
const volScalarField uPrime(sqrt((2.0/3.0)*model.k())); const volScalarField uPrime(sqrt((2.0/3.0)*model.k()));
const dimensionedScalar U0(dimVelocity, SMALL); const dimensionedScalar U0(dimVelocity, SMALL);
return tmp<volScalarField>::New return volScalarField::New
( (
"I.tmp", "I.tmp",
IOobject::NO_REGISTER,
uPrime/max(max(uPrime, mag(model.U())), U0) uPrime/max(max(uPrime, mag(model.U())), U0)
); );
} }

View File

@ -311,14 +311,10 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::forces::rho() const
{ {
if (rhoName_ == "rhoInf") if (rhoName_ == "rhoInf")
{ {
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"rho", "rho",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_
),
mesh_, mesh_,
dimensionedScalar(dimDensity, rhoRef_) dimensionedScalar(dimDensity, rhoRef_)
); );

View File

@ -182,7 +182,7 @@ Foam::functionObjects::hydrostaticPressure::hydrostaticPressure
if (read(dict)) if (read(dict))
{ {
// Read and store the initial ph_rgh field // Read and store the initial ph_rgh field
volScalarField* ph_rghPtr = volScalarField* ptr =
new volScalarField new volScalarField
( (
IOobject IOobject
@ -197,7 +197,7 @@ Foam::functionObjects::hydrostaticPressure::hydrostaticPressure
mesh_ mesh_
); );
regIOobject::store(ph_rghPtr); regIOobject::store(ptr);
bool reInitialise = dict.getOrDefault("reInitialise", false); bool reInitialise = dict.getOrDefault("reInitialise", false);

View File

@ -243,7 +243,7 @@ Foam::functionObjects::sizeDistribution::filterField
const scalarField& field const scalarField& field
) const ) const
{ {
return tmp<scalarField>(new scalarField(field, cellId_)); return tmp<scalarField>::New(field, cellId_);
} }

View File

@ -78,12 +78,7 @@ Foam::functionObjects::electricPotential::sigma() const
{ {
const IOobject sigmaIO const IOobject sigmaIO
( (
IOobject::scopedName(typeName, "sigma"), mesh_.thisDb().newIOobject(IOobject::scopedName(typeName, "sigma"))
mesh_.time().timeName(),
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
); );
if (phases_.size()) if (phases_.size())
@ -125,12 +120,7 @@ Foam::functionObjects::electricPotential::epsilonm() const
const IOobject epsilonrIO const IOobject epsilonrIO
( (
IOobject::scopedName(typeName, "epsilonr"), mesh_.thisDb().newIOobject(IOobject::scopedName(typeName, "epsilonr"))
mesh_.time().timeName(),
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
); );
if (phases_.size()) if (phases_.size())
@ -409,17 +399,10 @@ bool Foam::functionObjects::electricPotential::write()
// Write the current density field // Write the current density field
tmp<volScalarField> tsigma = this->sigma(); tmp<volScalarField> tsigma = this->sigma();
auto eJ = tmp<volVectorField>::New auto eJ = volVectorField::New
(
IOobject
( (
IOobject::scopedName(typeName, "J"), IOobject::scopedName(typeName, "J"),
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
-tsigma*fvc::grad(eV), -tsigma*fvc::grad(eV),
fvPatchFieldBase::calculatedType() fvPatchFieldBase::calculatedType()
); );
@ -432,17 +415,10 @@ bool Foam::functionObjects::electricPotential::write()
// Write the free-charge density field // Write the free-charge density field
tmp<volScalarField> tepsilonm = this->epsilonm(); tmp<volScalarField> tepsilonm = this->epsilonm();
auto erho = tmp<volScalarField>::New auto erho = volScalarField::New
(
IOobject
( (
IOobject::scopedName(typeName, "rho"), IOobject::scopedName(typeName, "rho"),
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
fvc::div(tepsilonm*(-fvc::grad(eV))), fvc::div(tepsilonm*(-fvc::grad(eV))),
fvPatchFieldBase::calculatedType() fvPatchFieldBase::calculatedType()
); );

View File

@ -93,9 +93,10 @@ Foam::functionObjects::energyTransport::kappaEff() const
if (turbPtr) if (turbPtr)
{ {
return tmp<volScalarField> return volScalarField::New
( (
new volScalarField "kappaEff",
IOobject::NO_REGISTER,
( (
kappa() + Cp()*turbPtr->nut()*rho()/Prt_ kappa() + Cp()*turbPtr->nut()*rho()/Prt_
) )
@ -113,17 +114,10 @@ Foam::functionObjects::energyTransport::kappaEff() const
Foam::tmp<Foam::volScalarField> Foam::tmp<Foam::volScalarField>
Foam::functionObjects::energyTransport::rho() const Foam::functionObjects::energyTransport::rho() const
{ {
auto trho = tmp<volScalarField>::New auto trho = volScalarField::New
(
IOobject
( (
"trho", "trho",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_, mesh_,
rho_ rho_
); );
@ -150,17 +144,10 @@ Foam::functionObjects::energyTransport::Cp() const
return tCp; return tCp;
} }
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"tCp", "tCp",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_, mesh_,
Cp_ Cp_
); );
@ -181,22 +168,16 @@ Foam::functionObjects::energyTransport::kappa() const
return tkappa; return tkappa;
} }
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"tkappa", "tkappa",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_, mesh_,
kappa_ kappa_
); );
} }
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::energyTransport::energyTransport Foam::functionObjects::energyTransport::energyTransport
@ -404,16 +385,10 @@ bool Foam::functionObjects::energyTransport::execute()
const surfaceScalarField CpPhi(rhoCp*phi); const surfaceScalarField CpPhi(rhoCp*phi);
auto trhoCp = tmp<volScalarField>::New auto trhoCp = volScalarField::New
(
IOobject
( (
"trhoCp", "trhoCp",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
rhoCp rhoCp
); );

View File

@ -96,16 +96,10 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
if (constantD_) if (constantD_)
{ {
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
Dname, Dname,
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(Dname, phi.dimensions()/dimLength, D_) dimensionedScalar(Dname, phi.dimensions()/dimLength, D_)
); );
@ -129,9 +123,10 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
if (turb) if (turb)
{ {
return tmp<volScalarField>::New return volScalarField::New
( (
Dname, Dname,
IOobject::NO_REGISTER,
alphaD_ * turb->nu() + alphaDt_ * turb->nut() alphaD_ * turb->nu() + alphaDt_ * turb->nut()
); );
} }
@ -147,25 +142,20 @@ Foam::tmp<Foam::volScalarField> Foam::functionObjects::scalarTransport::D
if (turb) if (turb)
{ {
return tmp<volScalarField>::New return volScalarField::New
( (
Dname, Dname,
IOobject::NO_REGISTER,
alphaD_ * turb->mu() + alphaDt_ * turb->mut() alphaD_ * turb->mu() + alphaDt_ * turb->mut()
); );
} }
} }
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
Dname, Dname,
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_.time(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(phi.dimensions()/dimLength, Zero) dimensionedScalar(phi.dimensions()/dimLength, Zero)
); );