FreeFOAM The Cross-Platform CFD Toolkit
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) 2006-2010 OpenCFD Ltd.
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 Description
28  Calculate turbulent kinetic energy from the intensity provided as a
29  fraction of the mean velocity
30 
31  Example of the boundary condition specification:
32  @verbatim
33  inlet
34  {
35  type turbulentIntensityKineticEnergyInlet;
36  intensity 0.05; // 5% turbulence
37  value uniform 1; // placeholder
38  }
39  @endverbatim
40 
41 SourceFiles
42  turbulentIntensityKineticEnergyInletFvPatchScalarField.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef turbulentIntensityKineticEnergyInletFvPatchScalarField_H
47 #define turbulentIntensityKineticEnergyInletFvPatchScalarField_H
48 
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class turbulentIntensityKineticEnergyInletFvPatch Declaration
58 \*---------------------------------------------------------------------------*/
59 
61 :
62  public inletOutletFvPatchScalarField
63 {
64  // Private data
65 
66  //- Turbulent intensity as fraction of mean velocity
67  scalar intensity_;
68 
69  //- Name of the velocity field
70  word UName_;
71 
72  //- Name of the flux field
73  word phiName_;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("turbulentIntensityKineticEnergyInlet");
80 
81 
82  // Constructors
83 
84  //- Construct from patch and internal field
86  (
87  const fvPatch&,
89  );
90 
91  //- Construct from patch, internal field and dictionary
93  (
94  const fvPatch&,
96  const dictionary&
97  );
98 
99  //- Construct by mapping given
100  // turbulentIntensityKineticEnergyInletFvPatchScalarField
101  // onto a new patch
103  (
105  const fvPatch&,
107  const fvPatchFieldMapper&
108  );
109 
110  //- Construct as copy
112  (
114  );
115 
116  //- Construct and return a clone
118  {
120  (
122  (
123  *this
124  )
125  );
126  }
127 
128  //- Construct as copy setting internal field reference
130  (
133  );
134 
135  //- Construct and return a clone setting internal field reference
137  (
139  ) const
140  {
142  (
144  (
145  *this,
146  iF
147  )
148  );
149  }
150 
151 
152  // Member functions
153 
154  //- Update the coefficients associated with the patch field
155  virtual void updateCoeffs();
156 
157  //- Write
158  virtual void write(Ostream&) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************ vim: set sw=4 sts=4 et: ************************ //