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-2021 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 
89 public:
90 
91  typedef typename TurbulenceThermophysicalTransportModel::alphaField
92  alphaField;
93 
94  typedef typename
97 
98  typedef typename TurbulenceThermophysicalTransportModel::thermoModel
100 
101 
102  //- Runtime type information
103  TypeName("eddyDiffusivity");
104 
105 
106  // Constructors
107 
108  //- Construct from a momentum transport model and a thermo model
110  (
111  const momentumTransportModel& momentumTransport,
112  const thermoModel& thermo
113  );
114 
115 
116  //- Destructor
117  virtual ~eddyDiffusivity()
118  {}
119 
120 
121  // Member Functions
122 
123  //- Read thermophysicalTransport dictionary
124  virtual bool read();
125 
126  //- Turbulent thermal diffusivity for enthalpy [kg/m/s]
127  virtual tmp<volScalarField> alphat() const
128  {
129  return alphat_;
130  }
131 
132  //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
133  virtual tmp<scalarField> alphat(const label patchi) const
134  {
135  return alphat()().boundaryField()[patchi];
136  }
137 
138  //- Effective thermal turbulent diffusivity for temperature
139  // of mixture [W/m/K]
140  virtual tmp<volScalarField> kappaEff() const
141  {
142  return this->thermo().kappaEff(alphat());
143  }
144 
145  //- Effective thermal turbulent diffusivity for temperature
146  // of mixture for patch [W/m/K]
147  virtual tmp<scalarField> kappaEff(const label patchi) const
148  {
149  return this->thermo().kappaEff
150  (
151  alphat(patchi),
152  patchi
153  );
154  }
155 
156  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
157  virtual tmp<volScalarField> alphaEff() const
158  {
159  return this->thermo().alphaEff(alphat());
160  }
161 
162  //- Effective thermal turbulent diffusivity of mixture
163  // for patch [kg/m/s]
164  virtual tmp<scalarField> alphaEff(const label patchi) const
165  {
166  return this->thermo().alphaEff
167  (
168  alphat(patchi),
169  patchi
170  );
171  }
172 
173  //- Effective mass diffusion coefficient
174  // for a given specie mass-fraction [kg/m/s]
175  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const;
176 
177  //- Effective mass diffusion coefficient
178  // for a given specie mass-fraction for patch [kg/m/s]
179  virtual tmp<scalarField> DEff
180  (
181  const volScalarField& Yi,
182  const label patchi
183  ) const;
184 
185  //- Return the heat flux [W/m^2]
186  virtual tmp<surfaceScalarField> q() const;
187 
188  //- Return the source term for the energy equation
189  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
190 
191  //- Return the specie flux for the given specie mass-fraction [kg/m^2/s]
192  virtual tmp<surfaceScalarField> j(const volScalarField& Yi) const;
193 
194  //- Return the source term for the given specie mass-fraction equation
195  virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
196 
197  //- Correct the eddyDiffusivity viscosity
198  virtual void correct();
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace turbulenceThermophysicalTransportModels
205 } // End namespace Foam
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #ifdef NoRepository
210  #include "eddyDiffusivity.C"
211 #endif
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #endif
216 
217 // ************************************************************************* //
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
fluidReactionThermo & thermo
Definition: createFields.H:28
virtual tmp< volScalarField > alphat() const
Turbulent thermal diffusivity for enthalpy [kg/m/s].
TypeName("eddyDiffusivity")
Runtime type information.
Eddy-diffusivity based temperature gradient heat flux model for single specie RAS or LES of turbulent...
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent diffusivity for temperature.
virtual tmp< surfaceScalarField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction [kg/m^2/s].
virtual tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
CompressibleMomentumTransportModel< dynamicTransportModel > momentumTransportModel
TurbulenceThermophysicalTransportModel::alphaField alphaField
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
TurbulenceThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual bool read()
Read thermophysicalTransport dictionary.
virtual void correct()
Correct the eddyDiffusivity viscosity.
thermo he()
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusion coefficient.
volScalarField alphat_
Turbulent thermal diffusivity of enthalpy [kg/m/s].
label patchi
eddyDiffusivity(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from a momentum transport model and a thermo model.
A class for managing temporary objects.
Definition: PtrList.H:53
TurbulenceThermophysicalTransportModel::thermoModel thermoModel
Namespace for OpenFOAM.