initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / turbulenceModels / compressible / RAS / derivedFvPatchFields / wallFunctions / mutWallFunctions / mutRoughWallFunction / mutRoughWallFunctionFvPatchScalarField.H
blob935ab29582bc187cb88fe1f02de029c9cf734cd6
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-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::compressible::RASModels::nutRoughWallFunctionFvPatchScalarField
28 Description
29     Boundary condition for turbulent (kinematic) viscosity when using wall
30     functions for rough walls.
32     Manipulates the E parameter to account for roughness effects, based on
33     KsPlus.
35     - roughness height = sand-grain roughness (0 for smooth walls)
36     - roughness constant = 0.5-1.0 (0.5 default)
38 SourceFiles
39     mutRoughWallFunctionFvPatchScalarField.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H
44 #define compressibleMutRoughWallFunctionFvPatchScalarField_H
46 #include "mutWallFunctionFvPatchScalarField.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
52 namespace compressible
54 namespace RASModels
57 /*---------------------------------------------------------------------------*\
58           Class mutRoughWallFunctionFvPatchScalarField Declaration
59 \*---------------------------------------------------------------------------*/
61 class mutRoughWallFunctionFvPatchScalarField
63     public mutWallFunctionFvPatchScalarField
65 protected:
67     // Protected data
69         //- Roughness height
70         scalarField Ks_;
72         //- Roughness constant
73         scalarField Cs_;
76     // Private member functions
78         //- Compute the roughness function
79         virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
81         //- Calculate the turbulence viscosity
82         virtual tmp<scalarField> calcMut() const;
85 public:
87     //- Runtime type information
88     TypeName("mutRoughWallFunction");
91     // Constructors
93         //- Construct from patch and internal field
94         mutRoughWallFunctionFvPatchScalarField
95         (
96             const fvPatch&,
97             const DimensionedField<scalar, volMesh>&
98         );
100         //- Construct from patch, internal field and dictionary
101         mutRoughWallFunctionFvPatchScalarField
102         (
103             const fvPatch&,
104             const DimensionedField<scalar, volMesh>&,
105             const dictionary&
106         );
108         //- Construct by mapping given
109         //  mutRoughWallFunctionFvPatchScalarField
110         //  onto a new patch
111         mutRoughWallFunctionFvPatchScalarField
112         (
113             const mutRoughWallFunctionFvPatchScalarField&,
114             const fvPatch&,
115             const DimensionedField<scalar, volMesh>&,
116             const fvPatchFieldMapper&
117         );
119         //- Construct as copy
120         mutRoughWallFunctionFvPatchScalarField
121         (
122             const mutRoughWallFunctionFvPatchScalarField&
123         );
125         //- Construct and return a clone
126         virtual tmp<fvPatchScalarField> clone() const
127         {
128             return tmp<fvPatchScalarField>
129             (
130                 new mutRoughWallFunctionFvPatchScalarField(*this)
131             );
132         }
134         //- Construct as copy setting internal field reference
135         mutRoughWallFunctionFvPatchScalarField
136         (
137             const mutRoughWallFunctionFvPatchScalarField&,
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 mutRoughWallFunctionFvPatchScalarField(*this, iF)
150             );
151         }
154     // Member functions
156         // Mapping functions
158             //- Map (and resize as needed) from self given a mapping object
159             virtual void autoMap
160             (
161                 const fvPatchFieldMapper&
162             );
164             //- Reverse map the given fvPatchField onto this fvPatchField
165             virtual void rmap
166             (
167                 const fvPatchScalarField&,
168                 const labelList&
169             );
172         // I-O
174             //- Write
175             virtual void write(Ostream&) const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace RASModels
182 } // End namespace compressible
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #endif
189 // ************************************************************************* //