ENH: yPLusRAS function object - store result on mesh database

This commit is contained in:
andy
2013-09-19 15:16:37 +01:00
parent 0b2b703760
commit 4c4fb677ce

View File

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