Cantera  2.1.2
SpeciesThermoInterpType.cpp
Go to the documentation of this file.
1 /**
2  * @file SpeciesThermoInterpType.cpp
3  * Definitions for a
4  */
5 // Copyright 2007 Sandia National Laboratories
6 
9 #include "cantera/thermo/PDSS.h"
11  #include "cantera/base/global.h"
12 
13 namespace Cantera
14 {
15 
17  m_lowT(0.0),
18  m_highT(0.0),
19  m_Pref(0.0),
20  m_index(0)
21 {
22 }
23 
25 {
26 }
27 
28 void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly,
29  doublereal* cp_R, doublereal* h_RT,
30  doublereal* s_R) const
31 {
32  double T = tempPoly[0];
33  updatePropertiesTemp(T, cp_R, h_RT, s_R);
34 }
35 
36 #ifdef H298MODIFY_CAPABILITY
37 
38 doublereal SpeciesThermoInterpType::reportHf298(doublereal* const h298) const
39 {
40  throw CanteraError("SpeciesThermoInterpType::reportHf298",
41  "Not implemented");
42 }
43 
44 void SpeciesThermoInterpType::modifyOneHf298(const int k, const doublereal Hf298New)
45 {
46  throw CanteraError("SpeciesThermoInterpType::modifyOneHf298",
47  "Not implemented");
48 }
49 
50 #endif
51 
53 {
54  m_index = npos;
55 }
56 
57 STITbyPDSS::STITbyPDSS(size_t k, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) :
58  m_vpssmgr_ptr(vpssmgr_ptr),
59  m_PDSS_ptr(PDSS_ptr)
60 {
61  m_index = k;
62 }
63 
65  m_vpssmgr_ptr(b.m_vpssmgr_ptr),
66  m_PDSS_ptr(b.m_PDSS_ptr)
67 {
68 }
69 
72 {
73  return new STITbyPDSS(*this);
74 }
75 
76 void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr)
77 {
78  AssertThrow(speciesIndex == m_index, "STITbyPDSS::initAllPtrs internal confusion");
79  m_vpssmgr_ptr = vpssmgr_ptr;
80  m_PDSS_ptr = PDSS_ptr;
81 }
82 
83 doublereal STITbyPDSS::minTemp() const
84 {
85  return m_PDSS_ptr->minTemp();
86 }
87 
88 doublereal STITbyPDSS::maxTemp() const
89 {
90  return m_PDSS_ptr->maxTemp();
91 }
92 
93 doublereal STITbyPDSS::refPressure() const
94 {
95  return m_PDSS_ptr->refPressure();
96 }
97 
99 {
100  return PDSS_TYPE;
101 }
102 
103 void STITbyPDSS::updateProperties(const doublereal* tempPoly,
104  doublereal* cp_R, doublereal* h_RT,
105  doublereal* s_R) const
106 {
107  doublereal T = tempPoly[0];
108  updatePropertiesTemp(T, cp_R, h_RT, s_R);
109 }
110 
111 void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
112  doublereal* cp_R,
113  doublereal* h_RT,
114  doublereal* s_R) const
115 {
116  //m_vpssmgr_ptr->setState_T(temp);
117  m_PDSS_ptr->setTemperature(temp);
118  AssertThrowMsg(m_index != npos, "STITbyPDSS::updatePropertiesTemp",
119  "object was probably not installed correctly");
121  cp_R[m_index] = m_PDSS_ptr->cp_R_ref();
122  s_R[m_index] = m_PDSS_ptr->entropy_R_ref();
123 }
124 
125 void STITbyPDSS::reportParameters(size_t& index, int& type,
126  doublereal& minTemp, doublereal& maxTemp,
127  doublereal& refPressure,
128  doublereal* const coeffs) const
129 {
130  warn_deprecated("STITbyPDSS::reportParameters");
131  index = m_index;
132  type = PDSS_TYPE;
133  minTemp = m_vpssmgr_ptr->minTemp(m_index);
134  maxTemp = m_vpssmgr_ptr->maxTemp(m_index);
135  refPressure = m_PDSS_ptr->refPressure();
136 }
137 
138 void STITbyPDSS::modifyParameters(doublereal* coeffs)
139 {
140  warn_deprecated("STITbyPDSS::modifyParameters");
141 }
142 
143 }
#define PDSS_TYPE
Type of reference state thermo which is a wrapper around a pressure dependent standard state object...
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
Definition: PDSS.cpp:305
doublereal maxTemp() const
return the minimum temperature
Definition: PDSS.h:375
Virtual base class for the classes that manage the calculation of standard state properties for all t...
Definition: VPSSMgr.h:238
Declaration file for a virtual base class that manages the calculation of standard state properties f...
const size_t npos
index returned by functions to indicate "no position"
Definition: ct_defs.h:173
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
Definition: VPSSMgr.cpp:468
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:76
doublereal refPressure() const
Return the reference pressure for this phase.
Definition: PDSS.h:365
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
doublereal minTemp() const
return the minimum temperature
Definition: PDSS.h:370
void initAllPtrs(size_t speciesIndex, VPSSMgr *vpssmgr_ptr, PDSS *PDSS_ptr)
Initialize and/or Reinitialize all the pointers for this object.
virtual void reportParameters(size_t &index, int &type, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure, doublereal *const coeffs) const
PDSS * m_PDSS_ptr
Pointer to the PDSS object that handles calls for this object.
#define AssertThrowMsg(expr, procedure, message)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:247
virtual void modifyParameters(doublereal *coeffs)
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
virtual void setTemperature(doublereal temp)
Set the internal temperature.
Definition: PDSS.cpp:384
Class for the thermodynamic manager for an individual species' reference state which uses the PDSS ba...
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.
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.
#define AssertThrow(expr, procedure)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:229
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:68
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
Definition: VPSSMgr.cpp:459
virtual int reportType() const
Returns an integer representing the type of parameterization.
virtual doublereal refPressure() const
Returns the reference pressure (Pa)
Virtual base class for a species with a pressure dependent standard state.
Definition: PDSS.h:195
virtual doublereal minTemp() const
Returns the minimum temperature that the thermo parameterization is valid.
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.
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Definition: PDSS.cpp:299
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
VPSSMgr * m_vpssmgr_ptr
Pointer to the Variable pressure standard state manager that owns the PDSS object that will handle ca...
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
Definition: PDSS.cpp:293