basicLagrangianThermo.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::basicLagrangianThermo
26 
27 Description
28  Base-class for Lagrangian fluid and solid thermodynamic models.
29 
30  The design of Lagrangian thermodynamic models is the same as that for
31  finite-volume. See basicThermo for an explanation of how the interface
32  class, and the implementation and composite sub-classes fit together.
33 
34 See also
35  Foam::basicThermo
36 
37 SourceFiles
38  basicLagrangianThermo.C
39  basicLagrangianThermoTemplates.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef basicLagrangianThermo_H
44 #define basicLagrangianThermo_H
45 
46 #include "LagrangianFields.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class basicLagrangianThermo Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59 protected:
60 
61  // Protected Member Functions
62 
63  //- Internal energy field boundary types
64  wordList eBoundaryTypes() const;
65 
66  //- Internal energy field boundary base types
68 
69  //- Field sources types
70  template<class LagrangianFieldSourceType>
72  (
74  );
75 
76 
77 public:
78 
79  // Public Classes
80 
81  //- Forward declare the implementation class
82  class implementation;
83 
84 
85  //- Runtime type information
86  TypeName("basicLagrangianThermo");
87 
88 
89  //- Declare run-time constructor selection table
91  (
92  autoPtr,
95  (const LagrangianMesh& mesh, const word& phaseName),
96  (mesh, phaseName)
97  );
98 
99 
100  // Selectors
101 
102  //- Select thermo of a given derived type
103  template<class Thermo>
104  static autoPtr<Thermo> New
105  (
106  const LagrangianMesh& mesh,
107  const word& phaseName=word::null
108  );
109 
110  //- Select a basic thermo
112  (
113  const LagrangianMesh& mesh,
114  const word& phaseName=word::null
115  );
116 
117 
118  //- Destructor
119  virtual ~basicLagrangianThermo();
120 
121 
122  // Member Functions
123 
124  //- Access the properties dictionary
125  virtual const IOdictionary& properties() const = 0;
126 
127  //- Modify the properties dictionary
128  virtual IOdictionary& properties() = 0;
129 
130  //- Access the mesh
131  virtual const LagrangianMesh& mesh() const = 0;
132 
133  //- Access the phase name
134  virtual const word& phaseName() const = 0;
135 
136  //- Initialise state
137  virtual void initialise() = 0;
138 
139  //- Update the pressure
140  virtual void correctPressure(const LagrangianSubMesh&) = 0;
141 
142  //- Update state
143  virtual void correct(const LagrangianSubMesh&) = 0;
144 
145  //- Return the full name of the thermodynamic model
146  virtual word thermoName() const = 0;
147 
148 
149  // Molecular Properties
150 
151  //- Molecular weight for a sub-mesh [kg/kmol]
153  (
154  const LagrangianSubMesh&
155  ) const = 0;
156 
157 
158  // Thermodynamic State
159 
160  //- Temperature [K]
161  virtual const LagrangianScalarDynamicField& T() const = 0;
162 
163  //- Modify the Temperature [K]
164  virtual LagrangianScalarDynamicField& T() = 0;
165 
166 
167  // Thermodynamic Properties
168 
169  //- Density [kg/m^3]
170  virtual const LagrangianScalarDynamicField& rho() const = 0;
171 
172  //- Modify the Density [kg/m^3]
173  virtual LagrangianScalarDynamicField& rho() = 0;
174 
175  //- Density for an injection [kg/m^3]
177  (
179  const LagrangianInjection&
180  ) const = 0;
181 
182  //- Internal energy [J/kg]
183  virtual const LagrangianScalarDynamicField& e() const = 0;
184 
185  //- Modify the internal energy [J/kg]
186  virtual LagrangianScalarDynamicField& e() = 0;
187 
188  //- Internal energy for an injection [J/kg]
190  (
192  const LagrangianInjection&
193  ) const = 0;
194 
195  //- Heat capacity at constant volume [J/kg/K]
196  virtual const LagrangianScalarDynamicField& Cv() const = 0;
197 
198  //- Heat capacity at constant volume for an injection [J/kg/K]
200  (
202  const LagrangianInjection&
203  ) const = 0;
204 
205  //- Heat capacity at constant pressure for a sub-mesh [J/kg/K]
207  (
208  const LagrangianSubMesh& subMesh
209  ) const = 0;
210 
211  //- Coefficient of thermal expansion for a sub-mesh [1/K]
213  (
214  const LagrangianSubMesh& subMesh
215  ) const = 0;
216 
217 
218  // Transport Properties
219 
220  //- Thermal conductivity [W/m/K]
221  virtual const LagrangianScalarDynamicField& kappa() const = 0;
222 
223  //- Thermal conductivity for an injection [W/m/K]
225  (
227  const LagrangianInjection&
228  ) const = 0;
229 };
230 
231 
232 /*---------------------------------------------------------------------------*\
233  Class basicLagrangianThermo::implementation Declaration
234 \*---------------------------------------------------------------------------*/
235 
237 :
238  virtual public basicLagrangianThermo
239 {
240  // Private Data
241 
242  //- Reference to the mesh
243  const LagrangianMesh& mesh_;
244 
245  //- Reference to the phase name
246  const word& phaseName_;
247 
248 
249 protected:
250 
251  // Protected Data
252 
253  //- Temperature [K]
255 
256  //- Density [kg/m^3]
258 
259  //- Heat capacity at constant volume [J/kg/K]
261 
262  //- Thermal conductivity [W/m/K]
264 
265 
266 public:
267 
268  // Constructors
269 
270  //- Construct from dictionary, mesh and phase name
271  implementation(const dictionary&, const LagrangianMesh&, const word&);
272 
273  //- Disallow default bitwise copy construction
274  implementation(const implementation&) = delete;
275 
276 
277  //- Destructor
278  virtual ~implementation();
279 
280 
281  // Member Functions
282 
283  //- Return const access to the mesh
284  virtual const LagrangianMesh& mesh() const;
285 
286  //- Phase name
287  virtual const word& phaseName() const;
288 
289 
290  // Thermodynamic State
291 
292  //- Temperature [K]
293  virtual const LagrangianScalarDynamicField& T() const;
294 
295  //- Modify the Temperature [K]
296  virtual LagrangianScalarDynamicField& T();
297 
298 
299  // Thermodynamic Properties
300 
301  //- Density [kg/m^3]
302  virtual const LagrangianScalarDynamicField& rho() const;
303 
304  //- Modify the Density [kg/m^3]
306 
307  //- Heat capacity at constant volume [J/kg/K]
308  virtual const LagrangianScalarDynamicField& Cv() const;
309 
310 
311  // Transport Properties
312 
313  //- Thermal conductivity [W/m/K]
314  virtual const LagrangianScalarDynamicField& kappa() const;
315 
316 
317  //- Read properties dictionary
318  virtual void read(const dictionary&);
319 };
320 
321 
322 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
323 
324 } // End namespace Foam
325 
326 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
327 
328 #ifdef NoRepository
330 #endif
331 
332 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
333 
334 #endif
335 
336 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
An STL-conforming hash table.
Definition: HashTable.H:127
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:57
Base class for Lagrangian injections. Minimal wrapper over LagrangianSource. Implements some utility ...
Class containing Lagrangian geometry and topology.
Mesh that relates to a sub-section of a Lagrangian mesh. This is used to construct fields that relate...
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
virtual const LagrangianScalarDynamicField & rho() const
Density [kg/m^3].
LagrangianScalarDynamicField T_
Temperature [K].
virtual const LagrangianScalarDynamicField & kappa() const
Thermal conductivity [W/m/K].
virtual const word & phaseName() const
Phase name.
virtual const LagrangianScalarDynamicField & T() const
Temperature [K].
virtual const LagrangianScalarDynamicField & Cv() const
Heat capacity at constant volume [J/kg/K].
virtual void read(const dictionary &)
Read properties dictionary.
virtual const LagrangianMesh & mesh() const
Return const access to the mesh.
LagrangianScalarDynamicField rho_
Density [kg/m^3].
LagrangianScalarDynamicField Cv_
Heat capacity at constant volume [J/kg/K].
LagrangianScalarDynamicField kappa_
Thermal conductivity [W/m/K].
implementation(const dictionary &, const LagrangianMesh &, const word &)
Construct from dictionary, mesh and phase name.
Base-class for Lagrangian fluid and solid thermodynamic models.
virtual word thermoName() const =0
Return the full name of the thermodynamic model.
virtual const LagrangianScalarDynamicField & T() const =0
Temperature [K].
virtual tmp< LagrangianSubScalarField > Cp(const LagrangianSubMesh &subMesh) const =0
Heat capacity at constant pressure for a sub-mesh [J/kg/K].
virtual ~basicLagrangianThermo()
Destructor.
virtual const LagrangianScalarDynamicField & kappa() const =0
Thermal conductivity [W/m/K].
virtual tmp< LagrangianSubScalarField > W(const LagrangianSubMesh &) const =0
Molecular weight for a sub-mesh [kg/kmol].
virtual const IOdictionary & properties() const =0
Access the properties dictionary.
wordList eBoundaryBaseTypes() const
Internal energy field boundary base types.
virtual const LagrangianScalarDynamicField & e() const =0
Internal energy [J/kg].
virtual const LagrangianScalarDynamicField & rho() const =0
Density [kg/m^3].
virtual const LagrangianScalarDynamicField & Cv() const =0
Heat capacity at constant volume [J/kg/K].
virtual const LagrangianMesh & mesh() const =0
Access the mesh.
virtual void correctPressure(const LagrangianSubMesh &)=0
Update the pressure.
virtual void correct(const LagrangianSubMesh &)=0
Update state.
TypeName("basicLagrangianThermo")
Runtime type information.
virtual const word & phaseName() const =0
Access the phase name.
virtual tmp< LagrangianSubScalarField > alphav(const LagrangianSubMesh &subMesh) const =0
Coefficient of thermal expansion for a sub-mesh [1/K].
static autoPtr< Thermo > New(const LagrangianMesh &mesh, const word &phaseName=word::null)
Select thermo of a given derived type.
static HashTable< word > sourcesTypes(const LagrangianScalarDynamicField &T)
Field sources types.
virtual void initialise()=0
Initialise state.
wordList eBoundaryTypes() const
Internal energy field boundary types.
declareRunTimeSelectionTable(autoPtr, basicLagrangianThermo, LagrangianMesh,(const LagrangianMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
static const word null
An empty word.
Definition: word.H:78
Namespace for OpenFOAM.