eddyDiffusivity.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) 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::turbulenceThermophysicalTransportModels::eddyDiffusivity
26 
27 Description
28  Eddy-diffusivity based gradient heat flux model for RAS or LES
29  of turbulent flow. Specie fluxes are computed assuming a unity turbulent
30  Lewis number.
31 
32 Usage
33  \verbatim
34  LES
35  {
36  model eddyDiffusivity;
37  Prt 0.85;
38  }
39  \endverbatim
40 
41 SourceFiles
42  eddyDiffusivity.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef eddyDiffusivity_H
47 #define eddyDiffusivity_H
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 namespace turbulenceThermophysicalTransportModels
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class eddyDiffusivity Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class TurbulenceThermophysicalTransportModel>
61 class eddyDiffusivity
62 :
63  public TurbulenceThermophysicalTransportModel
64 {
65 
66 protected:
67 
68  // Protected data
69 
70  // Model coefficients
71 
72  //- Turbulent Prandtl number []
74 
75  // Fields
76 
77  //- Turbulent thermal diffusivity of enthalpy [kg/m/s]
79 
80 
81  // Protected Member Functions
82 
83  virtual void correctAlphat();
84 
85 
86 public:
87 
88  typedef typename TurbulenceThermophysicalTransportModel::alphaField
89  alphaField;
90 
91  typedef typename
94 
95  typedef typename TurbulenceThermophysicalTransportModel::thermoModel
97 
98 
99  //- Runtime type information
100  TypeName("eddyDiffusivity");
101 
102 
103  // Constructors
104 
105  //- Construct from a momentum transport model and a thermo model
107  (
108  const momentumTransportModel& momentumTransport,
109  const thermoModel& thermo
110  );
111 
112  //- Construct from a type name, a momentum transport model and a thermo
113  // model, and whether to default the turbulent Prandtl number to one
114  // if it is not specified
116  (
117  const word& type,
118  const momentumTransportModel& momentumTransport,
119  const thermoModel& thermo,
120  const bool allowDefaultPrt
121  );
122 
123 
124  //- Destructor
125  virtual ~eddyDiffusivity()
126  {}
127 
128 
129  // Member Functions
130 
131  //- Read thermophysicalTransport dictionary
132  virtual bool read();
133 
134  //- Turbulent thermal diffusivity for enthalpy [kg/m/s]
135  virtual tmp<volScalarField> alphat() const
136  {
137  return alphat_;
138  }
139 
140  //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
141  virtual tmp<scalarField> alphat(const label patchi) const
142  {
143  return alphat()().boundaryField()[patchi];
144  }
145 
146  //- Effective thermal turbulent diffusivity for temperature
147  // of mixture [W/m/K]
148  virtual tmp<volScalarField> kappaEff() const
149  {
150  return this->thermo().kappaEff(alphat());
151  }
152 
153  //- Effective thermal turbulent diffusivity for temperature
154  // of mixture for patch [W/m/K]
155  virtual tmp<scalarField> kappaEff(const label patchi) const
156  {
157  return this->thermo().kappaEff
158  (
159  alphat(patchi),
160  patchi
161  );
162  }
163 
164  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
165  virtual tmp<volScalarField> alphaEff() const
166  {
167  return this->thermo().alphaEff(alphat());
168  }
169 
170  //- Effective thermal turbulent diffusivity of mixture
171  // for patch [kg/m/s]
172  virtual tmp<scalarField> alphaEff(const label patchi) const
173  {
174  return this->thermo().alphaEff
175  (
176  alphat(patchi),
177  patchi
178  );
179  }
180 
181  //- Effective mass diffusivity for a given specie mass-fraction [kg/m/s]
182  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const
183  {
184  return volScalarField::New
185  (
186  "DEff",
187  alphaEff()
188  );
189  }
190 
191  //- Effective mass diffusivity for a given specie mass-fraction
192  // for patch [kg/m/s]
194  (
195  const volScalarField& Yi,
196  const label patchi
197  ) const
198  {
199  return alphaEff(patchi);
200  }
201 
202  //- Return the heat flux
203  virtual tmp<volVectorField> q() const;
204 
205  //- Return the source term for the energy equation
206  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
207 
208  //- Return the specie flux for the given specie mass-fraction
209  virtual tmp<volVectorField> j(const volScalarField& Yi) const;
210 
211  //- Return the source term for the given specie mass-fraction equation
212  virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
213 
214  //- Correct the eddyDiffusivity viscosity
215  virtual void correct();
216 };
217 
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 } // End namespace turbulenceThermophysicalTransportModels
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #ifdef NoRepository
227  #include "eddyDiffusivity.C"
228 #endif
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
volScalarField & he
Definition: YEEqn.H:50
dimensionedScalar Prt_
Turbulent Prandtl number [].
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusivity for a given specie mass-fraction [kg/m/s].
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
virtual tmp< volScalarField > alphat() const
Turbulent thermal diffusivity for enthalpy [kg/m/s].
TypeName("eddyDiffusivity")
Runtime type information.
Eddy-diffusivity based gradient heat flux model for RAS or LES of turbulent flow. Specie fluxes are c...
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent diffusivity for temperature.
rhoReactionThermo & thermo
Definition: createFields.H:28
virtual tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
CompressibleMomentumTransportModel< fluidThermo > momentumTransportModel
A class for handling words, derived from string.
Definition: word.H:59
TurbulenceThermophysicalTransportModel::alphaField alphaField
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
TurbulenceThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual bool read()
Read thermophysicalTransport dictionary.
virtual void correct()
Correct the eddyDiffusivity viscosity.
volScalarField alphat_
Turbulent thermal diffusivity of enthalpy [kg/m/s].
virtual tmp< volVectorField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction.
label patchi
eddyDiffusivity(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from a momentum transport model and a thermo model.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volVectorField > q() const
Return the heat flux.
TurbulenceThermophysicalTransportModel::thermoModel thermoModel
Namespace for OpenFOAM.