thermal.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) 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::clouds::thermal
26 
27 Description
28  Base class for clouds with thermodynamic modelling
29 
30 SourceFiles
31  thermal.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef thermal_H
36 #define thermal_H
37 
38 #include "massive.H"
39 #include "carried.H"
40 #include "basicLagrangianThermo.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace clouds
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class thermal Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class thermal
54 :
55  private autoPtr<basicLagrangianThermo>,
56  public massive
57 {
58 private:
59 
60  // Private Data
61 
62  //- Reference to the cloud
63  const cloud& cloud_;
64 
65 
66  // Private Constructors
67 
68  //- Construct from a reference to the cloud and its base classes and a
69  // thermo model pointer
70  thermal(const cloud&, const shaped&, basicLagrangianThermo*);
71 
72 
73 public:
74 
75  //- Declare friendship with templated derivation
76  template<class Thermo>
77  friend class Thermal;
78 
79 
80  // Public Static Data
81 
82  //- Run-time type information
83  TypeName("thermal");
84 
85 
86  // Constructors
87 
88  //- Construct from a reference to the cloud and its base classes
89  thermal(const cloud&, const shaped&, const carried&);
90 
91 
92  // Public Data
93 
94  //- Temperature
96 
97  //- Internal energy
99 
100  //- Heat capacity at constant volume
102 
103  //- Thermal conductivity
105 
106 
107  //- Destructor
108  virtual ~thermal();
109 
110 
111  // Member Functions
112 
113  //- Determine whether the thermo model is one of the given types
114  template<class Thermo, class ... Thermos>
115  bool isThermo() const;
116 
117  //- Generate an error if the thermo model is not one of the given types
118  template<class Thermo, class ... Thermos>
119  void assertThermo() const;
120 
121  //- Generate an error if the thermo model is not one of the given
122  // types. A model is provided to give the error message some context.
123  template<class Thermo, class ... Thermos>
124  void assertThermo(const LagrangianModel& model) const;
125 
126  //- Get a reference to the thermodynamic model of a given type
127  template<class Thermo = basicLagrangianThermo, class ... Args>
128  const Thermo& thermo(const Args& ... args) const;
129 
130  //- Non-const override of the above
131  template<class Thermo = basicLagrangianThermo, class ... Args>
132  Thermo& thermo(const Args& ... args);
133 };
134 
135 /*---------------------------------------------------------------------------*\
136  Class Thermal Declaration
137 \*---------------------------------------------------------------------------*/
138 
139 template<class Thermo>
140 class Thermal
141 :
142  public thermal
143 {
144 public:
145 
146  // Constructors
147 
148  //- Construct from a reference to the cloud and its base classes
149  Thermal(const cloud&, const shaped&, const carried&);
150 };
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace clouds
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #ifdef NoRepository
160  #include "thermalTemplates.C"
161 #endif
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
Generic GeometricField class.
Base class for Lagrangian models.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base-class for Lagrangian fluid and solid thermodynamic models.
Base class for clouds. Provides a basic evolution algorithm, models, and a database for caching deriv...
Definition: cloud.H:61
Base class for clouds which are carried by a fluid.
Definition: carried.H:57
Base class for clouds with particles with mass.
Definition: massive.H:51
Base class for clouds with particles with mass.
Definition: shaped.H:51
Base class for clouds with thermodynamic modelling.
Definition: thermal.H:56
friend class Thermal
Declare friendship with templated derivation.
Definition: thermal.H:76
bool isThermo() const
Determine whether the thermo model is one of the given types.
const LagrangianScalarDynamicField & kappa
Thermal conductivity.
Definition: thermal.H:103
const Thermo & thermo(const Args &... args) const
Get a reference to the thermodynamic model of a given type.
void assertThermo() const
Generate an error if the thermo model is not one of the given types.
TypeName("thermal")
Run-time type information.
virtual ~thermal()
Destructor.
Definition: thermal.C:73
const LagrangianScalarDynamicField & Cv
Heat capacity at constant volume.
Definition: thermal.H:100
const LagrangianScalarDynamicField & T
Temperature.
Definition: thermal.H:94
CloudStateFieldRef< scalar > e
Internal energy.
Definition: thermal.H:97
Namespace for OpenFOAM.
Foam::argList args(argc, argv)