psiuReactionThermo.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) 2011-2020 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::psiuReactionThermo
26 
27 Description
28  Base-class for combustion fluid thermodynamic properties based on
29  compressibility.
30 
31 See also
32  Foam::basicThermo
33 
34 SourceFiles
35  psiuReactionThermo.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef psiuReactionThermo_H
40 #define psiuReactionThermo_H
41 
42 #include "psiThermo.H"
43 #include "basicCombustionMixture.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class psiuReactionThermo Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  virtual public psiThermo
57 {
58 protected:
59 
60  // Protected Member Functions
61 
62  //- Return the unburnt enthalpy/internal energy field boundary types
63  // by interrogating the temperature field boundary types
65 
66  //- ...
68 
69 
70 public:
71 
72  // Public Classes
73 
74  //- Forward declare the implementation class
75  class implementation;
76 
77  //- Forward declare the composite class
78  class composite;
79 
80 
81  //- Runtime type information
82  TypeName("psiuReactionThermo");
83 
84 
85  // Declare run-time constructor selection tables
86 
88  (
89  autoPtr,
91  fvMesh,
92  (const fvMesh& mesh, const word& phaseName),
93  (mesh, phaseName)
94  );
95 
96 
97  // Selectors
98 
99  //- Standard selection based on fvMesh
101  (
102  const fvMesh&,
103  const word& phaseName=word::null
104  );
105 
106 
107  //- Destructor
108  virtual ~psiuReactionThermo();
109 
110 
111  // Member Functions
112 
113  //- Update properties
114  virtual void correct() = 0;
115 
116  //- Return the composition of the combustion mixture
117  virtual basicCombustionMixture& composition() = 0;
118 
119  //- Return the composition of the combustion mixture
120  virtual const basicCombustionMixture& composition() const = 0;
121 
122 
123  // Access to thermodynamic state variables.
124 
125  //- Unburnt gas enthalpy [J/kg]
126  // Non-const access allowed for transport equations
127  virtual volScalarField& heu() = 0;
128 
129  //- Unburnt gas enthalpy [J/kg]
130  virtual const volScalarField& heu() const = 0;
131 
132 
133  // Fields derived from thermodynamic state variables
134 
135  //- Unburnt gas enthalpy for cell-set [J/kg]
136  virtual tmp<scalarField> heu
137  (
138  const scalarField& T,
139  const labelList& cells
140  ) const = 0;
141 
142  //- Unburnt gas enthalpy for patch [J/kg]
143  virtual tmp<scalarField> heu
144  (
145  const scalarField& T,
146  const label patchi
147  ) const = 0;
148 
149  //- Unburnt gas temperature [K]
150  virtual const volScalarField& Tu() const = 0;
151 
152  //- Burnt gas temperature [K]
153  virtual tmp<volScalarField> Tb() const = 0;
154 
155  //- Unburnt gas density [kg/m^3]
156  virtual tmp<volScalarField> rhou() const
157  {
158  return p()*psiu();
159  }
160 
161  //- Burnt gas density [kg/m^3]
162  virtual tmp<volScalarField> rhob() const
163  {
164  return p()*psib();
165  }
166 
167  //- Unburnt gas compressibility [s^2/m^2]
168  virtual tmp<volScalarField> psiu() const = 0;
169 
170  //- Burnt gas compressibility [s^2/m^2]
171  virtual tmp<volScalarField> psib() const = 0;
172 
173  //- Dynamic viscosity of unburnt gas [kg/m/s]
174  virtual tmp<volScalarField> muu() const = 0;
175 
176  //- Dynamic viscosity of burnt gas [kg/m/s]
177  virtual tmp<volScalarField> mub() const = 0;
178 };
179 
180 
181 /*---------------------------------------------------------------------------*\
182  Class psiuReactionThermo::implementation Declaration
183 \*---------------------------------------------------------------------------*/
186 :
187  virtual public psiuReactionThermo
188 {
189 public:
190 
191  // Constructors
192 
193  //- Construct from mesh and phase name
194  implementation(const fvMesh&, const word& phaseName);
195 
196 
197  //- Destructor
198  virtual ~implementation();
199 };
200 
201 
202 /*---------------------------------------------------------------------------*\
203  Class psiuReactionThermo::composite Declaration
204 \*---------------------------------------------------------------------------*/
207 :
212 {
213 public:
214 
215  // Constructors
216 
217  //- Construct from mesh and phase name
219  (
220  const fvMesh& mesh,
221  const word& phaseName
222  )
223  :
224  basicThermo::implementation(mesh, phaseName),
225  fluidThermo::implementation(mesh, phaseName),
226  psiThermo::implementation(mesh, phaseName),
227  psiuReactionThermo::implementation(mesh, phaseName)
228  {}
229 };
230 
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 } // End namespace Foam
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 #endif
239 
240 // ************************************************************************* //
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
Base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:77
virtual tmp< volScalarField > muu() const =0
Dynamic viscosity of unburnt gas [kg/m/s].
virtual basicCombustionMixture & composition()=0
Return the composition of the combustion mixture.
virtual tmp< volScalarField > rhou() const
Unburnt gas density [kg/m^3].
virtual ~psiuReactionThermo()
Destructor.
virtual const volScalarField & Tu() const =0
Unburnt gas temperature [K].
wordList heuBoundaryTypes()
Return the unburnt enthalpy/internal energy field boundary types.
virtual volScalarField & p()=0
Pressure [Pa].
virtual const word & phaseName() const =0
Return the phase name.
dynamicFvMesh & mesh
const cellShapeList & cells
virtual tmp< volScalarField > mub() const =0
Dynamic viscosity of burnt gas [kg/m/s].
A class for handling words, derived from string.
Definition: word.H:59
Specialisation of the basicMixture for combustion.
virtual void correct()=0
Update properties.
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:53
static const word null
An empty word.
Definition: word.H:77
virtual tmp< volScalarField > psiu() const =0
Unburnt gas compressibility [s^2/m^2].
virtual tmp< volScalarField > Tb() const =0
Burnt gas temperature [K].
Base-class for combustion fluid thermodynamic properties based on compressibility.
virtual volScalarField & heu()=0
Unburnt gas enthalpy [J/kg].
label patchi
void heuBoundaryCorrection(volScalarField &heu)
...
virtual const volScalarField & T() const =0
Temperature [K].
virtual tmp< volScalarField > psib() const =0
Burnt gas compressibility [s^2/m^2].
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
declareRunTimeSelectionTable(autoPtr, psiuReactionThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
TypeName("psiuReactionThermo")
Runtime type information.
A class for managing temporary objects.
Definition: PtrList.H:53
static autoPtr< psiuReactionThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Base-class for fluid thermodynamic properties based on compressibility.
Definition: psiThermo.H:51
virtual tmp< volScalarField > rhob() const
Burnt gas density [kg/m^3].
Namespace for OpenFOAM.