Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StatMech.h
Go to the documentation of this file.
1 /**
2  * @file StatMech.h
3  * Header for a single-species standard state object derived
4  * from
5  */
6 /*
7  * Copyright(2006) Sandia Corporation. Under the terms of
8  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
9  * U.S. Government retains certain rights in this software.
10  */
11 
12 #ifndef CT_STATMECH_H
13 #define CT_STATMECH_H
14 
15 #include "cantera/base/global.h"
17 #include "SpeciesThermoMgr.h"
18 
19 namespace Cantera
20 {
21 
22 //! Statistical mechanics
23 /*!
24  * @ingroup spthermo
25  * @deprecated Incomplete stub class, to be removed after Cantera 2.2.
26  */
28 {
29 
30 public:
31 
32  //! Empty constructor
33  StatMech();
34 
35 
36  //! constructor used in templated instantiations
37  /*!
38  * @param n Species index
39  * @param tlow Minimum temperature
40  * @param thigh Maximum temperature
41  * @param pref reference pressure (Pa).
42  * @param coeffs Vector of coefficients used to set the
43  * parameters for the standard state.
44  */
45  StatMech(int n, doublereal tlow, doublereal thigh, doublereal pref,
46  const doublereal* coeffs, const std::string& my_name);
47 
48  //! copy constructor
49  /*!
50  * @param b object to be copied
51  */
52  StatMech(const StatMech& b);
53 
54  //! assignment operator
55  /*!
56  * @param b object to be copied
57  */
58  StatMech& operator=(const StatMech& b);
59 
60  //! duplicator
63 
64  //! Returns an integer representing the type of parameterization
65  virtual int reportType() const;
66  //! Build a series of maps for the properties needed for species
67  int buildmap();
68 
69  //! Update the properties for this species, given a temperature polynomial
70  /*!
71  * This method is called with a pointer to an array containing the
72  * functions of temperature needed by this parameterization, and three
73  * pointers to arrays where the computed property values should be
74  * written. This method updates only one value in each array.
75  *
76  * \f[
77  * \frac{C_p^0(T)}{R} = \frac{C_v^0(T)}{R} + 1
78  * \f]
79  *
80  * Where,
81  * \f[
82  * \frac{C_v^0(T)}{R} = \frac{C_v^{tr}(T)}{R} + \frac{C_v^{vib}(T)}{R}
83  * \f]
84  *
85  * Temperature Polynomial:
86  * tt[0] = t;
87  *
88  * @param tt vector of temperature polynomials
89  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
90  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
91  * @param s_R Vector of Dimensionless entropies. (length m_kk).
92  */
93  virtual void updateProperties(const doublereal* tt,
94  doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const;
95 
96 
97  //! Compute the reference-state property of one species
98  /*!
99  * Given temperature T in K, this method updates the values of the non-
100  * dimensional heat capacity at constant pressure, enthalpy, and entropy,
101  * at the reference pressure, Pref of one of the species. The species
102  * index is used to reference into the cp_R, h_RT, and s_R arrays.
103  *
104  * @param temp Temperature (Kelvin)
105  * @param cp_R Vector of Dimensionless heat capacities. (length m_kk).
106  * @param h_RT Vector of Dimensionless enthalpies. (length m_kk).
107  * @param s_R Vector of Dimensionless entropies. (length m_kk).
108  */
109  virtual void updatePropertiesTemp(const doublereal temp,
110  doublereal* cp_R, doublereal* h_RT,
111  doublereal* s_R) const;
112 
113  //! This utility function reports back the type of parameterization and
114  //! all of the parameters for the species, index.
115  /*!
116  * All parameters are output variables
117  *
118  * @param n Species index
119  * @param type Integer type of the standard type
120  * @param tlow output - Minimum temperature
121  * @param thigh output - Maximum temperature
122  * @param pref output - reference pressure (Pa).
123  * @param coeffs Vector of coefficients used to set the
124  * parameters for the standard state. There are
125  * 12 of them, designed to be compatible
126  * with the multiple temperature formulation.
127  * coeffs[0] is equal to one.
128  * coeffs[1] is min temperature
129  * coeffs[2] is max temperature
130  * coeffs[3+i] from i =0,9 are the coefficients themselves
131  */
132  virtual void reportParameters(size_t& n, int& type,
133  doublereal& tlow, doublereal& thigh,
134  doublereal& pref,
135  doublereal* const coeffs) const;
136 
137  //! Modify parameters for the standard state
138  /*!
139  * @param coeffs Vector of coefficients used to set the
140  * parameters for the standard state.
141  */
142  virtual void modifyParameters(doublereal* coeffs);
143 
144 protected:
145  //! array of polynomial coefficients
147 
148  std::string sp_name;
149 
150  //*generic species struct that contains everything we need here
151  // achtung: add doxygen markup here
152  // achtung: convert doubles to realdoubles
153  struct species {
154  //Nominal T-R Degrees of freedom (cv = cfs*k*T)
155  doublereal cfs;
156 
157  // Mol. Wt. Molecular weight (kg/kmol)
158  doublereal mol_weight;
159 
160  // number of vibrational temperatures necessary
161  int nvib;
162 
163  // Theta_v Characteristic vibrational temperature(s) (K)
164  doublereal theta[5];
165  };
166 
167  std::map<std::string,species*> name_map;
168 
169 };
170 
171 }
172 #endif
Statistical mechanics.
Definition: StatMech.h:27
Pure Virtual Base class for the thermodynamic manager for an individual species' reference state...
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.
Definition: StatMech.cpp:554
virtual int reportType() const
Returns an integer representing the type of parameterization.
Definition: StatMech.cpp:51
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
virtual void modifyParameters(doublereal *coeffs)
Modify parameters for the standard state.
Definition: StatMech.cpp:651
Pure Virtual Base class for individual species reference state thermodynamic managers and text for th...
StatMech()
Empty constructor.
Definition: StatMech.cpp:13
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: StatMech.cpp:599
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
Definition: StatMech.cpp:608
int buildmap()
Build a series of maps for the properties needed for species.
Definition: StatMech.cpp:56
This file contains descriptions of templated subclasses of the virtual base class, SpeciesThermo, which includes SpeciesThermoDuo (see Managers for Calculating Reference-State Thermodynamics and class SpeciesThermoDuo)
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
StatMech & operator=(const StatMech &b)
assignment operator
Definition: StatMech.cpp:37
virtual SpeciesThermoInterpType * duplMyselfAsSpeciesThermoInterpType() const
duplicator
Definition: StatMech.cpp:46
vector_fp m_coeff
array of polynomial coefficients
Definition: StatMech.h:146