FreeFOAM The Cross-Platform CFD Toolkit
backwardsCompatibilityWallFunctions.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 
34 
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 
37 namespace Foam
38 {
39 namespace incompressible
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 tmp<volScalarField> autoCreateNut
45 (
46  const word& fieldName,
47  const fvMesh& mesh
48 )
49 {
50  IOobject nutHeader
51  (
52  fieldName,
53  mesh.time().timeName(),
54  mesh,
57  false
58  );
59 
60  if (nutHeader.headerOk())
61  {
62  return tmp<volScalarField>(new volScalarField(nutHeader, mesh));
63  }
64  else
65  {
66  Info<< "--> Creating " << fieldName
67  << " to employ run-time selectable wall functions" << endl;
68 
69  const fvBoundaryMesh& bm = mesh.boundary();
70 
71  wordList nutBoundaryTypes(bm.size());
72 
73  forAll(bm, patchI)
74  {
75  if (isA<wallFvPatch>(bm[patchI]))
76  {
77  nutBoundaryTypes[patchI] =
78  RASModels::nutWallFunctionFvPatchScalarField::typeName;
79  }
80  else
81  {
82  nutBoundaryTypes[patchI] =
84  }
85  }
86 
88  (
89  new volScalarField
90  (
91  IOobject
92  (
93  fieldName,
94  mesh.time().timeName(),
95  mesh,
97  IOobject::NO_WRITE,
98  false
99  ),
100  mesh,
101  dimensionedScalar("zero", dimArea/dimTime, 0.0),
102  nutBoundaryTypes
103  )
104  );
105 
106  Info<< " Writing new " << fieldName << endl;
107  nut().write();
108 
109  return nut;
110  }
111 }
112 
113 
115 (
116  const word& fieldName,
117  const fvMesh& mesh
118 )
119 {
120  IOobject nutHeader
121  (
122  fieldName,
123  mesh.time().timeName(),
124  mesh,
127  false
128  );
129 
130  if (nutHeader.headerOk())
131  {
132  return tmp<volScalarField>(new volScalarField(nutHeader, mesh));
133  }
134  else
135  {
136  Info<< "--> Creating " << fieldName
137  << " to employ run-time selectable wall functions" << endl;
138 
139  const fvBoundaryMesh& bm = mesh.boundary();
140 
141  wordList nutBoundaryTypes(bm.size());
142 
143  forAll(bm, patchI)
144  {
145  if (isA<wallFvPatch>(bm[patchI]))
146  {
147  nutBoundaryTypes[patchI] =
148  RASModels::nutLowReWallFunctionFvPatchScalarField::typeName;
149  }
150  else
151  {
152  nutBoundaryTypes[patchI] =
154  }
155  }
156 
158  (
159  new volScalarField
160  (
161  IOobject
162  (
163  fieldName,
164  mesh.time().timeName(),
165  mesh,
167  IOobject::NO_WRITE,
168  false
169  ),
170  mesh,
171  dimensionedScalar("zero", dimArea/dimTime, 0.0),
172  nutBoundaryTypes
173  )
174  );
175 
176  Info<< " Writing new " << fieldName << endl;
177  nut().write();
178 
179  return nut;
180  }
181 }
182 
183 
185 (
186  const word& fieldName,
187  const fvMesh& mesh
188 )
189 {
190  return
192  <
193  scalar,
195  >
196  (
197  fieldName,
198  mesh
199  );
200 }
201 
202 
204 (
205  const word& fieldName,
206  const fvMesh& mesh
207 )
208 {
209  return
211  <
212  scalar,
214  >
215  (
216  fieldName,
217  mesh
218  );
219 }
220 
221 
223 (
224  const word& fieldName,
225  const fvMesh& mesh
226 )
227 {
228  return
230  <
231  scalar,
233  >
234  (
235  fieldName,
236  mesh
237  );
238 }
239 
240 
242 (
243  const word& fieldName,
244  const fvMesh& mesh
245 )
246 {
247  return
249  <
250  scalar,
252  >
253  (
254  fieldName,
255  mesh
256  );
257 }
258 
259 
261 (
262  const word& fieldName,
263  const fvMesh& mesh
264 )
265 {
266  return
268  <
269  symmTensor,
271  >
272  (
273  fieldName,
274  mesh
275  );
276 }
277 
278 
279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
280 
281 } // End namespace incompressible
282 } // End namespace Foam
283 
284 // ************************ vim: set sw=4 sts=4 et: ************************ //
285