Cantera  2.0
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 
12 namespace Cantera
13 {
14 
16 {
17 }
18 
20 {
21 }
22 
23 void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly,
24  doublereal* cp_R, doublereal* h_RT,
25  doublereal* s_R) const
26 {
27  double T = tempPoly[0];
28  updatePropertiesTemp(T, cp_R, h_RT, s_R);
29 }
30 
31 #ifdef H298MODIFY_CAPABILITY
32 
33 doublereal SpeciesThermoInterpType::reportHf298(doublereal* const h298) const
34 {
35  throw CanteraError("SpeciesThermoInterpType::reportHf298",
36  "Not implemented");
37 }
38 
39 void SpeciesThermoInterpType::modifyOneHf298(const int k, const doublereal Hf298New)
40 {
41  throw CanteraError("SpeciesThermoInterpType::modifyOneHf298",
42  "Not implemented");
43 }
44 
45 #endif
46 
47 /***************************************************************************************************/
48 
49 //! Constructor
51  m_speciesIndex(npos)
52 {
53 }
54 
55 STITbyPDSS::STITbyPDSS(size_t k, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr) :
56  m_vpssmgr_ptr(vpssmgr_ptr),
57  m_PDSS_ptr(PDSS_ptr),
58  m_speciesIndex(k)
59 {
60 }
61 
63  m_vpssmgr_ptr(b.m_vpssmgr_ptr),
64  m_PDSS_ptr(b.m_PDSS_ptr),
65  m_speciesIndex(b.m_speciesIndex)
66 {
67 }
68 
69 //! Destructor
71 {
72 }
73 
74 //! duplicator
77 {
78  STITbyPDSS* np = new STITbyPDSS(*this);
79  return (SpeciesThermoInterpType*) np;
80 }
81 
82 
83 void STITbyPDSS::initAllPtrs(size_t speciesIndex, VPSSMgr* vpssmgr_ptr, PDSS* PDSS_ptr)
84 {
85  AssertThrow(speciesIndex == m_speciesIndex, "STITbyPDSS::initAllPtrs internal confusion");
86  m_vpssmgr_ptr = vpssmgr_ptr;
87  m_PDSS_ptr = PDSS_ptr;
88 }
89 
90 //! Returns the minimum temperature that the thermo
91 //! parameterization is valid
92 doublereal STITbyPDSS::minTemp() const
93 {
94  return m_PDSS_ptr->minTemp();
95 }
96 
97 //! Returns the maximum temperature that the thermo
98 //! parameterization is valid
99 doublereal STITbyPDSS::maxTemp() const
100 {
101  return m_PDSS_ptr->maxTemp();
102 }
103 
104 //! Returns the reference pressure (Pa)
105 doublereal STITbyPDSS::refPressure() const
106 {
107  return m_PDSS_ptr->refPressure();
108 }
109 
110 //! Returns an integer representing the type of parameterization
112 {
113  return PDSS_TYPE;
114 }
115 
116 //! Returns an integer representing the species index
118 {
119  return m_speciesIndex;
120 }
121 
122 //! Update the properties for this species, given a temperature
123 //! polynomial
124 /*!
125  * This method is called with a pointer to an array containing the functions of
126  * temperature needed by this parameterization, and three pointers to arrays where the
127  * computed property values should be written. This method updates only one value in
128  * each array.
129  *
130  * The form and length of the Temperature Polynomial may vary depending on the
131  * parameterization.
132  *
133  * @param tempPoly vector of temperature polynomials
134  * @param cp_R Vector of Dimensionless heat capacities.
135  * (length m_kk).
136  * @param h_RT Vector of Dimensionless enthalpies.
137  * (length m_kk).
138  * @param s_R Vector of Dimensionless entropies.
139  * (length m_kk).
140  */
141 void STITbyPDSS::updateProperties(const doublereal* tempPoly,
142  doublereal* cp_R, doublereal* h_RT,
143  doublereal* s_R) const
144 {
145  doublereal T = tempPoly[0];
146  updatePropertiesTemp(T, cp_R, h_RT, s_R);
147 }
148 
149 //! Compute the reference-state property of one species
150 /*!
151  * Given temperature T in K, this method updates the values of
152  * the non-dimensional heat capacity at constant pressure,
153  * enthalpy, and entropy, at the reference pressure, Pref
154  * of one of the species. The species index is used
155  * to reference into the cp_R, h_RT, and s_R arrays.
156  *
157  * @param temp Temperature (Kelvin)
158  * @param cp_R Vector of Dimensionless heat capacities.
159  * (length m_kk).
160  * @param h_RT Vector of Dimensionless enthalpies.
161  * (length m_kk).
162  * @param s_R Vector of Dimensionless entropies.
163  * (length m_kk).
164  */
165 void STITbyPDSS::updatePropertiesTemp(const doublereal temp,
166  doublereal* cp_R,
167  doublereal* h_RT,
168  doublereal* s_R) const
169 {
170  //m_vpssmgr_ptr->setState_T(temp);
171  m_PDSS_ptr->setTemperature(temp);
172  AssertThrowMsg(m_speciesIndex != npos, "STITbyPDSS::updatePropertiesTemp",
173  "object was probably not installed correctly");
177 }
178 
179 //!This utility function reports back the type of
180 //! parameterization and all of the parameters for the
181 //! species, index.
182 /*!
183  * All parameters are output variables
184  *
185  * @param index Species index
186  * @param type Integer type of the standard type
187  * @param minTemp output - Minimum temperature
188  * @param maxTemp output - Maximum temperature
189  * @param refPressure output - reference pressure (Pa).
190  * @param coeffs Vector of coefficients used to set the
191  * parameters for the standard state.
192  */
193 void STITbyPDSS::reportParameters(size_t& index, int& type,
194  doublereal& minTemp, doublereal& maxTemp,
195  doublereal& refPressure,
196  doublereal* const coeffs) const
197 {
198  index = m_speciesIndex;
199  type = PDSS_TYPE;
202  refPressure = m_PDSS_ptr->refPressure();
203 }
204 
205 //! Modify parameters for the standard state
206 /*!
207  * @param coeffs Vector of coefficients used to set the
208  * parameters for the standard state.
209  */
210 void STITbyPDSS::modifyParameters(doublereal* coeffs)
211 {
212 }
213 
214 
215 }