Cantera  2.1.2
vcs_species_thermo.h
Go to the documentation of this file.
1 //! @file vcs_species_thermo.h
2 
3 /*
4  * Copyright (2005) Sandia Corporation. Under the terms of
5  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
6  * U.S. Government retains certain rights in this software.
7  */
8 
9 #ifndef VCS_SPECIES_THERMO_H
10 #define VCS_SPECIES_THERMO_H
11 
12 #include <cstdlib>
13 
14 namespace VCSnonideal
15 {
16 
17 class vcs_VolPhase;
18 
19 // Models for the species standard state Naught temperature dependence
20 #define VCS_SS0_NOTHANDLED -1
21 #define VCS_SS0_CONSTANT 0
22 //#define VCS_SS0_NASA_POLY 1
23 #define VCS_SS0_CONSTANT_CP 2
24 
25 // Models for the species standard state extra pressure dependence
26 #define VCS_SSSTAR_NOTHANDLED -1
27 #define VCS_SSSTAR_CONSTANT 0
28 #define VCS_SSSTAR_IDEAL_GAS 1
29 
30 /*!
31  * Identifies the thermo model for the species. This structure is shared by
32  * volumetric and surface species. However, each will have its own types of
33  * thermodynamic models. These quantities all have appropriate units. The
34  * units are specified by VCS_UnitsFormat.
35  */
37 {
38  /*
39  * All objects are public for ease of development
40  */
41 public:
42  //! Index of the phase that this species belongs to.
43  size_t IndexPhase;
44 
45  //! Index of this species in the current phase.
47 
48  //! Pointer to the owning phase object.
50 
51  //! Integer representing the models for the species standard state
52  //! Naught temperature dependence. They are listed above and start
53  //! with VCS_SS0_...
54  int SS0_Model;
55 
56  //! Internal storage of the last calculation of the reference naught Gibbs
57  //! free energy at SS0_TSave. (always in units of Kelvin)
58  double SS0_feSave;
59 
60  //! Internal storage of the last temperature used in the calculation of the
61  //! reference naught Gibbs free energy. units = kelvin
62  double SS0_TSave;
63 
64  //! Base temperature used in the VCS_SS0_CONSTANT_CP model
65  double SS0_T0;
66 
67  //! Base enthalpy used in the VCS_SS0_CONSTANT_CP model
68  double SS0_H0;
69 
70  //! Base entropy used in the VCS_SS0_CONSTANT_CP model
71  double SS0_S0;
72 
73  //! Base heat capacity used in the VCS_SS0_CONSTANT_CP model
74  double SS0_Cp0;
75 
76  //! Value of the pressure for the reference state.
77  //! defaults to 1.01325E5 = 1 atm
78  double SS0_Pref;
79 
80  //! Pointer to a list of parameters that is malloced for complicated
81  //! reference state calculation.
82  void* SS0_Params;
83 
84  //! Integer value representing the star state model.
86 
87  //! Pointer to a list of parameters that is malloced for complicated
88  //! reference star state calculation.
90 
91  //! Integer value representing the activity coefficient model These are
92  //! defined in vcs_VolPhase.h and start with VCS_AC_...
94 
95  //! Pointer to a list of parameters that is malloced for activity
96  //! coefficient models.
98 
99  //! Models for the standard state volume of each species
101 
102  //! Pointer to a list of parameters that is malloced for volume models
104 
105  //! parameter that is used in the VCS_SSVOL_CONSTANT model.
106  double SSStar_Vol0;
107 
108  //! If true, this object will call Cantera to do its member calculations.
110 
111  int m_VCS_UnitsFormat;
112 
113  VCS_SPECIES_THERMO(size_t indexPhase, size_t indexSpeciesPhase);
114  virtual ~VCS_SPECIES_THERMO();
115 
117  VCS_SPECIES_THERMO& operator=(const VCS_SPECIES_THERMO& b);
118 
119  //! Duplication function for derived classes.
121 
122  /**
123  * This function calculates the standard state Gibbs free energy
124  * for species, kspec, at the temperature TKelvin and pressure, Pres.
125  *
126  * @param kspec species global index
127  * @param TKelvin Temperature in Kelvin
128  * @param pres pressure is given in units specified by if__ variable.
129  *
130  * @return standard state free energy in units of Kelvin.
131  */
132  virtual double GStar_R_calc(size_t kspec, double TKelvin, double pres);
133 
134  /**
135  * This function calculates the standard state Gibbs free energy
136  * for species, kspec, at the temperature TKelvin
137  *
138  * @param kglob species global index.
139  * @param TKelvin Temperature in Kelvin
140  *
141  * @return standard state free energy in Kelvin.
142  */
143  virtual double G0_R_calc(size_t kspec, double TKelvin);
144 
145  /**
146  * This function calculates the standard state molar volume
147  * for species, kspec, at the temperature TKelvin and pressure, Pres,
148  *
149  * @return standard state volume in cm**3 per mol.
150  * (if__=3) m**3 / kmol
151  */
152  virtual double VolStar_calc(size_t kglob, double TKelvin, double Pres);
153 
154  /**
155  * This function evaluates the activity coefficient for species, kspec
156  *
157  * @param kspec index of the species in the global species list within
158  * VCS_SOLVE. Phase and local species id can be looked up
159  * within object.
160  *
161  * Note, T, P and mole fractions are obtained from the
162  * single private instance of VCS_SOLVE
163  *
164  * @return activity coefficient for species kspec
165  */
166  virtual double eval_ac(size_t kspec);
167 };
168 
169 }
170 
171 #endif
double SS0_Pref
Value of the pressure for the reference state.
double SSStar_Vol0
parameter that is used in the VCS_SSVOL_CONSTANT model.
int SS0_Model
Integer representing the models for the species standard state Naught temperature dependence...
double SS0_S0
Base entropy used in the VCS_SS0_CONSTANT_CP model.
virtual double eval_ac(size_t kspec)
This function evaluates the activity coefficient for species, kspec.
int SSStar_Vol_Model
Models for the standard state volume of each species.
bool UseCanteraCalls
If true, this object will call Cantera to do its member calculations.
size_t IndexSpeciesPhase
Index of this species in the current phase.
int SSStar_Model
Integer value representing the star state model.
int Activity_Coeff_Model
Integer value representing the activity coefficient model These are defined in vcs_VolPhase.h and start with VCS_AC_...
void * SS0_Params
Pointer to a list of parameters that is malloced for complicated reference state calculation.
vcs_VolPhase * OwningPhase
Pointer to the owning phase object.
void * SSStar_Params
Pointer to a list of parameters that is malloced for complicated reference star state calculation...
Phase information and Phase calculations for vcs.
Definition: vcs_VolPhase.h:97
double SS0_Cp0
Base heat capacity used in the VCS_SS0_CONSTANT_CP model.
virtual double G0_R_calc(size_t kspec, double TKelvin)
This function calculates the standard state Gibbs free energy for species, kspec, at the temperature ...
void * SSStar_Vol_Params
Pointer to a list of parameters that is malloced for volume models.
double SS0_T0
Base temperature used in the VCS_SS0_CONSTANT_CP model.
virtual double VolStar_calc(size_t kglob, double TKelvin, double Pres)
This function calculates the standard state molar volume for species, kspec, at the temperature TKelv...
double SS0_TSave
Internal storage of the last temperature used in the calculation of the reference naught Gibbs free e...
virtual double GStar_R_calc(size_t kspec, double TKelvin, double pres)
This function calculates the standard state Gibbs free energy for species, kspec, at the temperature ...
void * Activity_Coeff_Params
Pointer to a list of parameters that is malloced for activity coefficient models. ...
double SS0_feSave
Internal storage of the last calculation of the reference naught Gibbs free energy at SS0_TSave...
virtual VCS_SPECIES_THERMO * duplMyselfAsVCS_SPECIES_THERMO()
Duplication function for derived classes.
size_t IndexPhase
Index of the phase that this species belongs to.
double SS0_H0
Base enthalpy used in the VCS_SS0_CONSTANT_CP model.