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::nutURoughWallFunctionFvPatchScalarField
28 Wall function boundary condition for rough walls, based on velocity.
31 nutSpalartAllmarasStandardWallFunctionFvPatchScalarField.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef nutURoughWallFunctionFvPatchScalarField_H
36 #define nutURoughWallFunctionFvPatchScalarField_H
38 #include "nutkWallFunctionFvPatchScalarField.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace incompressible
49 /*---------------------------------------------------------------------------*\
50 Class nutURoughWallFunctionFvPatchScalarField Declaration
51 \*---------------------------------------------------------------------------*/
53 class nutURoughWallFunctionFvPatchScalarField
55 public nutkWallFunctionFvPatchScalarField
59 // Roughness model parameters
62 scalar roughnessHeight_;
65 scalar roughnessConstant_;
68 scalar roughnessFactor_;
71 // Protected Member Functions
74 virtual tmp<scalarField> calcYPlus(const scalarField& magUp) const;
76 //- Calculate the turbulence viscosity
77 virtual tmp<scalarField> calcNut() const;
82 //- Runtime type information
83 TypeName("nutURoughWallFunction");
88 //- Construct from patch and internal field
89 nutURoughWallFunctionFvPatchScalarField
92 const DimensionedField<scalar, volMesh>&
95 //- Construct from patch, internal field and dictionary
96 nutURoughWallFunctionFvPatchScalarField
99 const DimensionedField<scalar, volMesh>&,
103 //- Construct by mapping given
104 // nutURoughWallFunctionFvPatchScalarField
106 nutURoughWallFunctionFvPatchScalarField
108 const nutURoughWallFunctionFvPatchScalarField&,
110 const DimensionedField<scalar, volMesh>&,
111 const fvPatchFieldMapper&
114 //- Construct as copy
115 nutURoughWallFunctionFvPatchScalarField
117 const nutURoughWallFunctionFvPatchScalarField&
120 //- Construct and return a clone
121 virtual tmp<fvPatchScalarField> clone() const
123 return tmp<fvPatchScalarField>
125 new nutURoughWallFunctionFvPatchScalarField(*this)
129 //- Construct as copy setting internal field reference
130 nutURoughWallFunctionFvPatchScalarField
132 const nutURoughWallFunctionFvPatchScalarField&,
133 const DimensionedField<scalar, volMesh>&
136 //- Construct and return a clone setting internal field reference
137 virtual tmp<fvPatchScalarField> clone
139 const DimensionedField<scalar, volMesh>& iF
142 return tmp<fvPatchScalarField>
144 new nutURoughWallFunctionFvPatchScalarField(*this, iF)
153 //- Return the roughness height
154 scalar roughnessHeight() const
156 return roughnessHeight_;
159 //- Return reference to the roughness height to allow adjustment
160 scalar& roughnessHeight()
162 return roughnessHeight_;
166 //- Return the roughness constant scale
167 scalar roughnessConstant() const
169 return roughnessConstant_;
172 //- Return reference to the roughness constant to allow adjustment
173 scalar& roughnessConstant()
175 return roughnessConstant_;
178 //- Return the roughness scale factor
179 scalar roughnessFactor() const
181 return roughnessFactor_;
184 //- Return reference to the roughness scale factor to allow
186 scalar& roughnessFactor()
188 return roughnessFactor_;
194 // Evaluation functions
196 //- Calculate and return the yPlus at the boundary
197 virtual tmp<scalarField> yPlus() const;
203 virtual void write(Ostream& os) const;
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 } // End namespace RASModels
210 } // End namespace incompressible
211 } // End namespace Foam
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 // ************************************************************************* //