BUG: UListIO: byteSize overflowing on really big faceLists
[OpenFOAM-2.0.x.git] / src / turbulenceModels / incompressible / RAS / derivedFvPatchFields / wallFunctions / nutWallFunctions / nutkRoughWallFunction / nutkRoughWallFunctionFvPatchScalarField.H
blobad39e628a270f523ecff939852ecc5cea8043623
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
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
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
19     for more details.
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 Class
25     Foam::incompressible::RASModels::nutkRoughWallFunctionFvPatchScalarField
27 Description
28     Boundary condition for turbulent (kinematic) viscosity when using wall
29     functions for rough walls, based on turbulence kinetic energy.
31     Manipulates the E parameter to account for roughness effects, based on
32     KsPlus.
34     - roughness height = sand-grain roughness (0 for smooth walls)
35     - roughness constant = 0.5-1.0 (0.5 default)
37 SourceFiles
38     nutkRoughWallFunctionFvPatchScalarField.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef nutkRoughWallFunctionFvPatchScalarField_H
43 #define nutkRoughWallFunctionFvPatchScalarField_H
45 #include "nutkWallFunctionFvPatchScalarField.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 namespace Foam
51 namespace incompressible
53 namespace RASModels
56 /*---------------------------------------------------------------------------*\
57            Class nutkRoughWallFunctionFvPatchScalarField Declaration
58 \*---------------------------------------------------------------------------*/
60 class nutkRoughWallFunctionFvPatchScalarField
62     public nutkWallFunctionFvPatchScalarField
64 protected:
66     // Protected data
68         //- Roughness height
69         scalarField Ks_;
71         //- Roughness constant
72         scalarField Cs_;
75     // Protected Member Functions
77         //- Compute the roughness function
78         virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
80         //- Calculate the turbulence viscosity
81         virtual tmp<scalarField> calcNut() const;
84 public:
86     //- Runtime type information
87     TypeName("nutkRoughWallFunction");
90     // Constructors
92         //- Construct from patch and internal field
93         nutkRoughWallFunctionFvPatchScalarField
94         (
95             const fvPatch&,
96             const DimensionedField<scalar, volMesh>&
97         );
99         //- Construct from patch, internal field and dictionary
100         nutkRoughWallFunctionFvPatchScalarField
101         (
102             const fvPatch&,
103             const DimensionedField<scalar, volMesh>&,
104             const dictionary&
105         );
107         //- Construct by mapping given
108         //  nutkRoughWallFunctionFvPatchScalarField
109         //  onto a new patch
110         nutkRoughWallFunctionFvPatchScalarField
111         (
112             const nutkRoughWallFunctionFvPatchScalarField&,
113             const fvPatch&,
114             const DimensionedField<scalar, volMesh>&,
115             const fvPatchFieldMapper&
116         );
118         //- Construct as copy
119         nutkRoughWallFunctionFvPatchScalarField
120         (
121             const nutkRoughWallFunctionFvPatchScalarField&
122         );
124         //- Construct and return a clone
125         virtual tmp<fvPatchScalarField> clone() const
126         {
127             return tmp<fvPatchScalarField>
128             (
129                 new nutkRoughWallFunctionFvPatchScalarField(*this)
130             );
131         }
133         //- Construct as copy setting internal field reference
134         nutkRoughWallFunctionFvPatchScalarField
135         (
136             const nutkRoughWallFunctionFvPatchScalarField&,
137             const DimensionedField<scalar, volMesh>&
138         );
140         //- Construct and return a clone setting internal field reference
141         virtual tmp<fvPatchScalarField> clone
142         (
143             const DimensionedField<scalar, volMesh>& iF
144         ) const
145         {
146             return tmp<fvPatchScalarField>
147             (
148                 new nutkRoughWallFunctionFvPatchScalarField(*this, iF)
149             );
150         }
153     // Member functions
155         // Acces functions
157             // Return Ks
158              scalarField& Ks()
159             {
160                 return Ks_;
161             }
163             // Return Cs
164             scalarField& Cs()
165             {
166                 return Cs_;
167             }
170         // Mapping functions
172             //- Map (and resize as needed) from self given a mapping object
173             virtual void autoMap(const fvPatchFieldMapper&);
175             //- Reverse map the given fvPatchField onto this fvPatchField
176             virtual void rmap
177             (
178                 const fvPatchScalarField&,
179                 const labelList&
180             );
183         // I-O
185             //- Write
186             virtual void write(Ostream&) const;
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace RASModels
193 } // End namespace incompressible
194 } // End namespace Foam
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #endif
200 // ************************************************************************* //