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-2022 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 temperature gradient heat flux model
29  for single specie RAS or LES of turbulent flow.
30 
31  The heat flux source is implemented as an implicit energy correction to the
32  temperature gradient based flux source. At convergence the energy
33  correction is 0.
34 
35 Usage
36  \verbatim
37  LES
38  {
39  model eddyDiffusivity;
40  Prt 0.85;
41  }
42  \endverbatim
43 
44 SourceFiles
45  eddyDiffusivity.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef eddyDiffusivity_H
50 #define eddyDiffusivity_H
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 namespace turbulenceThermophysicalTransportModels
57 {
58 
59 /*---------------------------------------------------------------------------*\
60  Class eddyDiffusivity Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class TurbulenceThermophysicalTransportModel>
64 class eddyDiffusivity
65 :
66  public TurbulenceThermophysicalTransportModel
67 {
68 
69 protected:
70 
71  // Protected data
72 
73  // Model coefficients
74 
75  //- Turbulent Prandtl number []
77 
78  // Fields
79 
80  //- Turbulent thermal diffusivity of enthalpy [kg/m/s]
82 
83 
84  // Protected Member Functions
85 
86  virtual void correctAlphat();
87 
88  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
89  // Used for the implicit energy correction on the temperature laplacian
90  virtual tmp<volScalarField> alphaEff() const
91  {
92  return this->thermo().kappa()/this->thermo().Cpv() + alphat();
93  }
94 
95 
96 public:
97 
98  typedef typename TurbulenceThermophysicalTransportModel::alphaField
99  alphaField;
100 
101  typedef typename
104 
105  typedef typename TurbulenceThermophysicalTransportModel::thermoModel
106  thermoModel;
107 
108 
109  //- Runtime type information
110  TypeName("eddyDiffusivity");
111 
112 
113  // Constructors
114 
115  //- Construct from a momentum transport model and a thermo model
117  (
118  const momentumTransportModel& momentumTransport,
119  const thermoModel& thermo
120  );
121 
122 
123  //- Destructor
124  virtual ~eddyDiffusivity()
125  {}
126 
127 
128  // Member Functions
129 
130  //- Read thermophysicalTransport dictionary
131  virtual bool read();
132 
133  //- Turbulent thermal diffusivity for enthalpy [kg/m/s]
134  virtual tmp<volScalarField> alphat() const
135  {
136  return alphat_;
137  }
138 
139  //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
140  virtual tmp<scalarField> alphat(const label patchi) const
141  {
142  return alphat()().boundaryField()[patchi];
143  }
144 
145  //- Effective thermal turbulent conductivity
146  // of mixture [W/m/K]
147  virtual tmp<volScalarField> kappaEff() const
148  {
149  return this->thermo().kappa() + this->thermo().Cp()*alphat();
150  }
151 
152  //- Effective thermal turbulent conductivity
153  // of mixture for patch [W/m/K]
154  virtual tmp<scalarField> kappaEff(const label patchi) const
155  {
156  return
157  this->thermo().kappa().boundaryField()[patchi]
158  + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
159  }
160 
161  //- Effective mass diffusion coefficient
162  // for a given specie mass-fraction [kg/m/s]
163  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const;
164 
165  //- Effective mass diffusion coefficient
166  // for a given specie mass-fraction for patch [kg/m/s]
167  virtual tmp<scalarField> DEff
168  (
169  const volScalarField& Yi,
170  const label patchi
171  ) const;
172 
173  //- Return the heat flux [W/m^2]
174  virtual tmp<surfaceScalarField> q() const;
175 
176  //- Return the source term for the energy equation
177  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
178 
179  //- Return the specie flux for the given specie mass-fraction [kg/m^2/s]
180  virtual tmp<surfaceScalarField> j(const volScalarField& Yi) const;
181 
182  //- Return the source term for the given specie mass-fraction equation
183  virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
184 
185  //- Correct the eddyDiffusivity viscosity
186  virtual void predict();
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace turbulenceThermophysicalTransportModels
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
197 #ifdef NoRepository
198  #include "eddyDiffusivity.C"
199 #endif
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #endif
204 
205 // ************************************************************************* //
Generic GeometricField class.
A class for managing temporary objects.
Definition: tmp.H:55
Eddy-diffusivity based temperature gradient heat flux model for single specie RAS or LES of turbulent...
dimensionedScalar Prt_
Turbulent Prandtl number [].
TypeName("eddyDiffusivity")
Runtime type information.
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusion coefficient.
volScalarField alphat_
Turbulent thermal diffusivity of enthalpy [kg/m/s].
TurbulenceThermophysicalTransportModel::thermoModel thermoModel
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
eddyDiffusivity(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from a momentum transport model and a thermo model.
virtual tmp< volScalarField > alphat() const
Turbulent thermal diffusivity for enthalpy [kg/m/s].
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
virtual void predict()
Correct the eddyDiffusivity viscosity.
virtual tmp< surfaceScalarField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction [kg/m^2/s].
TurbulenceThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
TurbulenceThermophysicalTransportModel::alphaField alphaField
virtual tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent conductivity.
virtual bool read()
Read thermophysicalTransport dictionary.
label patchi
compressibleMomentumTransportModel momentumTransportModel
Namespace for OpenFOAM.
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
thermo he()
fluidMulticomponentThermo & thermo
Definition: createFields.H:31