1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2009 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 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
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
26 Foam::incompressible::RASModels::nutkWallFunctionFvPatchScalarField
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
34 nutkWallFunctionFvPatchScalarField.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef nutkWallFunctionFvPatchScalarField_H
39 #define nutkWallFunctionFvPatchScalarField_H
41 #include "fixedValueFvPatchFields.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 namespace incompressible
52 /*---------------------------------------------------------------------------*\
53 Class nutkWallFunctionFvPatchScalarField Declaration
54 \*---------------------------------------------------------------------------*/
56 class nutkWallFunctionFvPatchScalarField
58 public fixedValueFvPatchScalarField
67 //- Von Karman constant
73 //- Y+ at the edge of the laminar sublayer
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;
94 //- Runtime type information
95 TypeName("nutkWallFunction");
100 //- Construct from patch and internal field
101 nutkWallFunctionFvPatchScalarField
104 const DimensionedField<scalar, volMesh>&
107 //- Construct from patch, internal field and dictionary
108 nutkWallFunctionFvPatchScalarField
111 const DimensionedField<scalar, volMesh>&,
115 //- Construct by mapping given
116 // nutkWallFunctionFvPatchScalarField
118 nutkWallFunctionFvPatchScalarField
120 const nutkWallFunctionFvPatchScalarField&,
122 const DimensionedField<scalar, volMesh>&,
123 const fvPatchFieldMapper&
126 //- Construct as copy
127 nutkWallFunctionFvPatchScalarField
129 const nutkWallFunctionFvPatchScalarField&
132 //- Construct and return a clone
133 virtual tmp<fvPatchScalarField> clone() const
135 return tmp<fvPatchScalarField>
137 new nutkWallFunctionFvPatchScalarField(*this)
141 //- Construct as copy setting internal field reference
142 nutkWallFunctionFvPatchScalarField
144 const nutkWallFunctionFvPatchScalarField&,
145 const DimensionedField<scalar, volMesh>&
148 //- Construct and return a clone setting internal field reference
149 virtual tmp<fvPatchScalarField> clone
151 const DimensionedField<scalar, volMesh>& iF
154 return tmp<fvPatchScalarField>
156 new nutkWallFunctionFvPatchScalarField(*this, iF)
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();
175 virtual void write(Ostream&) const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace RASModels
182 } // End namespace incompressible
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 // ************************************************************************* //