ENH: yPlusLES function object - store result on mesh database

This commit is contained in:
andy
2013-09-19 15:16:07 +01:00
parent 500315b17b
commit 0b2b703760

View File

@ -215,6 +215,30 @@ Foam::yPlusLES::yPlusLES
) << "No fvMesh available, deactivating." << nl ) << "No fvMesh available, deactivating." << nl
<< endl; << endl;
} }
if (active_)
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
volScalarField* yPlusLESPtr
(
new volScalarField
(
IOobject
(
type(),
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedScalar("0", dimless, 0.0)
)
);
mesh.objectRegistry::store(yPlusLESPtr);
}
} }
@ -267,17 +291,10 @@ void Foam::yPlusLES::write()
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
volScalarField yPlusLES volScalarField& yPlusLES =
const_cast<volScalarField&>
( (
IOobject mesh.lookupObject<volScalarField>(type())
(
"yPlusLES",
mesh.time().timeName(),
mesh,
IOobject::NO_READ
),
mesh,
dimensionedScalar("0", dimless, 0.0)
); );
if (log_) if (log_)
@ -296,7 +313,8 @@ void Foam::yPlusLES::write()
if (log_) if (log_)
{ {
Info<< " writing field " << yPlusLES.name() << nl Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << yPlusLES.name() << nl
<< endl; << endl;
} }