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-2024 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
91  {
92  return volScalarField::New
93  (
94  "alphaEff",
95  this->thermo().kappa()/this->thermo().Cpv() + alphat()
96  );
97  }
98 
99 
100 public:
101 
102  typedef typename TurbulenceThermophysicalTransportModel::alphaField
103  alphaField;
104 
105  typedef typename
108 
109  typedef typename TurbulenceThermophysicalTransportModel::thermoModel
110  thermoModel;
111 
112 
113  //- Runtime type information
114  TypeName("eddyDiffusivity");
115 
116 
117  // Constructors
118 
119  //- Construct from a momentum transport model and a thermo model
121  (
122  const momentumTransportModel& momentumTransport,
123  const thermoModel& thermo
124  );
125 
126 
127  //- Destructor
128  virtual ~eddyDiffusivity()
129  {}
130 
131 
132  // Member Functions
133 
134  //- Read thermophysicalTransport dictionary
135  virtual bool read();
136 
137  //- Turbulent thermal diffusivity for enthalpy [kg/m/s]
138  virtual tmp<volScalarField> alphat() const
139  {
140  return alphat_;
141  }
142 
143  //- Turbulent thermal diffusivity for enthalpy for a patch [kg/m/s]
144  virtual tmp<scalarField> alphat(const label patchi) const
145  {
146  return alphat()().boundaryField()[patchi];
147  }
148 
149  //- Effective thermal turbulent conductivity
150  // of mixture [W/m/K]
151  virtual tmp<volScalarField> kappaEff() const
152  {
153  return this->thermo().kappa() + this->thermo().Cp()*alphat();
154  }
155 
156  //- Effective thermal turbulent conductivity
157  // of mixture for patch [W/m/K]
158  virtual tmp<scalarField> kappaEff(const label patchi) const
159  {
160  return
161  this->thermo().kappa().boundaryField()[patchi]
162  + this->thermo().Cp().boundaryField()[patchi]*alphat(patchi);
163  }
164 
165  //- Effective thermal turbulent diffusivity
166  // of mixture for a patch [kg/m/s]
167  virtual tmp<scalarField> alphaEff(const label patchi) const
168  {
169  return
170  this->thermo().kappa().boundaryField()[patchi]
171  /this->thermo().Cpv().boundaryField()[patchi]
172  + alphat(patchi);
173  }
174 
175  //- Effective mass diffusion coefficient
176  // for a given specie mass-fraction [kg/m/s]
177  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const;
178 
179  //- Effective mass diffusion coefficient
180  // for a given specie mass-fraction for patch [kg/m/s]
181  virtual tmp<scalarField> DEff
182  (
183  const volScalarField& Yi,
184  const label patchi
185  ) const;
186 
187  //- Return the heat flux [W/m^2]
188  virtual tmp<surfaceScalarField> q() const;
189 
190  //- Return the patch heat flux [W/m^2]
191  virtual tmp<scalarField> q(const label patchi) const;
192 
193  //- Return the source term for the energy equation
194  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
195 
196  //- Return the specie flux for the given specie mass-fraction [kg/m^2/s]
197  virtual tmp<surfaceScalarField> j(const volScalarField& Yi) const;
198 
199  //- Return the specie flux
200  // for the given specie mass-fraction for patch [kg/m^2/s]
201  virtual tmp<scalarField> j
202  (
203  const volScalarField& Yi,
204  const label patchi
205  ) const;
206 
207  //- Return the source term for the given specie mass-fraction equation
208  virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
209 
210  //- Correct the eddyDiffusivity viscosity
211  virtual void predict();
212 };
213 
214 
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
216 
217 } // End namespace turbulenceThermophysicalTransportModels
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #ifdef NoRepository
223  #include "eddyDiffusivity.C"
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, GeoMesh, PrimitiveField > > New(const word &name, const Internal &, const PtrList< Patch > &, const HashPtrTable< Source > &=HashPtrTable< Source >())
Return a temporary field constructed from name,.
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
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
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
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