diff --git a/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObject.H b/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObject.H index b090c7c4b5..bf89a2646d 100644 --- a/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObject.H +++ b/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObject.H @@ -88,7 +88,7 @@ protected: bool store ( word& fieldName, - tmp tfield, + const tmp& tfield, bool cacheable = false ); diff --git a/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObjectTemplates.C b/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObjectTemplates.C index 2a466a789b..48b680620e 100644 --- a/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObjectTemplates.C +++ b/src/finiteVolume/fvMesh/fvMeshFunctionObject/fvMeshFunctionObjectTemplates.C @@ -52,7 +52,7 @@ template bool Foam::functionObjects::fvMeshFunctionObject::store ( word& fieldName, - tmp tfield, + const tmp& tfield, bool cacheable ) { diff --git a/src/postProcessing/functionObjects/field/CourantNo/CourantNo.C b/src/postProcessing/functionObjects/field/CourantNo/CourantNo.C index 40fa5ca004..736fdece67 100644 --- a/src/postProcessing/functionObjects/field/CourantNo/CourantNo.C +++ b/src/postProcessing/functionObjects/field/CourantNo/CourantNo.C @@ -75,29 +75,9 @@ Foam::functionObjects::CourantNo::CourantNo const dictionary& dict ) : - fvMeshFunctionObject(name, runTime, dict) + fieldExpression(name, runTime, dict, "phi", "Co") { read(dict); - - volScalarField* CourantNoPtr - ( - new volScalarField - ( - IOobject - ( - type(), - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("0", dimless, 0.0), - zeroGradientFvPatchScalarField::typeName - ) - ); - - mesh_.objectRegistry::store(CourantNoPtr); } @@ -111,6 +91,8 @@ Foam::functionObjects::CourantNo::~CourantNo() bool Foam::functionObjects::CourantNo::read(const dictionary& dict) { + fieldExpression::read(dict); + phiName_ = dict.lookupOrDefault("phi", "phi"); rhoName_ = dict.lookupOrDefault("rho", "rho"); @@ -120,38 +102,64 @@ bool Foam::functionObjects::CourantNo::read(const dictionary& dict) bool Foam::functionObjects::CourantNo::execute(const bool postProcess) { - const surfaceScalarField& phi = - mesh_.lookupObject(phiName_); + if (foundField(phiName_)) + { + const surfaceScalarField& phi = + lookupField(phiName_); - volScalarField& Co = const_cast - ( - mesh_.lookupObject(type()) - ); + tmp Coi + ( + byRho + ( + (0.5*mesh_.time().deltaT()) + *fvc::surfaceSum(mag(phi))()() + /mesh_.V() + ) + ); - Co.ref() = byRho - ( - (0.5*mesh_.time().deltaT()) - *fvc::surfaceSum(mag(phi))()() - /mesh_.V() - ); - Co.correctBoundaryConditions(); + if (foundField(resultName_)) + { + volScalarField& Co + ( + const_cast + ( + lookupField(resultName_) + ) + ); - return true; -} + Co.ref() = Coi(); + Co.correctBoundaryConditions(); + } + else + { + tmp tCo + ( + new volScalarField + ( + IOobject + ( + resultName_, + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("0", dimless, 0.0), + zeroGradientFvPatchScalarField::typeName + ) + ); + tCo.ref().ref() = Coi(); + tCo.ref().correctBoundaryConditions(); + mesh_.objectRegistry::store(tCo.ptr()); + } - -bool Foam::functionObjects::CourantNo::write(const bool postProcess) -{ - const volScalarField& CourantNo = - obr_.lookupObject(type()); - - Info<< type() << " " << name() << " output:" << nl - << " writing field " << CourantNo.name() << nl - << endl; - - CourantNo.write(); - - return true; + return true; + } + else + { + return false; + } } diff --git a/src/postProcessing/functionObjects/field/CourantNo/CourantNo.H b/src/postProcessing/functionObjects/field/CourantNo/CourantNo.H index feaa6b0aea..1e20c5e58e 100644 --- a/src/postProcessing/functionObjects/field/CourantNo/CourantNo.H +++ b/src/postProcessing/functionObjects/field/CourantNo/CourantNo.H @@ -33,6 +33,7 @@ Description be retrieved and used for other applications. SeeAlso + Foam::functionObjects::fieldExpression Foam::functionObjects::fvMeshFunctionObject SourceFiles @@ -43,7 +44,7 @@ SourceFiles #ifndef functionObjects_CourantNo_H #define functionObjects_CourantNo_H -#include "fvMeshFunctionObject.H" +#include "fieldExpression.H" #include "volFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,7 +60,7 @@ namespace functionObjects class CourantNo : - public fvMeshFunctionObject + public fieldExpression { // Private data @@ -78,12 +79,6 @@ class CourantNo const tmp& Co ) const; - //- Disallow default bitwise copy construct - CourantNo(const CourantNo&); - - //- Disallow default bitwise assignment - void operator=(const CourantNo&); - public: @@ -113,9 +108,6 @@ public: //- Execute, currently does nothing virtual bool execute(const bool postProcess = false); - - //- Calculate the CourantNo and write - virtual bool write(const bool postProcess = false); }; diff --git a/src/postProcessing/functionObjects/field/Lambda2/Lambda2.C b/src/postProcessing/functionObjects/field/Lambda2/Lambda2.C index c942606b5a..e6f8ccfad1 100644 --- a/src/postProcessing/functionObjects/field/Lambda2/Lambda2.C +++ b/src/postProcessing/functionObjects/field/Lambda2/Lambda2.C @@ -24,8 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "Lambda2.H" -#include "volFields.H" -#include "zeroGradientFvPatchFields.H" #include "fvcGrad.H" #include "addToRunTimeSelectionTable.H" @@ -56,29 +54,8 @@ Foam::functionObjects::Lambda2::Lambda2 const dictionary& dict ) : - fvMeshFunctionObject(name, runTime, dict) -{ - read(dict); - - volScalarField* Lambda2Ptr - ( - new volScalarField - ( - IOobject - ( - type(), - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("0", dimless/sqr(dimTime), 0.0) - ) - ); - - mesh_.objectRegistry::store(Lambda2Ptr); -} + fieldExpression(name, runTime, dict, "U", "Lambda2") +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -89,51 +66,30 @@ Foam::functionObjects::Lambda2::~Lambda2() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::functionObjects::Lambda2::read(const dictionary& dict) -{ - UName_ = dict.lookupOrDefault("U", "U"); - - return true; -} - - bool Foam::functionObjects::Lambda2::execute(const bool postProcess) { - const volVectorField& U = - mesh_.lookupObject(UName_); + if (foundField(fieldName_)) + { + const volVectorField& U = lookupField(fieldName_); + const tmp tgradU(fvc::grad(U)); + const volTensorField& gradU = tgradU(); - const volTensorField gradU(fvc::grad(U)); - - const volTensorField SSplusWW - ( - (symm(gradU) & symm(gradU)) - + (skew(gradU) & skew(gradU)) - ); - - volScalarField& Lambda2 = - const_cast + const volTensorField SSplusWW ( - mesh_.lookupObject(type()) + (symm(gradU) & symm(gradU)) + + (skew(gradU) & skew(gradU)) ); - Lambda2 = -eigenValues(SSplusWW)().component(vector::Y); - - return true; -} - - -bool Foam::functionObjects::Lambda2::write(const bool postProcess) -{ - const volScalarField& Lambda2 = - obr_.lookupObject(type()); - - Info<< type() << " " << name() << " output:" << nl - << " writing field " << Lambda2.name() << nl - << endl; - - Lambda2.write(); - - return true; + return store + ( + resultName_, + -eigenValues(SSplusWW)().component(vector::Y) + ); + } + else + { + return false; + } } diff --git a/src/postProcessing/functionObjects/field/Lambda2/Lambda2.H b/src/postProcessing/functionObjects/field/Lambda2/Lambda2.H index 0957556aa3..28b46b6ea0 100644 --- a/src/postProcessing/functionObjects/field/Lambda2/Lambda2.H +++ b/src/postProcessing/functionObjects/field/Lambda2/Lambda2.H @@ -33,6 +33,7 @@ Description the velocity gradient tensor. SeeAlso + Foam::functionObjects::fieldExpression Foam::functionObjects::fvMeshFunctionObject SourceFiles @@ -43,8 +44,7 @@ SourceFiles #ifndef functionObjects_Lambda2_H #define functionObjects_Lambda2_H -#include "fvMeshFunctionObject.H" -#include "volFieldsFwd.H" +#include "fieldExpression.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,22 +59,8 @@ namespace functionObjects class Lambda2 : - public fvMeshFunctionObject + public fieldExpression { - // Private data - - //- Name of velocity field, default is "U" - word UName_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - Lambda2(const Lambda2&); - - //- Disallow default bitwise assignment - void operator=(const Lambda2&); - public: @@ -99,14 +85,8 @@ public: // Member Functions - //- Read the Lambda2 data - virtual bool read(const dictionary&); - - //- Calculate Lambda2 + //- Calculate the Lambda2 field virtual bool execute(const bool postProcess = false); - - //- Write Lambda2 - virtual bool write(const bool postProcess = false); }; diff --git a/src/postProcessing/functionObjects/field/Make/files b/src/postProcessing/functionObjects/field/Make/files index 4d4491351d..86bda4ca73 100644 --- a/src/postProcessing/functionObjects/field/Make/files +++ b/src/postProcessing/functionObjects/field/Make/files @@ -40,5 +40,6 @@ vorticity/vorticity.C Q/Q.C Lambda2/Lambda2.C CourantNo/CourantNo.C +Peclet/Peclet.C LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects diff --git a/src/postProcessing/functionObjects/field/Make/options b/src/postProcessing/functionObjects/field/Make/options index 0732822dba..c1ebbb17e7 100644 --- a/src/postProcessing/functionObjects/field/Make/options +++ b/src/postProcessing/functionObjects/field/Make/options @@ -4,7 +4,8 @@ EXE_INC = \ -I$(LIB_SRC)/lagrangian/basic/lnInclude \ -I$(LIB_SRC)/fileFormats/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ - -I$(LIB_SRC)/surfMesh/lnInclude + -I$(LIB_SRC)/surfMesh/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude LIB_LIBS = \ -lfiniteVolume \ diff --git a/src/postProcessing/functionObjects/field/Peclet/Peclet.C b/src/postProcessing/functionObjects/field/Peclet/Peclet.C new file mode 100644 index 0000000000..a948b658b2 --- /dev/null +++ b/src/postProcessing/functionObjects/field/Peclet/Peclet.C @@ -0,0 +1,115 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "Peclet.H" +#include "turbulenceModel.H" +#include "surfaceInterpolate.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionObjects +{ + defineTypeNameAndDebug(Peclet, 0); + + addToRunTimeSelectionTable + ( + functionObject, + Peclet, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::functionObjects::Peclet::Peclet +( + const word& name, + const Time& runTime, + const dictionary& dict +) +: + fieldExpression(name, runTime, dict, "phi", "Pe") +{ + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::functionObjects::Peclet::~Peclet() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::functionObjects::Peclet::read(const dictionary& dict) +{ + fieldExpression::read(dict); + + phiName_ = dict.lookupOrDefault("phi", "phi"); + + return true; +} + + +bool Foam::functionObjects::Peclet::execute(const bool postProcess) +{ + if (foundField(phiName_)) + { + tmp nuEff + ( + mesh_.lookupObject + ( + turbulenceModel::propertiesName + ).nuEff() + ); + + const surfaceScalarField& phi = + mesh_.lookupObject(phiName_); + + return store + ( + resultName_, + mag(phi) + /( + mesh_.magSf() + *mesh_.surfaceInterpolation::deltaCoeffs() + *fvc::interpolate(nuEff) + ) + ); + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H b/src/postProcessing/functionObjects/field/Peclet/Peclet.H similarity index 85% rename from src/postProcessing/functionObjects/utilities/Peclet/Peclet.H rename to src/postProcessing/functionObjects/field/Peclet/Peclet.H index d2e872b868..1abbb49cdc 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.H +++ b/src/postProcessing/functionObjects/field/Peclet/Peclet.H @@ -32,6 +32,7 @@ Description surfaceScalarField. SeeAlso + Foam::functionObjects::fieldExpression Foam::functionObjects::fvMeshFunctionObject SourceFiles @@ -42,8 +43,7 @@ SourceFiles #ifndef functionObjects_Peclet_H #define functionObjects_Peclet_H -#include "fvMeshFunctionObject.H" -#include "volFieldsFwd.H" +#include "fieldExpression.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -58,25 +58,13 @@ namespace functionObjects class Peclet : - public fvMeshFunctionObject + public fieldExpression { // Private data //- Name of flux field, default is "phi" word phiName_; - //- Name of density field (compressible cases only), default is "rho" - word rhoName_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - Peclet(const Peclet&); - - //- Disallow default bitwise assignment - void operator=(const Peclet&); - public: @@ -107,9 +95,6 @@ public: //- Calculate the Peclet number field virtual bool execute(const bool postProcess = false); - - //- Write the Peclet number field - virtual bool write(const bool postProcess = false); }; diff --git a/src/postProcessing/functionObjects/field/Q/Q.H b/src/postProcessing/functionObjects/field/Q/Q.H index 40f5cd8103..7811508faa 100644 --- a/src/postProcessing/functionObjects/field/Q/Q.H +++ b/src/postProcessing/functionObjects/field/Q/Q.H @@ -88,7 +88,7 @@ public: // Member Functions - //- Calculate the Q-field + //- Calculate the Q field virtual bool execute(const bool postProcess = false); }; diff --git a/src/postProcessing/functionObjects/field/vorticity/vorticity.C b/src/postProcessing/functionObjects/field/vorticity/vorticity.C index fab61b736a..8c2291136f 100644 --- a/src/postProcessing/functionObjects/field/vorticity/vorticity.C +++ b/src/postProcessing/functionObjects/field/vorticity/vorticity.C @@ -24,7 +24,6 @@ License \*---------------------------------------------------------------------------*/ #include "vorticity.H" -#include "volFields.H" #include "fvcCurl.H" #include "addToRunTimeSelectionTable.H" @@ -55,30 +54,8 @@ Foam::functionObjects::vorticity::vorticity const dictionary& dict ) : - fvMeshFunctionObject(name, runTime, dict), - outputName_(typeName) -{ - read(dict); - - volVectorField* vorticityPtr - ( - new volVectorField - ( - IOobject - ( - outputName_, - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedVector("0", dimless/dimTime, Zero) - ) - ); - - mesh_.objectRegistry::store(vorticityPtr); -} + fieldExpression(name, runTime, dict, "U", "vorticity") +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // @@ -89,46 +66,23 @@ Foam::functionObjects::vorticity::~vorticity() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -bool Foam::functionObjects::vorticity::read(const dictionary& dict) +bool Foam::functionObjects::vorticity::execute(const bool postProcess) { - UName_ = dict.lookupOrDefault("U", "U"); - if (UName_ != "U") + if (foundField(fieldName_)) { - outputName_ = typeName + "(" + UName_ + ")"; + return store + ( + resultName_, + fvc::curl(lookupField(fieldName_)) + ); + } + else + { + return false; } return true; } -bool Foam::functionObjects::vorticity::execute(const bool postProcess) -{ - const volVectorField& U = mesh_.lookupObject(UName_); - - volVectorField& vorticity = const_cast - ( - mesh_.lookupObject(outputName_) - ); - - vorticity = fvc::curl(U); - - return true; -} - - -bool Foam::functionObjects::vorticity::write(const bool postProcess) -{ - const volVectorField& vorticity = - mesh_.lookupObject(outputName_); - - Info<< type() << " " << name() << " output:" << nl - << " writing field " << vorticity.name() << nl - << endl; - - vorticity.write(); - - return true; -} - - // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/field/vorticity/vorticity.H b/src/postProcessing/functionObjects/field/vorticity/vorticity.H index 6d719e3ed9..6d8a360ecd 100644 --- a/src/postProcessing/functionObjects/field/vorticity/vorticity.H +++ b/src/postProcessing/functionObjects/field/vorticity/vorticity.H @@ -31,6 +31,7 @@ Description This function object calculates the vorticity, the curl of the velocity. SeeAlso + Foam::functionObjects::fieldExpression Foam::functionObjects::fvMeshFunctionObject SourceFiles @@ -41,8 +42,7 @@ SourceFiles #ifndef functionObjects_vorticity_H #define functionObjects_vorticity_H -#include "fvMeshFunctionObject.H" -#include "volFieldsFwd.H" +#include "fieldExpression.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,25 +57,8 @@ namespace functionObjects class vorticity : - public fvMeshFunctionObject + public fieldExpression { - // Private data - - //- Name of velocity field, default is "U" - word UName_; - - //- Name of vorticity field - word outputName_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - vorticity(const vorticity&); - - //- Disallow default bitwise assignment - void operator=(const vorticity&); - public: @@ -100,14 +83,8 @@ public: // Member Functions - //- Read the vorticity data - virtual bool read(const dictionary&); - //- Execute, currently does nothing virtual bool execute(const bool postProcess = false); - - //- Calculate the vorticity and write - virtual bool write(const bool postProcess = false); }; diff --git a/src/postProcessing/functionObjects/utilities/Make/files b/src/postProcessing/functionObjects/utilities/Make/files index 25364ae225..7e7e618e3d 100644 --- a/src/postProcessing/functionObjects/utilities/Make/files +++ b/src/postProcessing/functionObjects/utilities/Make/files @@ -13,7 +13,6 @@ blendingFactor/blendingFactor.C dsmcFields/dsmcFields.C turbulenceFields/turbulenceFields.C -Peclet/Peclet.C yPlus/yPlus.C LIB = $(FOAM_LIBBIN)/libutilityFunctionObjects diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C deleted file mode 100644 index e84f841287..0000000000 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ /dev/null @@ -1,202 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "Peclet.H" -#include "volFields.H" -#include "dictionary.H" -#include "surfaceFields.H" -#include "turbulentTransportModel.H" -#include "turbulentFluidThermoModel.H" -#include "surfaceInterpolate.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace functionObjects -{ - defineTypeNameAndDebug(Peclet, 0); - - addToRunTimeSelectionTable - ( - functionObject, - Peclet, - dictionary - ); -} -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::functionObjects::Peclet::Peclet -( - const word& name, - const Time& runTime, - const dictionary& dict -) -: - fvMeshFunctionObject(name, runTime, dict) -{ - read(dict); - - surfaceScalarField* PecletPtr - ( - new surfaceScalarField - ( - IOobject - ( - type(), - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar("0", dimless, 0.0) - ) - ); - - mesh_.objectRegistry::store(PecletPtr); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::functionObjects::Peclet::~Peclet() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::functionObjects::Peclet::read(const dictionary& dict) -{ - phiName_ = dict.lookupOrDefault("phi", "phi"); - rhoName_ = dict.lookupOrDefault("rho", "rho"); - - return true; -} - - -bool Foam::functionObjects::Peclet::execute(const bool postProcess) -{ - typedef compressible::turbulenceModel cmpTurbModel; - typedef incompressible::turbulenceModel icoTurbModel; - - tmp nuEff; - if (mesh_.foundObject(turbulenceModel::propertiesName)) - { - const cmpTurbModel& model = - mesh_.lookupObject - ( - turbulenceModel::propertiesName - ); - - const volScalarField& rho = - mesh_.lookupObject(rhoName_); - - nuEff = model.muEff()/rho; - } - else if - ( - mesh_.foundObject(turbulenceModel::propertiesName) - ) - { - const icoTurbModel& model = - mesh_.lookupObject - ( - turbulenceModel::propertiesName - ); - - nuEff = model.nuEff(); - } - else if (mesh_.foundObject("transportProperties")) - { - const dictionary& model = - mesh_.lookupObject("transportProperties"); - - nuEff = - tmp - ( - new volScalarField - ( - IOobject - ( - "nuEff", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensionedScalar(model.lookup("nu")) - ) - ); - } - else - { - FatalErrorInFunction - << "Unable to determine the viscosity" - << exit(FatalError); - } - - const surfaceScalarField& phi = - mesh_.lookupObject(phiName_); - - surfaceScalarField& Peclet = - const_cast - ( - mesh_.lookupObject(type()) - ); - - Peclet = - mag(phi) - /( - mesh_.magSf() - *mesh_.surfaceInterpolation::deltaCoeffs() - *fvc::interpolate(nuEff) - ); - - return true; -} - - -bool Foam::functionObjects::Peclet::write(const bool postProcess) -{ - const surfaceScalarField& Peclet = - mesh_.lookupObject(type()); - - Info<< type() << " " << name() << " output:" << nl - << " writing field " << Peclet.name() << nl - << endl; - - Peclet.write(); - - return true; -} - - -// ************************************************************************* //