initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / LES / LESdeltas / smoothDelta / smoothDeltaDeltaDataI.H
blobb501d03f21580c237c10b88aef27f42bad79d7a6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 \*---------------------------------------------------------------------------*/
27 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 namespace Foam
32 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
35 // Update this with w2 if applicable
36 inline bool smoothDelta::deltaData::update
38     const smoothDelta::deltaData& w2,
39     const scalar scale,
40     const scalar tol
42 {   
43     if (!valid() || (delta_ < VSMALL))
44     {
45         // My delta not set. Take over neighbour.
46         delta_ = w2.delta()/scale;
48         // Something changed. Let caller know.
49         return true;
50     }
51     else if (w2.delta() > (1 + tol)*scale*delta_)
52     {
53         // Neighbour is too big for me. Up my delta.
54         delta_ = w2.delta()/scale;
56         // Something changed. Let caller know.
57         return true;
58     }
59     else
60     {
61         // Neighbour is not too big for me or change is too small
62         // Nothing changed.
63         return false;
64     }
66     
68 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
70 // Null constructor
71 inline smoothDelta::deltaData::deltaData()
73     delta_(-GREAT)
77 // Construct from components
78 inline smoothDelta::deltaData::deltaData(const scalar delta)
80     delta_(delta)
84 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
86 inline bool smoothDelta::deltaData::valid() const
88     return delta_ > -SMALL;
92 // Checks for cyclic faces
93 inline bool smoothDelta::deltaData::sameGeometry
95     const polyMesh&,
96     const deltaData&,
97     const scalar
98 ) const
100     return true;
104 inline void smoothDelta::deltaData::leaveDomain
106     const polyMesh&,
107     const polyPatch&,
108     const label,
109     const point&
114 inline void smoothDelta::deltaData::transform
116     const polyMesh&,
117     const tensor&
122 // Update absolute geometric quantities.
123 inline void smoothDelta::deltaData::enterDomain
125     const polyMesh&,
126     const polyPatch&,
127     const label,
128     const point&
133 // Update this (cellI) with face information.
134 inline bool smoothDelta::deltaData::updateCell
136     const polyMesh&,
137     const label,
138     const label,
139     const deltaData& neighbourWallInfo,
140     const scalar tol
143     // Take over info from face if more than deltaRatio larger.
144     return update(neighbourWallInfo, maxDeltaRatio, tol);
145 }    
148 // Update this (face) with cell information.
149 inline bool smoothDelta::deltaData::updateFace
151     const polyMesh&,
152     const label,
153     const label,
154     const deltaData& neighbourWallInfo,
155     const scalar tol
158     // Take over information from cell without any scaling (scale = 1.0)
159     return update(neighbourWallInfo, 1.0, tol);
160 }    
163 // Update this (face) with coupled face information.
164 inline bool smoothDelta::deltaData::updateFace
166     const polyMesh&,
167     const label,
168     const deltaData& neighbourWallInfo,
169     const scalar tol
172     // Take over information from coupled face without any scaling (scale = 1.0)
173     return update(neighbourWallInfo, 1.0, tol);
174 }    
177 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
179 inline bool smoothDelta::deltaData::operator==
181     const deltaData& rhs
182 ) const
184     return delta_ == rhs.delta();
188 inline bool smoothDelta::deltaData::operator!=
190     const deltaData& rhs
191 ) const
193     return !(*this == rhs);
197 // ************************************************************************* //
199 } // End namespace Foam
201 // ************************************************************************* //