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-2025 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  Cmu | Turbulence model coefficient | no | 0.09
53  \endtable
54 
55  Example of the source condition specification:
56  \verbatim
57  <sourceName>
58  {
59  type turbulentMixingLengthDissipationRate;
60  mixingLength 0.005;
61  }
62  \endverbatim
63 
64 SourceFiles
65  turbulentMixingLengthDissipationRateFvScalarFieldSource.C
66 
67 \*---------------------------------------------------------------------------*/
68 
69 #ifndef turbulentMixingLengthDissipationRateFvScalarFieldSource_H
70 #define turbulentMixingLengthDissipationRateFvScalarFieldSource_H
71 
72 #include "fvFieldSources.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 
79 /*---------------------------------------------------------------------------*\
80  Class turbulentMixingLengthDissipationRateFvScalarFieldSource Declaration
81 \*---------------------------------------------------------------------------*/
82 
83 class turbulentMixingLengthDissipationRateFvScalarFieldSource
84 :
85  public fvScalarFieldSource
86 {
87 private:
88 
89  // Private Data
90 
91  //- Turbulent length scale
92  scalar mixingLength_;
93 
94  //- Name of the turbulent kinetic energy field
95  word kName_;
96 
97  //- Turbulence model coefficient
98  scalar Cmu_;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("turbulentMixingLengthDissipationRate");
105 
106 
107  // Constructors
108 
109  //- Construct from internal field and dictionary
111  (
112  const DimensionedField<scalar, volMesh>&,
113  const dictionary& dict
114  );
115 
116  //- Copy constructor setting internal field reference
118  (
121  );
122 
123  //- Construct and return a clone setting internal field reference
125  (
127  ) const
128  {
130  (
132  (
133  *this,
134  iF
135  )
136  );
137  }
138 
139 
140  //- Destructor
142 
143 
144  // Member Functions
145 
146  //- Return the source value
148  (
149  const fvSource& model,
151  ) const;
152 
153  //- Return the source value
155  (
156  const fvSource& model,
157  const scalarField& source,
158  const labelUList& cells
159  ) const;
160 
161  //- Return the internal coefficient
163  (
164  const fvSource& model,
166  ) const;
167 
168  //- Return the internal coefficient
170  (
171  const fvSource& model,
172  const scalarField& source,
173  const labelUList& cells
174  ) const;
175 
176  //- Write
177  virtual void write(Ostream&) const;
178 };
179 
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
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 autoPtr< fvScalarFieldSource > clone(const DimensionedField< scalar, volMesh > &iF) const
Construct and return a clone setting internal field reference.
TypeName("turbulentMixingLengthDissipationRate")
Runtime type information.
turbulentMixingLengthDissipationRateFvScalarFieldSource(const DimensionedField< scalar, volMesh > &, const dictionary &dict)
Construct from internal field and dictionary.
virtual tmp< DimensionedField< scalar, volMesh > > sourceValue(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const
Return the source value.
virtual tmp< DimensionedField< scalar, volMesh > > internalCoeff(const fvSource &model, const DimensionedField< scalar, volMesh > &source) const
Return the internal coefficient.
const cellShapeList & cells
Namespace for OpenFOAM.
dictionary dict