Cantera  2.4.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  * @deprecated To be removed after Cantera 2.4
68  *
69  * Subclasses handle different means of specifying transport properties like
70  * constant, %Arrhenius or polynomial temperature fits. In its current state,
71  * it is primarily suitable for specifying temperature dependence, but the
72  * adjustCoeffsForComposition() method can be implemented to adjust for the
73  * composition dependence.
74  *
75  * Mixing rules for computing mixture transport properties are handled
76  * separately in the LiquidTranInteraction subclasses.
77  */
79 {
80 public:
81  LTPspecies();
82  virtual ~LTPspecies() {}
83 
84  //! Duplication routine
85  /*!
86  * (virtual from LTPspecies)
87  *
88  * @returns a copy of this routine as a pointer to LTPspecies
89  */
90  virtual LTPspecies* duplMyselfAsLTPspecies() const;
91 
92  //! Set the ThermoPhase object, which is used to find the temperature
93  void setThermo(thermo_t* thermo) {
94  m_thermo = thermo;
95  }
96 
97  //! Set the species name
98  void setName(const std::string& name) {
99  m_speciesName = name;
100  }
101 
102  //! TransportPropertyType containing the property id that this object is
103  //! creating a parameterization for (e.g., viscosity)
105  m_property = tp_ind;
106  }
107 
108  //! Set up the species transport property from the XML node, `<propNode>`
109  //! that is a child of the `<transport>` node in the species block and
110  //! specifies a type of transport property (like viscosity)
111  virtual void setupFromXML(const XML_Node& propNode) {}
112 
113  //! Returns the vector of standard state species transport property
114  /*!
115  * The standard state species transport property is returned. Any
116  * temperature and composition dependence will be adjusted internally
117  * according to the information provided by the subclass object.
118  *
119  * @returns a single double containing the property evaluation at the
120  * current ThermoPhase temperature.
121  */
122  virtual doublereal getSpeciesTransProp();
123 
124  //! Check to see if the property evaluation will be positive
125  virtual bool checkPositive() const;
126 
127  //! Return the weight mixture
128  doublereal getMixWeight() const;
129 
130 
131 
132 private:
133  //! Internal model to adjust species-specific properties for the composition.
134  /*!
135  * Currently just a place holder, but this method could take the composition
136  * from the thermo object and adjust coefficients according to some yet
137  * unspecified model.
138  */
139  virtual void adjustCoeffsForComposition();
140 
141 protected:
142  //! Species Name for the property that is being described
143  std::string m_speciesName;
144 
145  //! Model type for the temperature dependence
147 
148  //! enum indicating which property this is (i.e viscosity)
150 
151  //! Model temperature-dependence ceofficients
153 
154  //! Pointer to a const thermo object to get current temperature
156 
157  //! Weighting used for mixing.
158  /*!
159  * This weighting can be employed to allow salt transport properties to be
160  * represented by specific ions. For example, to have Li+ and Ca+ represent
161  * the mixing transport properties of LiCl and CaCl2, the weightings for Li+
162  * would be 2.0, for K+ would be 3.0 and for Cl- would be 0.0. The transport
163  * properties for Li+ would be those for LiCl and the transport properties
164  * for Ca+ would be those for CaCl2. The transport properties for Cl- should
165  * be something innoccuous like 1.0--note that 0.0 is not innocuous if there
166  * are logarithms involved.
167  */
168  doublereal m_mixWeight;
169 };
170 
171 //! Class LTPspecies_Const holds transport parameters for a specific liquid-
172 //! phase species (LTPspecies) when the transport property is just a constant
173 //! value.
174 /*!
175  * As an example of the input required for LTPspecies_Const consider the
176  * following XML fragment
177  *
178  * \verbatim
179  * <species>
180  * <!-- thermodynamic properties -->
181  * <transport>
182  * <hydrodynamicRadius model="Constant" units="A">
183  * 1.000
184  * </hydrodynamicRadius>
185  * <!-- other transport properties -->
186  * </transport>
187  * </species>
188  * \endverbatim
189  */
191 {
192 public:
194 
195  virtual LTPspecies* duplMyselfAsLTPspecies() const;
196  virtual void setupFromXML(const XML_Node& propNode);
197 
198  // Set the (constant) property value
199  void setCoeff(double C);
200 
201  doublereal getSpeciesTransProp();
202 };
203 
204 //! Class LTPspecies_Arrhenius holds transport parameters for a specific liquid-
205 //! phase species (LTPspecies) when the transport property is expressed in
206 //! Arrhenius form.
207 /*!
208  * Used for standard state species properties with equations of the form
209  * \f[
210  * x = A T^b \exp( - E / RT )
211  * \f]
212  * where A, b, and E are passed in the XML input file.
213  *
214  * As an example of the input required for LTPspecies_Arrhenius consider the
215  * following XML fragment
216  *
217  * \verbatim
218  * <species>
219  * <!-- thermodynamic properties -->
220  * <transport>
221  * <viscosity model="Arrhenius">
222  * <!-- Janz, JPCRD, 17, supplement 2, 1988 -->
223  * <A>6.578e-5</A>
224  * <b>0.0</b>
225  * <E units="J/kmol">23788.e3</E>
226  * </viscosity>
227  * <!-- other transport properties -->
228  * </transport>
229  * </species>
230  * \endverbatim
231  */
233 {
234 public:
236  virtual LTPspecies* duplMyselfAsLTPspecies() const;
237  virtual void setupFromXML(const XML_Node& propNode);
238 
239  //! Return the standard state species value for this transport property
240  //! evaluated from the Arrhenius expression
241  /*!
242  * In general the Arrhenius expression is
243  *
244  * \f[
245  * \mu = A T^n \exp( - E / R T ).
246  * \f]
247  *
248  * Note that for viscosity, the convention is such that a positive
249  * activation energy corresponds to the typical case of a positive
250  * argument to the exponential so that the Arrhenius expression is
251  *
252  * \f[
253  * \mu = A T^n \exp( + E / R T ).
254  * \f]
255  *
256  * Any temperature and composition dependence will be adjusted internally
257  * according to the information provided.
258  */
259  doublereal getSpeciesTransProp();
260 
261  // Set the coefficients in the Arrhenius expression
262  void setCoeffs(double A, double n, double Tact);
263 
264 protected:
265  //! temperature from thermo object
266  doublereal m_temp;
267 
268  //! logarithm of current temperature
269  doublereal m_logt;
270 
271  //! most recent evaluation of transport property
272  doublereal m_prop;
273 
274  //! logarithm of most recent evaluation of transport property
275  doublereal m_logProp;
276 };
277 
278 //! Class LTPspecies_Poly holds transport parameters for a specific liquid-phase
279 //! species (LTPspecies) when the transport property is expressed as a
280 //! polynomial in temperature.
281 /*!
282  * Used for standard state species properties with equations of the form
283  * \f[
284  * x = f[0] + f[1] T + ... + f[N] T^N
285  * \f]
286  * where f[i] are elements of the float array passed in.
287  *
288  * As an example of the input required for LTPspecies_Poly consider the
289  * following XML fragment
290  *
291  * \verbatim
292  * <species>
293  * <!-- thermodynamic properties -->
294  * <transport>
295  * <thermalConductivity model="coeffs">
296  * <floatArray size="2"> 0.6, -15.0e-5 </floatArray>
297  * </thermalConductivity>
298  * <!-- other transport properties -->
299  * </transport>
300  * </species>
301  * \endverbatim
302  */
304 {
305 public:
306  LTPspecies_Poly();
307 
308  virtual LTPspecies* duplMyselfAsLTPspecies() const;
309  virtual void setupFromXML(const XML_Node& propNode);
310  doublereal getSpeciesTransProp();
311 
312  // Set the coefficients in the polynomial expression
313  void setCoeffs(size_t N, const double* coeffs);
314 
315 protected:
316  //! temperature from thermo object
317  doublereal m_temp;
318 
319  //! most recent evaluation of transport property
320  doublereal m_prop;
321 };
322 
323 //! Class LTPspecies_ExpT holds transport parameters for a specific liquid-
324 //! phase species (LTPspecies) when the transport property is expressed as an
325 //! exponential in temperature.
326 /*!
327  * Used for standard state species properties with equations of the form
328  *
329  * \f[
330  * x = f[0] \exp( f[1] T + ... + f[N] T^{N} )
331  * \f]
332  *
333  * where f[i] are elements of the float array passed in.
334  *
335  * As an example of the input required for LTPspecies_ExpT consider the
336  * following XML fragment
337  *
338  * \verbatim
339  * <species>
340  * <!-- thermodynamic properties -->
341  * <transport>
342  * <thermalConductivity model="expT">
343  * <floatArray size="2"> 0.6, -15.0e-5 </floatArray>
344  * </thermalConductivity>
345  * <!-- other transport properties -->
346  * </transport>
347  * </species>
348  * \endverbatim
349  */
351 {
352 public:
353  LTPspecies_ExpT();
354 
355  virtual LTPspecies* duplMyselfAsLTPspecies() const;
356  virtual void setupFromXML(const XML_Node& propNode);
357 
358  // Set the coefficients in the polynomial expression
359  void setCoeffs(size_t N, const double* coeffs);
360 
361  doublereal getSpeciesTransProp();
362 
363 protected:
364  //! temperature from thermo object
365  doublereal m_temp;
366 
367  //! most recent evaluation of the transport property
368  doublereal m_prop;
369 };
370 
371 }
372 #endif
doublereal m_logProp
logarithm of most recent evaluation of transport property
Definition: LTPspecies.h:275
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:67
virtual void adjustCoeffsForComposition()
Internal model to adjust species-specific properties for the composition.
Definition: LTPspecies.cpp:82
doublereal m_logt
logarithm of current temperature
Definition: LTPspecies.h:269
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
Definition: LTPspecies.cpp:178
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
Definition: LTPspecies.cpp:173
doublereal getSpeciesTransProp()
Returns the vector of standard state species transport property.
Definition: LTPspecies.cpp:229
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
Definition: LTPspecies.h:111
void setName(const std::string &name)
Set the species name.
Definition: LTPspecies.h:98
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:111
void setThermo(thermo_t *thermo)
Set the ThermoPhase object, which is used to find the temperature.
Definition: LTPspecies.h:93
std::string m_speciesName
Species Name for the property that is being described.
Definition: LTPspecies.h:143
Class LTPspecies_Arrhenius holds transport parameters for a specific liquid- phase species (LTPspecie...
Definition: LTPspecies.h:232
doublereal m_temp
temperature from thermo object
Definition: LTPspecies.h:266
virtual bool checkPositive() const
Check to see if the property evaluation will be positive.
Definition: LTPspecies.cpp:72
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
Definition: LTPspecies.cpp:62
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
Definition: LTPspecies.cpp:212
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
doublereal m_prop
most recent evaluation of transport property
Definition: LTPspecies.h:272
const thermo_t * m_thermo
Pointer to a const thermo object to get current temperature.
Definition: LTPspecies.h:155
doublereal getMixWeight() const
Return the weight mixture.
Definition: LTPspecies.cpp:77
doublereal getSpeciesTransProp()
Return the standard state species value for this transport property evaluated from the Arrhenius expr...
Definition: LTPspecies.cpp:143
LTPTemperatureDependenceType
Temperature dependence type for standard state species properties.
Definition: LTPspecies.h:56
void setTransportPropertyType(TransportPropertyType tp_ind)
TransportPropertyType containing the property id that this object is creating a parameterization for ...
Definition: LTPspecies.h:104
LTPTemperatureDependenceType m_model
Model type for the temperature dependence.
Definition: LTPspecies.h:146
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
Definition: LTPspecies.cpp:91
vector_fp m_coeffs
Model temperature-dependence ceofficients.
Definition: LTPspecies.h:152
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
Definition: LTPspecies.cpp:217
doublereal getSpeciesTransProp()
Returns the vector of standard state species transport property.
Definition: LTPspecies.cpp:190
Class LTPspecies_Const holds transport parameters for a specific liquid- phase species (LTPspecies) w...
Definition: LTPspecies.h:190
Class LTPspecies holds transport parameterizations for a specific liquid- phase species.
Definition: LTPspecies.h:78
Class LTPspecies_ExpT holds transport parameters for a specific liquid- phase species (LTPspecies) wh...
Definition: LTPspecies.h:350
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:320
doublereal m_temp
temperature from thermo object
Definition: LTPspecies.h:365
doublereal m_temp
temperature from thermo object
Definition: LTPspecies.h:317
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
Definition: LTPspecies.cpp:123
doublereal m_mixWeight
Weighting used for mixing.
Definition: LTPspecies.h:168
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
doublereal m_prop
most recent evaluation of the transport property
Definition: LTPspecies.h:368
Class LTPspecies_Poly holds transport parameters for a specific liquid-phase species (LTPspecies) whe...
Definition: LTPspecies.h:303
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
Definition: LTPspecies.cpp:106
TransportPropertyType m_property
enum indicating which property this is (i.e viscosity)
Definition: LTPspecies.h:149
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
Definition: LTPspecies.cpp:128