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