solidThermophysicalTransportModel.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) 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 Class
25  Foam::solidThermophysicalTransportModel
26 
27 Description
28  Abstract base class for solid thermophysical transport models
29 
30 SourceFiles
31  solidThermophysicalTransportModel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef solidThermophysicalTransportModel_H
36 #define solidThermophysicalTransportModel_H
37 
39 #include "solidThermo.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class solidThermophysicalTransportModel Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
53 {
54 protected:
55 
56  // Protected data
57 
58  //- Reference to the solid thermophysical properties
59  const solidThermo& thermo_;
60 
61  //- Flag to print the model coeffs at run-time
63 
64  //- Model coefficients dictionary
66 
67 
68  // Protected Member Functions
69 
70  //- Print model coefficients
71  virtual void printCoeffs(const word& type);
72 
73 
74 public:
75 
76  // Declare run-time constructor selection table
77 
79  (
80  autoPtr,
82  dictionary,
83  (
84  const solidThermo& thermo
85  ),
86  (thermo)
87  );
88 
89 
90  // Constructors
91 
92  //- Construct from solid thermophysical properties
94  (
95  const word& type,
96  const solidThermo& thermo
97  );
98 
99 
100  // Selectors
101 
102  //- Return a reference to the selected thermophysical transport model
104  (
105  const solidThermo& thermo
106  );
107 
108 
109  //- Destructor
111  {}
112 
113 
114  // Member Functions
115 
116  //- Read model coefficients if they have changed
117  virtual bool read() = 0;
118 
119  //- Access function to solid thermophysical properties
120  virtual const solidThermo& thermo() const
121  {
122  return thermo_;
123  }
124 
125  //- Const access to the coefficients dictionary
126  virtual const dictionary& coeffDict() const
127  {
128  return coeffDict_;
129  }
130 
131  //- Thermal conductivity [W/m/K]
132  virtual tmp<volScalarField> kappa() const;
133 
134  //- Thermal conductivity for patch [W/m/K]
135  virtual tmp<scalarField> kappa(const label patchi) const;
136 
137  //- Effective thermal conductivity
138  // of mixture [W/m/K]
139  virtual tmp<volScalarField> kappaEff() const
140  {
141  return kappa();
142  }
143 
144  //- Effective thermal conductivity
145  // of mixture for patch [W/m/K]
146  virtual tmp<scalarField> kappaEff(const label patchi) const
147  {
148  return kappa(patchi);
149  }
150 
151  //- Return the heat flux [W/m^2]
152  virtual tmp<surfaceScalarField> q() const = 0;
153 
154  //- Return the patch heat flux correction [W/m^2]
155  // For isotropic or patch-aligned thermal conductivity qCorr is null
156  virtual tmp<scalarField> qCorr(const label patchi) const = 0;
157 
158  //- Return the source term for the energy equation
159  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const = 0;
160 
161  //- Predict the thermophysical transport coefficients if possible
162  // without solving thermophysical transport model equations
163  virtual void predict() = 0;
164 
165  //- Solve the thermophysical transport model equations
166  // and correct the thermophysical transport coefficients
167  virtual void correct();
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 #endif
178 
179 // ************************************************************************* //
Generic GeometricField class.
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:56
Abstract base class for solid thermophysical transport models.
dictionary coeffDict_
Model coefficients dictionary.
virtual void printCoeffs(const word &type)
Print model coefficients.
virtual tmp< scalarField > qCorr(const label patchi) const =0
Return the patch heat flux correction [W/m^2].
virtual const dictionary & coeffDict() const
Const access to the coefficients dictionary.
virtual void correct()
Solve the thermophysical transport model equations.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const =0
Return the source term for the energy equation.
virtual bool read()=0
Read model coefficients if they have changed.
static autoPtr< solidThermophysicalTransportModel > New(const solidThermo &thermo)
Return a reference to the selected thermophysical transport model.
declareRunTimeSelectionTable(autoPtr, solidThermophysicalTransportModel, dictionary,(const solidThermo &thermo),(thermo))
const solidThermo & thermo_
Reference to the solid thermophysical properties.
virtual void predict()=0
Predict the thermophysical transport coefficients if possible.
virtual tmp< volScalarField > kappa() const
Thermal conductivity [W/m/K].
virtual tmp< surfaceScalarField > q() const =0
Return the heat flux [W/m^2].
virtual tmp< volScalarField > kappaEff() const
Effective thermal conductivity.
solidThermophysicalTransportModel(const word &type, const solidThermo &thermo)
Construct from solid thermophysical properties.
Switch printCoeffs_
Flag to print the model coeffs at run-time.
virtual const solidThermo & thermo() const
Access function to solid thermophysical properties.
Abstract base class for all fluid and solid thermophysical transport models.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
label patchi
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
thermo he()