diff --git a/applications/utilities/postProcessing/wall/wallShearStress/Make/files b/applications/utilities/postProcessing/wall/wallShearStress/Make/files
deleted file mode 100644
index 2af0d8c60f..0000000000
--- a/applications/utilities/postProcessing/wall/wallShearStress/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-wallShearStress.C
-
-EXE = $(FOAM_APPBIN)/wallShearStress
diff --git a/applications/utilities/postProcessing/wall/wallShearStress/Make/options b/applications/utilities/postProcessing/wall/wallShearStress/Make/options
deleted file mode 100644
index 0128cf8401..0000000000
--- a/applications/utilities/postProcessing/wall/wallShearStress/Make/options
+++ /dev/null
@@ -1,23 +0,0 @@
-EXE_INC = \
- -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
- -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
- -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
- -I$(LIB_SRC)/transportModels \
- -I$(LIB_SRC)/turbulenceModels \
- -I$(LIB_SRC)/transportModels/compressible/lnInclude \
- -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/meshTools/lnInclude
-
-EXE_LIBS = \
- -lturbulenceModels \
- -lincompressibleTurbulenceModels \
- -lcompressibleTurbulenceModels \
- -lincompressibleTransportModels \
- -lcompressibleTransportModels \
- -lfluidThermophysicalModels \
- -lspecie \
- -lgenericPatchFields \
- -lfiniteVolume \
- -lfvOptions \
- -lmeshTools
diff --git a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
deleted file mode 100644
index 1406016e96..0000000000
--- a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C
+++ /dev/null
@@ -1,211 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2011-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 .
-
-Application
- wallShearStress
-
-Description
- Calculates and reports the turbulent wall shear stress for all patches,
- for the specified times.
-
- Compressible modes is automatically selected based on the existence of the
- "thermophysicalProperties" dictionary required to construct the
- thermodynamics package.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "turbulentTransportModel.H"
-#include "turbulentFluidThermoModel.H"
-#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-void calcIncompressible
-(
- const fvMesh& mesh,
- const Time& runTime,
- const volVectorField& U,
- volVectorField& wallShearStress
-)
-{
- #include "createPhi.H"
-
- singlePhaseTransportModel laminarTransport(U, phi);
-
- autoPtr model
- (
- incompressible::turbulenceModel::New(U, phi, laminarTransport)
- );
-
- const volSymmTensorField Reff(model->devReff());
-
- volVectorField::Boundary& wallShearStressBf =
- wallShearStress.boundaryFieldRef();
-
- forAll(wallShearStressBf, patchi)
- {
- wallShearStressBf[patchi] =
- (
- -mesh.Sf().boundaryField()[patchi]
- /mesh.magSf().boundaryField()[patchi]
- ) & Reff.boundaryField()[patchi];
- }
-}
-
-
-void calcCompressible
-(
- const fvMesh& mesh,
- const Time& runTime,
- const volVectorField& U,
- volVectorField& wallShearStress
-)
-{
- IOobject rhoHeader
- (
- "rho",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::NO_WRITE
- );
-
- if (!rhoHeader.headerOk())
- {
- Info<< " no rho field" << endl;
- return;
- }
-
- Info<< "Reading field rho\n" << endl;
- volScalarField rho(rhoHeader, mesh);
-
- #include "compressibleCreatePhi.H"
-
- autoPtr pThermo(fluidThermo::New(mesh));
- fluidThermo& thermo = pThermo();
-
- autoPtr model
- (
- compressible::turbulenceModel::New(rho, U, phi, thermo)
- );
-
- const volSymmTensorField Reff(model->devRhoReff());
-
- volVectorField::Boundary& wallShearStressBf =
- wallShearStress.boundaryFieldRef();
-
- forAll(wallShearStressBf, patchi)
- {
- wallShearStressBf[patchi] =
- (
- -mesh.Sf().boundaryField()[patchi]
- /mesh.magSf().boundaryField()[patchi]
- ) & Reff.boundaryField()[patchi];
- }
-}
-
-
-int main(int argc, char *argv[])
-{
- timeSelector::addOptions();
- #include "addRegionOption.H"
- #include "setRootCase.H"
- #include "createTime.H"
- instantList timeDirs = timeSelector::select0(runTime, args);
- #include "createNamedMesh.H"
-
- forAll(timeDirs, timeI)
- {
- runTime.setTime(timeDirs[timeI], timeI);
- Info<< "Time = " << runTime.timeName() << endl;
- mesh.readUpdate();
-
- volVectorField wallShearStress
- (
- IOobject
- (
- "wallShearStress",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::AUTO_WRITE
- ),
- mesh,
- dimensionedVector
- (
- "wallShearStress",
- sqr(dimLength)/sqr(dimTime),
- Zero
- )
- );
-
- IOobject UHeader
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::NO_WRITE
- );
-
- if (UHeader.headerOk())
- {
- Info<< "Reading field U\n" << endl;
- volVectorField U(UHeader, mesh);
-
- if
- (
- IOobject
- (
- basicThermo::dictName,
- runTime.constant(),
- mesh
- ).headerOk()
- )
- {
- calcCompressible(mesh, runTime, U, wallShearStress);
- }
- else
- {
- calcIncompressible(mesh, runTime, U, wallShearStress);
- }
- }
- else
- {
- Info<< " no U field" << endl;
- }
-
- Info<< "Writing wall shear stress to field " << wallShearStress.name()
- << nl << endl;
-
- wallShearStress.write();
- }
-
- Info<< "End" << endl;
-
- return 0;
-}
-
-
-// ************************************************************************* //
diff --git a/bin/wallShearStress b/bin/wallShearStress
new file mode 120000
index 0000000000..ff6b4704c6
--- /dev/null
+++ b/bin/wallShearStress
@@ -0,0 +1 @@
+supercededByPostProcessOption
\ No newline at end of file
diff --git a/etc/caseDicts/postProcessing/fields/wallShearStress b/etc/caseDicts/postProcessing/fields/wallShearStress
new file mode 100644
index 0000000000..c4f5b96e89
--- /dev/null
+++ b/etc/caseDicts/postProcessing/fields/wallShearStress
@@ -0,0 +1,18 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| ========= | |
+| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
+| \\ / O peration | Version: dev |
+| \\ / A nd | Web: www.OpenFOAM.org |
+| \\/ M anipulation | |
+\*---------------------------------------------------------------------------*/
+
+wallShearStress
+{
+ type wallShearStress;
+ libs ("libfieldFunctionObjects.so");
+
+ executeControl writeTime;
+ writeControl writeTime;
+}
+
+// ************************************************************************* //
diff --git a/src/functionObjects/field/Make/files b/src/functionObjects/field/Make/files
index 50ffce51de..3b447f0312 100644
--- a/src/functionObjects/field/Make/files
+++ b/src/functionObjects/field/Make/files
@@ -52,5 +52,6 @@ MachNo/MachNo.C
turbulenceFields/turbulenceFields.C
yPlus/yPlus.C
+wallShearStress/wallShearStress.C
LIB = $(FOAM_LIBBIN)/libfieldFunctionObjects
diff --git a/src/functionObjects/forces/wallShearStress/wallShearStress.C b/src/functionObjects/field/wallShearStress/wallShearStress.C
similarity index 94%
rename from src/functionObjects/forces/wallShearStress/wallShearStress.C
rename to src/functionObjects/field/wallShearStress/wallShearStress.C
index 0fbc1003cb..9d56c7be3b 100644
--- a/src/functionObjects/forces/wallShearStress/wallShearStress.C
+++ b/src/functionObjects/field/wallShearStress/wallShearStress.C
@@ -67,7 +67,6 @@ void Foam::functionObjects::wallShearStress::calcShearStress
forAllConstIter(labelHashSet, patchSet_, iter)
{
label patchi = iter.key();
- const polyPatch& pp = mesh.boundaryMesh()[patchi];
vectorField& ssp = shearStress.boundaryFieldRef()[patchi];
const vectorField& Sfp = mesh.Sf().boundaryField()[patchi];
@@ -75,21 +74,6 @@ void Foam::functionObjects::wallShearStress::calcShearStress
const symmTensorField& Reffp = Reff.boundaryField()[patchi];
ssp = (-Sfp/magSfp) & Reffp;
-
- vector minSsp = gMin(ssp);
- vector maxSsp = gMax(ssp);
-
- if (Pstream::master())
- {
- file() << mesh.time().value()
- << token::TAB << pp.name()
- << token::TAB << minSsp
- << token::TAB << maxSsp
- << endl;
- }
-
- Log << " min/max(" << pp.name() << ") = "
- << minSsp << ", " << maxSsp << endl;
}
}
@@ -212,8 +196,6 @@ bool Foam::functionObjects::wallShearStress::execute(const bool postProcess)
typedef compressible::turbulenceModel cmpModel;
typedef incompressible::turbulenceModel icoModel;
- writeFiles::write();
-
const fvMesh& mesh = refCast(obr_);
volVectorField& wallShearStress =
@@ -222,9 +204,6 @@ bool Foam::functionObjects::wallShearStress::execute(const bool postProcess)
mesh.lookupObject(type())
);
- Log << type() << " " << name() << " output:" << nl;
-
-
tmp Reff;
if (mesh.foundObject(turbulenceModel::propertiesName))
{
@@ -260,12 +239,37 @@ bool Foam::functionObjects::wallShearStress::write(const bool postProcess)
const volVectorField& wallShearStress =
obr_.lookupObject(type());
- Log << type() << " " << name() << " output:" << nl
- << " writing field " << wallShearStress.name() << nl
- << endl;
+ Log << type() << " " << name() << " write:" << nl
+ << " writing field " << wallShearStress.name() << endl;
wallShearStress.write();
+ const fvMesh& mesh = refCast(obr_);
+ const fvPatchList& patches = mesh.boundary();
+
+ forAllConstIter(labelHashSet, patchSet_, iter)
+ {
+ label patchi = iter.key();
+ const fvPatch& pp = patches[patchi];
+
+ const vectorField& ssp = wallShearStress.boundaryField()[patchi];
+
+ vector minSsp = gMin(ssp);
+ vector maxSsp = gMax(ssp);
+
+ if (Pstream::master())
+ {
+ file() << mesh.time().value()
+ << token::TAB << pp.name()
+ << token::TAB << minSsp
+ << token::TAB << maxSsp
+ << endl;
+ }
+
+ Log << " min/max(" << pp.name() << ") = "
+ << minSsp << ", " << maxSsp << endl;
+ }
+
return true;
}
diff --git a/src/functionObjects/forces/wallShearStress/wallShearStress.H b/src/functionObjects/field/wallShearStress/wallShearStress.H
similarity index 100%
rename from src/functionObjects/forces/wallShearStress/wallShearStress.H
rename to src/functionObjects/field/wallShearStress/wallShearStress.H
diff --git a/src/functionObjects/forces/Make/files b/src/functionObjects/forces/Make/files
index f4bde58606..310f1d60ba 100644
--- a/src/functionObjects/forces/Make/files
+++ b/src/functionObjects/forces/Make/files
@@ -1,4 +1,3 @@
-wallShearStress/wallShearStress.C
forces/forces.C
forceCoeffs/forceCoeffs.C