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