1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
26 Foam::incompressible::RASModels::
27 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
30 Wall function boundary condition for rough walls
33 nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
38 #define nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
40 #include "nutWallFunctionFvPatchScalarField.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace incompressible
51 /*---------------------------------------------------------------------------*\
52 Class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration
53 \*---------------------------------------------------------------------------*/
55 class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
57 public nutWallFunctionFvPatchScalarField
61 // Roughness model parameters
64 scalar roughnessHeight_;
67 scalar roughnessConstant_;
70 scalar roughnessFudgeFactor_;
73 // Protected member functions
76 virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
78 //- Calculate the turbulence viscosity
79 virtual tmp<scalarField> calcNut() const;
84 //- Runtime type information
85 TypeName("nutSpalartAllmarasStandardRoughWallFunction");
90 //- Construct from patch and internal field
91 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
94 const DimensionedField<scalar, volMesh>&
97 //- Construct from patch, internal field and dictionary
98 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
101 const DimensionedField<scalar, volMesh>&,
105 //- Construct by mapping given
106 // nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
108 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
110 const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&,
112 const DimensionedField<scalar, volMesh>&,
113 const fvPatchFieldMapper&
116 //- Construct as copy
117 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
119 const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&
122 //- Construct and return a clone
123 virtual tmp<fvPatchScalarField> clone() const
125 return tmp<fvPatchScalarField>
127 new nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
134 //- Construct as copy setting internal field reference
135 nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
137 const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&,
138 const DimensionedField<scalar, volMesh>&
141 //- Construct and return a clone setting internal field reference
142 virtual tmp<fvPatchScalarField> clone
144 const DimensionedField<scalar, volMesh>& iF
147 return tmp<fvPatchScalarField>
149 new nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
162 //- Return the roughness height
163 const scalar& roughnessHeight() const
165 return roughnessHeight_;
168 //- Return reference to the roughness height to allow adjustment
169 scalar& roughnessHeight()
171 return roughnessHeight_;
175 //- Return the roughness constant scale
176 const scalar& roughnessConstant() const
178 return roughnessConstant_;
181 //- Return reference to the roughness constant to allow adjustment
182 scalar& roughnessConstant()
184 return roughnessConstant_;
187 //- Return the roughness scale factor
188 const scalar& roughnessFudgeFactor() const
190 return roughnessFudgeFactor_;
193 //- Return reference to the roughness scale factor to allow
195 scalar& roughnessFudgeFactor()
197 return roughnessFudgeFactor_;
203 // Evaluation functions
205 //- Calculate and return the yPlus at the boundary
206 virtual tmp<scalarField> yPlus() const;
212 virtual void write(Ostream& os) const;
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace RASModels
219 } // End namespace incompressible
220 } // End namespace Foam
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 // ************************************************************************* //