diff --git a/applications/utilities/postProcessing/wall/yPlus/Make/files b/applications/utilities/postProcessing/wall/yPlus/Make/files
new file mode 100644
index 000000000..e52ae0b6a
--- /dev/null
+++ b/applications/utilities/postProcessing/wall/yPlus/Make/files
@@ -0,0 +1,3 @@
+yPlus.C
+
+EXE = $(FOAM_APPBIN)/yPlus
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/options b/applications/utilities/postProcessing/wall/yPlus/Make/options
similarity index 100%
rename from applications/utilities/postProcessing/wall/yPlusRAS/Make/options
rename to applications/utilities/postProcessing/wall/yPlus/Make/options
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlus/yPlus.C
similarity index 65%
rename from applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
rename to applications/utilities/postProcessing/wall/yPlus/yPlus.C
index dde81571e..9ff6c4905 100644
--- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C
+++ b/applications/utilities/postProcessing/wall/yPlus/yPlus.C
@@ -22,14 +22,18 @@ License
along with OpenFOAM. If not, see .
Application
- yPlusRAS
+ yPlus
Description
- Calculates and reports yPlus for all wall patches, for the specified times
- when using RAS turbulence models.
+ Calculates and reports yPlus for the near-wall cells of all wall patches,
+ for the specified times for laminar, LES and RAS.
+
+ For walls at which wall-functions are applied the wall-function provides
+ the y+ values otherwise they are obtained directly from the near-wall
+ velocity gradient and effective and laminar viscosities.
Default behaviour assumes operating in incompressible mode.
- Use the -compressible option for compressible RAS cases.
+ Use the -compressible option for compressible cases.
\*---------------------------------------------------------------------------*/
@@ -38,9 +42,75 @@ Description
#include "turbulentTransportModel.H"
#include "turbulentFluidThermoModel.H"
#include "nutWallFunctionFvPatchScalarField.H"
+#include "nearWallDist.H"
+#include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+template
+void calcYPlus
+(
+ const TurbulenceModel& turbulenceModel,
+ const fvMesh& mesh,
+ const Time& runTime,
+ const volVectorField& U,
+ volScalarField& yPlus
+)
+{
+ volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
+
+ const volScalarField::GeometricBoundaryField nutBf =
+ turbulenceModel->nut()().boundaryField();
+
+ const volScalarField::GeometricBoundaryField nuEffBf =
+ turbulenceModel->nuEff()().boundaryField();
+
+ const volScalarField::GeometricBoundaryField nuBf =
+ turbulenceModel->nu()().boundaryField();
+
+ const fvPatchList& patches = mesh.boundary();
+
+ forAll(patches, patchi)
+ {
+ const fvPatch& patch = patches[patchi];
+
+ if (isA(nutBf[patchi]))
+ {
+ const nutWallFunctionFvPatchScalarField& nutPf =
+ dynamic_cast
+ (
+ nutBf[patchi]
+ );
+
+ yPlus.boundaryField()[patchi] = nutPf.yPlus();
+ const scalarField& Yp = yPlus.boundaryField()[patchi];
+
+ Info<< "Patch " << patchi
+ << " named " << nutPf.patch().name()
+ << ", wall-function " << nutPf.type()
+ << ", y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
+ << " average: " << gAverage(Yp) << nl << endl;
+ }
+ else if (isA(patch))
+ {
+ yPlus.boundaryField()[patchi] =
+ d[patchi]
+ *sqrt
+ (
+ nuEffBf[patchi]
+ *mag(U.boundaryField()[patchi].snGrad())
+ )/nuBf[patchi];
+ const scalarField& Yp = yPlus.boundaryField()[patchi];
+
+ Info<< "Patch " << patchi
+ << " named " << patch.name()
+ << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
+ << " average: " << gAverage(Yp) << nl << endl;
+ }
+ }
+}
+
+
void calcIncompressibleYPlus
(
const fvMesh& mesh,
@@ -49,46 +119,16 @@ void calcIncompressibleYPlus
volScalarField& yPlus
)
{
- typedef nutWallFunctionFvPatchScalarField wallFunctionPatchField;
-
#include "createPhi.H"
singlePhaseTransportModel laminarTransport(U, phi);
- autoPtr RASModel
+ autoPtr turbulenceModel
(
- incompressible::RASModel::New(U, phi, laminarTransport)
+ incompressible::turbulenceModel::New(U, phi, laminarTransport)
);
- const volScalarField::GeometricBoundaryField nutPatches =
- RASModel->nut()().boundaryField();
-
- bool foundNutPatch = false;
- forAll(nutPatches, patchi)
- {
- if (isA(nutPatches[patchi]))
- {
- foundNutPatch = true;
-
- const wallFunctionPatchField& nutPw =
- dynamic_cast
- (nutPatches[patchi]);
-
- yPlus.boundaryField()[patchi] = nutPw.yPlus();
- const scalarField& Yp = yPlus.boundaryField()[patchi];
-
- Info<< "Patch " << patchi
- << " named " << nutPw.patch().name()
- << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
- << " average: " << gAverage(Yp) << nl << endl;
- }
- }
-
- if (!foundNutPatch)
- {
- Info<< " no " << wallFunctionPatchField::typeName << " patches"
- << endl;
- }
+ calcYPlus(turbulenceModel, mesh, runTime, U, yPlus);
}
@@ -100,8 +140,6 @@ void calcCompressibleYPlus
volScalarField& yPlus
)
{
- typedef nutWallFunctionFvPatchScalarField wallFunctionPatchField;
-
IOobject rhoHeader
(
"rho",
@@ -122,15 +160,12 @@ void calcCompressibleYPlus
#include "compressibleCreatePhi.H"
- autoPtr pThermo
- (
- fluidThermo::New(mesh)
- );
+ autoPtr pThermo(fluidThermo::New(mesh));
fluidThermo& thermo = pThermo();
- autoPtr RASModel
+ autoPtr turbulenceModel
(
- compressible::RASModel::New
+ compressible::turbulenceModel::New
(
rho,
U,
@@ -139,35 +174,7 @@ void calcCompressibleYPlus
)
);
- const volScalarField::GeometricBoundaryField nutPatches =
- RASModel->nut()().boundaryField();
-
- bool foundNutPatch = false;
- forAll(nutPatches, patchi)
- {
- if (isA(nutPatches[patchi]))
- {
- foundNutPatch = true;
-
- const wallFunctionPatchField& nutPw =
- dynamic_cast
- (nutPatches[patchi]);
-
- yPlus.boundaryField()[patchi] = nutPw.yPlus();
- const scalarField& Yp = yPlus.boundaryField()[patchi];
-
- Info<< "Patch " << patchi
- << " named " << nutPw.patch().name()
- << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
- << " average: " << gAverage(Yp) << nl << endl;
- }
- }
-
- if (!foundNutPatch)
- {
- Info<< " no " << wallFunctionPatchField::typeName << " patches"
- << endl;
- }
+ calcYPlus(turbulenceModel, mesh, runTime, U, yPlus);
}
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/files b/applications/utilities/postProcessing/wall/yPlusLES/Make/files
deleted file mode 100644
index 88490a7b2..000000000
--- a/applications/utilities/postProcessing/wall/yPlusLES/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-yPlusLES.C
-
-EXE = $(FOAM_APPBIN)/yPlusLES
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/Make/options b/applications/utilities/postProcessing/wall/yPlusLES/Make/options
deleted file mode 100644
index a3e31c220..000000000
--- a/applications/utilities/postProcessing/wall/yPlusLES/Make/options
+++ /dev/null
@@ -1,14 +0,0 @@
-EXE_INC = \
- -I$(LIB_SRC)/transportModels \
- -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
- -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
- -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
- -I$(LIB_SRC)/finiteVolume/lnInclude \
- -I$(LIB_SRC)/meshTools/lnInclude
-
-EXE_LIBS = \
- -lturbulenceModels \
- -lincompressibleTurbulenceModels \
- -lincompressibleTransportModels \
- -lfiniteVolume \
- -lgenericPatchFields
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/createFields.H b/applications/utilities/postProcessing/wall/yPlusLES/createFields.H
deleted file mode 100644
index 108aa9689..000000000
--- a/applications/utilities/postProcessing/wall/yPlusLES/createFields.H
+++ /dev/null
@@ -1,24 +0,0 @@
-Info<< "Reading field U\n" << endl;
-volVectorField U
-(
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::NO_WRITE
- ),
- mesh
-);
-
-#include "createPhi.H"
-
-singlePhaseTransportModel laminarTransport(U, phi);
-
-autoPtr sgsModel
-(
- incompressible::LESModel::New(U, phi, laminarTransport)
-);
-
-volScalarField::GeometricBoundaryField d(nearWallDist(mesh).y());
diff --git a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C b/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
deleted file mode 100644
index 731c6ea6b..000000000
--- a/applications/utilities/postProcessing/wall/yPlusLES/yPlusLES.C
+++ /dev/null
@@ -1,136 +0,0 @@
-/*---------------------------------------------------------------------------*\
- ========= |
- \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
- \\ / O peration |
- \\ / A nd | Copyright (C) 2011-2015 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
- yPlusLES
-
-Description
- Calculates and reports yPlus for all wall patches, for the specified times
- when using LES turbulence models.
-
-\*---------------------------------------------------------------------------*/
-
-#include "fvCFD.H"
-#include "singlePhaseTransportModel.H"
-#include "turbulentTransportModel.H"
-#include "nutWallFunctionFvPatchScalarField.H"
-
-#include "nearWallDist.H"
-#include "wallFvPatch.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-int main(int argc, char *argv[])
-{
- timeSelector::addOptions();
- #include "setRootCase.H"
- #include "createTime.H"
- instantList timeDirs = timeSelector::select0(runTime, args);
- #include "createMesh.H"
-
- forAll(timeDirs, timeI)
- {
- runTime.setTime(timeDirs[timeI], timeI);
- Info<< "Time = " << runTime.timeName() << endl;
- mesh.readUpdate();
-
- volScalarField yPlus
- (
- IOobject
- (
- "yPlus",
- runTime.timeName(),
- mesh,
- IOobject::NO_READ,
- IOobject::NO_WRITE
- ),
- mesh,
- dimensionedScalar("yPlus", dimless, 0.0)
- );
-
- Info<< "Reading field U\n" << endl;
- volVectorField U
- (
- IOobject
- (
- "U",
- runTime.timeName(),
- mesh,
- IOobject::MUST_READ,
- IOobject::NO_WRITE
- ),
- mesh
- );
-
- #include "createPhi.H"
-
- singlePhaseTransportModel laminarTransport(U, phi);
-
- autoPtr sgsModel
- (
- incompressible::LESModel::New(U, phi, laminarTransport)
- );
-
- volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
- volScalarField nuEff(sgsModel->nuEff());
-
- const fvPatchList& patches = mesh.boundary();
-
- const volScalarField nuLam(sgsModel->nu());
-
- forAll(patches, patchi)
- {
- const fvPatch& currPatch = patches[patchi];
-
- if (isA(currPatch))
- {
- yPlus.boundaryField()[patchi] =
- d[patchi]
- *sqrt
- (
- nuEff.boundaryField()[patchi]
- *mag(U.boundaryField()[patchi].snGrad())
- )
- /nuLam.boundaryField()[patchi];
- const scalarField& Yp = yPlus.boundaryField()[patchi];
-
- Info<< "Patch " << patchi
- << " named " << currPatch.name()
- << " y+ : min: " << gMin(Yp) << " max: " << gMax(Yp)
- << " average: " << gAverage(Yp) << nl << endl;
- }
- }
-
- Info<< "Writing yPlus to field "
- << yPlus.name() << nl << endl;
-
- yPlus.write();
- }
-
- Info<< "End\n" << endl;
-
- return 0;
-}
-
-
-// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/Make/files b/applications/utilities/postProcessing/wall/yPlusRAS/Make/files
deleted file mode 100644
index 2b6530784..000000000
--- a/applications/utilities/postProcessing/wall/yPlusRAS/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-yPlusRAS.C
-
-EXE = $(FOAM_APPBIN)/yPlusRAS