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 | Copyright (C) 2011-2016 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField
26 
27 Group
28  grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a turbulent kinetic energy condition,
32  based on user-supplied turbulence intensity, defined as a fraction of the
33  mean velocity:
34 
35  \f[
36  k_p = 1.5 (I |U|)^2
37  \f]
38 
39  where
40 
41  \vartable
42  k_p | kinetic energy at the patch
43  I | turbulence intensity
44  U | velocity field
45  \endvartable
46 
47  In the event of reverse flow, a zero-gradient condition is applied.
48 
49 Usage
50  \table
51  Property | Description | Required | Default value
52  intensity | fraction of mean field [0-1] | yes |
53  U | velocity field name | no | U
54  phi | flux field name | no | phi
55  \endtable
56 
57  Example of the boundary condition specification:
58  \verbatim
59  <patchName>
60  {
61  type turbulentIntensityKineticEnergyInlet;
62  intensity 0.05; // 5% turbulence
63  value uniform 1; // placeholder
64  }
65  \endverbatim
66 
67 See also
68  Foam::inletOutletFvPatchField
69 
70 SourceFiles
71  turbulentIntensityKineticEnergyInletFvPatchScalarField.C
72 
73 \*---------------------------------------------------------------------------*/
74 
75 #ifndef turbulentIntensityKineticEnergyInletFvPatchScalarField_H
76 #define turbulentIntensityKineticEnergyInletFvPatchScalarField_H
77 
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 namespace Foam
83 {
84 
85 /*---------------------------------------------------------------------------*\
86  Class turbulentIntensityKineticEnergyInletFvPatchScalarField Declaration
87 \*---------------------------------------------------------------------------*/
88 
89 class turbulentIntensityKineticEnergyInletFvPatchScalarField
90 :
91  public inletOutletFvPatchScalarField
92 {
93  // Private data
94 
95  //- Turbulent intensity as fraction of mean velocity
96  scalar intensity_;
97 
98  //- Name of the velocity field
99  word UName_;
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("turbulentIntensityKineticEnergyInlet");
106 
107 
108  // Constructors
109 
110  //- Construct from patch and internal field
112  (
113  const fvPatch&,
114  const DimensionedField<scalar, volMesh>&
115  );
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // turbulentIntensityKineticEnergyInletFvPatchScalarField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fvPatchFieldMapper&
134  );
135 
136  //- Construct as copy
138  (
140  );
141 
142  //- Construct and return a clone
143  virtual tmp<fvPatchScalarField> clone() const
144  {
146  (
148  (
149  *this
150  )
151  );
152  }
153 
154  //- Construct as copy setting internal field reference
156  (
159  );
160 
161  //- Construct and return a clone setting internal field reference
163  (
165  ) const
166  {
168  (
170  (
171  *this,
172  iF
173  )
174  );
175  }
176 
177 
178  // Member functions
179 
180  //- Update the coefficients associated with the patch field
181  virtual void updateCoeffs();
182 
183  //- Write
184  virtual void write(Ostream&) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #endif
195 
196 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
TypeName("turbulentIntensityKineticEnergyInlet")
Runtime type information.
This boundary condition provides a turbulent kinetic energy condition, based on user-supplied turbule...
Foam::fvPatchFieldMapper.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
turbulentIntensityKineticEnergyInletFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Namespace for OpenFOAM.