turbulentMixingLengthDissipationRateFvScalarFieldSource.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) 2023 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::turbulentMixingLengthDissipationRateFvScalarFieldSource
26 
27 Description
28  This source condition provides a turbulence dissipation, \f$\epsilon\f$
29  (epsilon), based on a specified mixing length. The source values are
30  calculated using:
31 
32  \f[
33  \epsilon = \frac{C_{\mu}^{0.75} k^{1.5}}{L}
34  \f]
35 
36  where
37 
38  \vartable
39  \epsilon | epsilon values
40  C_{\mu} | Model coefficient, set to 0.09
41  k | turbulence kinetic energy
42  L | length scale
43  \endvartable
44 
45  In the case of a sink, the current cell values are used instead.
46 
47 Usage
48  \table
49  Property | Description | Required | Default value
50  mixingLength | Length scale [m] | yes |
51  k | turbulence kinetic energy field name | no | k
52  \endtable
53 
54  Example of the source condition specification:
55  \verbatim
56  <patchName>
57  {
58  type turbulentMixingLengthDissipationRate;
59  mixingLength 0.005;
60  }
61  \endverbatim
62 
63 SourceFiles
64  turbulentMixingLengthDissipationRateFvScalarFieldSource.C
65 
66 \*---------------------------------------------------------------------------*/
67 
68 #ifndef turbulentMixingLengthDissipationRateFvScalarFieldSource_H
69 #define turbulentMixingLengthDissipationRateFvScalarFieldSource_H
70 
71 #include "fvFieldSources.H"
72 
73 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
74 
75 namespace Foam
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class turbulentMixingLengthDissipationRateFvScalarFieldSource Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class turbulentMixingLengthDissipationRateFvScalarFieldSource
83 :
84  public fvScalarFieldSource
85 {
86 private:
87 
88  // Private Data
89 
90  //- Turbulent length scale
91  scalar mixingLength_;
92 
93  //- Name of the turbulent kinetic energy field
94  word kName_;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("turbulentMixingLengthDissipationRate");
101 
102 
103  // Constructors
104 
105  //- Construct from internal field and dictionary
107  (
108  const DimensionedField<scalar, volMesh>&,
109  const dictionary& dict
110  );
111 
112  //- Copy constructor setting internal field reference
114  (
117  );
118 
119  //- Construct and return a clone setting internal field reference
121  (
123  ) const
124  {
126  (
128  (
129  *this,
130  iF
131  )
132  );
133  }
134 
135 
136  //- Destructor
138 
139 
140  // Member Functions
141 
142  //- Return the source value
143  virtual tmp<scalarField> sourceValue(const fvSource&) const;
144 
145  //- Return the internal coefficient
146  virtual tmp<scalarField> internalCoeff(const fvSource&) const;
147 
148  //- Write
149  virtual void write(Ostream&) const;
150 };
151 
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base class for finite volume sources.
Definition: fvSource.H:52
A class for managing temporary objects.
Definition: tmp.H:55
This source condition provides a turbulence dissipation, (epsilon), based on a specified mixing leng...
virtual tmp< scalarField > internalCoeff(const fvSource &) const
Return the internal coefficient.
virtual autoPtr< fvScalarFieldSource > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("turbulentMixingLengthDissipationRate")
Runtime type information.
virtual tmp< scalarField > sourceValue(const fvSource &) const
Return the source value.
turbulentMixingLengthDissipationRateFvScalarFieldSource(const DimensionedField< scalar, volMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
Namespace for OpenFOAM.
dictionary dict