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 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 data
58 
59  //- laminar coefficients dictionary
61 
62  //- Flag to print the model coeffs at run-time
64 
65  //- Model coefficients dictionary
67 
68 
69  // Protected Member Functions
70 
71  //- Print model coefficients
72  virtual void printCoeffs(const word& type);
73 
74 
75 public:
76 
77  typedef typename BasicThermophysicalTransportModel::alphaField
78  alphaField;
79 
82 
83  typedef typename BasicThermophysicalTransportModel::thermoModel
85 
86 
87  //- Runtime type information
88  TypeName("laminar");
89 
90 
91  // Declare run-time constructor selection table
92 
94  (
95  autoPtr,
97  dictionary,
98  (
99  const momentumTransportModel& momentumTransport,
100  const thermoModel& thermo
101  ),
102  (momentumTransport, thermo)
103  );
104 
105 
106  // Constructors
107 
108  //- Construct from components
110  (
111  const word& type,
112  const momentumTransportModel& momentumTransport,
113  const thermoModel& thermo
114  );
115 
116  //- Disallow default bitwise copy construction
118  (
120  ) = delete;
121 
122 
123  // Selectors
124 
125  //- Return a reference to the selected laminar model
127  (
128  const momentumTransportModel& momentumTransport,
129  const thermoModel& thermo
130  );
131 
132 
133  //- Destructor
135  {}
136 
137 
138  // Member Functions
139 
140  //- Read model coefficients if they have changed
141  virtual bool read();
142 
143  //- Const access to the coefficients dictionary
144  virtual const dictionary& coeffDict() const
145  {
146  return coeffDict_;
147  }
148 
149  //- Effective thermal turbulent diffusivity for temperature
150  // of mixture [W/m/K]
151  virtual tmp<volScalarField> kappaEff() const
152  {
153  return volScalarField::New
154  (
155  "kappaEff",
156  this->thermo().kappa()
157  );
158  }
159 
160  //- Effective thermal turbulent diffusivity for temperature
161  // of mixture for patch [W/m/K]
162  virtual tmp<scalarField> kappaEff(const label patchi) const
163  {
164  return this->thermo().kappa(patchi);
165  }
166 
167  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
168  virtual tmp<volScalarField> alphaEff() const
169  {
170  return volScalarField::New
171  (
172  "alphaEff",
173  this->thermo().alphahe()
174  );
175  }
176 
177  //- Effective thermal turbulent diffusivity of mixture
178  // for patch [kg/m/s]
179  virtual tmp<scalarField> alphaEff(const label patchi) const
180  {
181  return this->thermo().alphahe(patchi);
182  }
183 
184  //- Effective mass diffusivity for a given specie mass-fraction [kg/m/s]
185  virtual tmp<volScalarField> DEff(const volScalarField& Yi) const
186  {
187  return volScalarField::New
188  (
189  "DEff",
190  alphaEff()
191  );
192  }
193 
194  //- Effective mass diffusivity for a given specie mass-fraction
195  // for patch [kg/m/s]
197  (
198  const volScalarField& Yi,
199  const label patchi
200  ) const
201  {
202  return alphaEff(patchi);
203  }
204 
205  //- Correct the laminar transport
206  virtual void correct();
207 
208 
209  // Member Operators
210 
211  //- Disallow default bitwise assignment
212  void operator=(const laminarThermophysicalTransportModel&) = delete;
213 };
214 
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 } // End namespace Foam
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 #ifdef NoRepository
224 #endif
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
Templated abstract base class for laminar thermophysical transport models.
Switch printCoeffs_
Flag to print the model coeffs at run-time.
void operator=(const laminarThermophysicalTransportModel &)=delete
Disallow default bitwise assignment.
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
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
const dimensionedScalar & kappa
Coulomb constant: default SI units: [N.m2/C2].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
virtual bool read()
Read model coefficients if they have changed.
virtual void correct()
Correct the laminar transport.
dictionary coeffDict_
Model coefficients dictionary.
static tmp< GeometricField< scalar, fvPatchField, volMesh > > New(const word &name, const Internal &, const PtrList< fvPatchField< scalar >> &)
Return a temporary field constructed from name,.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
laminarThermophysicalTransportModel(const word &type, const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Construct from components.
TypeName("laminar")
Runtime type information.
rhoReactionThermo & thermo
Definition: createFields.H:28
dictionary laminarDict_
laminar coefficients dictionary
CompressibleMomentumTransportModel< fluidThermo > momentumTransportModel
virtual void printCoeffs(const word &type)
Print model coefficients.
static autoPtr< laminarThermophysicalTransportModel > New(const momentumTransportModel &momentumTransport, const thermoModel &thermo)
Return a reference to the selected laminar model.
A class for handling words, derived from string.
Definition: word.H:59
declareRunTimeSelectionTable(autoPtr, laminarThermophysicalTransportModel, dictionary,(const momentumTransportModel &momentumTransport, const thermoModel &thermo),(momentumTransport, thermo))
BasicThermophysicalTransportModel::thermoModel thermoModel
label patchi
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
BasicThermophysicalTransportModel::alphaField alphaField
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
BasicThermophysicalTransportModel::momentumTransportModel momentumTransportModel
virtual tmp< volScalarField > alphaEff() const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > kappaEff() const
Effective thermal turbulent diffusivity for temperature.
Namespace for OpenFOAM.
virtual tmp< volScalarField > DEff(const volScalarField &Yi) const
Effective mass diffusivity for a given specie mass-fraction [kg/m/s].