Cantera  2.3.0
SpeciesThermoInterpType.cpp
Go to the documentation of this file.
1 /**
2  * @file SpeciesThermoInterpType.cpp
3  */
4 
5 // This file is part of Cantera. See License.txt in the top-level directory or
6 // at http://www.cantera.org/license.txt for license and copyright information.
7 
10 #include "cantera/thermo/PDSS.h"
11 
12 namespace Cantera
13 {
14 
15 SpeciesThermoInterpType::SpeciesThermoInterpType() :
16  m_lowT(0.0),
17  m_highT(0.0),
18  m_Pref(0.0)
19 {
20 }
21 
22 SpeciesThermoInterpType::SpeciesThermoInterpType(double tlow,
23  double thigh,
24  double pref) :
25  m_lowT(tlow),
26  m_highT(thigh),
27  m_Pref(pref)
28 {
29 }
30 
31 SpeciesThermoInterpType::SpeciesThermoInterpType(const SpeciesThermoInterpType &b) :
32  m_lowT(b.m_lowT),
33  m_highT(b.m_highT),
34  m_Pref(b.m_Pref)
35 {
36  warn_deprecated("SpeciesThermoInterpType copy constructor",
37  "To be removed after Cantera 2.3.");
38 }
39 
41 {
42  warn_deprecated("SpeciesThermoInterpType assignment operator",
43  "To be removed after Cantera 2.3.");
44  if (&b != this) {
45  m_lowT = b.m_lowT;
46  m_highT = b.m_highT;
47  m_Pref = b.m_Pref;
48  }
49  return *this;
50 }
51 
52 void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly,
53  doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const
54 {
55  double T = tempPoly[0];
56  updatePropertiesTemp(T, cp_R, h_RT, s_R);
57 }
58 
59 doublereal SpeciesThermoInterpType::reportHf298(doublereal* const h298) const
60 {
61  throw CanteraError("SpeciesThermoInterpType::reportHf298",
62  "Not implemented");
63 }
64 
66  const doublereal Hf298New)
67 {
68  throw CanteraError("SpeciesThermoInterpType::modifyOneHf298",
69  "Not implemented");
70 }
71 
72 //=============================================================================
73 
75 {
76  warn_deprecated("STITbyPDSS::STITbyPDSS()",
77  "Default constructor to be removed after Cantera 2.3.");
78 }
79 
80 STITbyPDSS::STITbyPDSS(VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) :
82  m_vpssmgr_ptr(vpssmgr_ptr),
83  m_PDSS_ptr(PDSS_ptr)
84 {
85 }
86 
89  m_vpssmgr_ptr(b.m_vpssmgr_ptr),
90  m_PDSS_ptr(b.m_PDSS_ptr)
91 {
92 }
93 
95 {
96  return new STITbyPDSS(*this);
97 }
98 
99 void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr,
100  PDSS* PDSS_ptr)
101 {
102  m_vpssmgr_ptr = vpssmgr_ptr;
103  m_PDSS_ptr = PDSS_ptr;
104 }
105 
106 doublereal STITbyPDSS::minTemp() const
107 {
108  return m_PDSS_ptr->minTemp();
109 }
110 
111 doublereal STITbyPDSS::maxTemp() const
112 {
113  return m_PDSS_ptr->maxTemp();
114 }
115 
116 doublereal STITbyPDSS::refPressure() const
117 {
118  return m_PDSS_ptr->refPressure();
119 }
120 
122 {
123  return PDSS_TYPE;
124 }
125 
126 void STITbyPDSS::updateProperties(const doublereal* tempPoly,
127  doublereal* cp_R, doublereal* h_RT,
128  doublereal* s_R) const
129 {
130  doublereal T = tempPoly[0];
131  updatePropertiesTemp(T, cp_R, h_RT, s_R);
132 }
133 
134 void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
135  doublereal* cp_R,
136  doublereal* h_RT,
137  doublereal* s_R) const
138 {
139  m_PDSS_ptr->setTemperature(temp);
140  *h_RT = m_PDSS_ptr->enthalpy_RT_ref();
141  *cp_R = m_PDSS_ptr->cp_R_ref();
142  *s_R = m_PDSS_ptr->entropy_R_ref();
143 }
144 
145 void STITbyPDSS::reportParameters(size_t& index, int& type,
146  doublereal& minTemp, doublereal& maxTemp,
147  doublereal& refPressure,
148  doublereal* const coeffs) const
149 {
150  index = 0;
151  type = PDSS_TYPE;
155 }
156 
157 }
#define PDSS_TYPE
Type of reference state thermo which is a wrapper around a pressure dependent standard state object...
Abstract Base class for the thermodynamic manager for an individual species' reference state...
virtual doublereal reportHf298(doublereal *const h298=0) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
Virtual base class for the classes that manage the calculation of standard state properties for all t...
Definition: VPSSMgr.h:228
Declaration file for a virtual base class that manages the calculation of standard state properties f...
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Definition: PDSS.cpp:281
doublereal refPressure() const
Return the reference pressure for this phase.
Definition: PDSS.h:335
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
void initAllPtrs(size_t speciesIndex, VPSSMgr *vpssmgr_ptr, PDSS *PDSS_ptr)
Initialize and/or Reinitialize all the pointers for this object.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
Definition: VPSSMgr.cpp:394
doublereal maxTemp() const
return the minimum temperature
Definition: PDSS.h:345
PDSS * m_PDSS_ptr
Pointer to the PDSS object that handles calls for this object.
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) ...
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
virtual void reportParameters(size_t &index, int &type, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure, doublereal *const coeffs) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
virtual void updateProperties(const doublereal *tempPoly, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Update the properties for this species, given a temperature polynomial.
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
Definition: VPSSMgr.cpp:402
virtual void setTemperature(doublereal temp)
Set the internal temperature.
Definition: PDSS.cpp:351
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
Definition: PDSS.cpp:286
Class for the thermodynamic manager for an individual species' reference state which uses the PDSS ba...
doublereal m_highT
Highest valid temperature.
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
doublereal m_lowT
lowest valid temperature
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
virtual int reportType() const
Returns an integer representing the type of parameterization.
virtual void updateProperties(const doublereal *tt, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Update the properties for this species, given a temperature polynomial.
virtual doublereal minTemp() const
Returns the minimum temperature that the thermo parameterization is valid.
virtual doublereal refPressure() const
Returns the reference pressure (Pa)
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:176
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const =0
Compute the reference-state property of one species.
doublereal minTemp() const
return the minimum temperature
Definition: PDSS.h:340
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
Definition: PDSS.cpp:276
doublereal m_Pref
Reference state pressure.
Namespace for the Cantera kernel.
Definition: application.cpp:29
VPSSMgr * m_vpssmgr_ptr
Pointer to the Variable pressure standard state manager that owns the PDSS object that will handle ca...
SpeciesThermoInterpType & operator=(const SpeciesThermoInterpType &b)