turbulentIntensityKineticEnergyInletFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField
28 
29 Group
30  grpInletBoundaryConditions
31 
32 Description
33  This boundary condition provides a turbulent kinetic energy condition,
34  based on user-supplied turbulence intensity, defined as a fraction of the
35  mean velocity:
36 
37  \f[
38  k_p = 1.5 (I |U|)^2
39  \f]
40 
41  where
42 
43  \vartable
44  k_p | kinetic energy at the patch
45  I | turbulence intensity
46  U | velocity field
47  \endvartable
48 
49  In the event of reverse flow, a zero-gradient condition is applied.
50 
51 Usage
52  \table
53  Property | Description | Required | Default value
54  intensity | fraction of mean field [0-1] | yes |
55  U | velocity field name | no | U
56  phi | flux field name | no | phi
57  \endtable
58 
59  Example of the boundary condition specification:
60  \verbatim
61  <patchName>
62  {
63  type turbulentIntensityKineticEnergyInlet;
64  intensity 0.05; // 5% turbulence
65  value uniform 1; // placeholder
66  }
67  \endverbatim
68 
69 See also
70  Foam::inletOutletFvPatchField
71 
72 SourceFiles
73  turbulentIntensityKineticEnergyInletFvPatchScalarField.C
74 
75 \*---------------------------------------------------------------------------*/
76 
77 #ifndef turbulentIntensityKineticEnergyInletFvPatchScalarField_H
78 #define turbulentIntensityKineticEnergyInletFvPatchScalarField_H
79 
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
86 
87 /*---------------------------------------------------------------------------*\
88  Class turbulentIntensityKineticEnergyInletFvPatchScalarField Declaration
89 \*---------------------------------------------------------------------------*/
90 
91 class turbulentIntensityKineticEnergyInletFvPatchScalarField
92 :
93  public inletOutletFvPatchScalarField
94 {
95  // Private data
96 
97  //- Turbulent intensity as fraction of mean velocity
98  scalar intensity_;
99 
100  //- Name of the velocity field
101  word UName_;
102 
103 
104 public:
105 
106  //- Runtime type information
107  TypeName("turbulentIntensityKineticEnergyInlet");
108 
109 
110  // Constructors
111 
112  //- Construct from patch and internal field
114  (
115  const fvPatch&,
116  const DimensionedField<scalar, volMesh>&
117  );
119  //- Construct from patch, internal field and dictionary
121  (
122  const fvPatch&,
124  const dictionary&
125  );
126 
127  //- Construct by mapping given
128  // turbulentIntensityKineticEnergyInletFvPatchScalarField
129  // onto a new patch
131  (
133  const fvPatch&,
135  const fvPatchFieldMapper&
136  );
137 
138  //- Construct as copy
140  (
142  );
143 
144  //- Construct and return a clone
145  virtual tmp<fvPatchScalarField> clone() const
146  {
148  (
150  (
151  *this
152  )
153  );
154  }
155 
156  //- Construct as copy setting internal field reference
158  (
161  );
162 
163  //- Construct and return a clone setting internal field reference
165  (
167  ) const
168  {
170  (
172  (
173  *this,
174  iF
175  )
176  );
177  }
178 
179 
180  // Member functions
181 
182  //- Update the coefficients associated with the patch field
183  virtual void updateCoeffs();
184 
185  //- Write
186  virtual void write(Ostream&) const;
187 };
188 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
TypeName("turbulentIntensityKineticEnergyInlet")
Runtime type information.
This boundary condition provides a turbulent kinetic energy condition, based on user-supplied turbule...
A FieldMapper for finite-volume patch fields.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
A class for managing temporary objects.
Definition: HashPtrTable.H:50
turbulentIntensityKineticEnergyInletFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.