Cantera  2.0
MMCollisionInt.h
Go to the documentation of this file.
1 /**
2  * @file MMCollisionInt.h
3  * Monk and Monchick collision integrals
4  */
5 // Copyright 2001 California Institute of Technology
6 
7 #ifndef CT_MMCOLLISIONINT_H
8 #define CT_MMCOLLISIONINT_H
9 
10 #include "cantera/base/ct_defs.h"
11 
12 #include <vector>
13 #include <iostream>
14 
15 namespace Cantera
16 {
17 
18 class XML_Writer;
19 
20 
21 //! Error handler class for collision integrals
22 /*!
23  * This class doesn't
24  */
26 {
27 public:
28 
29  //! Constructor
30  /*!
31  * @param logfile ostream reference for writing out errors
32  * @param msg error message
33  */
34  MMCollisionIntError(std::ostream& logfile, std::string msg) {
35  logfile << "#### ERROR ####" << std::endl;
36  logfile << "MMCollisionInt: " << msg << std::endl;
37  std::cerr << "Error in fitting collision integrals. "
38  << "Execution terminated." << std::endl
39  << "See transport log file for more information." << std::endl;
40  }
41 };
42 
43 
44 
45 //! Calculation of Collision integrals
46 /*!
47  * This class provides functions that
48  * interpolate the tabulated collision integrals in Monchick and
49  * Mason, "Transport Properties of Polar Gases," J. Chem. Phys. (1961)
50  *
51  * @ingroup transportgroup
52  */
54 {
55 
56 public:
57 
58  //! Default Constructor
60 
61  //! Destructor
62  virtual ~MMCollisionInt();
63 
64 
65  //! Initialize the object for calculation
66  /*!
67  *
68  * @param xml Pointer to the log file that will receive the debug output
69  * messages
70  * @param tsmin Minimum value of Tstar to carry out the fitting
71  * @param tsmax Maximum value of Tstar to carry out the fitting
72  * @param loglevel Set the loglevel for the object. The default
73  * loglevel is zero, indicating no output.
74  */
75  void init(XML_Writer* xml, doublereal tsmin, doublereal tsmax, int loglevel = 0);
76 
77  //! omega22
78  /*!
79  * @param ts
80  * @param deltastar
81  */
82  doublereal omega22(double ts, double deltastar);
83 
84  //! astar
85  /*!
86  * @param ts
87  * @param deltastar
88  */
89  doublereal astar(double ts, double deltastar);
90 
91  //! bstar
92  /*!
93  * @param ts
94  * @param deltastar
95  */
96  doublereal bstar(double ts, double deltastar);
97 
98  //! cstar
99  /*!
100  * @param ts
101  * @param deltastar
102  */
103  doublereal cstar(double ts, double deltastar);
104 
105  //! fit
106  /*!
107  * @param logfile
108  * @param degree
109  * @param deltastar
110  * @param astar
111  * @param bstar
112  * @param cstar
113  */
114  void fit(std::ostream& logfile, int degree, doublereal deltastar,
115  doublereal* astar, doublereal* bstar, doublereal* cstar);
116 
117  //! fit_omega22
118  /*!
119  * @param logfile
120  * @param degree
121  * @param deltastar
122  * @param om22
123  */
124  void fit_omega22(std::ostream& logfile, int degree, doublereal deltastar, doublereal* om22);
125 
126  //! omega11
127  /*!
128  * @param ts
129  * @param deltastar
130  */
131  doublereal omega11(double ts, double deltastar) {
132  return omega22(ts, deltastar)/astar(ts, deltastar);
133  }
134 
135 private:
136 
137  //! Fit delta
138  /*!
139  * @param table
140  * @param ntstar
141  * @param degree
142  * @param c C is probable the output vector
143  *
144  * @return
145  */
146  doublereal fitDelta(int table, int ntstar, int degree, doublereal* c);
147 
148  //! m_o22poly
149  std::vector<vector_fp> m_o22poly;
150 
151  //! m_apoly
152  std::vector<vector_fp> m_apoly;
153  //! m_bpoly
154  std::vector<vector_fp> m_bpoly;
155 
156  //! m_cpoly
157  std::vector<vector_fp> m_cpoly;
158 
159  //! delta
160  static doublereal delta[8];
161 
162  //! tstar22
163  static doublereal tstar22[37];
164 
165  //! Table of omega22 values from MM
166  static doublereal omega22_table[37*8];
167 
168  //! tstar
169  /*!
170  * table of tstar values
171  */
172  static doublereal tstar[39];
173 
174  //! astar table from MM
175  static doublereal astar_table[39*8];
176 
177  //! bstar table from MM
178  static doublereal bstar_table[39*8];
179 
180  //! cstar table from MM
181  static doublereal cstar_table[39*8];
182 
183  //! Log temp
185 
186  //! nmin
187  int m_nmin;
188 
189  //! nmax
190  int m_nmax;
191 
192  //! XML_Writer pointer
193  XML_Writer* m_xml;
194 
195  //! loglevel
197 };
198 }
199 #endif
200 
201