Cantera  2.3.0
vcs_species_thermo.cpp
Go to the documentation of this file.
1 /**
2  * @file vcs_species_thermo.cpp Implementation for the VCS_SPECIES_THERMO
3  * object.
4  */
5 
6 // This file is part of Cantera. See License.txt in the top-level directory or
7 // at http://www.cantera.org/license.txt for license and copyright information.
8 
10 #include "cantera/equil/vcs_defs.h"
12 
15 
16 using namespace std;
17 namespace Cantera
18 {
19 VCS_SPECIES_THERMO::VCS_SPECIES_THERMO(size_t indexPhase,
20  size_t indexSpeciesPhase) :
21  IndexPhase(indexPhase),
22  IndexSpeciesPhase(indexSpeciesPhase),
23  OwningPhase(0),
24  SS0_Model(VCS_SS0_CONSTANT),
25  SS0_feSave(0.0),
26  SS0_TSave(-90.0),
27  SS0_T0(273.15),
28  SS0_H0(0.0),
29  SS0_S0(0.0),
30  SS0_Cp0(0.0),
31  SS0_Pref(1.01325E5),
32  SSStar_Model(VCS_SSSTAR_CONSTANT),
33  SSStar_Vol_Model(VCS_SSVOL_IDEALGAS),
34  SSStar_Vol0(-1.0)
35 {
36  SS0_Pref = 1.01325E5;
37 }
38 
40 {
41  return new VCS_SPECIES_THERMO(*this);
42 }
43 
44 double VCS_SPECIES_THERMO::GStar_R_calc(size_t kglob, double TKelvin,
45  double pres)
46 {
47  warn_deprecated("VCS_SPECIES_THERMO::GStar_R_calc",
48  "Unused. To be removed after Cantera 2.3.");
49  double fe = G0_R_calc(kglob, TKelvin);
50  OwningPhase->setState_TP(TKelvin, pres);
52  return fe / GasConstant;
53 }
54 
55 double VCS_SPECIES_THERMO::VolStar_calc(size_t kglob, double TKelvin,
56  double presPA)
57 {
58  warn_deprecated("VCS_SPECIES_THERMO::VolStar_calc",
59  "Unused. To be removed after Cantera 2.3.");
60  OwningPhase->setState_TP(TKelvin, presPA);
62 }
63 
64 double VCS_SPECIES_THERMO::G0_R_calc(size_t kglob, double TKelvin)
65 {
66  warn_deprecated("VCS_SPECIES_THERMO::G0_R_calc",
67  "Unused. To be removed after Cantera 2.3.");
68  if (SS0_Model == VCS_SS0_CONSTANT) {
69  return SS0_feSave;
70  }
71  if (TKelvin == SS0_TSave) {
72  return SS0_feSave;
73  }
74  OwningPhase->setState_T(TKelvin);
76  fe /= GasConstant;
77  SS0_feSave = fe;
78  SS0_TSave = TKelvin;
79  return fe;
80 }
81 
82 double VCS_SPECIES_THERMO::eval_ac(size_t kglob)
83 {
84  // Activity coefficients are frequently evaluated on a per phase basis. If
85  // they are, then the currPhAC[] boolean may be used to reduce repeated
86  // work. Just set currPhAC[iph], when the activity coefficients for all
87  // species in the phase are reevaluated.
88  warn_deprecated("VCS_SPECIES_THERMO::eval_ac",
89  "Unused. To be removed after Cantera 2.3.");
91 }
92 
93 }
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 VolStar_calc_one(size_t kspec) const
Molar volume calculation for standard state of one species.
size_t IndexSpeciesPhase
Index of this species in the current phase.
#define VCS_SSVOL_IDEALGAS
Models for the standard state volume of each species.
Definition: vcs_VolPhase.h:21
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...
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
double AC_calc_one(size_t kspec) const
Evaluate activity coefficients and return the kspec coefficient.
STL namespace.
Header for the object representing each phase within vcs.
double GStar_calc_one(size_t kspec) const
Gibbs free energy calculation for standard state of one species.
Defines and definitions within the vcs package.
Internal declarations for the VCSnonideal package.
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.
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 ...
int SS0_Model
Integer representing the models for the species standard state Naught temperature dependence...
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:64
Namespace for the Cantera kernel.
Definition: application.cpp:29
void setState_T(const double temperature_Kelvin)
Sets the temperature in this object and underlying ThermoPhase objects.
void setState_TP(const double temperature_Kelvin, const double pressure_PA)
Sets the temperature and pressure in this object and underlying ThermoPhase objects.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
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 G0_calc_one(size_t kspec) const
Gibbs free energy calculation at a temperature for the reference state of a species, return a value for one species.