fluidLagrangianThermo.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::fluidLagrangianThermo
26 
27 Description
28  Base-class for fluid Lagrangian thermodynamic models
29 
30 SourceFiles
31  fluidLagrangianThermo.C
32  fluidLagrangianThermoTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef fluidLagrangianThermo_H
37 #define fluidLagrangianThermo_H
38 
39 #include "FluidLagrangianThermo.H"
40 #include "pureLagrangianThermo.H"
42 #include "uniformGeometricFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class fluidLagrangianThermo Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  virtual public basicLagrangianThermo
56 {
57 public:
58 
59  // Public Classes
60 
61  //- Forward declare the implementation class
62  class implementation;
63 
64  //- Forward declare the composite class
65  class composite;
66 
67 
68  // Public Typedefs
69 
70  //- The derived type
71  template<class MixtureType>
72  using DerivedThermoType =
74  <
76  <
77  MixtureType,
78  composite
79  >
80  >;
81 
82  //- The derived name
83  static word derivedThermoName()
84  {
85  return "heRhoThermo";
86  }
87 
88 
89  //- Runtime type information
90  TypeName("fluidLagrangianThermo");
91 
92 
93  //- Declare run-time constructor selection table
95  (
96  autoPtr,
99  (const LagrangianMesh& mesh, const word& phaseName),
100  (mesh, phaseName)
101  );
102 
103 
104  // Selectors
105 
106  //- Select a fluid thermo
108  (
109  const LagrangianMesh& mesh,
110  const word& phaseName=word::null
111  );
112 
113 
114  //- Destructor
115  virtual ~fluidLagrangianThermo();
116 
117 
118  // Member Functions
119 
120  // Thermodynamic State
121 
122  //- Pressure [Pa]
123  virtual const LagrangianScalarDynamicField& p() const = 0;
124 
125  //- Modify the Pressure [Pa]
126  virtual LagrangianScalarDynamicField& p() = 0;
127 
128  //- Pressure for a sub-mesh [Pa]
130  (
131  const LagrangianSubMesh&
132  ) const = 0;
133 
134  //- Pressure for an injection [Pa]
136  (
137  const LagrangianInjection&,
138  const LagrangianSubMesh&
139  ) const = 0;
140 
141 
142  // Thermodynamic Properties
143 
144  //- Compressibility [s^2/m^2]
145  virtual const LagrangianScalarDynamicField& psi() const = 0;
146 
147  //- Compressibility for an injection [m^2/s^2]
149  (
151  const LagrangianInjection&
152  ) const = 0;
153 
154 
155  // Transport Properties
156 
157  //- Dynamic viscosity [kg/m/s]
158  virtual const LagrangianScalarDynamicField& mu() const = 0;
159 
160  //- Dynamic viscosity for an injection [W/m/K]
162  (
164  const LagrangianInjection&
165  ) const = 0;
166 };
167 
168 
169 /*---------------------------------------------------------------------------*\
170  Class fluidLagrangianThermo::implementation Declaration
171 \*---------------------------------------------------------------------------*/
172 
174 :
175  virtual public fluidLagrangianThermo
176 {
177 protected:
178 
179  // Protected Data
180 
181  //- Pressure [Pa]
183 
184  //- Pressure source condition [Pa]
186 
187  //- Compressibility [s^2/m^2]
189 
190  //- Dynamic Viscosity [kg/m/s]
192 
193 
194 public:
195 
196  // Constructors
197 
198  //- Construct from dictionary, mesh and phase name
200  (
201  const dictionary&,
202  const LagrangianMesh&,
203  const word&,
205  );
206 
207 
208  //- Destructor
209  virtual ~implementation();
210 
211 
212  // Member Functions
213 
214  //- Initialise state
215  virtual void initialise();
216 
217  //- Update the pressure
218  virtual void correctPressure(const LagrangianSubMesh&);
219 
220 
221  // Thermodynamic State
222 
223  //- Pressure [Pa]
224  virtual const LagrangianScalarDynamicField& p() const;
225 
226  //- Modify the Pressure [Pa]
227  virtual LagrangianScalarDynamicField& p();
228 
229  //- Pressure for a sub-mesh [Pa]
231  (
232  const LagrangianSubMesh&
233  ) const;
234 
235  //- Pressure for an injection [Pa]
237  (
238  const LagrangianInjection&,
239  const LagrangianSubMesh&
240  ) const;
241 
242 
243  // Thermodynamic Properties
244 
245  //- Compressibility [s^2/m^2]
246  virtual const LagrangianScalarDynamicField& psi() const;
247 
248 
249  // Transport Properties
250 
251  //- Dynamic viscosity [kg/m/s]
252  virtual const LagrangianScalarDynamicField& mu() const;
253 };
254 
255 
256 /*---------------------------------------------------------------------------*\
257  Class fluidLagrangianThermo::composite Declaration
258 \*---------------------------------------------------------------------------*/
259 
261 :
263  public pureLagrangianThermo,
265 {
266 public:
267 
268  // Constructors
269 
270  //- Construct from dictionary, mesh and phase name
271  composite
272  (
273  const dictionary& dict,
274  const LagrangianMesh& mesh,
275  const word& phaseName
276  )
277  :
280  {}
281 
282  //- Construct from dictionary, mesh and phase name
283  template<class MixtureType>
284  composite
285  (
286  const dictionary& dict,
287  const MixtureType& mixture,
288  const LagrangianMesh& mesh,
289  const word& phaseName
290  )
291  :
293  {}
294 };
295 
296 
297 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
298 
299 } // End namespace Foam
300 
301 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
302 
303 #endif
304 
305 // ************************************************************************* //
Lagrangian thermodynamic model implementation and storage of energy. Provides overloads of the functi...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Fluid Lagrangian thermodynamic model implementation.
Generic GeometricField class.
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
LagrangianScalarDynamicField T_
Temperature [K].
virtual const word & phaseName() const
Phase name.
virtual const LagrangianMesh & mesh() const
Return const access to the mesh.
Base-class for Lagrangian fluid and solid thermodynamic models.
virtual const LagrangianScalarDynamicField & T() const =0
Temperature [K].
virtual const LagrangianMesh & mesh() const =0
Access the mesh.
virtual const word & phaseName() const =0
Access the phase name.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
composite(const dictionary &dict, const LagrangianMesh &mesh, const word &phaseName)
Construct from dictionary, mesh and phase name.
virtual const LagrangianScalarDynamicField & psi() const
Compressibility [s^2/m^2].
virtual const LagrangianScalarDynamicField & mu() const
Dynamic viscosity [kg/m/s].
virtual void correctPressure(const LagrangianSubMesh &)
Update the pressure.
autoPtr< LagrangianScalarFieldSource > pSourcePtr_
Pressure source condition [Pa].
implementation(const dictionary &, const LagrangianMesh &, const word &, const LagrangianScalarDynamicField &T)
Construct from dictionary, mesh and phase name.
LagrangianScalarDynamicField p_
Pressure [Pa].
LagrangianScalarDynamicField mu_
Dynamic Viscosity [kg/m/s].
LagrangianScalarDynamicField psi_
Compressibility [s^2/m^2].
virtual const LagrangianScalarDynamicField & p() const
Pressure [Pa].
Base-class for fluid Lagrangian thermodynamic models.
static autoPtr< fluidLagrangianThermo > New(const LagrangianMesh &mesh, const word &phaseName=word::null)
Select a fluid thermo.
static word derivedThermoName()
The derived name.
virtual const LagrangianScalarDynamicField & p() const =0
Pressure [Pa].
TypeName("fluidLagrangianThermo")
Runtime type information.
virtual ~fluidLagrangianThermo()
Destructor.
virtual const LagrangianScalarDynamicField & psi() const =0
Compressibility [s^2/m^2].
declareRunTimeSelectionTable(autoPtr, fluidLagrangianThermo, LagrangianMesh,(const LagrangianMesh &mesh, const word &phaseName),(mesh, phaseName))
Declare run-time constructor selection table.
virtual const LagrangianScalarDynamicField & mu() const =0
Dynamic viscosity [kg/m/s].
Base-class for pure (i.e., single-component) Lagrangian thermodynamic models.
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.
dictionary dict
Typedefs for UniformDimensionedField.
Typedefs for UniformGeometricField.