turbulentIntensityKineticEnergyInletFvPatchScalarField.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2020 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 Description
28  This boundary condition provides a turbulent kinetic energy condition,
29  based on user-supplied turbulence intensity, defined as a fraction of the
30  mean velocity:
31 
32  \f[
33  k_p = 1.5 (I |U|)^2
34  \f]
35 
36  where
37 
38  \vartable
39  k_p | kinetic energy at the patch
40  I | turbulence intensity
41  U | velocity field
42  \endvartable
43 
44  In the event of reverse flow, a zero-gradient condition is applied.
45 
46 Usage
47  \table
48  Property | Description | Required | Default value
49  intensity | fraction of mean field [0-1] | yes |
50  U | velocity field name | no | U
51  phi | flux field name | no | phi
52  \endtable
53 
54  Example of the boundary condition specification:
55  \verbatim
56  <patchName>
57  {
58  type turbulentIntensityKineticEnergyInlet;
59  intensity 0.05; // 5% turbulence
60  value uniform 1; // placeholder
61  }
62  \endverbatim
63 
64 See also
65  Foam::inletOutletFvPatchField
66 
67 SourceFiles
68  turbulentIntensityKineticEnergyInletFvPatchScalarField.C
69 
70 \*---------------------------------------------------------------------------*/
71 
72 #ifndef turbulentIntensityKineticEnergyInletFvPatchScalarField_H
73 #define turbulentIntensityKineticEnergyInletFvPatchScalarField_H
74 
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 namespace Foam
80 {
81 
82 /*---------------------------------------------------------------------------*\
83  Class turbulentIntensityKineticEnergyInletFvPatchScalarField Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class turbulentIntensityKineticEnergyInletFvPatchScalarField
87 :
88  public inletOutletFvPatchScalarField
89 {
90  // Private Data
91 
92  //- Turbulent intensity as fraction of mean velocity
93  scalar intensity_;
94 
95  //- Name of the velocity field
96  word UName_;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("turbulentIntensityKineticEnergyInlet");
103 
104 
105  // Constructors
106 
107  //- Construct from patch and internal field
109  (
110  const fvPatch&,
111  const DimensionedField<scalar, volMesh>&
112  );
113 
114  //- Construct from patch, internal field and dictionary
116  (
117  const fvPatch&,
119  const dictionary&
120  );
121 
122  //- Construct by mapping given
123  // turbulentIntensityKineticEnergyInletFvPatchScalarField
124  // onto a new patch
126  (
128  const fvPatch&,
130  const fvPatchFieldMapper&
131  );
132 
133  //- Disallow copy without setting internal field reference
135  (
137  ) = delete;
138 
139  //- Copy constructor setting internal field reference
141  (
144  );
145 
146  //- Construct and return a clone setting internal field reference
148  (
150  ) const
151  {
153  (
155  (
156  *this,
157  iF
158  )
159  );
160  }
161 
162 
163  // Member Functions
164 
165  //- Update the coefficients associated with the patch field
166  virtual void updateCoeffs();
167 
168  //- Write
169  virtual void write(Ostream&) const;
170 };
171 
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 } // End namespace Foam
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
virtual tmp< fvPatchScalarField > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:63
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:54
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.