1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Calculates and reports yPlus for all wall patches, for the specified times.
31 \*---------------------------------------------------------------------------*/
34 #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
35 #include "incompressible/LESModel/LESModel.H"
36 #include "nearWallDist.H"
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 int main(int argc, char *argv[])
42 timeSelector::addOptions();
43 #include "setRootCase.H"
44 # include "createTime.H"
45 instantList timeDirs = timeSelector::select0(runTime, args);
46 # include "createMesh.H"
48 forAll(timeDirs, timeI)
50 runTime.setTime(timeDirs[timeI], timeI);
51 Info<< "Time = " << runTime.timeName() << endl;
65 dimensionedScalar("yPlus", dimless, 0.0)
68 Info<< "Reading field U\n" << endl;
82 # include "createPhi.H"
84 singlePhaseTransportModel laminarTransport(U, phi);
86 autoPtr<incompressible::LESModel> sgsModel
88 incompressible::LESModel::New(U, phi, laminarTransport)
91 volScalarField::GeometricBoundaryField d = nearWallDist(mesh).y();
92 volScalarField nuEff = sgsModel->nuEff();
94 const fvPatchList& patches = mesh.boundary();
96 forAll(patches, patchi)
98 const fvPatch& currPatch = patches[patchi];
100 if (typeid(currPatch) == typeid(wallFvPatch))
102 yPlus.boundaryField()[patchi] =
106 nuEff.boundaryField()[patchi]
107 *mag(U.boundaryField()[patchi].snGrad())
109 /sgsModel->nu().boundaryField()[patchi];
110 const scalarField& Yp = yPlus.boundaryField()[patchi];
112 Info<< "Patch " << patchi
113 << " named " << currPatch.name()
114 << " y+ : min: " << min(Yp) << " max: " << max(Yp)
115 << " average: " << average(Yp) << nl << endl;
122 Info<< "End\n" << endl;
128 // ************************************************************************* //