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