diff --git a/src/functionObjects/field/wallShearStress/wallShearStress.C b/src/functionObjects/field/wallShearStress/wallShearStress.C index c2be03f73d..35dd667430 100644 --- a/src/functionObjects/field/wallShearStress/wallShearStress.C +++ b/src/functionObjects/field/wallShearStress/wallShearStress.C @@ -102,9 +102,11 @@ Foam::functionObjects::wallShearStress::wallShearStress fvMeshFunctionObject(name, runTime, dict), logFiles(obr_, name), writeLocalObjects(obr_, log), + phaseName_(word::null), patchSet_() { read(dict); + resetLocalObjectName(IOobject::groupName(type(), phaseName_)); } @@ -121,6 +123,8 @@ bool Foam::functionObjects::wallShearStress::read(const dictionary& dict) fvMeshFunctionObject::read(dict); writeLocalObjects::read(dict); + phaseName_ = dict.lookupOrDefault("phase", word::null); + const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); patchSet_ = @@ -177,34 +181,38 @@ bool Foam::functionObjects::wallShearStress::read(const dictionary& dict) bool Foam::functionObjects::wallShearStress::execute() { + const word fieldName(IOobject::groupName(type(), phaseName_)); + typedef compressible::momentumTransportModel cmpModel; typedef incompressible::momentumTransportModel icoModel; - tmp tau; - if (mesh_.foundObject(momentumTransportModel::typeName)) + const word momentumTransportModelName + ( + IOobject::groupName(momentumTransportModel::typeName, phaseName_) + ); + + if (mesh_.foundObject(momentumTransportModelName)) { const cmpModel& model = - mesh_.lookupObject(momentumTransportModel::typeName); + mesh_.lookupObject(momentumTransportModelName); - tau = model.devTau(); + return store(fieldName, calcShearStress(model.devTau())); } - else if (mesh_.foundObject(momentumTransportModel::typeName)) + else if (mesh_.foundObject(momentumTransportModelName)) { const icoModel& model = - mesh_.lookupObject(momentumTransportModel::typeName); + mesh_.lookupObject(momentumTransportModelName); - tau = model.devSigma(); + return store(fieldName, calcShearStress(model.devSigma())); } else { FatalErrorInFunction << "Unable to find turbulence model in the " << "database" << exit(FatalError); + + return false; } - - word name(type()); - - return store(name, calcShearStress(tau)); } @@ -216,8 +224,10 @@ bool Foam::functionObjects::wallShearStress::write() logFiles::write(); - const volVectorField& wallShearStress = - obr_.lookupObject(type()); + const volVectorField& wallShearStress = obr_.lookupObject + ( + IOobject::groupName(type(), phaseName_) + ); const fvPatchList& patches = mesh_.boundary(); diff --git a/src/functionObjects/field/wallShearStress/wallShearStress.H b/src/functionObjects/field/wallShearStress/wallShearStress.H index e4e6363d09..2ff1b06955 100644 --- a/src/functionObjects/field/wallShearStress/wallShearStress.H +++ b/src/functionObjects/field/wallShearStress/wallShearStress.H @@ -26,7 +26,7 @@ Class Description Calculates and write the shear-stress at wall patches as - the volVectorField field 'wallShearStress'. + the volVectorField field 'wallShearStress' or 'wallShearStress.'. \f[ Stress = R \dot n @@ -55,9 +55,10 @@ Description Usage \table - Property | Description | Required | Default value + Property | Description | Required | Default value type | type name: wallShearStress | yes | patches | list of patches to process | no | all wall patches + phase | phase name | no | \endtable Note @@ -102,16 +103,16 @@ class wallShearStress public logFiles, public writeLocalObjects { + // Private Data -protected: - - // Protected data + //- The name of the phase + word phaseName_; //- Optional list of patches to process labelHashSet patchSet_; - // Protected Member Functions + // Private Member Functions //- File header information virtual void writeFileHeader(const label i); diff --git a/src/functionObjects/field/yPlus/yPlus.H b/src/functionObjects/field/yPlus/yPlus.H index ccdec7702e..f98a293e00 100644 --- a/src/functionObjects/field/yPlus/yPlus.H +++ b/src/functionObjects/field/yPlus/yPlus.H @@ -26,7 +26,7 @@ Class Description Evaluates and outputs turbulence y+ for models. Values written to - time directories as field 'yPlus' or 'yPlus.phase'. + time directories as field 'yPlus' or 'yPlus.'. Example of function object specification: \verbatim @@ -90,16 +90,12 @@ class yPlus public logFiles, public writeLocalObjects { -protected: - - // Protected data + // Private data //- Optional phase name word phaseName_; -private: - // Private Member Functions //- File header information