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 
35 
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
37 
38 namespace Foam
39 {
40 namespace compressible
41 {
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 tmp<volScalarField> autoCreateAlphat
46 (
47  const word& fieldName,
48  const fvMesh& mesh
49 )
50 {
51  IOobject alphatHeader
52  (
53  fieldName,
54  mesh.time().timeName(),
55  mesh,
58  false
59  );
60 
61  if (alphatHeader.headerOk())
62  {
63  return tmp<volScalarField>(new volScalarField(alphatHeader, mesh));
64  }
65  else
66  {
67  Info<< "--> Creating " << fieldName
68  << " to employ run-time selectable wall functions" << endl;
69 
70  const fvBoundaryMesh& bm = mesh.boundary();
71 
72  wordList alphatBoundaryTypes(bm.size());
73 
74  forAll(bm, patchI)
75  {
76  if (isA<wallFvPatch>(bm[patchI]))
77  {
78  alphatBoundaryTypes[patchI] =
79  RASModels::alphatWallFunctionFvPatchScalarField::typeName;
80  }
81  else
82  {
83  alphatBoundaryTypes[patchI] =
85  }
86  }
87 
88  tmp<volScalarField> alphat
89  (
90  new volScalarField
91  (
92  IOobject
93  (
94  fieldName,
95  mesh.time().timeName(),
96  mesh,
98  IOobject::NO_WRITE,
99  false
100  ),
101  mesh,
103  alphatBoundaryTypes
104  )
105  );
106 
107  Info<< " Writing new " << fieldName << endl;
108  alphat().write();
109 
110  return alphat;
111  }
112 }
113 
114 
116 (
117  const word& fieldName,
118  const fvMesh& mesh
119 )
120 {
121  IOobject mutHeader
122  (
123  fieldName,
124  mesh.time().timeName(),
125  mesh,
128  false
129  );
130 
131  if (mutHeader.headerOk())
132  {
133  return tmp<volScalarField>(new volScalarField(mutHeader, mesh));
134  }
135  else
136  {
137  Info<< "--> Creating " << fieldName
138  << " to employ run-time selectable wall functions" << endl;
139 
140  const fvBoundaryMesh& bm = mesh.boundary();
141 
142  wordList mutBoundaryTypes(bm.size());
143 
144  forAll(bm, patchI)
145  {
146  if (isA<wallFvPatch>(bm[patchI]))
147  {
148  mutBoundaryTypes[patchI] =
149  RASModels::mutWallFunctionFvPatchScalarField::typeName;
150  }
151  else
152  {
153  mutBoundaryTypes[patchI] =
155  }
156  }
157 
159  (
160  new volScalarField
161  (
162  IOobject
163  (
164  fieldName,
165  mesh.time().timeName(),
166  mesh,
168  IOobject::NO_WRITE,
169  false
170  ),
171  mesh,
173  mutBoundaryTypes
174  )
175  );
176 
177  Info<< " Writing new " << fieldName << endl;
178  mut().write();
179 
180  return mut;
181  }
182 }
183 
184 
186 (
187  const word& fieldName,
188  const fvMesh& mesh
189 )
190 {
191  IOobject mutHeader
192  (
193  fieldName,
194  mesh.time().timeName(),
195  mesh,
198  false
199  );
200 
201  if (mutHeader.headerOk())
202  {
203  return tmp<volScalarField>(new volScalarField(mutHeader, mesh));
204  }
205  else
206  {
207  Info<< "--> Creating " << fieldName
208  << " to employ run-time selectable wall functions" << endl;
209 
210  const fvBoundaryMesh& bm = mesh.boundary();
211 
212  wordList mutBoundaryTypes(bm.size());
213 
214  forAll(bm, patchI)
215  {
216  if (isA<wallFvPatch>(bm[patchI]))
217  {
218  mutBoundaryTypes[patchI] =
219  RASModels::mutLowReWallFunctionFvPatchScalarField::typeName;
220  }
221  else
222  {
223  mutBoundaryTypes[patchI] =
225  }
226  }
227 
229  (
230  new volScalarField
231  (
232  IOobject
233  (
234  fieldName,
235  mesh.time().timeName(),
236  mesh,
238  IOobject::NO_WRITE,
239  false
240  ),
241  mesh,
243  mutBoundaryTypes
244  )
245  );
246 
247  Info<< " Writing new " << fieldName << endl;
248  mut().write();
249 
250  return mut;
251  }
252 }
253 
254 
256 (
257  const word& fieldName,
258  const fvMesh& mesh
259 )
260 {
261  return
263  <
264  scalar,
266  >
267  (
268  fieldName,
269  mesh
270  );
271 }
272 
273 
275 (
276  const word& fieldName,
277  const fvMesh& mesh
278 )
279 {
280  return
282  <
283  scalar,
285  >
286  (
287  fieldName,
288  mesh
289  );
290 }
291 
292 
294 (
295  const word& fieldName,
296  const fvMesh& mesh
297 )
298 {
299  return
301  <
302  scalar,
304  >
305  (
306  fieldName,
307  mesh
308  );
309 }
310 
311 
313 (
314  const word& fieldName,
315  const fvMesh& mesh
316 )
317 {
318  return
320  <
321  scalar,
323  >
324  (
325  fieldName,
326  mesh
327  );
328 }
329 
330 
332 (
333  const word& fieldName,
334  const fvMesh& mesh
335 )
336 {
337  return
339  <
340  symmTensor,
342  >
343  (
344  fieldName,
345  mesh
346  );
347 }
348 
349 
350 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
351 
352 } // End namespace compressible
353 } // End namespace Foam
354 
355 // ************************ vim: set sw=4 sts=4 et: ************************ //
356