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
27 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37 // Update this with w2 if w2 nearer to pt.
38 inline bool wallPointYPlus::update
41 const wallPointYPlus& w2,
45 scalar dist2 = magSqr(pt - w2.origin());
47 scalar diff = distSqr() - dist2;
51 // already nearer to pt
55 if ((diff < SMALL) || ((distSqr() > SMALL) && (diff/distSqr() < tol)))
57 // don't propagate small changes
62 // only propagate if interesting (i.e. y+ < 100)
63 scalar yPlus = Foam::sqrt(dist2)/w2.data();
66 if (yPlus < yPlusCutOff)
68 // update with new values
70 origin() = w2.origin();
83 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
86 inline wallPointYPlus::wallPointYPlus()
88 wallPointData<scalar>()
90 // Important: value of yStar where meshWave does not come.
95 // Construct from components
96 inline wallPointYPlus::wallPointYPlus
103 wallPointData<scalar>(origin, yStar, distSqr)
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
109 // Update this with w2 if w2 nearer to pt.
110 inline bool wallPointYPlus::updateCell
112 const polyMesh& mesh,
113 const label thisCellI,
114 const label neighbourFaceI,
115 const wallPointYPlus& neighbourWallInfo,
119 const vectorField& cellCentres = mesh.primitiveMesh::cellCentres();
123 cellCentres[thisCellI],
130 // Update this with w2 if w2 nearer to pt.
131 inline bool wallPointYPlus::updateFace
133 const polyMesh& mesh,
134 const label thisFaceI,
135 const label neighbourCellI,
136 const wallPointYPlus& neighbourWallInfo,
140 const vectorField& faceCentres = mesh.faceCentres();
144 faceCentres[thisFaceI],
151 // Update this with w2 if w2 nearer to pt.
152 inline bool wallPointYPlus::updateFace
154 const polyMesh& mesh,
155 const label thisFaceI,
156 const wallPointYPlus& neighbourWallInfo,
160 const vectorField& faceCentres = mesh.faceCentres();
164 faceCentres[thisFaceI],
171 // ************************************************************************* //
173 } // End namespace Foam
175 // ************************************************************************* //