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::compressible::RASModels::nutRoughWallFunctionFvPatchScalarField
29 Boundary condition for turbulent (kinematic) viscosity when using wall
30 functions for rough walls.
32 Manipulates the E parameter to account for roughness effects, based on
35 - roughness height = sand-grain roughness (0 for smooth walls)
36 - roughness constant = 0.5-1.0 (0.5 default)
39 mutRoughWallFunctionFvPatchScalarField.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H
44 #define compressibleMutRoughWallFunctionFvPatchScalarField_H
46 #include "mutWallFunctionFvPatchScalarField.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace compressible
57 /*---------------------------------------------------------------------------*\
58 Class mutRoughWallFunctionFvPatchScalarField Declaration
59 \*---------------------------------------------------------------------------*/
61 class mutRoughWallFunctionFvPatchScalarField
63 public mutWallFunctionFvPatchScalarField
72 //- Roughness constant
76 // Private member functions
78 //- Compute the roughness function
79 virtual scalar fnRough(const scalar KsPlus, const scalar Cs) const;
81 //- Calculate the turbulence viscosity
82 virtual tmp<scalarField> calcMut() const;
87 //- Runtime type information
88 TypeName("mutRoughWallFunction");
93 //- Construct from patch and internal field
94 mutRoughWallFunctionFvPatchScalarField
97 const DimensionedField<scalar, volMesh>&
100 //- Construct from patch, internal field and dictionary
101 mutRoughWallFunctionFvPatchScalarField
104 const DimensionedField<scalar, volMesh>&,
108 //- Construct by mapping given
109 // mutRoughWallFunctionFvPatchScalarField
111 mutRoughWallFunctionFvPatchScalarField
113 const mutRoughWallFunctionFvPatchScalarField&,
115 const DimensionedField<scalar, volMesh>&,
116 const fvPatchFieldMapper&
119 //- Construct as copy
120 mutRoughWallFunctionFvPatchScalarField
122 const mutRoughWallFunctionFvPatchScalarField&
125 //- Construct and return a clone
126 virtual tmp<fvPatchScalarField> clone() const
128 return tmp<fvPatchScalarField>
130 new mutRoughWallFunctionFvPatchScalarField(*this)
134 //- Construct as copy setting internal field reference
135 mutRoughWallFunctionFvPatchScalarField
137 const mutRoughWallFunctionFvPatchScalarField&,
138 const DimensionedField<scalar, volMesh>&
141 //- Construct and return a clone setting internal field reference
142 virtual tmp<fvPatchScalarField> clone
144 const DimensionedField<scalar, volMesh>& iF
147 return tmp<fvPatchScalarField>
149 new mutRoughWallFunctionFvPatchScalarField(*this, iF)
158 //- Map (and resize as needed) from self given a mapping object
161 const fvPatchFieldMapper&
164 //- Reverse map the given fvPatchField onto this fvPatchField
167 const fvPatchScalarField&,
175 virtual void write(Ostream&) const;
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 } // End namespace RASModels
182 } // End namespace compressible
183 } // End namespace Foam
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 // ************************************************************************* //