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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField
29 
30 Group
31  grpRASBoundaryConditions grpInletBoundaryConditions
32 
33 Description
34  This boundary condition provides an inlet condition for turbulent kinetic
35  energy dissipation rate, i.e. \c epsilon, based on a specified mixing
36  length. The patch values are calculated using:
37 
38  \f[
39  \epsilon_p = \frac{C_{\mu}^{0.75} k^{1.5}}{L}
40  \f]
41 
42  where
43  \vartable
44  \epsilon_p | Patch epsilon values [m2/s3]
45  C_\mu | Empirical model constant retrived from turbulence model
46  k | Turbulent kinetic energy [m2/s2]
47  L | Mixing length scale [m]
48  \endvartable
49 
50 Usage
51  Example of the boundary condition specification:
52  \verbatim
53  <patchName>
54  {
55  // Mandatory entries (unmodifiable)
56  type turbulentMixingLengthDissipationRateInlet;
57 
58  // Mandatory entries (runtime modifiable)
59  mixingLength 0.005;
60 
61  // Optional entries (runtime modifiable)
62  Cmu 0.09;
63  k k;
64  phi phi;
65 
66  // Placeholder
67  value uniform 200;
68  }
69  \endverbatim
70 
71  where the entries mean:
72  \table
73  Property | Description | Type | Req'd | Dflt
74  mixingLength | Mixing length scale [m] | scalar | yes | -
75  Cmu | Empirical model constant | scalar | no | 0.09
76  phi | Name of flux field | word | no | phi
77  k | Name of turbulent kinetic energy field | word | no | k
78  \endtable
79 
80 Note
81  - The boundary condition is derived from \c inletOutlet condition.
82  Therefore, in the event of reverse flow, a zero-gradient condition
83  is applied.
84  - The order of precedence to input the empirical model constant \c Cmu is:
85  turbulence model, boundary condition dictionary, and default value=0.09.
86  - The empirical model constant \c Cmu is not a spatiotemporal variant field.
87  Therefore, the use of the boundary condition may not be fully consistent
88  with the turbulence models where \c Cmu is a variant field, such as
89  \c realizableKE closure model in this respect. Nevertheless, workflow
90  observations suggest that the matter poses no importance.
91 
92 See also
93  Foam::inletOutletFvPatchField
94 
95 SourceFiles
96  turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef turbulentMixingLengthDissipationRateInletFvPatchScalarField_H
101 #define turbulentMixingLengthDissipationRateInletFvPatchScalarField_H
102 
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 namespace Foam
108 {
109 
110 /*---------------------------------------------------------------------------*\
111  Class turbulentMixingLengthDissipationRateInletFvPatchScalarField Declaration
112 \*---------------------------------------------------------------------------*/
113 
114 class turbulentMixingLengthDissipationRateInletFvPatchScalarField
115 :
116  public inletOutletFvPatchScalarField
117 {
118  // Private Data
119 
120  //- Name of the turbulent kinetic energy field
121  word kName_;
122 
123  //- Mixing length scale
124  scalar mixingLength_;
125 
126  //- Empirical model constant
127  scalar Cmu_;
128 
129 
130 public:
131 
132  //- Runtime type information
133  TypeName("turbulentMixingLengthDissipationRateInlet");
134 
135 
136  // Constructors
137 
138  //- Construct from patch and internal field
140  (
141  const fvPatch&,
142  const DimensionedField<scalar, volMesh>&
143  );
144 
145  //- Construct from patch, internal field and dictionary
147  (
148  const fvPatch&,
149  const DimensionedField<scalar, volMesh>&,
150  const dictionary&
151  );
152 
153  //- Construct by mapping given
154  //- turbulentMixingLengthDissipationRateInletFvPatchScalarField
155  //- onto a new patch
157  (
159  const fvPatch&,
161  const fvPatchFieldMapper&
162  );
163 
164  //- Construct as copy
166  (
168  );
169 
170  //- Construct and return a clone
171  virtual tmp<fvPatchScalarField> clone() const
172  {
174  (
176  (
177  *this
178  )
179  );
180  }
181 
182  //- Construct as copy setting internal field reference
184  (
187  );
188 
189  //- Construct and return a clone setting internal field reference
191  (
193  ) const
194  {
196  (
198  (
199  *this,
200  iF
201  )
202  );
203  }
204 
205 
206  // Member Functions
207 
208  //- Update the coefficients associated with the patch field
209  virtual void updateCoeffs();
210 
211  //- Write
212  virtual void write(Ostream&) const;
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #endif
223 
224 // ************************************************************************* //
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::turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.C:167
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::TypeName
TypeName("turbulentMixingLengthDissipationRateInlet")
Runtime type information.
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.H:216
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::turbulentMixingLengthDissipationRateInletFvPatchScalarField
This boundary condition provides an inlet condition for turbulent kinetic energy dissipation rate,...
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.H:159
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
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:54
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::turbulentMixingLengthDissipationRateInletFvPatchScalarField
turbulentMixingLengthDissipationRateInletFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.C:45
Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: turbulentMixingLengthDissipationRateInletFvPatchScalarField.C:132