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-2026 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 public:
55 
57 
58 
59 protected:
60 
61  // Protected data
62 
64 
65  //- Reference to the solid thermophysical properties
66  const solidThermo& thermo_;
67 
68 
69  // Protected Member Functions
70 
71  //- Const access to the coefficients dictionary
72  const dictionary& typeDict() const;
73 
74  //- Const access to the coefficients dictionary
75  const dictionary& typeDict(const word&) const;
76 
77 
78 public:
79 
80  // Declare run-time constructor selection table
81 
83  (
84  autoPtr,
86  dictionary,
87  (
88  const alphaField& alpha,
89  const solidThermo& thermo
90  ),
91  (alpha, thermo)
92  );
93 
94 
95  // Constructors
96 
97  //- Construct from solid thermophysical properties
99  (
100  const word& type,
101  const alphaField& alpha,
102  const solidThermo& thermo
103  );
104 
105 
106  // Selectors
107 
108  //- Return a reference to the selected thermophysical transport model
110  (
111  const solidThermo& thermo
112  );
113 
114 
115  //- Destructor
117  {}
118 
119 
120  // Member Functions
121 
122  //- Read model coefficients if they have changed
123  virtual bool read() = 0;
124 
125  //- Return the phase fraction field
126  const alphaField& alpha() const
127  {
128  return alpha_;
129  }
130 
131  //- Access function to solid thermophysical properties
132  virtual const solidThermo& thermo() const
133  {
134  return thermo_;
135  }
136 
137  //- Thermal conductivity [W/m/K]
138  virtual tmp<volScalarField> kappa() const;
139 
140  //- Thermal conductivity for patch [W/m/K]
141  virtual tmp<scalarField> kappa(const label patchi) const;
142 
143  //- Effective thermal conductivity
144  // of mixture [W/m/K]
145  virtual tmp<volScalarField> kappaEff() const
146  {
147  return kappa();
148  }
149 
150  //- Effective thermal conductivity
151  // of mixture for patch [W/m/K]
152  virtual tmp<scalarField> kappaEff(const label patchi) const
153  {
154  return kappa(patchi);
155  }
156 
157  //- Return the heat flux [W/m^2]
158  virtual tmp<surfaceScalarField> q() const = 0;
159 
160  //- Return the patch heat flux correction [W/m^2]
161  // For isotropic or patch-aligned thermal conductivity qCorr is null
162  virtual tmp<scalarField> qCorr(const label patchi) const = 0;
163 
164  //- Return the source term for the energy equation
165  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const = 0;
166 
167  //- Predict the thermophysical transport coefficients if possible
168  // without solving thermophysical transport model equations
169  virtual void predict() = 0;
170 
171  //- Solve the thermophysical transport model equations
172  // and correct the thermophysical transport coefficients
173  virtual void correct();
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
Generic GeometricField class.
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
A class representing the concept of a GeometricField of 1 used to avoid unnecessary manipulations for...
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:59
Abstract base class for solid thermophysical transport models.
virtual tmp< scalarField > qCorr(const label patchi) const =0
Return the patch heat flux correction [W/m^2].
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.
const dictionary & typeDict() const
Const access to the coefficients dictionary.
const solidThermo & thermo_
Reference to the solid thermophysical properties.
const alphaField & alpha() const
Return the phase fraction field.
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].
declareRunTimeSelectionTable(autoPtr, solidThermophysicalTransportModel, dictionary,(const alphaField &alpha, const solidThermo &thermo),(alpha, thermo))
solidThermophysicalTransportModel(const word &type, const alphaField &alpha, const solidThermo &thermo)
Construct from solid thermophysical properties.
virtual tmp< volScalarField > kappaEff() const
Effective thermal conductivity.
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:63
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