Cantera  2.0
LTPspecies.h
Go to the documentation of this file.
1 /**
2  * @file LTPspecies.h
3  * Header file defining class LTPspecies and its child classes
4  */
5 
6 #ifndef CT_LTPSPECIES_H
7 #define CT_LTPSPECIES_H
8 
9 // Cantera includes
10 #include "cantera/base/ct_defs.h"
11 #include "TransportBase.h"
13 
14 // STL includes
15 #include <vector>
16 #include <string>
17 
18 namespace Cantera
19 {
20 
21 //====================================================================================================================
22 //! Enumeration of the types of transport properties that can be
23 //! handled by the variables in the various Transport classes.
24 /*!
25  * Not all of these are handled by each class and each class
26  * should handle exceptions where the transport property is not handled.
27  *
28  * Transport properties currently on the list
29  *
30  * 0 - viscosity
31  * 1 - Ionic conductivity
32  * 2 - Mobility Ratio
33  * 3 - Self Diffusion coefficient
34  * 4 - Thermal conductivity
35  * 5 - species diffusivity
36  * 6 - hydrodynamic radius
37  * 7 - electrical conductivity
38  */
40  TP_UNKNOWN = -1,
41  TP_VISCOSITY = 0,
42  TP_IONCONDUCTIVITY,
43  TP_MOBILITYRATIO,
44  TP_SELFDIFFUSION,
45  TP_THERMALCOND,
46  TP_DIFFUSIVITY,
47  TP_HYDRORADIUS,
48  TP_ELECTCOND
49 };
50 
51 //====================================================================================================================
52 //! Temperature dependence type for pure (liquid) species properties
53 /*!
54  * Types of temperature dependencies:
55  * 0 - Independent of temperature
56  * 1 - extended arrhenius form
57  * 2 - polynomial in temperature form
58  * 3 - exponential temperature polynomial
59  */
61  LTP_TD_NOTSET=-1,
62  LTP_TD_CONSTANT,
63  LTP_TD_ARRHENIUS,
64  LTP_TD_POLY,
65  LTP_TD_EXPT
66 };
67 
68 //====================================================================================================================
69 //! Class LTPspecies holds transport parameters for a specific liquid-phase species.
70 /*!
71  * Subclasses handle different means of specifying transport properties
72  * like constant, %Arrhenius or polynomial fits. In its current state,
73  * it is primarily suitable for specifying temperature dependence, but
74  * the adjustCoeffsForComposition() method can be implemented to
75  * adjust for composition dependence.
76  *
77  * Mixing rules for computing mixture transport properties are handled
78  * separately in LiquidTranInteraction subclasses.
79  */
81 {
82 
83 public:
84 
85  //! Construct an LTPspecies object for a liquid transport property.
86  /*!
87  * The species transport property is constructed from the XML node,
88  * \verbatim <propNode>, \endverbatim that is a child of the
89  * \verbatim <transport> \endverbatim node in the species block and specifies a type of transport
90  * property (like viscosity)
91  *
92  * @param propNode Pointer to the XML node that contains the property information. A default
93  * value of 0 is allowed for the base class, but not for classes which
94  * are assumed to be parameterized by reading XML_Node information.
95  * @param name String containing the species name
96  * @param tp_ind enum TransportPropertyType containing the property id that this object
97  * is creating a parameterization for (e.g., viscosity)
98  * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
99  */
100  LTPspecies(const XML_Node* const propNode = 0, std::string name = "-",
101  TransportPropertyType tp_ind = TP_UNKNOWN, const thermo_t* thermo = 0);
102 
103  //! Copy constructor
104  /*!
105  * @param right Object to be copied
106  */
107  LTPspecies(const LTPspecies& right);
108 
109  //! Assignment operator
110  /*!
111  * @param right Object to be copied
112  */
113  LTPspecies& operator=(const LTPspecies& right);
114 
115  //! Destructor
116  virtual ~LTPspecies();
117 
118  //! Duplication routine
119  /*!
120  * @return Returns a copy of this routine as a pointer to LTPspecies
121  */
122  virtual LTPspecies* duplMyselfAsLTPspecies() const;
123 
124  //! Returns the vector of pure species transport property
125  /*!
126  * The pure species transport property (i.e. pure species viscosity)
127  * is returned. Any temperature and composition dependence will be
128  * adjusted internally according to the information provided by the
129  * subclass object.
130  *
131  * @return Returns a single double containing the property evaluation
132  * at the current ThermoPhase temperature.
133  */
134  virtual doublereal getSpeciesTransProp();
135 
136  //! Check to see if the property evaluation will be positive
137  /*!
138  * @return Returns a boolean
139  */
140  virtual bool checkPositive() const;
141 
142  //! Return the weight mixture
143  /*!
144  * @return Returns a single double which is used as a weight
145  */
146  doublereal getMixWeight() const;
147 
148 private:
149  //! Internal model to adjust species-specific properties for composition.
150  /*!
151  * Currently just a place holder, but this method could take
152  * the composition from the thermo object and adjust coefficients
153  * accoding to some unspecified model.
154  */
155  virtual void adjustCoeffsForComposition();
156 
157 protected:
158 
159  //! Species Name
160  std::string m_speciesName;
161 
162  //! Model type for the temperature dependence
164 
165  //! enum indicating which property this is (i.e viscosity)
167 
168  //! Model temperature-dependence ceofficients
170 
171  //! Pointer to a const thermo object to get current temperature
173 
174  //! Weighting used for mixing.
175  /*!
176  * This weighting can be employed to allow salt transport
177  * properties to be represented by specific ions.
178  * For example, to have Li+ and Ca+ represent the mixing
179  * transport properties of LiCl and CaCl2, the weightings for
180  * Li+ would be 2.0, for K+ would be 3.0 and for Cl- would be 0.0.
181  * The transport properties for Li+ would be those for LiCl and
182  * the transport properties for Ca+ would be those for CaCl2.
183  * The transport properties for Cl- should be something innoccuous like
184  * 1.0--note that 0.0 is not innocuous if there are logarithms involved.
185  */
186  doublereal m_mixWeight;
187 };
188 
189 //====================================================================================================================
190 //! Class LTPspecies_Const holds transport parameters for a
191 //! specific liquid-phase species (LTPspecies) when the
192 //! transport property is just a constant value.
193 /*!
194  * As an example of the input required for LTPspecies_Const
195  * consider the following XML fragment
196  *
197  * \verbatim
198  * <species>
199  * <!-- thermodynamic properties -->
200  * <transport>
201  * <hydrodynamicRadius model="Constant" units="A">
202  * 1.000
203  * </hydrodynamicRadius>
204  * <!-- other transport properties -->
205  * </transport>
206  * </species>
207  * \endverbatim
208  */
210 {
211 
212 public:
213 
214  //! Construct an LTPspecies object for a liquid transport property
215  //! expressed as a constant value.
216  /** The transport property is constructed from the XML node,
217  * \verbatim <propNode>, \endverbatim that is a child of the
218  * \verbatim <transport> \endverbatim node and specifies a type of
219  * transport property (like viscosity).
220  *
221  *
222  * @param propNode Reference to the XML node that contains the property information.
223  * @param name String containing the species name
224  * @param tp_ind enum TransportPropertyType containing the property id that this object
225  * is creating a parameterization for (e.g., viscosity)
226  * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
227  */
228  LTPspecies_Const(const XML_Node& propNode, std::string name,
229  TransportPropertyType tp_ind, const thermo_t* const thermo);
230 
231  //! Copy constructor
232  /*!
233  * @param right Object to be copied
234  */
235  LTPspecies_Const(const LTPspecies_Const& right);
236 
237  //! Assignment operator
238  /*!
239  * @param right Object to be copied
240  */
242 
243  //! Destructor
244  virtual ~LTPspecies_Const();
245 
246  //! duplication routine
247  /*!
248  * @return Returns a copy of this routine as a pointer to LTPspecies
249  */
250  virtual LTPspecies* duplMyselfAsLTPspecies() const;
251 
252  //! Returns the pure species transport property
253  /*!
254  * The pure species transport property (i.e. pure species viscosity)
255  * is returned. Any temperature and composition dependence will be
256  * adjusted internally according to the information provided.
257  */
258  doublereal getSpeciesTransProp();
259 
260 };
261 
262 //====================================================================================================================
263 //! Class LTPspecies_Arrhenius holds transport parameters for a
264 //! specific liquid-phase species (LTPspecies) when the
265 //! transport property is expressed in Arrhenius form.
266 /*!
267  * Used for pure species properties with equations of the form
268  * \f[
269  * x = A T^b \exp( - E / RT )
270  * \f]
271  * where A, b, and E are passed in the xml input file.
272  *
273  * As an example of the input required for LTPspecies_Arrhenius
274  * consider the following XML fragment
275  *
276  * \verbatim
277  * <species>
278  * <!-- thermodynamic properties -->
279  * <transport>
280  * <viscosity model="Arrhenius">
281  * <!-- Janz, JPCRD, 17, supplement 2, 1988 -->
282  * <A>6.578e-5</A>
283  * <b>0.0</b>
284  * <E units="J/kmol">23788.e3</E>
285  * </viscosity>
286  * <!-- other transport properties -->
287  * </transport>
288  * </species>
289  * \endverbatim
290  */
292 {
293 
294 public:
295 
296  //! Construct an LTPspecies object for a liquid transport property
297  //! expressed in extended Arrhenius form.
298  /*!
299  * The transport property is constructed from the XML node,
300  * \verbatim <propNode>, \endverbatim that is a child of the
301  * \verbatim <transport> \endverbatim node and specifies a type of transport property (like viscosity)
302  *
303  *
304  * @param propNode Reference to the XML node that contains the property information.This class
305  * is assumed to be parameterized by reading XML_Node information.
306  * @param name String containing the species name
307  * @param tp_ind enum TransportPropertyType containing the property id that this object
308  * is creating a parameterization for (e.g., viscosity)
309  * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
310  *
311  */
312  LTPspecies_Arrhenius(const XML_Node& propNode, std::string name,
313  TransportPropertyType tp_ind, const thermo_t* thermo);
314 
315  //! Copy constructor
316  /*!
317  * @param right Object to be copied
318  */
320 
321  //! Assignment operator
322  /*!
323  * @param right Object to be copied
324  */
326 
327  //! Destructor
328  virtual ~LTPspecies_Arrhenius();
329 
330  //! duplication routine
331  /*!
332  * @return Returns a copy of this routine as a pointer to LTPspecies
333  */
334  virtual LTPspecies* duplMyselfAsLTPspecies() const;
335 
336  //! Return the pure species value for this transport property evaluated
337  //! from the Arrhenius expression
338  /*!
339  * In general the Arrhenius expression is
340  *
341  * \f[
342  * \mu = A T^n \exp( - E / R T ).
343  * \f]
344  *
345  * Note that for viscosity, the convention is such that
346  * a positive activation energy corresponds to the typical
347  * case of a positive argument to the exponential so that
348  * the Arrhenius expression is
349  *
350  * \f[
351  * \mu = A T^n \exp( + E / R T ).
352  * \f]
353  *
354  * Any temperature and composition dependence will be
355  * adjusted internally according to the information provided.
356  */
357  doublereal getSpeciesTransProp();
358 
359 protected:
360 
361  //! temperature from thermo object
362  doublereal m_temp;
363 
364  //! logarithm of current temperature
365  doublereal m_logt;
366 
367  //! most recent evaluation of transport property
368  doublereal m_prop;
369 
370  //! logarithm of most recent evaluation of transport property
371  doublereal m_logProp;
372 };
373 
374 //====================================================================================================================
375 //! Class LTPspecies_Poly holds transport parameters for a
376 //! specific liquid-phase species (LTPspecies) when the transport
377 //! property is expressed as a polynomial in temperature.
378 /*!
379  * Used for pure species properties with equations of the form
380  * \f[
381  * x = f[0] + f[1] T + ... + f[N] T^N
382  * \f]
383  * where f[i] are elements of the float array passed in.
384  *
385  * As an example of the input required for LTPspecies_Poly
386  * consider the following XML fragment
387  *
388  * \verbatim
389  * <species>
390  * <!-- thermodynamic properties -->
391  * <transport>
392  * <thermalConductivity model="coeffs">
393  * <floatArray size="2"> 0.6, -15.0e-5 </floatArray>
394  * </thermalConductivity>
395  * <!-- other transport properties -->
396  * </transport>
397  * </species>
398  * \endverbatim
399  */
401 {
402 
403 public:
404 
405  //! Construct an LTPspecies object for a liquid transport property expressed as a polynomial in temperature.
406  /*!
407  * The transport property is constructed from the XML node, \verbatim <propNode>, \endverbatim that is a child of the
408  * \verbatim <transport> \endverbatim node and specifies a type of transport property (like viscosity).
409  *
410  *
411  * @param propNode Reference to the XML node that contains the property information. This class
412  * must be parameterized by reading XML_Node information.
413  * @param name String containing the species name
414  * @param tp_ind enum TransportPropertyType containing the property id that this object
415  * is creating a parameterization for (e.g., viscosity)
416  * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
417  *
418  */
419  LTPspecies_Poly(const XML_Node& propNode, std::string name, TransportPropertyType tp_ind, const thermo_t* thermo);
420 
421  //! Copy constructor
422  /*!
423  * @param right Object to be copied
424  */
425  LTPspecies_Poly(const LTPspecies_Poly& right);
426 
427  //! Assignment operator
428  /*!
429  * @param right Object to be copied
430  */
432 
433  //! Destructor
434  virtual ~LTPspecies_Poly();
435 
436  //! Duplication routine
437  /*!
438  * @return Returns a copy of this routine as a pointer to LTPspecies
439  */
440  virtual LTPspecies* duplMyselfAsLTPspecies() const;
441 
442  //! Returns the pure species transport property
443  /*!
444  * The pure species transport property (i.e. pure species viscosity)
445  * is returned. Any temperature and composition dependence will be
446  * adjusted internally according to the information provided.
447  */
448  doublereal getSpeciesTransProp();
449 
450 protected:
451 
452  //! temperature from thermo object
453  doublereal m_temp;
454 
455  //! most recent evaluation of transport property
456  doublereal m_prop;
457 
458 };
459 
460 //====================================================================================================================
461 //! Class LTPspecies_ExpT holds transport parameters for a specific liquid-phase species (LTPspecies)
462 //! when the transport property is expressed as an exponential in temperature.
463 /*!
464  * Used for pure species properties with equations of the form
465  *
466  * \f[
467  * x = f[0] \exp( f[1] T + ... + f[N] T^{N} )
468  * \f]
469  *
470  * where f[i] are elements of the float array passed in.
471  *
472  * As an example of the input required for LTPspecies_ExpT
473  * consider the following XML fragment
474  *
475  * \verbatim
476  * <species>
477  * <!-- thermodynamic properties -->
478  * <transport>
479  * <thermalConductivity model="expT">
480  * <floatArray size="2"> 0.6, -15.0e-5 </floatArray>
481  * </thermalConductivity>
482  * <!-- other transport properties -->
483  * </transport>
484  * </species>
485  * \endverbatim
486  */
488 {
489 
490 public:
491 
492  //! Construct an LTPspecies object for a liquid transport property
493  //! expressed as an exponential in temperature.
494  /*!
495  * The transport property is constructed from the XML node, \verbatim <propNode>, \endverbatim that is a child of the
496  * \verbatim <transport> \endverbatim node and specifies a type of transport property (like viscosity).
497  *
498  *
499  * @param propNode Reference to the XML node that contains the property information. This class
500  * must be parameterized by reading XML_Node information.
501  * @param name String containing the species name
502  * @param tp_ind enum TransportPropertyType containing the property id that this object
503  * is creating a parameterization for (e.g., viscosity)
504  * @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
505  *
506  */
507  LTPspecies_ExpT(const XML_Node& propNode, std::string name,
508  TransportPropertyType tp_ind, const thermo_t* thermo);
509 
510  //! Copy constructor
511  /*!
512  * @param right Object to be copied
513  */
514  LTPspecies_ExpT(const LTPspecies_ExpT& right);
515 
516  //! Assignment operator
517  /*!
518  * @param right Object to be copied
519  */
521 
522  //! Destructor
523  virtual ~LTPspecies_ExpT();
524 
525  //! Duplication routine
526  /*!
527  * @return Returns a copy of this routine as a pointer to LTPspecies
528  */
529  virtual LTPspecies* duplMyselfAsLTPspecies() const;
530 
531  //! Returns the pure species transport property
532  /*!
533  * The pure species transport property (i.e. pure species viscosity)
534  * is returned. Any temperature and composition dependence will be
535  * adjusted internally according to the information provided.
536  */
537  doublereal getSpeciesTransProp();
538 
539 protected:
540 
541  //! temperature from thermo object
542  doublereal m_temp;
543 
544  //! most recent evaluation of transport property
545  doublereal m_prop;
546 
547 };
548 
549 //====================================================================================================================
550 
551 }
552 #endif