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::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 nutRoughWallFunctionFvPatchScalarField.C
41 \*---------------------------------------------------------------------------*/
43 #ifndef nutRoughWallFunctionFvPatchScalarField_H
44 #define nutRoughWallFunctionFvPatchScalarField_H
46 #include <incompressibleRASModels/nutWallFunctionFvPatchScalarField.H>
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace incompressible
57 /*---------------------------------------------------------------------------*\
58 Class nutRoughWallFunctionFvPatchScalarField Declaration
59 \*---------------------------------------------------------------------------*/
61 class nutRoughWallFunctionFvPatchScalarField
63 public nutWallFunctionFvPatchScalarField
72 //- Roughness constant
76 // Protected 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> calcNut() const;
87 //- Runtime type information
88 TypeName("nutRoughWallFunction");
93 //- Construct from patch and internal field
94 nutRoughWallFunctionFvPatchScalarField
97 const DimensionedField<scalar, volMesh>&
100 //- Construct from patch, internal field and dictionary
101 nutRoughWallFunctionFvPatchScalarField
104 const DimensionedField<scalar, volMesh>&,
108 //- Construct by mapping given
109 // nutRoughWallFunctionFvPatchScalarField
111 nutRoughWallFunctionFvPatchScalarField
113 const nutRoughWallFunctionFvPatchScalarField&,
115 const DimensionedField<scalar, volMesh>&,
116 const fvPatchFieldMapper&
119 //- Construct as copy
120 nutRoughWallFunctionFvPatchScalarField
122 const nutRoughWallFunctionFvPatchScalarField&
125 //- Construct and return a clone
126 virtual tmp<fvPatchScalarField> clone() const
128 return tmp<fvPatchScalarField>
130 new nutRoughWallFunctionFvPatchScalarField(*this)
134 //- Construct as copy setting internal field reference
135 nutRoughWallFunctionFvPatchScalarField
137 const nutRoughWallFunctionFvPatchScalarField&,
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 nutRoughWallFunctionFvPatchScalarField(*this, iF)
158 //- Map (and resize as needed) from self given a mapping object
159 virtual void autoMap(const fvPatchFieldMapper&);
161 //- Reverse map the given fvPatchField onto this fvPatchField
164 const fvPatchScalarField&,
172 virtual void write(Ostream&) const;
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 } // End namespace RASModels
179 } // End namespace incompressible
180 } // End namespace Foam
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 // ************************ vim: set sw=4 sts=4 et: ************************ //