initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / incompressible / RAS / derivedFvPatchFields / wallFunctions / nutWallFunctions / nutSpalartAllmarasStandardRoughWallFunction / nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField.H
blob8d72e5ad13c1f8b3d4df3eecc19bf7031dbec017
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 Class
26     Foam::incompressible::RASModels::
27     nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
29 Description
30     Wall function boundary condition for rough walls
32 SourceFiles
33     nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
38 #define nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField_H
40 #include "nutWallFunctionFvPatchScalarField.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
46 namespace incompressible
48 namespace RASModels
51 /*---------------------------------------------------------------------------*\
52 Class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField Declaration
53 \*---------------------------------------------------------------------------*/
55 class nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
57     public nutWallFunctionFvPatchScalarField
59     // Private data
61         // Roughness model parameters
63             //- Height
64             scalar roughnessHeight_;
66             //- Constant
67             scalar roughnessConstant_;
69             //- Scale factor
70             scalar roughnessFudgeFactor_;
73     // Protected member functions
75         //- Calculate yPLus
76         virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
78         //- Calculate the turbulence viscosity
79         virtual tmp<scalarField> calcNut() const;
82 public:
84     //- Runtime type information
85     TypeName("nutSpalartAllmarasStandardRoughWallFunction");
88     // Constructors
90         //- Construct from patch and internal field
91         nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
92         (
93             const fvPatch&,
94             const DimensionedField<scalar, volMesh>&
95         );
97         //- Construct from patch, internal field and dictionary
98         nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
99         (
100             const fvPatch&,
101             const DimensionedField<scalar, volMesh>&,
102             const dictionary&
103         );
105         //- Construct by mapping given
106         //  nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
107         //  onto a new patch
108         nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
109         (
110             const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&,
111             const fvPatch&,
112             const DimensionedField<scalar, volMesh>&,
113             const fvPatchFieldMapper&
114         );
116         //- Construct as copy
117         nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
118         (
119             const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&
120         );
122         //- Construct and return a clone
123         virtual tmp<fvPatchScalarField> clone() const
124         {
125             return tmp<fvPatchScalarField>
126             (
127                 new nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
128                 (
129                     *this
130                 )
131             );
132         }
134         //- Construct as copy setting internal field reference
135         nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
136         (
137             const nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField&,
138             const DimensionedField<scalar, volMesh>&
139         );
141         //- Construct and return a clone setting internal field reference
142         virtual tmp<fvPatchScalarField> clone
143         (
144             const DimensionedField<scalar, volMesh>& iF
145         ) const
146         {
147             return tmp<fvPatchScalarField>
148             (
149                 new nutSpalartAllmarasStandardRoughWallFunctionFvPatchScalarField
150                 (
151                     *this,
152                     iF
153                 )
154             );
155         }
158     // Member functions
160         // Access
162             //- Return the roughness height
163             const scalar& roughnessHeight() const
164             {
165                 return roughnessHeight_;
166             }
168             //- Return reference to the roughness height to allow adjustment
169             scalar& roughnessHeight()
170             {
171                 return roughnessHeight_;
172             }
175             //- Return the roughness constant scale
176             const scalar& roughnessConstant() const
177             {
178                 return roughnessConstant_;
179             }
181             //- Return reference to the roughness constant to allow adjustment
182             scalar& roughnessConstant()
183             {
184                 return roughnessConstant_;
185             }
187             //- Return the roughness scale factor
188             const scalar& roughnessFudgeFactor() const
189             {
190                 return roughnessFudgeFactor_;
191             }
193             //- Return reference to the roughness scale factor to allow
194             //  adjustment
195             scalar& roughnessFudgeFactor()
196             {
197                 return roughnessFudgeFactor_;
198             }
201     // I-O
203         // Evaluation functions
205             //- Calculate and return the yPlus at the boundary
206             virtual tmp<scalarField> yPlus() const;
209         // I-O
211             //- Write
212             virtual void write(Ostream& os) const;
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace RASModels
219 } // End namespace incompressible
220 } // End namespace Foam
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
224 #endif
226 // ************************************************************************* //