Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PropertyCalculator.h
Go to the documentation of this file.
1 /**
2  * @file PropertyCalculator.h
3  */
4 
5 // Copyright 2001 California Institute of Technology
6 
7 #ifndef CT_PROP_CALC_H
8 #define CT_PROP_CALC_H
9 
10 #include "cantera/base/ct_defs.h"
11 
12 namespace Cantera
13 {
14 
15 /// Classes used by ChemEquil. These classes are used only by the
16 /// ChemEquil equilibrium solver. Each one returns a particular
17 /// property of the object supplied as the argument.
18 ///
19 template<class M>
21 {
22 public:
23  virtual ~PropertyCalculator() {}
24  virtual doublereal value(const M& s) =0;
25  virtual std::string symbol() =0;
26 };
27 
28 template<class M>
29 class EnthalpyCalculator : public PropertyCalculator<M>
30 {
31 public:
32  virtual doublereal value(const M& s) {
33  return s.enthalpy_mass();
34  }
35  virtual std::string symbol() {
36  return "H";
37  }
38 };
39 
40 template<class M>
41 class EntropyCalculator : public PropertyCalculator<M>
42 {
43 public:
44  virtual doublereal value(const M& s) {
45  return s.entropy_mass();
46  }
47  virtual std::string symbol() {
48  return "S";
49  }
50 };
51 
52 template<class M>
53 class TemperatureCalculator : public PropertyCalculator<M>
54 {
55 public:
56  virtual doublereal value(const M& s) {
57  return s.temperature();
58  }
59  virtual std::string symbol() {
60  return "T";
61  }
62 };
63 
64 template<class M>
65 class PressureCalculator : public PropertyCalculator<M>
66 {
67 public:
68  virtual doublereal value(const M& s) {
69  return s.pressure();
70  }
71  virtual std::string symbol() {
72  return "P";
73  }
74 };
75 
76 template<class M>
77 class DensityCalculator : public PropertyCalculator<M>
78 {
79 public:
80  virtual doublereal value(const M& s) {
81  return s.density();
82  }
83  virtual std::string symbol() {
84  return "V";
85  }
86 };
87 
88 template<class M>
89 class IntEnergyCalculator : public PropertyCalculator<M>
90 {
91 public:
92  virtual doublereal value(const M& s) {
93  return s.intEnergy_mass();
94  }
95  virtual std::string symbol() {
96  return "U";
97  }
98 };
99 }
100 
101 #endif
102 
Classes used by ChemEquil.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...