1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
26 Calculate distance to wall.
28 \*---------------------------------------------------------------------------*/
30 #include <finiteVolume/fvCFD.H>
31 #include <finiteVolume/wallDistData.H>
32 #include <finiteVolume/wallPointYPlus.H>
34 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 int main(int argc, char *argv[])
39 # include <OpenFOAM/setRootCase.H>
40 # include <OpenFOAM/createTime.H>
41 # include <OpenFOAM/createMesh.H>
43 Info<< "Mesh read in = "
44 << runTime.cpuTimeIncrement()
45 << " s\n" << endl << endl;
48 Info<< "Time now = " << runTime.timeName() << endl;
50 // wall distance and yStar
57 mesh.time().timeName(),
61 dimensionedScalar("yStar", dimless, 1.0)
64 // Fill wall patches of yStar with some value.
65 forAll(mesh.boundary(), patchI)
67 const fvPatch& patch = mesh.boundary()[patchI];
69 if (typeid(patch) == typeid(wallFvPatch))
71 fvPatchScalarField& wallData = yStar.boundaryField()[patchI];
73 forAll(patch, patchFaceI)
75 // Hack. Just some value.
76 wallData[patchFaceI] = 1/2500.0;
82 // Do distance calculation, transporting values of yStar
83 wallPointYPlus::yPlusCutOff = 200;
84 wallDistData<wallPointYPlus> y(mesh, yStar, true);
88 WarningIn(args.executable())
89 << "There are " << y.nUnset()
90 << " remaining unset cells and/or boundary values" << endl;
103 mesh.time().timeName(),
111 Info<< "End\n" << endl;
120 // ************************ vim: set sw=4 sts=4 et: ************************ //