1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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::nutkRoughWallFunctionFvPatchScalarField
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
34 - roughness height = sand-grain roughness (0 for smooth walls)
35 - roughness constant = 0.5-1.0 (0.5 default)
38 nutkRoughWallFunctionFvPatchScalarField.C
40 \*---------------------------------------------------------------------------*/
42 #ifndef nutkRoughWallFunctionFvPatchScalarField_H
43 #define nutkRoughWallFunctionFvPatchScalarField_H
45 #include "nutkWallFunctionFvPatchScalarField.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 namespace incompressible
56 /*---------------------------------------------------------------------------*\
57 Class nutkRoughWallFunctionFvPatchScalarField Declaration
58 \*---------------------------------------------------------------------------*/
60 class nutkRoughWallFunctionFvPatchScalarField
62 public nutkWallFunctionFvPatchScalarField
71 //- Roughness constant
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;
86 //- Runtime type information
87 TypeName("nutkRoughWallFunction");
92 //- Construct from patch and internal field
93 nutkRoughWallFunctionFvPatchScalarField
96 const DimensionedField<scalar, volMesh>&
99 //- Construct from patch, internal field and dictionary
100 nutkRoughWallFunctionFvPatchScalarField
103 const DimensionedField<scalar, volMesh>&,
107 //- Construct by mapping given
108 // nutkRoughWallFunctionFvPatchScalarField
110 nutkRoughWallFunctionFvPatchScalarField
112 const nutkRoughWallFunctionFvPatchScalarField&,
114 const DimensionedField<scalar, volMesh>&,
115 const fvPatchFieldMapper&
118 //- Construct as copy
119 nutkRoughWallFunctionFvPatchScalarField
121 const nutkRoughWallFunctionFvPatchScalarField&
124 //- Construct and return a clone
125 virtual tmp<fvPatchScalarField> clone() const
127 return tmp<fvPatchScalarField>
129 new nutkRoughWallFunctionFvPatchScalarField(*this)
133 //- Construct as copy setting internal field reference
134 nutkRoughWallFunctionFvPatchScalarField
136 const nutkRoughWallFunctionFvPatchScalarField&,
137 const DimensionedField<scalar, volMesh>&
140 //- Construct and return a clone setting internal field reference
141 virtual tmp<fvPatchScalarField> clone
143 const DimensionedField<scalar, volMesh>& iF
146 return tmp<fvPatchScalarField>
148 new nutkRoughWallFunctionFvPatchScalarField(*this, iF)
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
178 const fvPatchScalarField&,
186 virtual void write(Ostream&) const;
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace RASModels
193 } // End namespace incompressible
194 } // End namespace Foam
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 // ************************************************************************* //