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  );
118 
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 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: turbulentIntensityKineticEnergyInletFvPatchScalarField.C:129
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::turbulentIntensityKineticEnergyInletFvPatchScalarField
turbulentIntensityKineticEnergyInletFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: turbulentIntensityKineticEnergyInletFvPatchScalarField.C:39
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: turbulentIntensityKineticEnergyInletFvPatchScalarField.H:176
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::TypeName
TypeName("turbulentIntensityKineticEnergyInlet")
Runtime type information.
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: turbulentIntensityKineticEnergyInletFvPatchScalarField.C:150
inletOutletFvPatchFields.H
Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField
This boundary condition provides a turbulent kinetic energy condition, based on user-supplied turbule...
Definition: turbulentIntensityKineticEnergyInletFvPatchScalarField.H:122
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54