Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 Cantera
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  //! Integer value representing the star state model.
82 
83  //! Models for the standard state volume of each species
85 
86  //! parameter that is used in the VCS_SSVOL_CONSTANT model.
87  double SSStar_Vol0;
88 
89  //! If true, this object will call Cantera to do its member calculations.
90  //! @deprecated Will always behave as if 'true' after Cantera 2.2
92 
93  int m_VCS_UnitsFormat;
94 
95  VCS_SPECIES_THERMO(size_t indexPhase, size_t indexSpeciesPhase);
96  virtual ~VCS_SPECIES_THERMO() {}
97 
99  VCS_SPECIES_THERMO& operator=(const VCS_SPECIES_THERMO& b);
100 
101  //! Duplication function for derived classes.
103 
104  /**
105  * This function calculates the standard state Gibbs free energy
106  * for species, kspec, at the temperature TKelvin and pressure, Pres.
107  *
108  * @param kspec species global index
109  * @param TKelvin Temperature in Kelvin
110  * @param pres pressure is given in units specified by if__ variable.
111  *
112  * @return standard state free energy in units of Kelvin.
113  */
114  virtual double GStar_R_calc(size_t kspec, double TKelvin, double pres);
115 
116  /**
117  * This function calculates the standard state Gibbs free energy
118  * for species, kspec, at the temperature TKelvin
119  *
120  * @param kglob species global index.
121  * @param TKelvin Temperature in Kelvin
122  *
123  * @return standard state free energy in Kelvin.
124  */
125  virtual double G0_R_calc(size_t kglob, double TKelvin);
126 
127  /**
128  * This function calculates the standard state molar volume
129  * for species, kspec, at the temperature TKelvin and pressure, Pres,
130  *
131  * @return standard state volume in cm**3 per mol.
132  * (if__=3) m**3 / kmol
133  */
134  virtual double VolStar_calc(size_t kglob, double TKelvin, double Pres);
135 
136  /**
137  * This function evaluates the activity coefficient for species, kspec
138  *
139  * @param kspec index of the species in the global species list within
140  * VCS_SOLVE. Phase and local species id can be looked up
141  * within object.
142  *
143  * Note, T, P and mole fractions are obtained from the
144  * single private instance of VCS_SOLVE
145  *
146  * @return activity coefficient for species kspec
147  */
148  virtual double eval_ac(size_t kspec);
149 };
150 
151 }
152 
153 #endif
vcs_VolPhase * OwningPhase
Pointer to the owning phase object.
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 ...
double SS0_Cp0
Base heat capacity used in the VCS_SS0_CONSTANT_CP model.
size_t IndexSpeciesPhase
Index of this species in the current phase.
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 SSStar_Vol0
parameter that is used in the VCS_SSVOL_CONSTANT model.
int SSStar_Vol_Model
Models for the standard state volume of each species.
double SS0_S0
Base entropy used in the VCS_SS0_CONSTANT_CP model.
size_t IndexPhase
Index of the phase that this species belongs to.
virtual double eval_ac(size_t kspec)
This function evaluates the activity coefficient for species, kspec.
virtual VCS_SPECIES_THERMO * duplMyselfAsVCS_SPECIES_THERMO()
Duplication function for derived classes.
double SS0_H0
Base enthalpy used in the VCS_SS0_CONSTANT_CP model.
virtual double G0_R_calc(size_t kglob, double TKelvin)
This function calculates the standard state Gibbs free energy for species, kspec, at the temperature ...
Phase information and Phase calculations for vcs.
Definition: vcs_VolPhase.h:86
double SS0_T0
Base temperature used in the VCS_SS0_CONSTANT_CP model.
int SSStar_Model
Integer value representing the star state model.
int SS0_Model
Integer representing the models for the species standard state Naught temperature dependence...
bool UseCanteraCalls
If true, this object will call Cantera to do its member calculations.
double SS0_TSave
Internal storage of the last temperature used in the calculation of the reference naught Gibbs free e...
double SS0_feSave
Internal storage of the last calculation of the reference naught Gibbs free energy at SS0_TSave...
double SS0_Pref
Value of the pressure for the reference state.