New BCs: nutkWallFunction (equivalent to nutWallFunction)
[OpenFOAM-1.6.x.git] / src / turbulenceModels / incompressible / RAS / derivedFvPatchFields / wallFunctions / nutWallFunctions / nutkWallFunction / nutkWallFunctionFvPatchScalarField.H
blob5b781a934a54b42c83b477a5e6a11e6601281b88
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::incompressible::RASModels::nutkWallFunctionFvPatchScalarField
28 Description
29     Boundary condition for turbulent (kinematic) viscosity when using wall
30     functions, based on turbulence kinetic energy.
31     - replicates OpenFOAM v1.5 (and earlier) behaviour
33 SourceFiles
34     nutkWallFunctionFvPatchScalarField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef nutkWallFunctionFvPatchScalarField_H
39 #define nutkWallFunctionFvPatchScalarField_H
41 #include "fixedValueFvPatchFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
47 namespace incompressible
49 namespace RASModels
52 /*---------------------------------------------------------------------------*\
53              Class nutkWallFunctionFvPatchScalarField Declaration
54 \*---------------------------------------------------------------------------*/
56 class nutkWallFunctionFvPatchScalarField
58     public fixedValueFvPatchScalarField
60 protected:
62     // Protected data
64         //- Cmu coefficient
65         scalar Cmu_;
67         //- Von Karman constant
68         scalar kappa_;
70         //- E coefficient
71         scalar E_;
73         //- Y+ at the edge of the laminar sublayer
74         scalar yPlusLam_;
77     // Protected member functions
79         //- Check the type of the patch
80         virtual void checkType();
82         //- Calculate the Y+ at the edge of the laminar sublayer
83         virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
85         //- Calculate the turbulence viscosity
86         virtual tmp<scalarField> calcNut() const;
88         //- Write local wall function variables
89         virtual void writeLocalEntries(Ostream&) const;
92 public:
94     //- Runtime type information
95     TypeName("nutkWallFunction");
98     // Constructors
100         //- Construct from patch and internal field
101         nutkWallFunctionFvPatchScalarField
102         (
103             const fvPatch&,
104             const DimensionedField<scalar, volMesh>&
105         );
107         //- Construct from patch, internal field and dictionary
108         nutkWallFunctionFvPatchScalarField
109         (
110             const fvPatch&,
111             const DimensionedField<scalar, volMesh>&,
112             const dictionary&
113         );
115         //- Construct by mapping given
116         //  nutkWallFunctionFvPatchScalarField
117         //  onto a new patch
118         nutkWallFunctionFvPatchScalarField
119         (
120             const nutkWallFunctionFvPatchScalarField&,
121             const fvPatch&,
122             const DimensionedField<scalar, volMesh>&,
123             const fvPatchFieldMapper&
124         );
126         //- Construct as copy
127         nutkWallFunctionFvPatchScalarField
128         (
129             const nutkWallFunctionFvPatchScalarField&
130         );
132         //- Construct and return a clone
133         virtual tmp<fvPatchScalarField> clone() const
134         {
135             return tmp<fvPatchScalarField>
136             (
137                 new nutkWallFunctionFvPatchScalarField(*this)
138             );
139         }
141         //- Construct as copy setting internal field reference
142         nutkWallFunctionFvPatchScalarField
143         (
144             const nutkWallFunctionFvPatchScalarField&,
145             const DimensionedField<scalar, volMesh>&
146         );
148         //- Construct and return a clone setting internal field reference
149         virtual tmp<fvPatchScalarField> clone
150         (
151             const DimensionedField<scalar, volMesh>& iF
152         ) const
153         {
154             return tmp<fvPatchScalarField>
155             (
156                 new nutkWallFunctionFvPatchScalarField(*this, iF)
157             );
158         }
161     // Member functions
163         // Evaluation functions
165             //- Calculate and return the yPlus at the boundary
166             virtual tmp<scalarField> yPlus() const;
168             //- Update the coefficients associated with the patch field
169             virtual void updateCoeffs();
172         // I-O
174             //- Write
175             virtual void write(Ostream&) const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace RASModels
182 } // End namespace incompressible
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 #endif
189 // ************************************************************************* //