From 0b2b7037602db3609dad21f129a4b613285e62de Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Thu, 19 Sep 2013 15:16:07 +0100 Subject: [PATCH] ENH: yPlusLES function object - store result on mesh database --- .../utilities/yPlusLES/yPlusLES.C | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C index 00c7e36087d..88bd22b2195 100644 --- a/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C +++ b/src/postProcessing/functionObjects/utilities/yPlusLES/yPlusLES.C @@ -215,6 +215,30 @@ Foam::yPlusLES::yPlusLES ) << "No fvMesh available, deactivating." << nl << 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,18 +291,11 @@ void Foam::yPlusLES::write() const fvMesh& mesh = refCast<const fvMesh>(obr_); - volScalarField yPlusLES - ( - IOobject + volScalarField& yPlusLES = + const_cast<volScalarField&> ( - "yPlusLES", - mesh.time().timeName(), - mesh, - IOobject::NO_READ - ), - mesh, - dimensionedScalar("0", dimless, 0.0) - ); + mesh.lookupObject<volScalarField>(type()) + ); if (log_) { @@ -296,7 +313,8 @@ void Foam::yPlusLES::write() if (log_) { - Info<< " writing field " << yPlusLES.name() << nl + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << yPlusLES.name() << nl << endl; } -- GitLab