turbulentMixingLengthDissipationRateInletFvPatchScalarField.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-2015 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::turbulentMixingLengthDissipationRateInletFvPatchScalarField
26 
27 Group
28  grpRASBoundaryConditions grpInletBoundaryConditions
29 
30 Description
31  This boundary condition provides a turbulence dissipation, \f$\epsilon\f$
32  (epsilon) inlet condition based on a specified mixing length. The patch
33  values are calculated using:
34 
35  \f[
36  \epsilon_p = \frac{C_{\mu}^{0.75} k^{1.5}}{L}
37  \f]
38 
39  where
40 
41  \vartable
42  \epsilon_p | patch epsilon values
43  C_{\mu} | Model coefficient, set to 0.09
44  k | turbulence kinetic energy
45  L | length scale
46  \endvartable
47 
48  \heading Patch usage
49 
50  \table
51  Property | Description | Required | Default value
52  mixingLength | Length scale [m] | yes |
53  phi | flux field name | no | phi
54  k | turbulence kinetic energy field name | no | k
55  \endtable
56 
57  Example of the boundary condition specification:
58  \verbatim
59  myPatch
60  {
61  type turbulentMixingLengthDissipationRateInlet;
62  mixingLength 0.005;
63  value uniform 200; // placeholder
64  }
65  \endverbatim
66 
67 Note
68  In the event of reverse flow, a zero-gradient condition is applied
69 
70 SeeAlso
71  Foam::inletOutletFvPatchField
72 
73 SourceFiles
74  turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
75 
76 \*---------------------------------------------------------------------------*/
77 
78 #ifndef turbulentMixingLengthDissipationRateInlet_H
79 #define turbulentMixingLengthDissipationRateInlet_H
80 
82 
83 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
84 
85 namespace Foam
86 {
87 
88 /*---------------------------------------------------------------------------*\
89  Class turbulentMixingLengthDissipationRateInletFvPatchScalarField Declaration
90 \*---------------------------------------------------------------------------*/
91 
92 class turbulentMixingLengthDissipationRateInletFvPatchScalarField
93 :
94  public inletOutletFvPatchScalarField
95 {
96  // Private data
97 
98  //- Turbulent length scale
99  scalar mixingLength_;
100 
101  //- Name of the turbulent kinetic energy field
102  word kName_;
103 
104 
105 public:
106 
107  //- Runtime type information
108  TypeName("turbulentMixingLengthDissipationRateInlet");
109 
110 
111  // Constructors
112 
113  //- Construct from patch and internal field
115  (
116  const fvPatch&,
117  const DimensionedField<scalar, volMesh>&
118  );
119 
120  //- Construct from patch, internal field and dictionary
122  (
123  const fvPatch&,
124  const DimensionedField<scalar, volMesh>&,
125  const dictionary&
126  );
127 
128  //- Construct by mapping given
129  // turbulentMixingLengthDissipationRateInletFvPatchScalarField
130  // onto a new patch
132  (
134  const fvPatch&,
136  const fvPatchFieldMapper&
137  );
138 
139  //- Construct as copy
141  (
143  );
144 
145  //- Construct and return a clone
146  virtual tmp<fvPatchScalarField> clone() const
147  {
149  (
151  (
152  *this
153  )
154  );
155  }
156 
157  //- Construct as copy setting internal field reference
159  (
162  );
163 
164  //- Construct and return a clone setting internal field reference
166  (
168  ) const
169  {
171  (
173  (
174  *this,
175  iF
176  )
177  );
178  }
179 
180 
181  // Member functions
182 
183  //- Update the coefficients associated with the patch field
184  virtual void updateCoeffs();
185 
186  //- Write
187  virtual void write(Ostream&) const;
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #endif
198 
199 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.C:157
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::kName_
word kName_
Name of the turbulent kinetic energy field.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.H:137
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::TypeName
TypeName("turbulentMixingLengthDissipationRateInlet")
Runtime type information.
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.H:181
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField
This boundary condition provides a turbulence dissipation, (epsilon) inlet condition based on a spec...
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.H:127
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::mixingLength_
scalar mixingLength_
Turbulent length scale.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.H:134
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:45
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
inletOutletFvPatchFields.H
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:51
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::turbulentMixingLengthDissipationRateInletFvPatchScalarField
turbulentMixingLengthDissipationRateInletFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.C:42
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.C:121