Changed tmp<volField> and tmp<surfaceField> construction to use the new simpler "New" method

avoiding unnecessary database registration of temporary fields
This commit is contained in:
Henry Weller
2018-12-21 18:37:13 +00:00
parent d95d68d7be
commit 6dc48b62d9
101 changed files with 445 additions and 1302 deletions

View File

@ -12,7 +12,7 @@ volVectorField U
mesh
);
U = dimensionedVector("0", U.dimensions(), Zero);
U = dimensionedVector(U.dimensions(), Zero);
surfaceScalarField phi
(

View File

@ -93,20 +93,12 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
{
tmp<volSymmTensorField> tDragDcu
(
new volSymmTensorField
volSymmTensorField::New
(
IOobject
(
"tDragDcu",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"tDragDcu",
U_.mesh(),
dimensionedSymmTensor
(
"zero",
dimMass/dimTime/pow(dimLength, 3),
Zero
)
@ -132,16 +124,9 @@ Foam::tmp<Foam::volScalarField> Foam::PDRDragModels::basic::Gk() const
{
tmp<volScalarField> tGk
(
new volScalarField
volScalarField::New
(
IOobject
(
"tGk",
U_.mesh().time().constant(),
U_.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"tGk",
U_.mesh(),
dimensionedScalar(dimMass/dimLength/pow(dimTime, 3), 0)
)

View File

@ -94,16 +94,9 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::SCOPEXiEq::XiEq() const
tmp<volScalarField> tXiEq
(
new volScalarField
volScalarField::New
(
IOobject
(
"XiEq",
epsilon.time().timeName(),
epsilon.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"XiEq",
epsilon.mesh(),
dimensionedScalar(dimless, 0)
)

View File

@ -98,17 +98,9 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
tmp<volScalarField> tN
(
new volScalarField
volScalarField::New
(
IOobject
(
"tN",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"tN",
mesh,
dimensionedScalar(Nv.dimensions(), 0)
)

View File

@ -244,16 +244,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
{
tmp<volScalarField> tSu0
(
new volScalarField
volScalarField::New
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Su0",
p.mesh(),
dimensionedScalar(dimVelocity, 0)
)
@ -293,16 +286,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Su0pTphi
{
tmp<volScalarField> tSu0
(
new volScalarField
volScalarField::New
(
IOobject
(
"Su0",
p.time().timeName(),
p.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Su0",
p.mesh(),
dimensionedScalar(dimVelocity, 0)
)
@ -347,16 +333,9 @@ Foam::tmp<Foam::volScalarField> Foam::laminarFlameSpeedModels::SCOPE::Ma
{
tmp<volScalarField> tMa
(
new volScalarField
volScalarField::New
(
IOobject
(
"Ma",
phi.time().timeName(),
phi.db(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Ma",
phi.mesh(),
dimensionedScalar(dimless, 0)
)
@ -407,16 +386,9 @@ Foam::laminarFlameSpeedModels::SCOPE::Ma() const
return tmp<volScalarField>
(
new volScalarField
volScalarField::New
(
IOobject
(
"Ma",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Ma",
mesh,
dimensionedScalar(dimless, Ma(equivalenceRatio_))
)

View File

@ -75,7 +75,7 @@
IOobject::NO_WRITE
),
mesh,
dimensionedVector("zero", dimVelocity, Zero)
dimensionedVector(dimVelocity, Zero)
);
#include "createPhi.H"

View File

@ -78,17 +78,9 @@ Foam::surfaceTensionModels::liquidProperties::sigma() const
tmp<volScalarField> tsigma
(
new volScalarField
volScalarField::New
(
IOobject
(
"sigma",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"sigma",
mesh_,
dimSigma
)

View File

@ -770,14 +770,9 @@ Foam::multiphaseMixtureThermo::surfaceTensionForce() const
{
tmp<surfaceScalarField> tstf
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"surfaceTensionForce",
mesh_.time().timeName(),
mesh_
),
"surfaceTensionForce",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
@ -1021,14 +1016,9 @@ Foam::multiphaseMixtureThermo::nearInterface() const
{
tmp<volScalarField> tnearInt
(
new volScalarField
volScalarField::New
(
IOobject
(
"nearInterface",
mesh_.time().timeName(),
mesh_
),
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)

View File

@ -90,7 +90,7 @@ Foam::relativeVelocityModel::relativeVelocityModel
IOobject::AUTO_WRITE
),
alphac_.mesh(),
dimensionedVector("Udm", dimVelocity, Zero),
dimensionedVector(dimVelocity, Zero),
UdmPatchFieldTypes()
)
{}
@ -155,13 +155,10 @@ tmp<volSymmTensorField> Foam::relativeVelocityModel::tauDm() const
// Calculate the relative velocity of the continuous phase w.r.t the mean
volVectorField Ucm(betad*Udm_/betac);
return tmp<volSymmTensorField>
return volSymmTensorField::New
(
new volSymmTensorField
(
"tauDm",
betad*sqr(Udm_) + betac*sqr(Ucm)
)
"tauDm",
betad*sqr(Udm_) + betac*sqr(Ucm)
);
}

View File

@ -165,15 +165,12 @@ Foam::incompressibleThreePhaseMixture::incompressibleThreePhaseMixture
Foam::tmp<Foam::volScalarField>
Foam::incompressibleThreePhaseMixture::mu() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
"mu",
alpha1_*rho1_*nuModel1_->nu()
+ alpha2_*rho2_*nuModel2_->nu()
+ alpha3_*rho3_*nuModel3_->nu()
)
"mu",
alpha1_*rho1_*nuModel1_->nu()
+ alpha2_*rho2_*nuModel2_->nu()
+ alpha3_*rho3_*nuModel3_->nu()
);
}
@ -185,15 +182,12 @@ Foam::incompressibleThreePhaseMixture::muf() const
surfaceScalarField alpha2f(fvc::interpolate(alpha2_));
surfaceScalarField alpha3f(fvc::interpolate(alpha3_));
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
(
"mu",
alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
+ alpha2f*rho2_*fvc::interpolate(nuModel2_->nu())
+ alpha3f*rho3_*fvc::interpolate(nuModel3_->nu())
)
"mu",
alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
+ alpha2f*rho2_*fvc::interpolate(nuModel2_->nu())
+ alpha3f*rho3_*fvc::interpolate(nuModel3_->nu())
);
}
@ -205,17 +199,14 @@ Foam::incompressibleThreePhaseMixture::nuf() const
surfaceScalarField alpha2f(fvc::interpolate(alpha2_));
surfaceScalarField alpha3f(fvc::interpolate(alpha3_));
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
"nu",
(
"nu",
(
alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
+ alpha2f*rho2_*fvc::interpolate(nuModel2_->nu())
+ alpha3f*rho3_*fvc::interpolate(nuModel3_->nu())
)/(alpha1f*rho1_ + alpha2f*rho2_ + alpha3f*rho3_)
)
alpha1f*rho1_*fvc::interpolate(nuModel1_->nu())
+ alpha2f*rho2_*fvc::interpolate(nuModel2_->nu())
+ alpha3f*rho3_*fvc::interpolate(nuModel3_->nu())
)/(alpha1f*rho1_ + alpha2f*rho2_ + alpha3f*rho3_)
);
}

View File

@ -23,7 +23,7 @@ volVectorField U
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("U", dimVelocity, Zero)
dimensionedVector(dimVelocity, Zero)
);
surfaceScalarField phi

View File

@ -70,22 +70,11 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::interface::K
const volScalarField& Ur
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"K",
Ur.mesh().time().timeName(),
Ur.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
Ur.mesh(),
dimensionedScalar(dimDensity/dimTime, 0)
)
"K",
Ur.mesh(),
dimensionedScalar(dimDensity/dimTime, 0)
);
}

View File

@ -67,19 +67,11 @@ 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()
),
phase_.U().mesh(),
d_
)
"d",
phase_.U().mesh(),
d_
);
}

View File

@ -551,14 +551,9 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::Cvm
{
tmp<volScalarField> tCvm
(
new volScalarField
volScalarField::New
(
IOobject
(
"Cvm",
mesh_.time().timeName(),
mesh_
),
"Cvm",
mesh_,
dimensionedScalar(dimensionSet(1, -3, 0, 0, 0), 0)
)
@ -602,21 +597,11 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
{
tmp<volVectorField> tSvm
(
new volVectorField
volVectorField::New
(
IOobject
(
"Svm",
mesh_.time().timeName(),
mesh_
),
"Svm",
mesh_,
dimensionedVector
(
"Svm",
dimensionSet(1, -2, -2, 0, 0),
Zero
)
dimensionedVector(dimensionSet(1, -2, -2, 0, 0), Zero)
)
);
@ -729,14 +714,9 @@ Foam::tmp<Foam::volScalarField> Foam::multiphaseSystem::dragCoeff
{
tmp<volScalarField> tdragCoeff
(
new volScalarField
volScalarField::New
(
IOobject
(
"dragCoeff",
mesh_.time().timeName(),
mesh_
),
"dragCoeff",
mesh_,
dimensionedScalar(dimensionSet(1, -3, -1, 0, 0), 0)
)
@ -772,14 +752,9 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
{
tmp<surfaceScalarField> tSurfaceTension
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"surfaceTension",
mesh_.time().timeName(),
mesh_
),
"surfaceTension",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
@ -818,14 +793,9 @@ Foam::multiphaseSystem::nearInterface() const
{
tmp<volScalarField> tnearInt
(
new volScalarField
volScalarField::New
(
IOobject
(
"nearInterface",
mesh_.time().timeName(),
mesh_
),
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)

View File

@ -99,7 +99,7 @@ Foam::phaseModel::phaseModel
mesh
),
mesh,
dimensionedVector("0", dimVelocity/dimTime, Zero)
dimensionedVector(dimVelocity/dimTime, Zero)
),
alphaPhi_
(

View File

@ -266,7 +266,7 @@
mSfGradp = pEqnIncomp.flux()/rAUf;
U = dimensionedVector("U", dimVelocity, Zero);
U = dimensionedVector(dimVelocity, Zero);
phasei = 0;
forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter)

View File

@ -254,14 +254,9 @@ Foam::multiphaseMixture::surfaceTensionForce() const
{
tmp<surfaceScalarField> tstf
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"surfaceTensionForce",
mesh_.time().timeName(),
mesh_
),
"surfaceTensionForce",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
@ -530,14 +525,9 @@ Foam::multiphaseMixture::nearInterface() const
{
tmp<volScalarField> tnearInt
(
new volScalarField
volScalarField::New
(
IOobject
(
"nearInterface",
mesh_.time().timeName(),
mesh_
),
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)

View File

@ -49,7 +49,7 @@ volVectorField zeta
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimLength, Zero)
dimensionedVector(dimLength, Zero)
);
Info<< "Creating field p_gh\n" << endl;

View File

@ -110,7 +110,7 @@ Foam::functionObjects::phaseForces::phaseForces
mesh_
),
mesh_,
dimensionedVector("0", dimForce/dimVolume, Zero)
dimensionedVector(dimForce/dimVolume, Zero)
)
);
}
@ -133,7 +133,7 @@ Foam::functionObjects::phaseForces::phaseForces
mesh_
),
mesh_,
dimensionedVector("0", dimForce/dimVolume, Zero)
dimensionedVector(dimForce/dimVolume, Zero)
)
);
}
@ -152,7 +152,7 @@ Foam::functionObjects::phaseForces::phaseForces
mesh_
),
mesh_,
dimensionedVector("0", dimForce/dimVolume, Zero)
dimensionedVector(dimForce/dimVolume, Zero)
)
);
}
@ -175,7 +175,7 @@ Foam::functionObjects::phaseForces::phaseForces
mesh_
),
mesh_,
dimensionedVector("0", dimForce/dimVolume, Zero)
dimensionedVector(dimForce/dimVolume, Zero)
)
);
}
@ -198,7 +198,7 @@ Foam::functionObjects::phaseForces::phaseForces
mesh_
),
mesh_,
dimensionedVector("0", dimForce/dimVolume, Zero)
dimensionedVector(dimForce/dimVolume, Zero)
)
);
}

View File

@ -116,19 +116,11 @@ Foam::interfaceCompositionModels::Henry<Thermo, OtherThermo>::YfPrime
const volScalarField& Tf
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
IOobject::groupName("YfPrime", this->pair_.name()),
this->pair_.phase1().mesh().time().timeName(),
this->pair_.phase1().mesh()
),
this->pair_.phase1().mesh(),
dimensionedScalar(dimless/dimTemperature, 0)
)
IOobject::groupName("YfPrime", this->pair_.name()),
this->pair_.phase1().mesh(),
dimensionedScalar(dimless/dimTemperature, 0)
);
}

View File

@ -140,14 +140,9 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::D
tmp<volScalarField> tmpD
(
new volScalarField
volScalarField::New
(
IOobject
(
IOobject::groupName("D", pair_.name()),
p.time().timeName(),
p.mesh()
),
IOobject::groupName("D", pair_.name()),
p.mesh(),
dimensionedScalar(dimArea/dimTime, 0)
)
@ -194,14 +189,9 @@ Foam::InterfaceCompositionModel<Thermo, OtherThermo>::L
tmp<volScalarField> tmpL
(
new volScalarField
volScalarField::New
(
IOobject
(
IOobject::groupName("L", pair_.name()),
p.time().timeName(),
p.mesh()
),
IOobject::groupName("L", pair_.name()),
p.mesh(),
dimensionedScalar(dimEnergy/dimMass, 0)
)

View File

@ -73,22 +73,11 @@ Foam::saturationModels::constantSaturationConditions::pSat
const volScalarField& T
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"pSat",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
T.mesh(),
pSat_
)
"pSat",
T.mesh(),
pSat_
);
}
@ -99,22 +88,11 @@ Foam::saturationModels::constantSaturationConditions::pSatPrime
const volScalarField& T
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"pSatPrime",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
T.mesh(),
dimensionedScalar(dimPressure/dimTemperature, 0)
)
"pSatPrime",
T.mesh(),
dimensionedScalar(dimPressure/dimTemperature, 0)
);
}
@ -125,22 +103,11 @@ Foam::saturationModels::constantSaturationConditions::lnPSat
const volScalarField& T
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"lnPSat",
T.mesh().time().timeName(),
T.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
T.mesh(),
dimensionedScalar(dimless, log(pSat_.value()))
)
"lnPSat",
T.mesh(),
dimensionedScalar(dimless, log(pSat_.value()))
);
}
@ -151,22 +118,11 @@ Foam::saturationModels::constantSaturationConditions::Tsat
const volScalarField& p
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"Tsat",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
p.mesh(),
Tsat_
)
"Tsat",
p.mesh(),
Tsat_
);
}

View File

@ -103,16 +103,9 @@ Foam::saturationModels::function1::Tsat
{
tmp<volScalarField> tTsat
(
new volScalarField
volScalarField::New
(
IOobject
(
"Tsat",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Tsat",
p.mesh(),
dimensionedScalar(dimTemperature, 0)
)

View File

@ -100,16 +100,9 @@ Foam::saturationModels::polynomial::Tsat
{
tmp<volScalarField> tTsat
(
new volScalarField
volScalarField::New
(
IOobject
(
"Tsat",
p.mesh().time().timeName(),
p.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
"Tsat",
p.mesh(),
dimensionedScalar(dimTemperature, 0)
)

View File

@ -73,22 +73,11 @@ Foam::surfaceTensionModels::constantSurfaceTensionCoefficient::sigma() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"sigma",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
sigma_
)
"sigma",
mesh,
sigma_
);
}

View File

@ -70,21 +70,12 @@ Foam::aspectRatioModels::constantAspectRatio::E() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
aspectRatioModel::typeName + ":E",
mesh.time().timeName(),
mesh
),
mesh,
E0_
)
);
return volScalarField::New
(
aspectRatioModel::typeName + ":E",
mesh,
E0_
);
}

View File

@ -65,21 +65,12 @@ Foam::liftModels::constantLiftCoefficient::Cl() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
Cl_
)
);
return volScalarField::New
(
"zero",
mesh,
Cl_
);
}

View File

@ -63,22 +63,11 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"Cl",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(dimless, 0)
)
"Cl",
mesh,
dimensionedScalar(dimless, 0)
);
}
@ -87,22 +76,11 @@ Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volVectorField>
return volVectorField::New
(
new volVectorField
(
IOobject
(
"noLift:F",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
"noLift:F",
mesh,
dimensionedVector(dimF, Zero)
);
}
@ -111,22 +89,11 @@ Foam::tmp<Foam::surfaceScalarField> Foam::liftModels::noLift::Ff() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
(
IOobject
(
"noLift:Ff",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(dimF*dimArea, 0)
)
"noLift:Ff",
mesh,
dimensionedScalar(dimF*dimArea, 0)
);
}

View File

@ -63,21 +63,12 @@ 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(dimless, 1)
)
);
return volScalarField::New
(
"Cs",
mesh,
dimensionedScalar(dimless, 1)
);
}

View File

@ -70,22 +70,11 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::D() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(dimD, 0)
)
"zero",
mesh,
dimensionedScalar(dimD, 0)
);
}
@ -95,21 +84,12 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volVectorField>
(
new volVectorField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
);
return volVectorField::New
(
"zero",
mesh,
dimensionedVector(dimF, Zero)
);
}

View File

@ -73,22 +73,11 @@ Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const
{
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,
false
),
mesh,
Cvm_
)
"Cvm",
mesh,
Cvm_
);
}

View File

@ -65,21 +65,12 @@ Foam::virtualMassModels::noVirtualMass::Cvm() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar(dimless, 0)
)
);
return volScalarField::New
(
"zero",
mesh,
dimensionedScalar(dimless, 0)
);
}

View File

@ -69,22 +69,11 @@ Foam::wallLubricationModels::noWallLubrication::Fi() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volVectorField>
return volVectorField::New
(
new volVectorField
(
IOobject
(
"noWallLubrication:Fi",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
"noWallLubrication:Fi",
mesh,
dimensionedVector(dimF, Zero)
);
}
@ -94,22 +83,11 @@ Foam::wallLubricationModels::noWallLubrication::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volVectorField>
return volVectorField::New
(
new volVectorField
(
IOobject
(
"noWallLubrication:F",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
"noWallLubrication:F",
mesh,
dimensionedVector(dimF, Zero)
);
}

View File

@ -72,26 +72,12 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f1
{
const fvMesh& mesh(phase1.mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"f",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar
(
"f",
dimless,
phase2.name() == continuousPhase_
)
)
);
return volScalarField::New
(
"f",
mesh,
dimensionedScalar(dimless, phase2.name() == continuousPhase_)
);
}
@ -103,26 +89,12 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f2
{
const fvMesh& mesh(phase1.mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"f",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar
(
"f",
dimless,
phase1.name() == continuousPhase_
)
)
);
return volScalarField::New
(
"f",
mesh,
dimensionedScalar(dimless, phase1.name() == continuousPhase_)
);
}

View File

@ -60,22 +60,11 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kd
}
else
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
dragModel::typeName + ":K",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(dragModel::dimK, 0)
)
dragModel::typeName + ":K",
this->mesh_,
dimensionedScalar(dragModel::dimK, 0)
);
}
}
@ -94,22 +83,11 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Kdf
}
else
{
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
(
IOobject
(
dragModel::typeName + ":K",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(dragModel::dimK, 0)
)
dragModel::typeName + ":K",
this->mesh_,
dimensionedScalar(dragModel::dimK, 0)
);
}
}
@ -128,22 +106,11 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::Vm
}
else
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
virtualMassModel::typeName + ":K",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(virtualMassModel::dimK, 0)
)
virtualMassModel::typeName + ":K",
this->mesh_,
dimensionedScalar(virtualMassModel::dimK, 0)
);
}
}

View File

@ -67,19 +67,11 @@ 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",
phase_.mesh(),
d_
);
}

View File

@ -53,14 +53,9 @@ Foam::tmp<Foam::volScalarField> Foam::diameterModels::velocityGroup::dsm() const
{
tmp<volScalarField> tInvDsm
(
new volScalarField
volScalarField::New
(
IOobject
(
"invDsm",
phase_.time().timeName(),
phase_.mesh()
),
"invDsm",
phase_.mesh(),
dimensionedScalar(inv(dimLength), Zero)
)
@ -84,14 +79,9 @@ Foam::diameterModels::velocityGroup::fSum() const
{
tmp<volScalarField> tsumSizeGroups
(
new volScalarField
volScalarField::New
(
IOobject
(
"sumSizeGroups",
phase_.time().timeName(),
phase_.mesh()
),
"sumSizeGroups",
phase_.mesh(),
dimensionedScalar(dimless, 0)
)

View File

@ -67,19 +67,11 @@ template<class BasePhaseModel>
Foam::tmp<Foam::volScalarField>
Foam::InertPhaseModel<BasePhaseModel>::Qdot() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
IOobject::groupName("Qdot", this->name()),
this->mesh().time().timeName(),
this->mesh()
),
this->mesh(),
dimensionedScalar(dimEnergy/dimTime/dimVolume, 0)
)
IOobject::groupName("Qdot", this->name()),
this->mesh(),
dimensionedScalar(dimEnergy/dimTime/dimVolume, 0)
);
}

View File

@ -57,7 +57,7 @@ void Foam::IsothermalPhaseModel<BasePhaseModel>::correctThermo()
// Correct the thermo, but make sure that the temperature remains the same
tmp<volScalarField> TCopy
(
new volScalarField
volScalarField::New
(
this->thermo().T().name() + ":Copy",
this->thermo().T()

View File

@ -441,12 +441,11 @@ Foam::MovingPhaseModel<BasePhaseModel>::K() const
{
if (!K_.valid())
{
K_ =
new volScalarField
(
IOobject::groupName("K", this->name()),
0.5*magSqr(this->U())
);
K_ = volScalarField::New
(
IOobject::groupName("K", this->name()),
0.5*magSqr(this->U())
);
}
return tmp<volScalarField>(K_());

View File

@ -52,7 +52,7 @@ Foam::tmp<Foam::surfaceScalarField> Foam::phaseSystem::calcPhi
{
tmp<surfaceScalarField> tmpPhi
(
new surfaceScalarField
surfaceScalarField::New
(
"phi",
fvc::interpolate(phaseModels[0])*phaseModels[0].phi()
@ -299,22 +299,11 @@ Foam::phaseSystem::E(const phasePairKey& key) const
}
else
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
aspectRatioModel::typeName + ":E",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(dimless, 1)
)
aspectRatioModel::typeName + ":E",
this->mesh_,
dimensionedScalar(dimless, 1)
);
}
}
@ -329,22 +318,11 @@ Foam::phaseSystem::sigma(const phasePairKey& key) const
}
else
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
surfaceTensionModel::typeName + ":sigma",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar(surfaceTensionModel::dimSigma, 0)
)
surfaceTensionModel::typeName + ":sigma",
this->mesh_,
dimensionedScalar(surfaceTensionModel::dimSigma, 0)
);
}
}
@ -355,19 +333,11 @@ Foam::tmp<Foam::volScalarField> Foam::phaseSystem::dmdt
const phasePairKey& key
) const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
IOobject::groupName("dmdt", phasePairs_[key]->name()),
this->mesh_.time().timeName(),
this->mesh_
),
this->mesh_,
dimensionedScalar(dimDensity/dimTime, 0)
)
IOobject::groupName("dmdt", phasePairs_[key]->name()),
this->mesh_,
dimensionedScalar(dimDensity/dimTime, 0)
);
}

View File

@ -803,14 +803,9 @@ Foam::diameterModels::populationBalanceModel::calcDsm()
{
tmp<volScalarField> tInvDsm
(
new volScalarField
volScalarField::New
(
IOobject
(
"invDsm",
mesh_.time().timeName(),
mesh_
),
"invDsm",
mesh_,
dimensionedScalar(inv(dimLength), Zero)
)
@ -1134,7 +1129,7 @@ Foam::diameterModels::populationBalanceModel::populationBalanceModel
IOobject::AUTO_WRITE
),
mesh_,
dimensionedVector("U", dimVelocity, Zero)
dimensionedVector(dimVelocity, Zero)
)
);
}

View File

@ -553,14 +553,9 @@ Foam::tmp<Foam::surfaceScalarField> Foam::multiphaseSystem::surfaceTension
{
tmp<surfaceScalarField> tSurfaceTension
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"surfaceTension",
mesh_.time().timeName(),
mesh_
),
"surfaceTension",
mesh_,
dimensionedScalar(dimensionSet(1, -2, -2, 0, 0), 0)
)
@ -597,14 +592,9 @@ Foam::multiphaseSystem::nearInterface() const
{
tmp<volScalarField> tnearInt
(
new volScalarField
volScalarField::New
(
IOobject
(
"nearInterface",
mesh_.time().timeName(),
mesh_
),
"nearInterface",
mesh_,
dimensionedScalar(dimless, 0)
)

View File

@ -129,17 +129,9 @@ JohnsonJacksonSchaeffer::nu
tmp<volScalarField> tnu
(
new volScalarField
volScalarField::New
(
IOobject
(
"JohnsonJacksonSchaeffer:nu",
phase.mesh().time().timeName(),
phase.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"JohnsonJacksonSchaeffer:nu",
phase.mesh(),
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), 0)
)

View File

@ -70,21 +70,12 @@ Foam::aspectRatioModels::constantAspectRatio::E() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
E0_
)
);
return volScalarField::New
(
"zero",
mesh,
E0_
);
}

View File

@ -65,21 +65,12 @@ Foam::liftModels::constantLiftCoefficient::Cl() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
Cl_
)
);
return volScalarField::New
(
"zero",
mesh,
Cl_
);
}

View File

@ -63,22 +63,11 @@ Foam::tmp<Foam::volScalarField> Foam::liftModels::noLift::Cl() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"Cl",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(dimless, 0)
)
"Cl",
mesh,
dimensionedScalar(dimless, 0)
);
}
@ -87,22 +76,11 @@ Foam::tmp<Foam::volVectorField> Foam::liftModels::noLift::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volVectorField>
return volVectorField::New
(
new volVectorField
(
IOobject
(
"noLift:F",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
"noLift:F",
mesh,
dimensionedVector(dimF, Zero)
);
}
@ -113,17 +91,9 @@ Foam::tmp<Foam::surfaceScalarField> Foam::liftModels::noLift::Ff() const
return tmp<surfaceScalarField>
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"noLift:Ff",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"noLift:Ff",
mesh,
dimensionedScalar(dimF*dimArea, 0)
)

View File

@ -63,21 +63,12 @@ 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(dimless, 1)
)
);
return volScalarField::New
(
"one",
mesh,
dimensionedScalar(dimless, 1)
);
}

View File

@ -70,22 +70,11 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::D() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedScalar(dimD, 0)
)
"zero",
mesh,
dimensionedScalar(dimD, 0)
);
}
@ -95,21 +84,12 @@ Foam::turbulentDispersionModels::noTurbulentDispersion::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volVectorField>
(
new volVectorField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
);
return volVectorField::New
(
"zero",
mesh,
dimensionedVector(dimF, Zero)
);
}

View File

@ -73,22 +73,11 @@ Foam::virtualMassModels::constantVirtualMassCoefficient::Cvm() const
{
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,
false
),
mesh,
Cvm_
)
"Cvm",
mesh,
Cvm_
);
}

View File

@ -65,21 +65,12 @@ Foam::virtualMassModels::noVirtualMass::Cvm() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"zero",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar(dimless, 0)
)
);
return volScalarField::New
(
"zero",
mesh,
dimensionedScalar(dimless, 0)
);
}

View File

@ -69,22 +69,11 @@ Foam::wallLubricationModels::noWallLubrication::Fi() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volVectorField>
return volVectorField::New
(
new volVectorField
(
IOobject
(
"noWallLubrication:Fi",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
"noWallLubrication:Fi",
mesh,
dimensionedVector(dimF, Zero)
);
}
@ -94,22 +83,11 @@ Foam::wallLubricationModels::noWallLubrication::F() const
{
const fvMesh& mesh(this->pair_.phase1().mesh());
return tmp<volVectorField>
return volVectorField::New
(
new volVectorField
(
IOobject
(
"noWallLubrication:F",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensionedVector("zero", dimF, Zero)
)
"noWallLubrication:F",
mesh,
dimensionedVector(dimF, Zero)
);
}

View File

@ -129,17 +129,9 @@ JohnsonJacksonSchaeffer::nu
tmp<volScalarField> tnu
(
new volScalarField
volScalarField::New
(
IOobject
(
"JohnsonJacksonSchaeffer:nu",
phase.mesh().time().timeName(),
phase.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"JohnsonJacksonSchaeffer:nu",
phase.mesh(),
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), 0)
)

View File

@ -118,17 +118,9 @@ Foam::kineticTheoryModels::frictionalStressModels::Schaeffer::nu
tmp<volScalarField> tnu
(
new volScalarField
volScalarField::New
(
IOobject
(
"Schaeffer:nu",
phase.mesh().time().timeName(),
phase.mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"Schaeffer:nu",
phase.mesh(),
dimensionedScalar(dimensionSet(0, 2, -1, 0, 0), 0)
)

View File

@ -251,21 +251,11 @@ Foam::RASModels::kineticTheoryModel::epsilon() const
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::kineticTheoryModel::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
),
- (nut_)*dev(twoSymm(fvc::grad(U_)))
- (lambda_*fvc::div(phi_))*symmTensor::I
)
IOobject::groupName("R", U_.group()),
- (nut_)*dev(twoSymm(fvc::grad(U_)))
- (lambda_*fvc::div(phi_))*symmTensor::I
);
}
@ -319,22 +309,12 @@ Foam::RASModels::kineticTheoryModel::pPrimef() const
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::kineticTheoryModel::devRhoReff() const
{
return tmp<volSymmTensorField>
return volSymmTensorField::New
(
new volSymmTensorField
(
IOobject
(
IOobject::groupName("devRhoReff", U_.group()),
runTime_.timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
- (rho_*nut_)
*dev(twoSymm(fvc::grad(U_)))
- ((rho_*lambda_)*fvc::div(phi_))*symmTensor::I
)
IOobject::groupName("devRhoReff", U_.group()),
- (rho_*nut_)
*dev(twoSymm(fvc::grad(U_)))
- ((rho_*lambda_)*fvc::div(phi_))*symmTensor::I
);
}

View File

@ -133,26 +133,11 @@ Foam::RASModels::phasePressureModel::epsilon() 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>
(
"R",
dimensionSet(0, 2, -2, 0, 0),
Zero
)
)
IOobject::groupName("R", U_.group()),
mesh_,
dimensioned<symmTensor>(dimensionSet(0, 2, -2, 0, 0), Zero)
);
}
@ -216,25 +201,14 @@ Foam::RASModels::phasePressureModel::pPrimef() const
Foam::tmp<Foam::volSymmTensorField>
Foam::RASModels::phasePressureModel::devRhoReff() const
{
return tmp<volSymmTensorField>
return volSymmTensorField::New
(
new volSymmTensorField
IOobject::groupName("devRhoReff", U_.group()),
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
)
);
}

View File

@ -139,17 +139,9 @@ Foam::BlendedInterfacialModel<modelType>::K() const
tmp<volScalarField> x
(
new volScalarField
volScalarField::New
(
IOobject
(
modelType::typeName + ":K",
pair_.phase1().mesh().time().timeName(),
pair_.phase1().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
modelType::typeName + ":K",
pair_.phase1().mesh(),
dimensionedScalar(modelType::dimK, 0)
)
@ -207,17 +199,9 @@ Foam::BlendedInterfacialModel<modelType>::Kf() const
tmp<surfaceScalarField> x
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
modelType::typeName + ":Kf",
pair_.phase1().mesh().time().timeName(),
pair_.phase1().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
modelType::typeName + ":Kf",
pair_.phase1().mesh(),
dimensionedScalar(modelType::dimK, 0)
)
@ -338,17 +322,9 @@ Foam::BlendedInterfacialModel<modelType>::Ff() const
tmp<surfaceScalarField> x
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
modelType::typeName + ":Ff",
pair_.phase1().mesh().time().timeName(),
pair_.phase1().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
modelType::typeName + ":Ff",
pair_.phase1().mesh(),
dimensionedScalar(modelType::dimF*dimArea, 0)
)
@ -400,17 +376,9 @@ Foam::BlendedInterfacialModel<modelType>::D() const
tmp<volScalarField> x
(
new volScalarField
volScalarField::New
(
IOobject
(
modelType::typeName + ":D",
pair_.phase1().mesh().time().timeName(),
pair_.phase1().mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
modelType::typeName + ":D",
pair_.phase1().mesh(),
dimensionedScalar(modelType::dimD, 0)
)

View File

@ -72,25 +72,12 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f1
{
const fvMesh& mesh(phase1.mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"f",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar
(
dimless,
phase2.name() != continuousPhase_
)
)
);
return volScalarField::New
(
"f",
mesh,
dimensionedScalar(dimless, phase2.name() != continuousPhase_)
);
}
@ -102,25 +89,12 @@ Foam::tmp<Foam::volScalarField> Foam::blendingMethods::noBlending::f2
{
const fvMesh& mesh(phase1.mesh());
return
tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"f",
mesh.time().timeName(),
mesh
),
mesh,
dimensionedScalar
(
dimless,
phase1.name() == continuousPhase_
)
)
);
return volScalarField::New
(
"f",
mesh,
dimensionedScalar(dimless, phase1.name() == continuousPhase_)
);
}

View File

@ -46,19 +46,11 @@ namespace IATEsources
Foam::tmp<Foam::volScalarField>
Foam::diameterModels::IATEsources::dummy::R() const
{
return tmp<volScalarField>
return volScalarField::New
(
new volScalarField
(
IOobject
(
"R",
iate_.phase().U().time().timeName(),
iate_.phase().mesh()
),
iate_.phase().U().mesh(),
dimensionedScalar(dimless/dimTime, 0)
)
"R",
iate_.phase().U().mesh(),
dimensionedScalar(dimless/dimTime, 0)
);
}

View File

@ -64,14 +64,9 @@ Foam::diameterModels::IATEsources::randomCoalescence::R() const
{
tmp<volScalarField> tR
(
new volScalarField
volScalarField::New
(
IOobject
(
"R",
iate_.phase().U().time().timeName(),
iate_.phase().mesh()
),
"R",
iate_.phase().U().mesh(),
dimensionedScalar(dimless/dimTime, 0)
)

View File

@ -63,14 +63,9 @@ Foam::diameterModels::IATEsources::turbulentBreakUp::R() const
{
tmp<volScalarField> tR
(
new volScalarField
volScalarField::New
(
IOobject
(
"R",
iate_.phase().U().time().timeName(),
iate_.phase().mesh()
),
"R",
iate_.phase().U().mesh(),
dimensionedScalar(dimless/dimTime, 0)
)

View File

@ -67,22 +67,11 @@ 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,
false
),
phase_.U().mesh(),
d_
)
"d",
phase_.U().mesh(),
d_
);
}

View File

@ -14,6 +14,6 @@ if (!(runTime.timeIndex() % 5))
if (smi < -small)
{
Info<< "Resetting Dcorr to 0" << endl;
Dcorr == dimensionedVector("0", Dcorr.dimensions(), Zero);
Dcorr == dimensionedVector(Dcorr.dimensions(), Zero);
}
}

View File

@ -82,7 +82,7 @@ int main(int argc, char *argv[])
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimLength, Zero),
dimensionedVector(dimLength, Zero),
patchFieldTypes
);

View File

@ -56,7 +56,7 @@ int main(int argc, char *argv[])
IOobject::AUTO_WRITE
),
pMesh,
dimensionedVector("fvmU", dimLength, Zero),
dimensionedVector(dimLength, Zero),
pointPatchVectorField::calculatedType()
);

View File

@ -68,17 +68,9 @@ tmp<volScalarField> createScalarField
{
tmp<volScalarField> tfld
(
new volScalarField
volScalarField::New
(
IOobject
(
name,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE,
false
),
name,
mesh,
dimensionedScalar(dimless, 0),
zeroGradientFvPatchScalarField::typeName

View File

@ -134,7 +134,8 @@ int main(int argc, char *argv[])
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
false
),
mesh
);
@ -152,7 +153,8 @@ int main(int argc, char *argv[])
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
IOobject::AUTO_WRITE,
false
),
mesh
);

View File

@ -145,25 +145,25 @@ int main(int argc, char *argv[])
(
IOobject("uGas", runTime.timeName(), mesh),
mesh,
dimensionedVector("0", dimVelocity, vector::zero)
dimensionedVector(dimVelocity, vector::zero)
);
pointVectorField uGasp
(
IOobject("uGasp", runTime.timeName(), mesh),
pMesh,
dimensionedVector("0", dimVelocity, vector::zero)
dimensionedVector(dimVelocity, vector::zero)
);
volVectorField uLiq
(
IOobject("uLiq", runTime.timeName(), mesh),
mesh,
dimensionedVector("0", dimVelocity, vector::zero)
dimensionedVector(dimVelocity, vector::zero)
);
pointVectorField uLiqp
(
IOobject("uLiqp", runTime.timeName(), mesh),
pMesh,
dimensionedVector("0", dimVelocity, vector::zero)
dimensionedVector(dimVelocity, vector::zero)
);
// Cell centres and points

View File

@ -94,9 +94,12 @@ Foam::regIOobject::regIOobject(const regIOobject& rio, bool registerCopy)
watchIndices_(),
eventNo_(db().getEvent())
{
if (registerCopy && rio.registered_)
if (registerCopy)
{
const_cast<regIOobject&>(rio).checkOut();
if (rio.registered_)
{
const_cast<regIOobject&>(rio).checkOut();
}
checkIn();
}
}

View File

@ -57,7 +57,7 @@ Foam::anisotropicFilter::anisotropicFilter
mesh
),
mesh,
dimensionedVector("zero", dimLength*dimLength, Zero),
dimensionedVector(dimLength*dimLength, Zero),
calculatedFvPatchVectorField::typeName
)
{
@ -97,7 +97,7 @@ Foam::anisotropicFilter::anisotropicFilter
mesh
),
mesh,
dimensionedVector("zero", dimLength*dimLength, Zero),
dimensionedVector(dimLength*dimLength, Zero),
calculatedFvPatchScalarField::typeName
)
{

View File

@ -143,7 +143,7 @@ void Foam::porosityModels::DarcyForchheimer::calcTransformModelData()
IOobject::NO_WRITE
),
mesh_,
dimensionedTensor("0", dXYZ_.dimensions(), Zero)
dimensionedTensor(dXYZ_.dimensions(), Zero)
);
volTensorField Fout
(
@ -156,7 +156,7 @@ void Foam::porosityModels::DarcyForchheimer::calcTransformModelData()
IOobject::NO_WRITE
),
mesh_,
dimensionedTensor("0", fXYZ_.dimensions(), Zero)
dimensionedTensor(fXYZ_.dimensions(), Zero)
);
UIndirectList<tensor>(Dout, mesh_.cellZones()[cellZoneIDs_[0]]) = D_[0];

View File

@ -51,7 +51,7 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
false
),
mesh_,
dimensionedVector("zero", dimless/dimLength, Zero)
dimensionedVector(dimless/dimLength, Zero)
),
nVectors_
(
@ -65,7 +65,7 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
false
),
mesh_,
dimensionedVector("zero", dimless/dimLength, Zero)
dimensionedVector(dimless/dimLength, Zero)
)
{
calcLeastSquaresVectors();

View File

@ -51,7 +51,7 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
false
),
mesh_,
dimensionedVector("zero", dimless/dimLength, Zero)
dimensionedVector(dimless/dimLength, Zero)
),
nVectors_
(
@ -65,7 +65,7 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
false
),
mesh_,
dimensionedVector("zero", dimless/dimLength, Zero)
dimensionedVector(dimless/dimLength, Zero)
)
{
calcLeastSquaresVectors();

View File

@ -51,7 +51,7 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
false
),
mesh_,
dimensionedVector("zero", dimless/dimLength, Zero)
dimensionedVector(dimless/dimLength, Zero)
),
nVectors_
(
@ -65,7 +65,7 @@ Foam::leastSquaresVectors::leastSquaresVectors(const fvMesh& mesh)
false
),
mesh_,
dimensionedVector("zero", dimless/dimLength, Zero)
dimensionedVector(dimless/dimLength, Zero)
)
{
calcLeastSquaresVectors();

View File

@ -383,18 +383,9 @@ Foam::tmp<Foam::surfaceVectorField> Foam::fvMesh::delta() const
tmp<surfaceVectorField> tdelta
(
new surfaceVectorField
surfaceVectorField::New
(
IOobject
(
"delta",
pointsInstance(),
meshSubDir,
*this,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"delta",
*this,
dimLength
)

View File

@ -105,7 +105,7 @@ bool Foam::patchDistMethods::advectionDiffusion::correct
false
),
mesh_,
dimensionedVector("ny", dimless, Zero),
dimensionedVector(dimless, Zero),
patchTypes<vector>(mesh_, patchIDs_)
);

View File

@ -42,14 +42,9 @@ Foam::PhiScheme<Type, PhiLimiter>::limiter
tmp<surfaceScalarField> tLimiter
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"PhiLimiter",
mesh.time().timeName(),
mesh
),
"PhiLimiter",
mesh,
dimless
)

View File

@ -126,22 +126,11 @@ public:
const GeometricField<Type, fvPatchField, volMesh>& vf
) const
{
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
(
IOobject
(
vf.name() + "BlendingFactor",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar(dimless, blendingFactor_)
)
vf.name() + "BlendingFactor",
this->mesh(),
dimensionedScalar(dimless, blendingFactor_)
);
}
@ -151,22 +140,11 @@ public:
const GeometricField<Type, fvPatchField, volMesh>&
) const
{
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
(
IOobject
(
"blendedLimiter",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar(dimless, 1 - blendingFactor_)
)
"blendedLimiter",
this->mesh(),
dimensionedScalar(dimless, 1 - blendingFactor_)
);
}

View File

@ -109,22 +109,11 @@ public:
const GeometricField<Type, fvPatchField, volMesh>&
) const
{
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
(
IOobject
(
"upwindLimiter",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar(dimless, 0)
)
"upwindLimiter",
this->mesh(),
dimensionedScalar(dimless, 0)
);
}

View File

@ -210,25 +210,22 @@ public:
<< exit(FatalError);
}
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
vf.name() + "BlendingFactor",
scalar(1)
- max
(
vf.name() + "BlendingFactor",
scalar(1)
- max
min
(
min
(
(
mesh.time().deltaT()*mesh.deltaCoeffs()
*mag(tUflux)/mesh.magSf()
- Co1_
)/(Co2_ - Co1_),
scalar(1)
),
scalar(0)
)
mesh.time().deltaT()*mesh.deltaCoeffs()
*mag(tUflux)/mesh.magSf()
- Co1_
)/(Co2_ - Co1_),
scalar(1)
),
scalar(0)
)
);
}

View File

@ -242,21 +242,18 @@ public:
(sumPhi/mesh.V().field())*(0.5*mesh.time().deltaTValue());
Co.correctBoundaryConditions();
return tmp<surfaceScalarField>
return surfaceScalarField::New
(
new surfaceScalarField
vf.name() + "BlendingFactor",
scalar(1)
- max
(
vf.name() + "BlendingFactor",
scalar(1)
- max
min
(
min
(
(fvc::interpolate(Co) - Co1_)/(Co2_ - Co1_),
scalar(1)
),
scalar(0)
)
(fvc::interpolate(Co) - Co1_)/(Co2_ - Co1_),
scalar(1)
),
scalar(0)
)
);
}

View File

@ -138,14 +138,9 @@ public:
tmp<surfaceScalarField> tclippedLinearWeights
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"clippedLinearWeights",
mesh.time().timeName(),
mesh
),
"clippedLinearWeights",
mesh,
dimless
)

View File

@ -150,17 +150,9 @@ Foam::linearUpwind<Foam::vector>::correction
tmp<surfaceVectorField> tsfCorr
(
new surfaceVectorField
surfaceVectorField::New
(
IOobject
(
"linearUpwind::correction(" + vf.name() + ')',
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"linearUpwind::correction(" + vf.name() + ')',
mesh,
dimensioned<vector>(vf.name(), vf.dimensions(), Zero)
)

View File

@ -100,17 +100,9 @@ public:
{
tmp<surfaceScalarField> taw
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"midPointWeights",
this->mesh().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
"midPointWeights",
this->mesh(),
dimensionedScalar(dimless, 0.5)
)

View File

@ -110,14 +110,9 @@ public:
tmp<surfaceScalarField> treverseLinearWeights
(
new surfaceScalarField
surfaceScalarField::New
(
IOobject
(
"reverseLinearWeights",
mesh.time().timeName(),
mesh
),
"reverseLinearWeights",
mesh,
dimless
)

View File

@ -69,7 +69,7 @@ Foam::functionObjects::wallShearStress::calcShearStress
(
type(),
mesh_,
dimensionedVector("0", Reff.dimensions(), Zero)
dimensionedVector(Reff.dimensions(), Zero)
)
);

View File

@ -64,7 +64,7 @@ Foam::functionObjects::icoUncoupledKinematicCloud::icoUncoupledKinematicCloud
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE
),
dimensionedVector("g", dimAcceleration, Zero)
dimensionedVector(dimAcceleration, Zero)
),
laminarTransport_
(

View File

@ -204,7 +204,7 @@ void Foam::fv::meanVelocityForce::addSup
IOobject::NO_WRITE
),
mesh_,
dimensionedVector("zero", eqn.dimensions()/dimVolume, Zero)
dimensionedVector(eqn.dimensions()/dimVolume, Zero)
);
scalar gradP = gradP0_ + dGradP_;

View File

@ -154,7 +154,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
IOobject::NO_WRITE
),
nbrMesh,
dimensionedVector("zero", U.dimensions(), Zero)
dimensionedVector(U.dimensions(), Zero)
);
// Map local velocity onto neighbour region
@ -208,7 +208,7 @@ void Foam::fv::interRegionExplicitPorositySource::addSup
IOobject::NO_WRITE
),
nbrMesh,
dimensionedVector("zero", U.dimensions(), Zero)
dimensionedVector(U.dimensions(), Zero)
);
// Map local velocity onto neighbour region

View File

@ -36,7 +36,7 @@ Foam::coalCloudList::UTrans() const
(
"UTransEff",
mesh_,
dimensionedVector("zero", dimMass*dimVelocity, Zero)
dimensionedVector(dimMass*dimVelocity, Zero)
)
);

View File

@ -370,7 +370,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
IOobject::AUTO_WRITE
),
mesh_,
dimensionedVector("zero", dimMass*dimVelocity, Zero)
dimensionedVector(dimMass*dimVelocity, Zero)
)
),
UCoeff_

View File

@ -190,13 +190,10 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
if (applyGravity_)
(
phiGByA = tmp<surfaceScalarField>
phiGByA = surfaceScalarField::New
(
new surfaceScalarField
(
"phiGByA",
deltaT*(g & mesh.Sf())*fvc::interpolate(1.0 - rhoc/rho)
)
"phiGByA",
deltaT*(g & mesh.Sf())*fvc::interpolate(1.0 - rhoc/rho)
)
);
@ -230,13 +227,10 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
// ~~~~~~~~~~~~~~~~~
// correction volumetric flux
phiCorrect_ = tmp<surfaceScalarField>
phiCorrect_ = surfaceScalarField::New
(
new surfaceScalarField
(
cloudName + ":phiCorrect",
alphaEqn.flux()/fvc::interpolate(alpha_)
)
cloudName + ":phiCorrect",
alphaEqn.flux()/fvc::interpolate(alpha_)
);
// limit the correction flux
@ -253,7 +247,7 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
IOobject::NO_WRITE
),
mesh,
dimensionedVector("zero", dimVelocity, Zero),
dimensionedVector(dimVelocity, Zero),
fixedValueFvPatchField<vector>::typeName
);
U.primitiveFieldRef() = uAverage.primitiveField();

View File

@ -195,20 +195,17 @@ Info << " Creating total velocity field" << endl;
volVectorField totalVelocity
(
IOobject
(
"velocity_total",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
"velocity_total",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector("zero", dimVelocity, Zero)
dimensionedVector(dimVelocity, Zero)
);
/*---------------------------------------------------------------------------*\

View File

@ -1639,7 +1639,7 @@ Foam::medialAxisMeshMover::medialAxisMeshMover
false
),
pMesh(),
dimensionedVector("dispVec", dimLength, Zero)
dimensionedVector(dimLength, Zero)
),
medialRatio_
(
@ -1681,7 +1681,7 @@ Foam::medialAxisMeshMover::medialAxisMeshMover
false
),
pMesh(),
dimensionedVector("medialVec", dimLength, Zero)
dimensionedVector(dimLength, Zero)
)
{
update(dict);

View File

@ -1828,7 +1828,7 @@ Foam::tmp<Foam::pointVectorField> Foam::meshRefinement::makeDisplacementField
IOobject::AUTO_WRITE
),
pMesh,
dimensionedVector("displacement", dimLength, Zero),
dimensionedVector(dimLength, Zero),
patchFieldTypes
)
);

View File

@ -868,7 +868,7 @@ Foam::snappyLayerDriver::makeLayerDisplacementField
IOobject::AUTO_WRITE
),
pMesh,
dimensionedVector("displacement", dimLength, Zero),
dimensionedVector(dimLength, Zero),
patchFieldTypes,
actualPatchTypes
)

View File

@ -39,7 +39,6 @@ namespace regionModels
void Foam::regionModels::regionModel1D::constructMeshObjects()
{
nMagSfPtr_.reset
(
new surfaceScalarField

View File

@ -56,7 +56,7 @@ void Foam::regionModels::singleLayerRegion::constructMeshObjects()
NO_WRITE
),
regionMesh(),
dimensionedVector("zero", dimless, Zero),
dimensionedVector(dimless, Zero),
zeroGradientFvPatchField<vector>::typeName
)
);

View File

@ -88,7 +88,7 @@ void kinematicSingleLayer::resetPrimaryRegionSourceTerms()
}
rhoSpPrimary_ == dimensionedScalar(rhoSp_.dimensions(), 0);
USpPrimary_ == dimensionedVector("zero", USp_.dimensions(), Zero);
USpPrimary_ == dimensionedVector(USp_.dimensions(), Zero);
pSpPrimary_ == dimensionedScalar(pSp_.dimensions(), 0);
}
@ -682,7 +682,7 @@ kinematicSingleLayer::kinematicSingleLayer
IOobject::NO_WRITE
),
primaryMesh(),
dimensionedVector("zero", USp_.dimensions(), Zero)
dimensionedVector(USp_.dimensions(), Zero)
),
pSpPrimary_
(
@ -722,7 +722,7 @@ kinematicSingleLayer::kinematicSingleLayer
IOobject::NO_WRITE
),
regionMesh(),
dimensionedVector("zero", dimVelocity, Zero),
dimensionedVector(dimVelocity, Zero),
this->mappedFieldAndInternalPatchTypes<vector>()
),
pPrimary_

View File

@ -76,7 +76,7 @@ tmp<volVectorField> laminar::Us() const
(
typeName + ":Us",
filmModel_.regionMesh(),
dimensionedVector("zero", dimVelocity, Zero),
dimensionedVector(dimVelocity, Zero),
extrapolatedCalculatedFvPatchVectorField::typeName
)
);

Some files were not shown because too many files have changed in this diff Show More