unityLewisFourier.C
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 \*---------------------------------------------------------------------------*/
25 
26 #include "unityLewisFourier.H"
27 #include "fvmLaplacian.H"
28 #include "fvcSnGrad.H"
29 #include "surfaceInterpolate.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35 namespace laminarThermophysicalTransportModels
36 {
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
40 template<class BasicThermophysicalTransportModel>
42 (
43  const momentumTransportModel& momentumTransport,
44  const thermoModel& thermo
45 )
46 :
48  (
49  typeName,
50  momentumTransport,
51  thermo
52  )
53 {}
54 
55 
56 template<class BasicThermophysicalTransportModel>
58 (
59  const word& type,
60  const momentumTransportModel& momentumTransport,
61  const thermoModel& thermo
62 )
63 :
64  laminarThermophysicalTransportModel<BasicThermophysicalTransportModel>
65  (
66  type,
67  momentumTransport,
68  thermo
69  )
70 {}
71 
72 
73 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
74 
75 template<class BasicThermophysicalTransportModel>
76 const dictionary&
78 {
79  return dictionary::null;
80 }
81 
82 
83 template<class BasicThermophysicalTransportModel>
85 {
86  return true;
87 }
88 
89 
90 template<class BasicThermophysicalTransportModel>
93 {
95  (
97  (
98  "q",
99  this->momentumTransport().alphaRhoPhi().group()
100  ),
102  (
103  this->alpha()*this->thermo().kappa()/this->thermo().Cpv()
104  )
105  *fvc::snGrad(this->thermo().he())
106  );
107 }
108 
109 
110 template<class BasicThermophysicalTransportModel>
113 divq(volScalarField& he) const
114 {
115  volScalarField alphahe
116  (
118  (
119  "alphahe",
120  this->thermo().kappa()/this->thermo().Cpv()
121  )
122  );
123 
124  return -fvm::laplacian(this->alpha()*alphahe, he);
125 }
126 
127 
128 template<class BasicThermophysicalTransportModel>
130 (
131  const volScalarField& Yi
132 ) const
133 {
135  (
137  (
138  "j(" + Yi.name() + ')',
139  this->momentumTransport().alphaRhoPhi().group()
140  ),
141  -fvc::interpolate(this->alpha()*this->DEff(Yi))
142  *fvc::snGrad(Yi)
143  );
144 }
145 
146 
147 template<class BasicThermophysicalTransportModel>
150 divj(volScalarField& Yi) const
151 {
152  return -fvm::laplacian(this->alpha()*this->DEff(Yi), Yi);
153 }
154 
155 
156 template<class BasicThermophysicalTransportModel>
158 {
160  <
161  BasicThermophysicalTransportModel
162  >::predict();
163 }
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace laminarThermophysicalTransportModels
169 } // End namespace Foam
170 
171 // ************************************************************************* //
Generic GeometricField class.
static tmp< GeometricField< Type, PatchField, GeoMesh > > New(const word &name, const Internal &, const PtrList< PatchField< Type >> &)
Return a temporary field constructed from name,.
const word & name() const
Return name.
Definition: IOobject.H:310
static word groupName(Name name, const word &group)
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
static const dictionary null
Null dictionary.
Definition: dictionary.H:242
Templated abstract base class for laminar thermophysical transport models.
BasicThermophysicalTransportModel::thermoModel thermoModel
BasicThermophysicalTransportModel::momentumTransportModel momentumTransportModel
unityLewisFourier's energy gradient heat flux model for laminar flow. Specie fluxes are computed assu...
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
virtual tmp< fvScalarMatrix > divj(volScalarField &Yi) const
Return the source term for the given specie mass-fraction equation.
virtual void predict()
Correct the unityLewisFourier viscosity.
unityLewisFourier(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from a momentum transport model and a thermo model.
virtual tmp< surfaceScalarField > j(const volScalarField &Yi) const
Return the specie flux for the given specie mass-fraction [kg/m^2/s].
virtual tmp< surfaceScalarField > q() const
Return the heat flux [W/m^2].
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
virtual bool read()
Read thermophysicalTransport dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Calculate the snGrad of the given volField.
Calculate the matrix for the laplacian of the field.
volScalarField alpha(IOobject("alpha", runTime.name(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), lambda *max(Ua &U, zeroSensitivity))
const char *const group
Group name for atomic constants.
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
static tmp< SurfaceField< Type > > interpolate(const VolField< Type > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
tmp< SurfaceField< Type > > snGrad(const VolField< Type > &vf, const word &name)
Definition: fvcSnGrad.C:45
tmp< fvMatrix< Type > > laplacian(const VolField< Type > &vf, const word &name)
Definition: fvmLaplacian.C:47
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
thermo he()
fluidMulticomponentThermo & thermo
Definition: createFields.H:31