1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2010 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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "backwardsCompatibilityWallFunctions.H"
28 #include "calculatedFvPatchField.H"
29 #include "nutkWallFunctionFvPatchScalarField.H"
30 #include "nutLowReWallFunctionFvPatchScalarField.H"
31 #include "epsilonWallFunctionFvPatchScalarField.H"
32 #include "kqRWallFunctionFvPatchField.H"
33 #include "omegaWallFunctionFvPatchScalarField.H"
35 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 namespace incompressible
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 tmp<volScalarField> autoCreateNut
46 const word& fieldName,
53 mesh.time().timeName(),
60 if (nutHeader.headerOk())
62 return tmp<volScalarField>(new volScalarField(nutHeader, mesh));
66 Info<< "--> Creating " << fieldName
67 << " to employ run-time selectable wall functions" << endl;
69 const fvBoundaryMesh& bm = mesh.boundary();
71 wordList nutBoundaryTypes(bm.size());
75 if (isA<wallFvPatch>(bm[patchI]))
77 nutBoundaryTypes[patchI] =
78 RASModels::nutkWallFunctionFvPatchScalarField::typeName;
82 nutBoundaryTypes[patchI] =
83 calculatedFvPatchField<scalar>::typeName;
87 tmp<volScalarField> nut
94 mesh.time().timeName(),
101 dimensionedScalar("zero", dimArea/dimTime, 0.0),
106 Info<< " Writing new " << fieldName << endl;
114 tmp<volScalarField> autoCreateLowReNut
116 const word& fieldName,
123 mesh.time().timeName(),
130 if (nutHeader.headerOk())
132 return tmp<volScalarField>(new volScalarField(nutHeader, mesh));
136 Info<< "--> Creating " << fieldName
137 << " to employ run-time selectable wall functions" << endl;
139 const fvBoundaryMesh& bm = mesh.boundary();
141 wordList nutBoundaryTypes(bm.size());
145 if (isA<wallFvPatch>(bm[patchI]))
147 nutBoundaryTypes[patchI] =
148 RASModels::nutLowReWallFunctionFvPatchScalarField::typeName;
152 nutBoundaryTypes[patchI] =
153 calculatedFvPatchField<scalar>::typeName;
157 tmp<volScalarField> nut
164 mesh.time().timeName(),
171 dimensionedScalar("zero", dimArea/dimTime, 0.0),
176 Info<< " Writing new " << fieldName << endl;
184 tmp<volScalarField> autoCreateEpsilon
186 const word& fieldName,
191 autoCreateWallFunctionField
194 RASModels::epsilonWallFunctionFvPatchScalarField
203 tmp<volScalarField> autoCreateOmega
205 const word& fieldName,
210 autoCreateWallFunctionField
213 RASModels::omegaWallFunctionFvPatchScalarField
222 tmp<volScalarField> autoCreateK
224 const word& fieldName,
229 autoCreateWallFunctionField
232 RASModels::kqRWallFunctionFvPatchField<scalar>
241 tmp<volScalarField> autoCreateQ
243 const word& fieldName,
248 autoCreateWallFunctionField
251 RASModels::kqRWallFunctionFvPatchField<scalar>
260 tmp<volSymmTensorField> autoCreateR
262 const word& fieldName,
267 autoCreateWallFunctionField
270 RASModels::kqRWallFunctionFvPatchField<symmTensor>
279 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281 } // End namespace incompressible
282 } // End namespace Foam
284 // ************************************************************************* //