laminarThermophysicalTransportModel.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::laminarThermophysicalTransportModel
26 
27 Description
28  Templated abstract base class for laminar thermophysical transport models
29 
30 SourceFiles
31  laminarThermophysicalTransportModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef laminarThermophysicalTransportModel_H
36 #define laminarThermophysicalTransportModel_H
37 
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class laminarThermophysicalTransportModel Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class BasicThermophysicalTransportModel>
51 :
52  public BasicThermophysicalTransportModel
53 {
54 
55 protected:
56 
57  // Protected member functions
58 
59  //- Const access to the coefficients dictionary
60  const dictionary& coeffDict() const;
61 
62  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
63  // Used for the implicit energy correction on the temperature laplacian
65  {
66  return volScalarField::New
67  (
68  "alphaEff",
69  this->thermo().kappa()/this->thermo().Cpv()
70  );
71  }
72 
73 
74 public:
75 
76  typedef typename BasicThermophysicalTransportModel::alphaField
77  alphaField;
78 
81 
82  typedef typename BasicThermophysicalTransportModel::thermoModel
84 
85 
86  //- Runtime type information
87  TypeName("laminar");
88 
89 
90  // Declare run-time constructor selection table
91 
93  (
94  autoPtr,
96  dictionary,
97  (
98  const momentumTransportModel& momentumTransport,
99  const thermoModel& thermo
100  ),
101  (momentumTransport, thermo)
102  );
103 
104 
105  // Constructors
106 
107  //- Construct from components
109  (
110  const word& type,
111  const momentumTransportModel& momentumTransport,
112  const thermoModel& thermo
113  );
114 
115  //- Disallow default bitwise copy construction
117  (
119  ) = delete;
120 
121 
122  // Selectors
123 
124  //- Return a reference to the selected laminar model
126  (
127  const momentumTransportModel& momentumTransport,
128  const thermoModel& thermo
129  );
130 
131 
132  //- Destructor
134  {}
135 
136 
137  // Member Functions
138 
139  //- Read model coefficients if they have changed
140  virtual bool read();
141 
142  //- Effective thermal turbulent conductivity
143  // of mixture [W/m/K]
144  virtual tmp<volScalarField> kappaEff() const
145  {
146  return volScalarField::New
147  (
148  "kappaEff",
149  this->thermo().kappa()
150  );
151  }
152 
153  //- Effective thermal turbulent conductivity
154  // of mixture for patch [W/m/K]
155  virtual tmp<scalarField> kappaEff(const label patchi) const
156  {
157  return this->thermo().kappa().boundaryField()[patchi];
158  }
159 
160  //- Effective thermal turbulent diffusivity
161  // of mixture for a patch [kg/m/s]
162  virtual tmp<scalarField> alphaEff(const label patchi) const
163  {
164  return
165  this->thermo().kappa().boundaryField()[patchi]
166  /this->thermo().Cpv().boundaryField()[patchi];
167  }
168 
169  //- Effective mass diffusion coefficient
170  // for a given specie mass-fraction [kg/m/s]
171  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const = 0;
172 
173  //- Effective mass diffusion coefficient
174  // for a given specie mass-fraction for patch [kg/m/s]
175  virtual tmp<scalarField> DEff
176  (
177  const volScalarField& Yi,
178  const label patchi
179  ) const = 0;
180 
181  //- Predict the laminar transport coefficients if possible
182  // without solving thermophysical transport model equations
183  virtual void predict();
184 
185  //- Solve the thermophysical transport model equations
186  // and correct the laminar transport coefficients
187  virtual void correct();
188 
189 
190  // Member Operators
191 
192  //- Disallow default bitwise assignment
193  void operator=(const laminarThermophysicalTransportModel&) = delete;
194 };
195 
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 } // End namespace Foam
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 #ifdef NoRepository
205 #endif
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 #endif
210 
211 // ************************************************************************* //
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,.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Templated abstract base class for laminar thermophysical transport models.
BasicThermophysicalTransportModel::alphaField alphaField
virtual void correct()
Solve the thermophysical transport model equations.
laminarThermophysicalTransportModel(const word &type, const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from components.
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const =0
Effective mass diffusion coefficient.
static autoPtr< laminarThermophysicalTransportModel > New(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Return a reference to the selected laminar model.
declareRunTimeSelectionTable(autoPtr, laminarThermophysicalTransportModel, dictionary,(const momentumTransportModel &momentumTransport, const thermoModel &thermo),(momentumTransport, thermo))
virtual void predict()
Predict the laminar transport coefficients if possible.
void operator=(const laminarThermophysicalTransportModel &)=delete
Disallow default bitwise assignment.
const dictionary & coeffDict() const
Const access to the coefficients dictionary.
TypeName("laminar")
Runtime type information.
tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
BasicThermophysicalTransportModel::thermoModel thermoModel
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent conductivity.
BasicThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual bool read()
Read model coefficients if they have changed.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
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
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
fluidMulticomponentThermo & thermo
Definition: createFields.H:31