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-2013 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  \heading Patch usage
50 
51  \table
52  Property | Description | Required | Default value
53  intensity | fraction of mean field [0-1] | yes |
54  U | velocity field name | no | U
55  phi | flux field name | no | phi
56  \endtable
57 
58  Example of the boundary condition specification:
59  \verbatim
60  myPatch
61  {
62  type turbulentIntensityKineticEnergyInlet;
63  intensity 0.05; // 5% turbulence
64  value uniform 1; // placeholder
65  }
66  \endverbatim
67 
68 SeeAlso
69  Foam::inletOutletFvPatchField
70 
71 SourceFiles
72  turbulentIntensityKineticEnergyInletFvPatchScalarField.C
73 
74 \*---------------------------------------------------------------------------*/
75 
76 #ifndef turbulentIntensityKineticEnergyInletFvPatchScalarField_H
77 #define turbulentIntensityKineticEnergyInletFvPatchScalarField_H
78 
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 namespace Foam
84 {
85 
86 /*---------------------------------------------------------------------------*\
87  Class turbulentIntensityKineticEnergyInletFvPatchScalarField Declaration
88 \*---------------------------------------------------------------------------*/
89 
90 class turbulentIntensityKineticEnergyInletFvPatchScalarField
91 :
92  public inletOutletFvPatchScalarField
93 {
94  // Private data
95 
96  //- Turbulent intensity as fraction of mean velocity
97  scalar intensity_;
98 
99  //- Name of the velocity field
100  word UName_;
101 
102 
103 public:
104 
105  //- Runtime type information
106  TypeName("turbulentIntensityKineticEnergyInlet");
107 
108 
109  // Constructors
110 
111  //- Construct from patch and internal field
113  (
114  const fvPatch&,
115  const DimensionedField<scalar, volMesh>&
116  );
117 
118  //- Construct from patch, internal field and dictionary
120  (
121  const fvPatch&,
123  const dictionary&
124  );
125 
126  //- Construct by mapping given
127  // turbulentIntensityKineticEnergyInletFvPatchScalarField
128  // onto a new patch
130  (
132  const fvPatch&,
134  const fvPatchFieldMapper&
135  );
136 
137  //- Construct as copy
139  (
141  );
142 
143  //- Construct and return a clone
144  virtual tmp<fvPatchScalarField> clone() const
145  {
147  (
149  (
150  *this
151  )
152  );
153  }
154 
155  //- Construct as copy setting internal field reference
157  (
160  );
161 
162  //- Construct and return a clone setting internal field reference
163  virtual tmp<fvPatchScalarField> clone
164  (
166  ) const
167  {
169  (
171  (
172  *this,
173  iF
174  )
175  );
176  }
177 
178 
179  // Member functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184  //- Write
185  virtual void write(Ostream&) const;
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
197 // ************************************************************************* //