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

- thermophysicalModels, transportModels
This commit is contained in:
Mark Olesen 2024-01-23 10:30:43 +01:00
parent 71d4a23ec0
commit 51f150d84c
45 changed files with 508 additions and 1140 deletions

View File

@ -253,11 +253,9 @@ baffleThickness() const
nbrPatch.template lookupPatchField<volScalarField>(TName_)
);
tmp<scalarField> tthickness
(
new scalarField(nbrField.baffleThickness())
);
scalarField& thickness = tthickness.ref();
auto tthickness = tmp<scalarField>::New(nbrField.baffleThickness());
auto& thickness = tthickness.ref();
mapDist.distribute(thickness);
return tthickness;
}
@ -284,8 +282,9 @@ tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs() const
nbrPatch.template lookupPatchField<volScalarField>(TName_)
);
tmp<scalarField> tqs(new scalarField(nbrField.qs()));
scalarField& qs = tqs.ref();
auto tqs = tmp<scalarField>::New(nbrField.qs());
auto& qs = tqs.ref();
mapDist.distribute(qs);
return tqs;
}

View File

@ -433,20 +433,8 @@ turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::coeffs
<< "which has more functionalities and it can handle "
<< "the assemble coupled option for energy. "
<< abort(FatalError);
/*
const label index(this->patch().index());
const label nSubFaces(matrix.lduMesh().cellBoundMap()[mat][index].size());
Field<scalar> mapCoeffs(nSubFaces, Zero);
label subFaceI = 0;
forAll(*this, faceI)
{
}
*/
return tmp<Field<scalar>>(new Field<scalar>());
return nullptr;
}

View File

@ -804,7 +804,7 @@ tmp<Field<scalar>> turbulentTemperatureRadCoupledMixedFvPatchScalarField::coeffs
<< "the assemble coupled option for energy. "
<< abort(FatalError);
return tmp<Field<scalar>>(new Field<scalar>());
return nullptr;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2021 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -285,8 +285,9 @@ Foam::basicThermo::basicThermo
phasePropertyName(dictName, phaseName),
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
IOobject::READ_MODIFIED,
IOobject::NO_WRITE,
IOobject::REGISTER
)
),
@ -303,11 +304,12 @@ Foam::basicThermo::basicThermo
(
IOobject
(
phasePropertyName("thermo:alpha"),
phaseScopedName("thermo", "alpha"),
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), Zero)
@ -332,7 +334,8 @@ Foam::basicThermo::basicThermo
mesh.time().constant(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
dict
),
@ -350,11 +353,12 @@ Foam::basicThermo::basicThermo
(
IOobject
(
phasePropertyName("thermo:alpha"),
phaseScopedName("thermo", "alpha"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), Zero)
@ -378,8 +382,9 @@ Foam::basicThermo::basicThermo
dictionaryName,
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
IOobject::READ_MODIFIED,
IOobject::NO_WRITE,
IOobject::REGISTER
)
),
@ -396,11 +401,12 @@ Foam::basicThermo::basicThermo
(
IOobject
(
phasePropertyName("thermo:alpha"),
phaseScopedName("thermo", "alpha"),
mesh.time().timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionedScalar(dimensionSet(1, -1, -1, 0, 0), Zero)

View File

@ -218,25 +218,15 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::he
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> the
auto the = volScalarField::New
(
new volScalarField
(
IOobject
(
"he",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
he_.dimensions()
)
"he",
IOobject::NO_REGISTER,
mesh,
he_.dimensions()
);
auto& he = the.ref();
volScalarField& he = the.ref();
scalarField& heCells = he.primitiveFieldRef();
const scalarField& pCells = p;
const scalarField& TCells = T;
@ -274,8 +264,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
const labelList& cells
) const
{
tmp<scalarField> the(new scalarField(T.size()));
scalarField& he = the.ref();
auto the = tmp<scalarField>::New(T.size());
auto& he = the.ref();
forAll(T, celli)
{
@ -294,8 +284,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::he
const label patchi
) const
{
tmp<scalarField> the(new scalarField(T.size()));
scalarField& he = the.ref();
auto the = tmp<scalarField>::New(T.size());
auto& he = the.ref();
forAll(T, facei)
{
@ -313,25 +303,15 @@ Foam::heThermo<BasicThermo, MixtureType>::hc() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> thc
auto thc = volScalarField::New
(
new volScalarField
(
IOobject
(
"hc",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
he_.dimensions()
)
"hc",
IOobject::NO_REGISTER,
mesh,
he_.dimensions()
);
auto& hcf = thc.ref();
volScalarField& hcf = thc.ref();
scalarField& hcCells = hcf.primitiveFieldRef();
forAll(hcCells, celli)
@ -363,8 +343,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cp
const label patchi
) const
{
tmp<scalarField> tCp(new scalarField(T.size()));
scalarField& cp = tCp.ref();
auto tCp = tmp<scalarField>::New(T.size());
auto& cp = tCp.ref();
forAll(T, facei)
{
@ -404,25 +384,14 @@ Foam::heThermo<BasicThermo, MixtureType>::Cp() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> tCp
auto tCp = volScalarField::New
(
new volScalarField
(
IOobject
(
"Cp",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimEnergy/dimMass/dimTemperature
)
"Cp",
IOobject::NO_REGISTER,
mesh,
dimEnergy/dimMass/dimTemperature
);
volScalarField& cp = tCp.ref();
auto& cp = tCp.ref();
forAll(this->T_, celli)
{
@ -458,8 +427,8 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv
const label patchi
) const
{
tmp<scalarField> tCv(new scalarField(T.size()));
scalarField& cv = tCv.ref();
auto tCv = tmp<scalarField>::New(T.size());
auto& cv = tCv.ref();
forAll(T, facei)
{
@ -499,25 +468,14 @@ Foam::heThermo<BasicThermo, MixtureType>::Cv() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> tCv
auto tCv = volScalarField::New
(
new volScalarField
(
IOobject
(
"Cv",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimEnergy/dimMass/dimTemperature
)
"Cv",
IOobject::NO_REGISTER,
mesh,
dimEnergy/dimMass/dimTemperature
);
volScalarField& cv = tCv.ref();
auto& cv = tCv.ref();
forAll(this->T_, celli)
{
@ -549,8 +507,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::gamma
const label patchi
) const
{
tmp<scalarField> tgamma(new scalarField(T.size()));
scalarField& gamma = tgamma.ref();
auto tgamma = tmp<scalarField>::New(T.size());
auto& gamma = tgamma.ref();
forAll(T, facei)
{
@ -568,25 +526,14 @@ Foam::heThermo<BasicThermo, MixtureType>::gamma() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> tgamma
auto tgamma = volScalarField::New
(
new volScalarField
(
IOobject
(
"gamma",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimless
)
"gamma",
IOobject::NO_REGISTER,
mesh,
dimless
);
volScalarField& gamma = tgamma.ref();
auto& gamma = tgamma.ref();
forAll(this->T_, celli)
{
@ -624,8 +571,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::Cpv
const label patchi
) const
{
tmp<scalarField> tCpv(new scalarField(T.size()));
scalarField& Cpv = tCpv.ref();
auto tCpv = tmp<scalarField>::New(T.size());
auto& Cpv = tCpv.ref();
forAll(T, facei)
{
@ -643,25 +590,14 @@ Foam::heThermo<BasicThermo, MixtureType>::Cpv() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> tCpv
auto tCpv = volScalarField::New
(
new volScalarField
(
IOobject
(
"Cpv",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimEnergy/dimMass/dimTemperature
)
"Cpv",
IOobject::NO_REGISTER,
mesh,
dimEnergy/dimMass/dimTemperature
);
volScalarField& Cpv = tCpv.ref();
auto& Cpv = tCpv.ref();
forAll(this->T_, celli)
{
@ -696,8 +632,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::CpByCpv
const label patchi
) const
{
tmp<scalarField> tCpByCpv(new scalarField(T.size()));
scalarField& CpByCpv = tCpByCpv.ref();
auto tCpByCpv = tmp<scalarField>::New(T.size());
auto& CpByCpv = tCpByCpv.ref();
forAll(T, facei)
{
@ -715,25 +651,14 @@ Foam::heThermo<BasicThermo, MixtureType>::CpByCpv() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> tCpByCpv
auto tCpByCpv = volScalarField::New
(
new volScalarField
(
IOobject
(
"CpByCpv",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimless
)
"CpByCpv",
IOobject::NO_REGISTER,
mesh,
dimless
);
volScalarField& CpByCpv = tCpByCpv.ref();
auto& CpByCpv = tCpByCpv.ref();
forAll(this->T_, celli)
{
@ -776,8 +701,8 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
const labelList& cells
) const
{
tmp<scalarField> tT(new scalarField(h.size()));
scalarField& T = tT.ref();
auto tT = tmp<scalarField>::New(h.size());
auto& T = tT.ref();
forAll(h, celli)
{
@ -799,8 +724,9 @@ Foam::tmp<Foam::scalarField> Foam::heThermo<BasicThermo, MixtureType>::THE
) const
{
tmp<scalarField> tT(new scalarField(h.size()));
scalarField& T = tT.ref();
auto tT = tmp<scalarField>::New(h.size());
auto& T = tT.ref();
forAll(h, facei)
{
T[facei] = this->patchFaceMixture
@ -821,25 +747,15 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::W
{
const fvMesh& mesh = this->T_.mesh();
tmp<volScalarField> tW
auto tW = volScalarField::New
(
new volScalarField
(
IOobject
(
"W",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh,
dimMass/dimMoles
)
"W",
IOobject::NO_REGISTER,
mesh,
dimMass/dimMoles
);
auto& W = tW.ref();
volScalarField& W = tW.ref();
scalarField& WCells = W.primitiveFieldRef();
forAll(WCells, celli)
@ -847,7 +763,7 @@ Foam::tmp<Foam::volScalarField> Foam::heThermo<BasicThermo, MixtureType>::W
WCells[celli] = this->cellMixture(celli).W();
}
volScalarField::Boundary& WBf = W.boundaryFieldRef();
auto& WBf = W.boundaryFieldRef();
forAll(WBf, patchi)
{

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -48,11 +48,12 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName)
(
IOobject
(
phasePropertyName("thermo:psi"),
phaseScopedName("thermo", "psi"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(0, -2, 2, 0, 0)
@ -62,11 +63,12 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName)
(
IOobject
(
phasePropertyName("thermo:mu"),
phaseScopedName("thermo", "mu"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(1, -1, -1, 0, 0)
@ -87,11 +89,12 @@ Foam::psiThermo::psiThermo
(
IOobject
(
phasePropertyName("thermo:psi"),
phaseScopedName("thermo", "psi"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(0, -2, 2, 0, 0)
@ -101,11 +104,12 @@ Foam::psiThermo::psiThermo
(
IOobject
(
phasePropertyName("thermo:mu"),
phaseScopedName("thermo", "mu"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(1, -1, -1, 0, 0)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -47,11 +47,12 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName)
(
IOobject
(
phasePropertyName("thermo:rho"),
phaseScopedName("thermo", "rho"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimDensity
@ -61,11 +62,12 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName)
(
IOobject
(
phasePropertyName("thermo:psi"),
phaseScopedName("thermo", "psi"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(0, -2, 2, 0, 0)
@ -75,11 +77,12 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName)
(
IOobject
(
phasePropertyName("thermo:mu"),
phaseScopedName("thermo", "mu"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(1, -1, -1, 0, 0)
@ -99,11 +102,12 @@ Foam::rhoThermo::rhoThermo
(
IOobject
(
phasePropertyName("thermo:rho"),
phaseScopedName("thermo", "rho"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimDensity
@ -113,11 +117,12 @@ Foam::rhoThermo::rhoThermo
(
IOobject
(
phasePropertyName("thermo:psi"),
phaseScopedName("thermo", "psi"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(0, -2, 2, 0, 0)
@ -127,11 +132,12 @@ Foam::rhoThermo::rhoThermo
(
IOobject
(
phasePropertyName("thermo:mu"),
phaseScopedName("thermo", "mu"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(1, -1, -1, 0, 0)
@ -151,11 +157,12 @@ Foam::rhoThermo::rhoThermo
(
IOobject
(
phasePropertyName("thermo:rho"),
phaseScopedName("thermo", "rho"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimDensity
@ -165,11 +172,12 @@ Foam::rhoThermo::rhoThermo
(
IOobject
(
phasePropertyName("thermo:psi"),
phaseScopedName("thermo", "psi"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(0, -2, 2, 0, 0)
@ -179,11 +187,12 @@ Foam::rhoThermo::rhoThermo
(
IOobject
(
phasePropertyName("thermo:mu"),
phaseScopedName("thermo", "mu"),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::REGISTER
),
mesh,
dimensionSet(1, -1, -1, 0, 0)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020-2021,2023 OpenCFD Ltd.
Copyright (C) 2020-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -470,25 +470,14 @@ template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::tc() const
{
tmp<volScalarField> ttc
auto ttc = volScalarField::New
(
new volScalarField
(
IOobject
(
"tc",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->mesh(),
dimensionedScalar(word::null, dimTime, SMALL),
fvPatchFieldBase::extrapolatedCalculatedType()
)
"tc",
IOobject::NO_REGISTER,
this->mesh(),
dimensionedScalar(word::null, dimTime, SMALL),
fvPatchFieldBase::extrapolatedCalculatedType()
);
scalarField& tc = ttc.ref();
tmp<volScalarField> trho(this->thermo().rho());
@ -544,22 +533,12 @@ template<class ReactionThermo, class ThermoType>
Foam::tmp<Foam::volScalarField>
Foam::StandardChemistryModel<ReactionThermo, ThermoType>::Qdot() const
{
tmp<volScalarField> tQdot
auto tQdot = volScalarField::New
(
new volScalarField
(
IOobject
(
"Qdot",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->mesh_,
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
)
"Qdot",
IOobject::NO_REGISTER,
this->mesh_,
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
);
if (this->chemistry_)
@ -592,24 +571,14 @@ Foam::StandardChemistryModel<ReactionThermo, ThermoType>::calculateRR
scalar pf, cf, pr, cr;
label lRef, rRef;
tmp<volScalarField::Internal> tRR
auto tRR = volScalarField::Internal::New
(
new volScalarField::Internal
(
IOobject
(
"RR",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
)
"RR",
IOobject::NO_REGISTER,
this->mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
);
volScalarField::Internal& RR = tRR.ref();
auto& RR = tRR.ref();
tmp<volScalarField> trho(this->thermo().rho());
const scalarField& rho = trho();

View File

@ -112,25 +112,14 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulders::Su0pTphi
scalar phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{
@ -165,25 +154,14 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::Gulders::Su0pTphi
const volScalarField& phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{

View File

@ -112,25 +112,14 @@ Foam::laminarFlameSpeedModels::GuldersEGR::Su0pTphi
scalar phi
) const
{
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{
@ -167,25 +156,14 @@ Foam::laminarFlameSpeedModels::GuldersEGR::Su0pTphi
const volScalarField& egr
) const
{
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{

View File

@ -295,15 +295,7 @@ Foam::laminarFlameSpeedModels::RaviPetersen::operator()() const
volScalarField EqR
(
IOobject
(
"EqR",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p.db().newIOobject("EqR"),
p.mesh(),
dimensionedScalar(dimless, Zero)
);
@ -323,25 +315,14 @@ Foam::laminarFlameSpeedModels::RaviPetersen::operator()() const
EqR = equivalenceRatio_;
}
tmp<volScalarField> tSu0
auto tSu0 = volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
)
"Su0",
IOobject::NO_REGISTER,
p.mesh(),
dimensionedScalar(dimVelocity, Zero)
);
volScalarField& Su0 = tSu0.ref();
auto& Su0 = tSu0.ref();
forAll(Su0, celli)
{

View File

@ -71,22 +71,12 @@ Foam::laminarFlameSpeedModels::constant::~constant()
Foam::tmp<Foam::volScalarField>
Foam::laminarFlameSpeedModels::constant::operator()() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"Su0",
psiuReactionThermo_.T().time().timeName(),
psiuReactionThermo_.T().db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
psiuReactionThermo_.T().mesh(),
Su_
)
"Su0",
IOobject::NO_REGISTER,
psiuReactionThermo_.T().mesh(),
Su_
);
}

View File

@ -158,7 +158,7 @@ updateCoeffs()
Foam::tmp<Foam::scalarField> Foam::radiation::
greyDiffusiveViewFactorFixedValueFvPatchScalarField::qro(label bandI) const
{
tmp<scalarField> tqrt(new scalarField(qro_));
auto tqrt = tmp<scalarField>::New(qro_);
const viewFactor& radiation =
db().lookupObject<viewFactor>("radiationProperties");

View File

@ -215,18 +215,13 @@ void Foam::radiation::P1::calculate()
const dimensionedScalar a0("a0", a_.dimensions(), ROOTVSMALL);
// Construct diffusion
const volScalarField gamma
const auto tgamma = volScalarField::New
(
IOobject
(
"gammaRad",
G_.mesh().time().timeName(),
G_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"gammaRad",
IOobject::REGISTER, // used by boundary conditions
1.0/(3.0*a_ + sigmaEff + a0)
);
const auto& gamma = tgamma();
// Solve G transport equation
solve
@ -254,21 +249,11 @@ void Foam::radiation::P1::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::P1::Rp() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"Rp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
4.0*absorptionEmission_->eCont()*physicoChemical::sigma
)
"Rp",
IOobject::NO_REGISTER,
4.0*absorptionEmission_->eCont()*physicoChemical::sigma
);
}

View File

@ -201,21 +201,12 @@ Foam::radiation::blackBodyEmission::deltaLambdaT
const Vector2D<scalar>& band
) const
{
tmp<volScalarField> deltaLambdaT
auto deltaLambdaT = volScalarField::New
(
new volScalarField
(
IOobject
(
"deltaLambdaT",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
T.mesh(),
dimensionedScalar("deltaLambdaT", dimless, 1.0)
)
"deltaLambdaT",
IOobject::NO_REGISTER,
T.mesh(),
dimensionedScalar("deltaLambdaT", dimless, 1.0)
);
if (band != Vector2D<scalar>::one)
@ -239,20 +230,11 @@ Foam::radiation::blackBodyEmission::EbDeltaLambdaT
const Vector2D<scalar>& band
) const
{
tmp<volScalarField> Eb
auto Eb = volScalarField::New
(
new volScalarField
(
IOobject
(
"Eb",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
physicoChemical::sigma*pow4(T)
)
"Eb",
IOobject::NO_REGISTER,
physicoChemical::sigma*pow4(T)
);
if (band != Vector2D<scalar>::one)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2019-2021 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -356,7 +356,8 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -369,7 +370,8 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
mesh_.time().timeName(),
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -395,7 +397,8 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
mesh_.time().timeName(),
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -462,7 +465,8 @@ Foam::radiation::fvDOM::fvDOM
mesh_.time().timeName(),
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -475,7 +479,8 @@ Foam::radiation::fvDOM::fvDOM
mesh_.time().timeName(),
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -501,7 +506,8 @@ Foam::radiation::fvDOM::fvDOM
mesh_.time().timeName(),
mesh_,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -645,29 +651,18 @@ void Foam::radiation::fvDOM::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::fvDOM::Rp() const
{
// Construct using contribution from first frequency band
tmp<volScalarField> tRp
auto tRp = volScalarField::New
(
new volScalarField
"Rp",
IOobject::NO_REGISTER,
(
IOobject
(
"Rp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
(
4
*physicoChemical::sigma
*(aLambda_[0] - absorptionEmission_->aDisp(0)())
*blackBody_.deltaLambdaT(T_, absorptionEmission_->bands(0))
)
4
* physicoChemical::sigma
* (aLambda_[0] - absorptionEmission_->aDisp(0)())
* blackBody_.deltaLambdaT(T_, absorptionEmission_->bands(0))
)
);
volScalarField& Rp=tRp.ref();
auto& Rp = tRp.ref();
// Add contributions over remaining frequency bands
for (label j=1; j < nLambda_; j++)
@ -688,25 +683,14 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::fvDOM::Rp() const
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::fvDOM::Ru() const
{
tmp<DimensionedField<scalar, volMesh>> tRu
auto tRu = DimensionedField<scalar, volMesh>::New
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
"Ru",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimensionSet(1, -1, -3, 0, 0), Zero)
)
"Ru",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimensionSet(1, -1, -3, 0, 0), Zero)
);
DimensionedField<scalar, volMesh>& Ru=tRu.ref();
auto& Ru = tRu.ref();
// Sum contributions over all frequency bands
for (label j=0; j < nLambda_; j++)

View File

@ -82,16 +82,10 @@ void Foam::radiation::noRadiation::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::noRadiation::Rp() const
{
return tmp<volScalarField>::New
return volScalarField::New
(
IOobject
(
"Rp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Rp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar
(
@ -104,16 +98,10 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::noRadiation::Rp() const
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::noRadiation::Ru() const
{
return tmp<volScalarField::Internal>::New
return volScalarField::Internal::New
(
IOobject
(
"Ru",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Ru",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);

View File

@ -83,16 +83,10 @@ void Foam::radiation::opaqueSolid::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::opaqueSolid::Rp() const
{
return tmp<volScalarField>::New
return volScalarField::New
(
IOobject
(
"Rp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Rp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar
(
@ -105,16 +99,10 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::opaqueSolid::Rp() const
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::opaqueSolid::Ru() const
{
return tmp<volScalarField::Internal>::New
return volScalarField::Internal::New
(
IOobject
(
"Ru",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Ru",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
@ -126,4 +114,5 @@ Foam::label Foam::radiation::opaqueSolid::nBands() const
return absorptionEmission_->nBands();
}
// ************************************************************************* //

View File

@ -58,7 +58,8 @@ void Foam::faceReflecting::initialise(const dictionary& coeffs)
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh_,
dimensionedScalar(dimMass/pow3(dimTime), Zero)
@ -393,17 +394,8 @@ void Foam::faceReflecting::calculate()
PtrList<List<scalarField>> patcha(patches.size());
forAll(patchr, patchi)
{
patchr.set
(
patchi,
new List<scalarField>(nBands)
);
patcha.set
(
patchi,
new List<scalarField>(nBands)
);
patchr.emplace_set(patchi, nBands);
patcha.emplace_set(patchi, nBands);
}
// Fill patchr

View File

@ -214,22 +214,15 @@ void Foam::faceShading::calculate()
if (debug)
{
auto thitFaces = tmp<surfaceScalarField>::New
auto thitFaces = surfaceScalarField::New
(
IOobject
(
"hitFaces",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
"hitFaces",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimless, Zero)
);
auto& hitFaces = thitFaces.ref();
surfaceScalarField& hitFaces = thitFaces.ref();
surfaceScalarField::Boundary& hitFacesBf = hitFaces.boundaryFieldRef();
hitFacesBf = 0.0;

View File

@ -911,17 +911,10 @@ void Foam::radiation::solarLoad::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::solarLoad::Rp() const
{
return tmp<volScalarField>::New
return volScalarField::New
(
IOobject
(
"Rp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
"Rp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar
(

View File

@ -1133,17 +1133,10 @@ void Foam::radiation::viewFactor::calculate()
Foam::tmp<Foam::volScalarField> Foam::radiation::viewFactor::Rp() const
{
return tmp<volScalarField>::New
return volScalarField::New
(
IOobject
(
"Rp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
"Rp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar
(
@ -1156,17 +1149,10 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::viewFactor::Rp() const
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::viewFactor::Ru() const
{
return tmp<DimensionedField<scalar, volMesh>>::New
return DimensionedField<scalar, volMesh>::New
(
IOobject
(
"Ru",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
"Ru",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);

View File

@ -69,22 +69,12 @@ Foam::radiation::absorptionEmissionModel::a(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::absorptionEmissionModel::aCont(const label bandI) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"aCont",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
)
"aCont",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
);
}
@ -92,22 +82,12 @@ Foam::radiation::absorptionEmissionModel::aCont(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::absorptionEmissionModel::aDisp(const label bandI) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"aDisp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
)
"aDisp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
);
}
@ -122,22 +102,12 @@ Foam::radiation::absorptionEmissionModel::e(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::absorptionEmissionModel::eCont(const label bandI) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"eCont",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
)
"eCont",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
);
}
@ -145,22 +115,12 @@ Foam::radiation::absorptionEmissionModel::eCont(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::absorptionEmissionModel::eDisp(const label bandI) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"eDisp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
)
"eDisp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
);
}
@ -175,22 +135,12 @@ Foam::radiation::absorptionEmissionModel::E(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::absorptionEmissionModel::ECont(const label bandI) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"ECont",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"ECont",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
}
@ -198,22 +148,12 @@ Foam::radiation::absorptionEmissionModel::ECont(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::absorptionEmissionModel::EDisp(const label bandI) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"EDisp",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"EDisp",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
}

View File

@ -67,75 +67,39 @@ Foam::radiation::constantAbsorptionEmission::constantAbsorptionEmission
Foam::tmp<Foam::volScalarField>
Foam::radiation::constantAbsorptionEmission::aCont(const label bandI) const
{
tmp<volScalarField> ta
return volScalarField::New
(
new volScalarField
(
IOobject
(
"a",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
a_
)
"a",
IOobject::NO_REGISTER,
mesh_,
a_
);
return ta;
}
Foam::tmp<Foam::volScalarField>
Foam::radiation::constantAbsorptionEmission::eCont(const label bandI) const
{
tmp<volScalarField> te
return volScalarField::New
(
new volScalarField
(
IOobject
(
"e",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
e_
)
"e",
IOobject::NO_REGISTER,
mesh_,
e_
);
return te;
}
Foam::tmp<Foam::volScalarField>
Foam::radiation::constantAbsorptionEmission::ECont(const label bandI) const
{
tmp<volScalarField> tE
return volScalarField::New
(
new volScalarField
(
IOobject
(
"E",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
E_
)
"E",
IOobject::NO_REGISTER,
mesh_,
E_
);
return tE;
}

View File

@ -194,25 +194,15 @@ Foam::radiation::greyMeanAbsorptionEmission::aCont(const label bandI) const
const volScalarField& p = thermo_.p();
tmp<volScalarField> ta
auto ta = volScalarField::New
(
new volScalarField
(
IOobject
(
"aCont" + name(bandI),
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar(dimless/dimLength, Zero),
fvPatchFieldBase::extrapolatedCalculatedType()
)
"aCont" + name(bandI),
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar(dimless/dimLength, Zero),
fvPatchFieldBase::extrapolatedCalculatedType()
);
scalarField& a = ta.ref().primitiveFieldRef();
auto& a = ta.ref().primitiveFieldRef();
forAll(a, celli)
{
@ -275,21 +265,12 @@ Foam::radiation::greyMeanAbsorptionEmission::eCont(const label bandI) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::greyMeanAbsorptionEmission::ECont(const label bandI) const
{
tmp<volScalarField> E
auto E = volScalarField::New
(
new volScalarField
(
IOobject
(
"ECont" + name(bandI),
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"ECont" + name(bandI),
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
const volScalarField* QdotPtr = mesh_.findObject<volScalarField>("Qdot");

View File

@ -56,11 +56,11 @@ greyMeanSolidAbsorptionEmission::X(const word specie) const
const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p();
tmp<scalarField> tXj(new scalarField(T.primitiveField().size(), Zero));
scalarField& Xj = tXj.ref();
auto tXj = tmp<scalarField>::New(T.primitiveField().size(), Zero);
auto& Xj = tXj.ref();
tmp<scalarField> tRhoInv(new scalarField(T.primitiveField().size(), Zero));
scalarField& rhoInv = tRhoInv.ref();
auto tRhoInv = tmp<scalarField>::New(T.primitiveField().size(), Zero);
auto& rhoInv = tRhoInv.ref();
forAll(mixture_.Y(), specieI)
{
@ -142,25 +142,15 @@ Foam::tmp<Foam::volScalarField>
Foam::radiation::greyMeanSolidAbsorptionEmission::
calc(const label propertyId) const
{
tmp<volScalarField> ta
auto ta = volScalarField::New
(
new volScalarField
(
IOobject
(
"a",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar(dimless/dimLength, Zero),
fvPatchFieldBase::extrapolatedCalculatedType()
)
"a",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar(dimless/dimLength, Zero),
fvPatchFieldBase::extrapolatedCalculatedType()
);
scalarField& a = ta.ref().primitiveFieldRef();
auto& a = ta.ref().primitiveFieldRef();
forAllConstIters(speciesNames_, iter)
{
@ -194,4 +184,5 @@ Foam::radiation::greyMeanSolidAbsorptionEmission::aCont
return calc(absorptivity);
}
// ************************************************************************* //

View File

@ -81,24 +81,13 @@ Foam::radiation::multiBandAbsorptionEmission::aCont
const label bandI
) const
{
tmp<volScalarField> ta
return volScalarField::New
(
new volScalarField
(
IOobject
(
"a",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("a", dimless/dimLength, absCoeffs_[bandI])
)
"a",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar("a", dimless/dimLength, absCoeffs_[bandI])
);
return ta;
}
@ -108,24 +97,13 @@ Foam::radiation::multiBandAbsorptionEmission::eCont
const label bandI
) const
{
tmp<volScalarField> te
return volScalarField::New
(
new volScalarField
(
IOobject
(
"e",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("e", dimless/dimLength, emiCoeffs_[bandI])
)
"e",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar("e", dimless/dimLength, emiCoeffs_[bandI])
);
return te;
}
@ -135,24 +113,13 @@ Foam::radiation::multiBandAbsorptionEmission::ECont
const label bandI
) const
{
tmp<volScalarField> E
return volScalarField::New
(
new volScalarField
(
IOobject
(
"E",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"E",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
return E;
}

View File

@ -108,23 +108,13 @@ Foam::radiation::multiBandZoneAbsorptionEmission::aCont
const label bandI
) const
{
tmp<volScalarField> ta
auto ta = volScalarField::New
(
new volScalarField
(
IOobject
(
"a",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("a", dimless/dimLength, absCoeffs_[bandI])
)
"a",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar("a", dimless/dimLength, absCoeffs_[bandI])
);
scalarField& a = ta.ref().primitiveFieldRef();
for (const label zonei : zoneIds_)
@ -150,23 +140,13 @@ Foam::radiation::multiBandZoneAbsorptionEmission::eCont
const label bandI
) const
{
tmp<volScalarField> te
auto te = volScalarField::New
(
new volScalarField
(
IOobject
(
"e",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar("e", dimless/dimLength, emiCoeffs_[bandI])
)
"e",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar("e", dimless/dimLength, emiCoeffs_[bandI])
);
scalarField& e = te.ref().primitiveFieldRef();
for (const label zonei : zoneIds_)
@ -192,24 +172,13 @@ Foam::radiation::multiBandZoneAbsorptionEmission::ECont
const label bandI
) const
{
tmp<volScalarField> E
return volScalarField::New
(
new volScalarField
(
IOobject
(
"E",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"E",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
return E;
}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -206,23 +206,13 @@ Foam::radiation::wideBandAbsorptionEmission::aCont(const label bandi) const
const volScalarField& T = thermo_.T();
const volScalarField& p = thermo_.p();
tmp<volScalarField> ta
auto ta = volScalarField::New
(
new volScalarField
(
IOobject
(
"a",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar(dimless/dimLength, Zero)
)
"a",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar(dimless/dimLength, Zero)
);
scalarField& a = ta.ref().primitiveFieldRef();
forAll(a, celli)
@ -290,21 +280,12 @@ Foam::radiation::wideBandAbsorptionEmission::eCont(const label bandi) const
Foam::tmp<Foam::volScalarField>
Foam::radiation::wideBandAbsorptionEmission::ECont(const label bandi) const
{
tmp<volScalarField> E
auto E = volScalarField::New
(
new volScalarField
(
IOobject
(
"E",
mesh().time().timeName(),
mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
)
"E",
IOobject::NO_REGISTER,
mesh(),
dimensionedScalar(dimMass/dimLength/pow3(dimTime), Zero)
);
const volScalarField* QdotPtr = mesh().findObject<volScalarField>("Qdot");

View File

@ -209,7 +209,7 @@ Foam::radiation::boundaryRadiationProperties::emissivity
<< "Please add it"
<< exit(FatalError);
return tmp<scalarField>::New();
return nullptr;
}
@ -262,13 +262,13 @@ Foam::radiation::boundaryRadiationProperties::absorptivity
);
}
FatalErrorInFunction
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
<< " is not found in the boundaryRadiationProperties. "
<< "Please add it"
<< exit(FatalError);
FatalErrorInFunction
<< "Patch : " << mesh().boundaryMesh()[patchi].name()
<< " is not found in the boundaryRadiationProperties. "
<< "Please add it"
<< exit(FatalError);
return tmp<scalarField>::New();
return nullptr;
}
@ -327,7 +327,7 @@ Foam::radiation::boundaryRadiationProperties::transmissivity
<< "Please add it"
<< exit(FatalError);
return tmp<scalarField>::New();
return nullptr;
}
@ -389,12 +389,12 @@ Foam::radiation::boundaryRadiationProperties::zoneTransmissivity
}
FatalErrorInFunction
<< "Zone : " << mesh().faceZones()[zonei].name()
<< " is not found in the boundaryRadiationProperties. "
<< "Please add it"
<< exit(FatalError);
<< "Zone : " << mesh().faceZones()[zonei].name()
<< " is not found in the boundaryRadiationProperties. "
<< "Please add it"
<< exit(FatalError);
return tmp<scalarField>::New();
return nullptr;
}
@ -423,7 +423,7 @@ Foam::radiation::boundaryRadiationProperties::diffReflectivity
<< "Please add it"
<< exit(FatalError);
return tmp<scalarField>::New();
return nullptr;
}
@ -482,7 +482,7 @@ Foam::radiation::boundaryRadiationProperties::specReflectivity
<< "Please add it"
<< exit(FatalError);
return tmp<scalarField>::New();
return nullptr;
}

View File

@ -66,22 +66,12 @@ Foam::radiation::constantScatter::constantScatter
Foam::tmp<Foam::volScalarField>
Foam::radiation::constantScatter::sigmaEff() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"sigma",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
sigma_*(3.0 - C_)
)
"sigma",
IOobject::NO_REGISTER,
mesh_,
sigma_*(3.0 - C_)
);
}

View File

@ -56,22 +56,12 @@ Foam::radiation::noScatter::noScatter
Foam::tmp<Foam::volScalarField> Foam::radiation::noScatter::sigmaEff() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"sigma",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
)
"sigma",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar(dimless/dimLength, Zero)
);
}

View File

@ -70,7 +70,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::a
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), a_));
return tmp<scalarField>::New(pp_.size(), a_);
}
@ -93,7 +93,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::constantAbsorption::e
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), e_));
return tmp<scalarField>::New(pp_.size(), e_);
}

View File

@ -82,7 +82,7 @@ Foam::radiation::multiBandAbsorption::a
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), aCoeffs_[bandI]));
return tmp<scalarField>::New(pp_.size(), aCoeffs_[bandI]);
}
Foam::scalar Foam::radiation::multiBandAbsorption::a
@ -104,7 +104,7 @@ Foam::tmp<Foam::scalarField> Foam::radiation::multiBandAbsorption::e
scalarField* T
) const
{
return tmp<scalarField>(new scalarField(pp_.size(), eCoeffs_[bandI]));
return tmp<scalarField>::New(pp_.size(), eCoeffs_[bandI]);
}

View File

@ -98,7 +98,8 @@ Foam::basicMultiComponentMixture::basicMultiComponentMixture
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
IOobject::NO_WRITE,
IOobject::NO_REGISTER
);
IOobject constantIO

View File

@ -253,7 +253,8 @@ Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heheuPsiThermo
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh
),
@ -328,7 +329,8 @@ Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heheuPsiThermo
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
IOobject::REGISTER
),
mesh
),
@ -429,8 +431,8 @@ Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heu
const labelList& cells
) const
{
tmp<scalarField> theu(new scalarField(Tu.size()));
scalarField& heu = theu.ref();
auto theu = tmp<scalarField>::New(Tu.size());
auto& heu = theu.ref();
forAll(Tu, celli)
{
@ -450,8 +452,8 @@ Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::heu
const label patchi
) const
{
tmp<scalarField> theu(new scalarField(Tu.size()));
scalarField& heu = theu.ref();
auto theu = tmp<scalarField>::New(Tu.size());
auto& heu = theu.ref();
forAll(Tu, facei)
{
@ -467,24 +469,14 @@ template<class BasicPsiThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::Tb() const
{
tmp<volScalarField> tTb
auto tTb = volScalarField::New
(
new volScalarField
(
IOobject
(
"Tb",
this->T_.time().timeName(),
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->T_
)
"Tb",
IOobject::NO_REGISTER,
this->T_
);
auto& Tb_ = tTb.ref();
volScalarField& Tb_ = tTb.ref();
scalarField& TbCells = Tb_.primitiveFieldRef();
const scalarField& pCells = this->p_;
const scalarField& TCells = this->T_;
@ -526,25 +518,15 @@ template<class BasicPsiThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::psiu() const
{
tmp<volScalarField> tpsiu
auto tpsiu = volScalarField::New
(
new volScalarField
(
IOobject
(
"psiu",
this->psi_.time().timeName(),
this->psi_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->psi_.mesh(),
this->psi_.dimensions()
)
"psiu",
IOobject::NO_REGISTER,
this->psi_.mesh(),
this->psi_.dimensions()
);
auto& psiu = tpsiu.ref();
volScalarField& psiu = tpsiu.ref();
scalarField& psiuCells = psiu.primitiveFieldRef();
const scalarField& TuCells = this->Tu_;
const scalarField& pCells = this->p_;
@ -580,25 +562,15 @@ template<class BasicPsiThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::psib() const
{
tmp<volScalarField> tpsib
auto tpsib = volScalarField::New
(
new volScalarField
(
IOobject
(
"psib",
this->psi_.time().timeName(),
this->psi_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->psi_.mesh(),
this->psi_.dimensions()
)
"psib",
IOobject::NO_REGISTER,
this->psi_.mesh(),
this->psi_.dimensions()
);
auto& psib = tpsib.ref();
volScalarField& psib = tpsib.ref();
scalarField& psibCells = psib.primitiveFieldRef();
const volScalarField Tb_(Tb());
const scalarField& TbCells = Tb_;
@ -635,25 +607,15 @@ template<class BasicPsiThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::muu() const
{
tmp<volScalarField> tmuu
auto tmuu = volScalarField::New
(
new volScalarField
(
IOobject
(
"muu",
this->T_.time().timeName(),
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->T_.mesh(),
dimensionSet(1, -1, -1, 0, 0)
)
"muu",
IOobject::NO_REGISTER,
this->T_.mesh(),
dimensionSet(1, -1, -1, 0, 0)
);
auto& muu_ = tmuu.ref();
volScalarField& muu_ = tmuu.ref();
scalarField& muuCells = muu_.primitiveFieldRef();
const scalarField& pCells = this->p_;
const scalarField& TuCells = this->Tu_;
@ -693,25 +655,15 @@ template<class BasicPsiThermo, class MixtureType>
Foam::tmp<Foam::volScalarField>
Foam::heheuPsiThermo<BasicPsiThermo, MixtureType>::mub() const
{
tmp<volScalarField> tmub
auto tmub = volScalarField::New
(
new volScalarField
(
IOobject
(
"mub",
this->T_.time().timeName(),
this->T_.db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->T_.mesh(),
dimensionSet(1, -1, -1, 0, 0)
)
"mub",
IOobject::NO_REGISTER,
this->T_.mesh(),
dimensionSet(1, -1, -1, 0, 0)
);
auto& mub_ = tmub.ref();
volScalarField& mub_ = tmub.ref();
scalarField& mubCells = mub_.primitiveFieldRef();
const volScalarField Tb_(Tb());
const scalarField& pCells = this->p_;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -621,25 +621,14 @@ Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::gasHs
const label index
) const
{
tmp<volScalarField> tHs
auto tHs = volScalarField::New
(
new volScalarField
(
IOobject
(
"Hs_" + pyrolisisGases_[index],
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
this->mesh_,
dimensionedScalar(dimEnergy/dimMass, Zero)
)
"Hs_" + pyrolisisGases_[index],
IOobject::NO_REGISTER,
this->mesh_,
dimensionedScalar(dimEnergy/dimMass, Zero)
);
volScalarField::Internal& gasHs = tHs.ref();
auto& gasHs = tHs.ref();
const GasThermo& mixture = gasThermo_[index];

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -81,26 +82,17 @@ inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::pyrolysisChemistryModel<CompType, SolidThermo, GasThermo>::
RRg() const
{
tmp<volScalarField::Internal> tRRg
auto tRRg = DimensionedField<scalar, volMesh>::New
(
new volScalarField::Internal
(
IOobject
(
"RRg",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
)
"RRg",
IOobject::NO_REGISTER,
this->mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
);
auto& RRg = tRRg.ref();
if (this->chemistry_)
{
volScalarField::Internal& RRg = tRRg.ref();
for (label i=0; i < nGases_; i++)
{
RRg += RRg_[i];

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -116,28 +117,17 @@ template<class CompType, class SolidThermo>
Foam::tmp<Foam::volScalarField>
Foam::solidChemistryModel<CompType, SolidThermo>::Qdot() const
{
tmp<volScalarField> tQdot
auto tQdot = volScalarField::New
(
new volScalarField
(
IOobject
(
"Qdot",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE,
IOobject::NO_REGISTER
),
this->mesh_,
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
)
"Qdot",
IOobject::NO_REGISTER,
this->mesh_,
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
);
scalarField& Qdot = tQdot.ref();
if (this->chemistry_)
{
scalarField& Qdot = tQdot.ref();
forAll(Ys_, i)
{
forAll(Qdot, celli)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2016 OpenCFD Ltd.
Copyright (C) 2016-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -70,26 +70,17 @@ template<class CompType, class SolidThermo>
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::solidChemistryModel<CompType, SolidThermo>::RRs() const
{
tmp<volScalarField::Internal> tRRs
auto tRRs = DimensionedField<scalar, volMesh>::New
(
new volScalarField::Internal
(
IOobject
(
"RRs",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
)
"RRs",
IOobject::NO_REGISTER,
this->mesh(),
dimensionedScalar(dimMass/dimVolume/dimTime, Zero)
);
auto& RRs = tRRs.ref();
if (this->chemistry_)
{
volScalarField::Internal& RRs = tRRs.ref();
for (label i=0; i < nSolids_; i++)
{
RRs += RRs_[i];
@ -103,27 +94,17 @@ template<class CompType, class SolidThermo>
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::solidChemistryModel<CompType, SolidThermo>::RRsHs() const
{
tmp<DimensionedField<scalar, volMesh>> tRRsHs
auto tRRsHs = DimensionedField<scalar, volMesh>::New
(
new DimensionedField<scalar, volMesh>
(
IOobject
(
"RRsHs",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
)
"RRsHs",
IOobject::NO_REGISTER,
this->mesh(),
dimensionedScalar(dimEnergy/dimVolume/dimTime, Zero)
);
auto& RRs = tRRsHs.ref();
if (this->chemistry_)
{
DimensionedField<scalar, volMesh>& RRs = tRRsHs.ref();
const volScalarField& T = this->solidThermo().T();
const volScalarField& p = this->solidThermo().p();

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2017-2020 OpenCFD Ltd.
Copyright (C) 2017-2023 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -219,24 +219,15 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa() const
{
const fvMesh& mesh = this->T_.mesh();
tmp<volVectorField> tKappa
auto tKappa = volVectorField::New
(
new volVectorField
(
IOobject
(
"Kappa",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimEnergy/dimTime/dimLength/dimTemperature
)
"Kappa",
IOobject::NO_REGISTER,
mesh,
dimEnergy/dimTime/dimLength/dimTemperature
);
auto& Kappa = tKappa.ref();
volVectorField& Kappa = tKappa.ref();
vectorField& KappaCells = Kappa.primitiveFieldRef();
const scalarField& TCells = this->T_;
const scalarField& pCells = this->p_;
@ -286,9 +277,9 @@ Foam::heSolidThermo<BasicSolidThermo, MixtureType>::Kappa
{
const scalarField& pp = this->p_.boundaryField()[patchi];
const scalarField& Tp = this->T_.boundaryField()[patchi];
tmp<vectorField> tKappa(new vectorField(pp.size()));
vectorField& Kappap = tKappa.ref();
auto tKappa = tmp<vectorField>::New(pp.size());
auto& Kappap = tKappa.ref();
forAll(Tp, facei)
{

View File

@ -355,15 +355,15 @@ public:
//- Return mass flux
tmp<surfaceScalarField> getRhoPhi
(
const dimensionedScalar rho1,
const dimensionedScalar rho2
const dimensionedScalar& rho1,
const dimensionedScalar& rho2
) const
{
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
"rhoPhi",
IOobject::NO_REGISTER,
(
"rhoPhi",
(rho1 - rho2)*dVf_/mesh_.time().deltaT() + rho2*phi_
)
);
@ -376,14 +376,14 @@ public:
const volScalarField& rho2
)
{
return tmp<surfaceScalarField>
(
new surfaceScalarField
return surfaceScalarField::New
(
"rhoPhi",
fvc::interpolate(rho1 - rho2)*alphaPhi_
+ fvc::interpolate(rho2)*phi_
)
IOobject::NO_REGISTER,
(
fvc::interpolate(rho1 - rho2)*alphaPhi_
+ fvc::interpolate(rho2)*phi_
)
);
}

View File

@ -130,9 +130,10 @@ Foam::incompressibleTwoPhaseMixture::mu() const
clamp(alpha1_, zero_one{})
);
return tmp<volScalarField>::New
return volScalarField::New
(
"mu",
IOobject::NO_REGISTER,
limitedAlpha1*rho1_*nuModel1_->nu()
+ (scalar(1) - limitedAlpha1)*rho2_*nuModel2_->nu()
);
@ -155,9 +156,10 @@ Foam::incompressibleTwoPhaseMixture::muf() const
clamp(fvc::interpolate(alpha1_), zero_one{})
);
return tmp<surfaceScalarField>::New
return surfaceScalarField::New
(
"muf",
IOobject::NO_REGISTER,
alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
+ (scalar(1) - alpha1f)*rho2_*fvc::interpolate(nuModel2_->nu())
);
@ -172,9 +174,10 @@ Foam::incompressibleTwoPhaseMixture::nuf() const
clamp(fvc::interpolate(alpha1_), zero_one{})
);
return tmp<surfaceScalarField>::New
return surfaceScalarField::New
(
"nuf",
IOobject::NO_REGISTER,
(
alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
+ (scalar(1) - alpha1f)*rho2_*fvc::interpolate(nuModel2_->nu())

View File

@ -65,17 +65,10 @@ Foam::surfaceTensionModels::constant::~constant()
Foam::tmp<Foam::volScalarField>
Foam::surfaceTensionModels::constant::sigma() const
{
return tmp<volScalarField>::New
return volScalarField::New
(
IOobject
(
"sigma",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
"sigma",
IOobject::NO_REGISTER,
mesh_,
sigma_
);

View File

@ -72,17 +72,10 @@ Foam::surfaceTensionModels::temperatureDependent::~temperatureDependent()
Foam::tmp<Foam::volScalarField>
Foam::surfaceTensionModels::temperatureDependent::sigma() const
{
auto tsigma = tmp<volScalarField>::New
auto tsigma = volScalarField::New
(
IOobject
(
"sigma",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
IOobject::NO_REGISTER
),
"sigma",
IOobject::NO_REGISTER,
mesh_,
dimSigma
);