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

- src/optimisation
This commit is contained in:
Mark Olesen
2024-01-23 10:55:56 +01:00
parent c138f89c1f
commit ec2b1be8c5
20 changed files with 137 additions and 261 deletions

View File

@ -229,25 +229,16 @@ tmp<volScalarField> ATCModel::createLimiter
const labelList& zeroCells = zeroType->getZeroATCcells(); const labelList& zeroCells = zeroType->getZeroATCcells();
const label nSmooth = dict.getOrDefault<label>("nSmooth", 0); const label nSmooth = dict.getOrDefault<label>("nSmooth", 0);
tmp<volScalarField> tlimiter auto tlimiter = volScalarField::New
(
new volScalarField
(
IOobject
( (
"limiter", "limiter",
mesh.time().timeName(), IOobject::NO_REGISTER,
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh, mesh,
scalar(1), scalar(1),
dimless, dimless,
fvPatchFieldBase::zeroGradientType() fvPatchFieldBase::zeroGradientType()
)
); );
volScalarField& limiter = tlimiter.ref(); auto& limiter = tlimiter.ref();
computeLimiter(limiter, zeroCells, nSmooth); computeLimiter(limiter, zeroCells, nSmooth);

View File

@ -102,23 +102,14 @@ void ATCUaGradU::addATC(fvVectorMatrix& UaEqn)
tmp<volTensorField> ATCUaGradU::getFISensitivityTerm() const tmp<volTensorField> ATCUaGradU::getFISensitivityTerm() const
{ {
tmp<volTensorField> tvolSDTerm auto tvolSDTerm = volTensorField::New
(
new volTensorField
(
IOobject
( (
"ATCFISensitivityTerm" + type(), "ATCFISensitivityTerm" + type(),
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedTensor(sqr(dimLength)/pow(dimTime, 3), Zero) dimensionedTensor(sqr(dimLength)/pow(dimTime, 3), Zero)
)
); );
volTensorField& volSDTerm = tvolSDTerm.ref(); auto& volSDTerm = tvolSDTerm.ref();
const volVectorField& U = primalVars_.U(); const volVectorField& U = primalVars_.U();
const volVectorField& Ua = adjointVars_.Ua(); const volVectorField& Ua = adjointVars_.Ua();

View File

@ -251,8 +251,8 @@ tmp<scalarField> boundaryAdjointContributionIncompressible::momentumDiffusion()
tmp<scalarField> boundaryAdjointContributionIncompressible::laminarDiffusivity() tmp<scalarField> boundaryAdjointContributionIncompressible::laminarDiffusivity()
{ {
tmp<scalarField> tnu(new scalarField(patch_.size(), Zero)); auto tnu = tmp<scalarField>::New(patch_.size(), Zero);
scalarField& nu = tnu.ref(); auto& nu = tnu.ref();
const autoPtr<incompressible::turbulenceModel>& turbulenceModel = const autoPtr<incompressible::turbulenceModel>& turbulenceModel =
primalVars_.turbulence(); primalVars_.turbulence();
@ -272,13 +272,10 @@ tmp<scalarField> boundaryAdjointContributionIncompressible::thermalDiffusion()
tmp<scalarField> talphaEff = turbulenceModel.alphaEff(patch_.index()); tmp<scalarField> talphaEff = turbulenceModel.alphaEff(patch_.index());
*/ */
tmp<scalarField> talphaEff(new scalarField(patch_.size(), Zero));
WarningInFunction WarningInFunction
<< "no abstract thermalDiffusion is implemented. Returning zero field"; << "no abstract thermalDiffusion is implemented. Returning zero field";
return tmp<scalarField>::New(patch_.size(), Zero);
return talphaEff;
} }

View File

@ -171,9 +171,7 @@ Foam::elasticityMotionSolver::elasticityMotionSolver
Foam::tmp<Foam::pointField> Foam::elasticityMotionSolver::curPoints() const Foam::tmp<Foam::pointField> Foam::elasticityMotionSolver::curPoints() const
{ {
tmp<pointField> tnewPoints(new pointField(mesh().points())); return tmp<pointField>::New(mesh().points());
return tnewPoints;
} }

View File

@ -74,8 +74,8 @@ Foam::volumetricBSplinesMotionSolver::volumetricBSplinesMotionSolver
Foam::tmp<Foam::pointField> Foam::tmp<Foam::pointField>
Foam::volumetricBSplinesMotionSolver::curPoints() const Foam::volumetricBSplinesMotionSolver::curPoints() const
{ {
tmp<vectorField> tPointMovement(new vectorField(mesh().points())); auto tPointMovement = tmp<vectorField>::New(mesh().points());
vectorField& pointMovement = tPointMovement.ref(); auto& pointMovement = tPointMovement.ref();
label pastControlPoints(0); label pastControlPoints(0);
PtrList<NURBS3DVolume>& boxes = volBSplinesBase_.boxesRef(); PtrList<NURBS3DVolume>& boxes = volBSplinesBase_.boxesRef();

View File

@ -81,7 +81,8 @@ void Foam::volPointInterpolationAdjoint::pushUntransformedData
template<class Type> template<class Type>
Foam::tmp<Foam::Field<Type>> Foam::volPointInterpolationAdjoint::flatBoundaryField Foam::tmp<Foam::Field<Type>>
Foam::volPointInterpolationAdjoint::flatBoundaryField
( (
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) const ) const
@ -89,11 +90,8 @@ Foam::tmp<Foam::Field<Type>> Foam::volPointInterpolationAdjoint::flatBoundaryFie
const fvMesh& mesh = vf.mesh(); const fvMesh& mesh = vf.mesh();
const fvBoundaryMesh& bm = mesh.boundary(); const fvBoundaryMesh& bm = mesh.boundary();
tmp<Field<Type>> tboundaryVals auto tboundaryVals = tmp<Field<Type>>::New(mesh.nBoundaryFaces());
( auto& boundaryVals = tboundaryVals.ref();
new Field<Type>(mesh.nBoundaryFaces())
);
Field<Type>& boundaryVals = tboundaryVals.ref();
forAll(vf.boundaryField(), patchi) forAll(vf.boundaryField(), patchi)
{ {
@ -188,11 +186,8 @@ void Foam::volPointInterpolationAdjoint::interpolateSensitivitiesField
const fvMesh& Mesh = mesh(); const fvMesh& Mesh = mesh();
const fvBoundaryMesh& bm = Mesh.boundary(); const fvBoundaryMesh& bm = Mesh.boundary();
tmp<Field<Type>> tboundaryVals auto tboundaryVals = tmp<Field<Type>>::New(Mesh.nBoundaryFaces(), Zero);
( auto& boundaryVals = tboundaryVals.ref();
new Field<Type>(Mesh.nBoundaryFaces(), Zero)
);
Field<Type>& boundaryVals = tboundaryVals.ref();
// Do points on 'normal' patches from the surrounding patch faces // Do points on 'normal' patches from the surrounding patch faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -262,7 +262,7 @@ void Foam::designVariables::addFvOptions
Foam::tmp<Foam::scalarField> Foam::designVariables::constraintValues() Foam::tmp<Foam::scalarField> Foam::designVariables::constraintValues()
{ {
return tmp<scalarField>(nullptr); return nullptr;
} }

View File

@ -267,12 +267,7 @@ Foam::tmp<Foam::scalarField> Foam::updateMethod::readOrZeroField
const label size const label size
) )
{ {
return tmp<scalarField> return tmp<scalarField>::New(name, *this, size, IOobjectOption::LAZY_READ);
(
found(name) ?
new scalarField(name, *this, size) :
new scalarField(size, Zero)
);
} }

View File

@ -1342,8 +1342,9 @@ Foam::tmp<Foam::tensorField> Foam::NURBS3DVolume::dndbBasedSensitivities
const fvPatch& patch = mesh_.boundary()[patchI]; const fvPatch& patch = mesh_.boundary()[patchI];
const polyPatch& ppatch = patch.patch(); const polyPatch& ppatch = patch.patch();
// Return field // Return field
tmp<tensorField> tdndbSens(new tensorField(patch.size(), Zero)); auto tdndbSens = tmp<tensorField>::New(patch.size(), Zero);
tensorField& dndbSens = tdndbSens.ref(); auto& dndbSens = tdndbSens.ref();
// Auxiliary quantities // Auxiliary quantities
deltaBoundary deltaBoundary(mesh_); deltaBoundary deltaBoundary(mesh_);
const label patchStart = ppatch.start(); const label patchStart = ppatch.start();
@ -1574,8 +1575,8 @@ Foam::tmp<Foam::vectorField> Foam::NURBS3DVolume::computeNewPoints
const vectorField& parameterizedPoints = tparameterizedPoints(); const vectorField& parameterizedPoints = tparameterizedPoints();
// Return field. Initialized with current mesh points // Return field. Initialized with current mesh points
tmp<vectorField> tnewPoints(new vectorField(mesh_.points())); auto tnewPoints = tmp<vectorField>::New(mesh_.points());
vectorField& newPoints = tnewPoints.ref(); auto& newPoints = tnewPoints.ref();
// Update position of parameterized points // Update position of parameterized points
forAll(parameterizedPoints, pI) forAll(parameterizedPoints, pI)
@ -1612,8 +1613,8 @@ Foam::tmp<Foam::vectorField> Foam::NURBS3DVolume::computeNewBoundaryPoints
} }
// Return field. Initialized with current mesh points // Return field. Initialized with current mesh points
tmp<vectorField> tnewPoints(new vectorField(mesh_.points())); auto tnewPoints = tmp<vectorField>::New(mesh_.points());
vectorField& newPoints = tnewPoints.ref(); auto& newPoints = tnewPoints.ref();
// Update position of parameterized boundary points // Update position of parameterized boundary points
for (const label patchI : patchesToBeMoved) for (const label patchI : patchesToBeMoved)
@ -1883,21 +1884,12 @@ Foam::tmp<Foam::volTensorField> Foam::NURBS3DVolume::getDxCellsDb
const vectorField& parametricCoordinates = getParametricCoordinates(); const vectorField& parametricCoordinates = getParametricCoordinates();
// Set return field to zero // Set return field to zero
tmp<volTensorField> tDxDb auto tDxDb = volTensorField::New
(
new volTensorField
(
IOobject
( (
"DxDb", "DxDb",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedTensor(dimless, Zero) dimensionedTensor(dimless, Zero)
)
); );
volTensorField& DxDb = tDxDb.ref(); volTensorField& DxDb = tDxDb.ref();

View File

@ -301,8 +301,8 @@ void Foam::adjointSolverManager::solveAdjointEquations()
Foam::tmp<Foam::scalarField> Foam::tmp<Foam::scalarField>
Foam::adjointSolverManager::aggregateSensitivities() Foam::adjointSolverManager::aggregateSensitivities()
{ {
tmp<scalarField> tsens(new scalarField(0)); auto tsens = tmp<scalarField>::New();
scalarField& sens = tsens.ref(); auto& sens = tsens.ref();
// Sum sensitivities from all objectives expect the constraints // Sum sensitivities from all objectives expect the constraints
for (const label solveri : objectiveSolverIDs_) for (const label solveri : objectiveSolverIDs_)

View File

@ -131,7 +131,8 @@ void incompressibleVars::setMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
pInst() pInst()
) )
@ -146,7 +147,8 @@ void incompressibleVars::setMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
UInst() UInst()
) )
@ -161,7 +163,8 @@ void incompressibleVars::setMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
phiInst() phiInst()
) )

View File

@ -76,7 +76,8 @@ void incompressibleAdjointMeanFlowVars::setMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
paInst() paInst()
) )
@ -91,7 +92,8 @@ void incompressibleAdjointMeanFlowVars::setMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
UaInst() UaInst()
) )
@ -106,7 +108,8 @@ void incompressibleAdjointMeanFlowVars::setMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
phiaInst() phiaInst()
) )

View File

@ -80,18 +80,11 @@ tmp<volSymmTensorField> adjointLaminar::devReff
const volVectorField& U const volVectorField& U
) const ) const
{ {
return tmp<volSymmTensorField> return volSymmTensorField::New
(
new volSymmTensorField
(
IOobject
( (
"devRhoReff", "devRhoReff",
runTime_.timeName(), IOobject::NO_REGISTER,
mesh_, (
IOobject::NO_READ,
IOobject::NO_WRITE
),
-nu()*devTwoSymm(fvc::grad(U)) -nu()*devTwoSymm(fvc::grad(U))
) )
); );
@ -110,22 +103,12 @@ tmp<fvVectorMatrix> adjointLaminar::divDevReff(volVectorField& U) const
tmp<volVectorField> adjointLaminar::adjointMeanFlowSource() tmp<volVectorField> adjointLaminar::adjointMeanFlowSource()
{ {
return tmp<volVectorField>::New return volVectorField::New
(
IOobject
( (
"adjointMeanFlowSource", "adjointMeanFlowSource",
runTime_.timeName(), IOobject::NO_REGISTER,
mesh_, mesh_,
IOobject::NO_READ, dimensionedVector(dimensionSet(0, 1, -2, 0, 0), Zero)
IOobject::NO_WRITE
),
mesh_,
dimensionedVector
(
dimensionSet(0, 1, -2, 0, 0),
Zero
)
); );
} }
@ -151,16 +134,10 @@ const boundaryVectorField& adjointLaminar::wallFloCoSensitivities()
tmp<volScalarField> adjointLaminar::distanceSensitivities() tmp<volScalarField> adjointLaminar::distanceSensitivities()
{ {
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"adjointEikonalSource" + type(), "adjointEikonalSource" + type(),
runTime_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimLength/pow3(dimTime), Zero) dimensionedScalar(dimLength/pow3(dimTime), Zero)
); );
@ -169,16 +146,10 @@ tmp<volScalarField> adjointLaminar::distanceSensitivities()
tmp<volTensorField> adjointLaminar::FISensitivityTerm() tmp<volTensorField> adjointLaminar::FISensitivityTerm()
{ {
return tmp<volTensorField>::New return volTensorField::New
(
IOobject
( (
"volumeSensTerm" + type(), "volumeSensTerm" + type(),
runTime_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedTensor(dimensionSet(0, 2, -3, 0, 0), Zero) dimensionedTensor(dimensionSet(0, 2, -3, 0, 0), Zero)
); );

View File

@ -440,32 +440,18 @@ void adjointSpalartAllmaras::updatePrimalRelatedFields()
tmp<volScalarField> adjointSpalartAllmaras::allocateMask() tmp<volScalarField> adjointSpalartAllmaras::allocateMask()
{ {
tmp<volScalarField> mask;
if (limitAdjointProduction_) if (limitAdjointProduction_)
{ {
mask = ATCModel::createLimiter(mesh_, coeffDict_); return ATCModel::createLimiter(mesh_, coeffDict_);
}
else
{
mask = tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"unitMask",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("unit", dimless, scalar(1))
)
);
} }
return mask; return volScalarField::New
(
"unitMask",
IOobject::NO_REGISTER,
mesh_,
dimensionedScalar("unit", dimless, scalar(1))
);
} }
@ -714,17 +700,10 @@ tmp<volSymmTensorField> adjointSpalartAllmaras::devReff
const volVectorField& U const volVectorField& U
) const ) const
{ {
return return volSymmTensorField::New
tmp<volSymmTensorField>::New
(
IOobject
( (
"devRhoReff", "devRhoReff",
runTime_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
-nuEff()*devTwoSymm(fvc::grad(U)) -nuEff()*devTwoSymm(fvc::grad(U))
); );
} }
@ -767,10 +746,8 @@ tmp<volScalarField> adjointSpalartAllmaras::nutJacobianTMVar1() const
tmp<scalarField> adjointSpalartAllmaras::diffusionCoeffVar1(label patchI) const tmp<scalarField> adjointSpalartAllmaras::diffusionCoeffVar1(label patchI) const
{ {
tmp<scalarField> tdiffCoeff auto tdiffCoeff =
( tmp<scalarField>::New(mesh_.boundary()[patchI].size(), Zero);
new scalarField(mesh_.boundary()[patchI].size(), Zero)
);
scalarField& diffCoeff = tdiffCoeff.ref(); scalarField& diffCoeff = tdiffCoeff.ref();

View File

@ -125,21 +125,14 @@ tmp<volScalarField::Internal> adjointkOmegaSST::GbyNu
tmp<volScalarField> adjointkOmegaSST::zeroFirstCell() tmp<volScalarField> adjointkOmegaSST::zeroFirstCell()
{ {
auto tzeroFirstCell = auto tzeroFirstCell = volScalarField::New
tmp<volScalarField>::New
(
IOobject
( (
"zeroFirstCell", "zeroFirstCell",
runTime_.timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimless, Foam::one{}) dimensionedScalar(dimless, Foam::one{})
); );
volScalarField& zeroFirstCell = tzeroFirstCell.ref(); auto& zeroFirstCell = tzeroFirstCell.ref();
firstCellIDs_.resize(mesh_.nCells(), -1); firstCellIDs_.resize(mesh_.nCells(), -1);
label counter(0); label counter(0);
@ -1799,8 +1792,7 @@ tmp<volSymmTensorField> adjointkOmegaSST::devReff
const volVectorField& U const volVectorField& U
) const ) const
{ {
return return tmp<volSymmTensorField>::New
tmp<volSymmTensorField>::New
( (
IOobject IOobject
( (

View File

@ -174,10 +174,10 @@ public:
const autoPtr<incompressible::RASModelVariables>& const autoPtr<incompressible::RASModelVariables>&
turbVars = primalVars_.RASModelVariables(); turbVars = primalVars_.RASModelVariables();
return return volScalarField::New
tmp<volScalarField>::New
( (
"nuEff", "nuEff",
IOobject::NO_REGISTER,
lamTrans.nu() + turbVars().nut() lamTrans.nu() + turbVars().nut()
); );
} }

View File

@ -305,16 +305,10 @@ tmp<volScalarField> RASModelVariables::nutJacobianVar1
<< "jutJacobianVar1 not implemented for the current turbulence model." << "jutJacobianVar1 not implemented for the current turbulence model."
<< "Returning zero field" << endl; << "Returning zero field" << endl;
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"nutJacobianVar1", "nutJacobianVar1",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero) dimensionedScalar(dimless, Zero)
); );
@ -330,16 +324,10 @@ tmp<volScalarField> RASModelVariables::nutJacobianVar2
<< "nutJacobianVar2 not implemented for the current turbulence model." << "nutJacobianVar2 not implemented for the current turbulence model."
<< "Returning zero field" << endl; << "Returning zero field" << endl;
return tmp<volScalarField>::New return volScalarField::New
(
IOobject
( (
"nutJacobianVar2", "nutJacobianVar2",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero) dimensionedScalar(dimless, Zero)
); );
@ -426,16 +414,10 @@ tmp<volSymmTensorField> RASModelVariables::devReff
const volVectorField& U const volVectorField& U
) const ) const
{ {
return tmp<volSymmTensorField>::New return volSymmTensorField::New
(
IOobject
( (
"devRhoReff", "devRhoReff",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
- (laminarTransport.nu() + nut())*devTwoSymm(fvc::grad(U)) - (laminarTransport.nu() + nut())*devTwoSymm(fvc::grad(U))
); );
} }

View File

@ -148,17 +148,10 @@ inline tmp<volScalarField> RASModelVariables::nut() const
return tmp<volScalarField>(nutRef()); return tmp<volScalarField>(nutRef());
} }
return return volScalarField::New
tmp<volScalarField>::New
(
IOobject
( (
"dummylaminarNut", "dummylaminarNut",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimViscosity, Zero) dimensionedScalar(dimViscosity, Zero)
); );

View File

@ -80,16 +80,10 @@ tmp<volScalarField> SpalartAllmaras::nutJacobianVar1
const singlePhaseTransportModel& laminarTransport const singlePhaseTransportModel& laminarTransport
) const ) const
{ {
auto tnutJacobian = tmp<volScalarField>::New auto tnutJacobian = volScalarField::New
(
IOobject
( (
"nutJacobianVar1", "nutJacobianVar1",
mesh_.time().timeName(), IOobject::NO_REGISTER,
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_, mesh_,
dimensionedScalar(dimless, Zero) dimensionedScalar(dimless, Zero)
); );

View File

@ -63,7 +63,8 @@ void kOmegaSST::allocateMeanFields()
mesh_.time().timeName(), mesh_.time().timeName(),
mesh_, mesh_,
IOobject::READ_IF_PRESENT, IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE IOobject::AUTO_WRITE,
IOobject::REGISTER
), ),
mesh_, mesh_,
dimensionedScalar(dimArea/pow3(dimTime), Zero) dimensionedScalar(dimArea/pow3(dimTime), Zero)
@ -120,12 +121,13 @@ tmp<volScalarField::Internal> kOmegaSST::computeG()
); );
// NB: leave tmp registered (for correctBoundaryConditions) // NB: leave tmp registered (for correctBoundaryConditions)
auto tG = auto tG = volScalarField::Internal::New
tmp<volScalarField::Internal>::New
( (
turbModel.GName(), turbModel.GName(),
IOobject::REGISTER,
nutRefInst()*GbyNu0 nutRefInst()*GbyNu0
); );
// Use correctBoundaryConditions instead of updateCoeffs to avoid // Use correctBoundaryConditions instead of updateCoeffs to avoid
// messing with updateCoeffs in the next iteration of omegaEqn // messing with updateCoeffs in the next iteration of omegaEqn
TMVar2Inst().correctBoundaryConditions(); TMVar2Inst().correctBoundaryConditions();