pressureWork.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::Lagrangian::pressureWork
26 
27 Description
28  Model for pressure work. Subtracts the pressure-volume work associated with
29  particle expansion from the particle energy, and adds it to the carrier
30  energy. This model is needed to make (e.g.,) bubbles reduce in temperature
31  as they expand.
32 
33 Usage
34  Example specification:
35  \verbatim
36  <LagrangianModelName>
37  {
38  type pressureWork;
39  }
40  \endverbatim
41 
42 SourceFiles
43  pressureWork.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef pressureWork_H
48 #define pressureWork_H
49 
50 #include "cloudLagrangianModel.H"
51 #include "thermal.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace Foam
56 {
57 namespace Lagrangian
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class pressureWork Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class pressureWork
65 :
66  public LagrangianModel,
67  private cloudLagrangianModel
68 {
69 private:
70 
71  // Private Data
72 
73  //- Thermal cloud reference
74  const clouds::thermal& thermalCloud_;
75 
76  //- Pressure at the previous iteration
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("pressureWork");
84 
85 
86  // Constructors
87 
88  //- Construct from components
90  (
91  const word& name,
92  const LagrangianMesh& mesh,
93  const dictionary& modelDict,
94  const dictionary& stateDict
95  );
96 
97 
98  // Member Functions
99 
100  //- Return the name of the energy field
101  virtual wordList addSupFields() const;
102 
103  //- Return true for the energy or carrier energy field
104  virtual bool addsSupToField
105  (
106  const word& fieldName,
107  const word& eqnFieldName
108  ) const;
109 
110  //- Hook before source evaluation
111  virtual void preAddSup
112  (
113  const LagrangianSubScalarField& deltaT,
114  const bool final
115  );
116 
117  //- Add a source term to the energy equation
118  virtual void addSup
119  (
120  const LagrangianSubScalarField& deltaT,
121  const LagrangianSubScalarSubField& vOrM,
124  ) const;
125 
126  //- Hook after source evaluation
127  virtual void postAddSup
128  (
129  const LagrangianSubScalarField& deltaT,
130  const bool final
131  );
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Lagrangian
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
This class stores the coefficients of a Lagrangian equation, and facilitates solving that equation an...
Definition: LagrangianEqn.H:56
Class containing Lagrangian geometry and topology.
Base class for Lagrangian models.
const LagrangianMesh & mesh() const
The mesh.
static word fieldName(const AlphaRhoFieldType &alphaRhoField, const AlphaRhoFieldTypes &... alphaRhoFields)
Return the name of the field associated with a source term.
const word & name() const
The source name.
Model for pressure work. Subtracts the pressure-volume work associated with particle expansion from t...
Definition: pressureWork.H:67
virtual wordList addSupFields() const
Return the name of the energy field.
Definition: pressureWork.C:61
virtual bool addsSupToField(const word &fieldName, const word &eqnFieldName) const
Return true for the energy or carrier energy field.
Definition: pressureWork.C:68
TypeName("pressureWork")
Runtime type information.
virtual void addSup(const LagrangianSubScalarField &deltaT, const LagrangianSubScalarSubField &vOrM, const LagrangianSubScalarSubField &e, LagrangianEqn< scalar > &eqn) const
Add a source term to the energy equation.
Definition: pressureWork.C:99
virtual void preAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Hook before source evaluation.
Definition: pressureWork.C:83
virtual void postAddSup(const LagrangianSubScalarField &deltaT, const bool final)
Hook after source evaluation.
Definition: pressureWork.C:158
pressureWork(const word &name, const LagrangianMesh &mesh, const dictionary &modelDict, const dictionary &stateDict)
Construct from components.
Definition: pressureWork.C:45
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Mix-in for Lagrangian models that refer to a cloud.
Base class for clouds with thermodynamic modelling.
Definition: thermal.H:56
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
static dictionary stateDict(const word &name, const objectRegistry &db)
Construct and return the state dictionary for reading.
Definition: stateModel.C:137
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
const doubleScalar e
Definition: doubleScalar.H:106