1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2010 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
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
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/>.
25 Foam::incompressible::RASModels::nutkWallFunctionFvPatchScalarField
28 Boundary condition for turbulent (kinematic) viscosity when using wall
29 functions, based on turbulence kinetic energy.
30 - replicates OpenFOAM v1.5 (and earlier) behaviour
33 nutkWallFunctionFvPatchScalarField.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef nutkWallFunctionFvPatchScalarField_H
38 #define nutkWallFunctionFvPatchScalarField_H
40 #include "fixedValueFvPatchFields.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace incompressible
51 /*---------------------------------------------------------------------------*\
52 Class nutkWallFunctionFvPatchScalarField Declaration
53 \*---------------------------------------------------------------------------*/
55 class nutkWallFunctionFvPatchScalarField
57 public fixedValueFvPatchScalarField
66 //- Von Karman constant
72 //- Y+ at the edge of the laminar sublayer
76 // Protected Member Functions
78 //- Check the type of the patch
79 virtual void checkType();
81 //- Calculate the Y+ at the edge of the laminar sublayer
82 virtual scalar calcYPlusLam(const scalar kappa, const scalar E) const;
84 //- Calculate the turbulence viscosity
85 virtual tmp<scalarField> calcNut() const;
87 //- Write local wall function variables
88 virtual void writeLocalEntries(Ostream&) const;
93 //- Runtime type information
94 TypeName("nutkWallFunction");
99 //- Construct from patch and internal field
100 nutkWallFunctionFvPatchScalarField
103 const DimensionedField<scalar, volMesh>&
106 //- Construct from patch, internal field and dictionary
107 nutkWallFunctionFvPatchScalarField
110 const DimensionedField<scalar, volMesh>&,
114 //- Construct by mapping given
115 // nutkWallFunctionFvPatchScalarField
117 nutkWallFunctionFvPatchScalarField
119 const nutkWallFunctionFvPatchScalarField&,
121 const DimensionedField<scalar, volMesh>&,
122 const fvPatchFieldMapper&
125 //- Construct as copy
126 nutkWallFunctionFvPatchScalarField
128 const nutkWallFunctionFvPatchScalarField&
131 //- Construct and return a clone
132 virtual tmp<fvPatchScalarField> clone() const
134 return tmp<fvPatchScalarField>
136 new nutkWallFunctionFvPatchScalarField(*this)
140 //- Construct as copy setting internal field reference
141 nutkWallFunctionFvPatchScalarField
143 const nutkWallFunctionFvPatchScalarField&,
144 const DimensionedField<scalar, volMesh>&
147 //- Construct and return a clone setting internal field reference
148 virtual tmp<fvPatchScalarField> clone
150 const DimensionedField<scalar, volMesh>& iF
153 return tmp<fvPatchScalarField>
155 new nutkWallFunctionFvPatchScalarField(*this, iF)
162 // Evaluation functions
164 //- Calculate and return the yPlus at the boundary
165 virtual tmp<scalarField> yPlus() const;
167 //- Update the coefficients associated with the patch field
168 virtual void updateCoeffs();
174 virtual void write(Ostream&) const;
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 } // End namespace RASModels
181 } // End namespace incompressible
182 } // End namespace Foam
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 // ************************************************************************* //