Cantera
2.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
include
cantera
transport
SimpleTransport.h
Go to the documentation of this file.
1
/**
2
* @file SimpleTransport.h
3
* Header file for the class SimpleTransport which provides simple
4
* transport properties for liquids and solids
5
* (see \ref tranprops and \link Cantera::SimpleTransport SimpleTransport \endlink) .
6
*/
7
#ifndef CT_SIMPLETRAN_H
8
#define CT_SIMPLETRAN_H
9
10
11
12
// STL includes
13
#include <vector>
14
#include <string>
15
#include <map>
16
#include <numeric>
17
#include <algorithm>
18
19
// Cantera includes
20
#include "
TransportBase.h
"
21
#include "
cantera/numerics/DenseMatrix.h
"
22
#include "
TransportParams.h
"
23
#include "
LiquidTransportParams.h
"
24
25
namespace
Cantera
26
{
27
28
class
LiquidTransportParams;
29
30
31
//! Class SimpleTransport implements mixture-averaged transport
32
//! properties for liquid phases.
33
/*!
34
* The model is based on that
35
* described by Newman, Electrochemical Systems
36
*
37
* The velocity of species i may be described by the
38
* following equation p. 297 (12.1)
39
*
40
* \f[
41
* c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}}
42
* (\mathbf{v}_j - \mathbf{v}_i)
43
* \f]
44
*
45
* This as written is degenerate by 1 dof.
46
*
47
* To fix this we must add in the definition of the mass averaged
48
* velocity of the solution. We will call the simple bold-faced
49
* \f$\mathbf{v} \f$
50
* symbol the mass-averaged velocity. Then, the relation
51
* between \f$\mathbf{v}\f$ and the individual species velocities is
52
* \f$\mathbf{v}_i\f$
53
*
54
* \f[
55
* \rho_i \mathbf{v}_i = \rho_i \mathbf{v} + \mathbf{j}_i
56
* \f]
57
* where \f$\mathbf{j}_i\f$ are the diffusional fluxes of species i
58
* with respect to the mass averaged velocity and
59
*
60
* \f[
61
* \sum_i \mathbf{j}_i = 0
62
* \f]
63
*
64
* and
65
*
66
* \f[
67
* \sum_i \rho_i \mathbf{v}_i = \rho \mathbf{v}
68
* \f]
69
*
70
* Using these definitions, we can write
71
*
72
* \f[
73
* \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i}
74
* \f]
75
*
76
*
77
* \f[
78
* c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}}
79
* (\frac{\mathbf{j}_j}{\rho_j} - \frac{\mathbf{j}_i}{\rho_i})
80
* = R T \sum_j \frac{1}{D_{ij}}
81
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
82
* \f]
83
*
84
* The equations that we actually solve are
85
*
86
* \f[
87
* c_i \nabla \mu_i =
88
* = R T \sum_j \frac{1}{D_{ij}}
89
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
90
* \f]
91
* and we replace the 0th equation with the following:
92
*
93
* \f[
94
* \sum_i \mathbf{j}_i = 0
95
* \f]
96
*
97
* When there are charged species, we replace the rhs with the
98
* gradient of the electrochemical potential to obtain the
99
* modified equation
100
*
101
* \f[
102
* c_i \nabla \mu_i + c_i F z_i \nabla \Phi
103
* = R T \sum_j \frac{1}{D_{ij}}
104
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
105
* \f]
106
*
107
* With this formulation we may solve for the diffusion velocities,
108
* without having to worry about what the mass averaged velocity
109
* is.
110
*
111
* <H2> Viscosity Calculation </H2>
112
*
113
* The viscosity calculation may be broken down into two parts.
114
* In the first part, the viscosity of the pure species are calculated
115
* In the second part, a mixing rule is applied. There are two mixing rules.
116
* Solvent-only and mixture-averaged.
117
*
118
* For the solvent-only mixing rule, we use the pure species viscosity calculated for
119
* the solvent as the viscosity of the entire mixture. For the mixture averaged rule
120
* we do a mole fraction based average of the pure species viscosities:
121
*
122
* Solvent-only:
123
* \f[
124
* \mu = \mu_0
125
* \f]
126
* Mixture-average:
127
* \f[
128
* \mu = \sum_k {\mu_k X_k}
129
* \f]
130
*
131
*
132
* <H2> Calculate of the Binary Diffusion Coefficients </H2>
133
*
134
* The binary diffusion coefficients are obtained from the pure species diffusion coefficients
135
* using an additive process
136
*
137
* \f[
138
* D_{i,j} = \frac{1}{2} \left( D^0_i(T) + D^0_j(T) \right)
139
* \f]
140
*
141
*
142
*
143
*
144
* <H2> Electrical Mobilities </H2>
145
*
146
* The mobility \f$ \mu^e_k \f$ is calculated from the diffusion coefficient using the Einstein relation.
147
*
148
* \f[
149
* \mu^e_k = \frac{F D_k}{R T}
150
* \f]
151
*
152
* The diffusion coefficients, \f$ D_k \f$ , is calculated from a call to the mixture diffusion
153
* coefficient routine.
154
*
155
* <H2> Species Diffusive Fluxes </H2>
156
*
157
* The diffusive mass flux of species \e k is computed from the following
158
* formula
159
*
160
* Usually the specified solution average velocity is the mass averaged velocity.
161
* This is changed in some subclasses, however.
162
*
163
* \f[
164
* j_k = - c^T M_k D_k \nabla X_k - \rho Y_k V_c
165
* \f]
166
*
167
* where V_c is the correction velocity
168
*
169
* \f[
170
* \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j}
171
* \f]
172
*
173
* In the above equation, \f$ D_k \f$ is the mixture diffusivity for species k calculated for the current
174
* conditions, which may depend on T, P, and X_k. \f$ C^T \f$ is the total concentration of the phase.
175
*
176
* When this is electrical migration, the formulas above are enhanced to
177
*
178
* \f[
179
* j_k = - C^T M_k D_k \nabla X_k + F C^T M_k \frac{D_k}{ R T } X_k z_k \nabla V - \rho Y_k V_c
180
* \f]
181
*
182
* where V_c is the correction velocity
183
*
184
* \f[
185
* \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j} + \sum_j F C^T M_j \frac{D_j}{ R T } X_j z_j \nabla V
186
* \f]
187
*
188
*
189
* <H2> Species Diffusional Velocities </H2>
190
*
191
* Species diffusional velocities are calculated from the species diffusional fluxes, within this object,
192
* using the following formula for the diffusional velocity of the kth species, \f$ V_k^d \f$
193
*
194
* \f[
195
* j_k = \rho Y_k V_k^d
196
* \f]
197
*
198
*
199
* TODO
200
* This object has to be made compatible with different types of reference velocities. Right now, elements
201
* of the formulas are only compatible with the mass-averaged velocity.
202
*
203
* @ingroup tranprops
204
*
205
*/
206
class
SimpleTransport
:
public
Transport
207
{
208
public
:
209
210
//! Default constructor.
211
/*!
212
* This requires call to initLiquid(LiquidTransportParams& tr)
213
* after filling LiquidTransportParams to complete instantiation.
214
* The filling of LiquidTransportParams is currently carried out
215
* in the TransportFactory class, but might be moved at some point.
216
*
217
* @param thermo ThermoPhase object holding species information.
218
* @param ndim Number of spatial dimensions.
219
*/
220
SimpleTransport
(
thermo_t
*
thermo
= 0,
int
ndim = 1);
221
222
//!Copy Constructor for the %LiquidThermo object.
223
/*!
224
* @param right %LiquidTransport to be copied
225
*/
226
SimpleTransport
(
const
SimpleTransport
& right);
227
228
//! Assignment operator
229
/*!
230
* This is NOT a virtual function.
231
*
232
* @param right Reference to %LiquidTransport object to be copied
233
* into the current one.
234
*/
235
SimpleTransport
&
operator=
(
const
SimpleTransport
& right);
236
237
//! Duplication routine for objects which inherit from
238
//! %Transport
239
/*!
240
* This virtual routine can be used to duplicate %Transport objects
241
* inherited from %Transport even if the application only has
242
* a pointer to %Transport to work with.
243
*
244
* These routines are basically wrappers around the derived copy
245
* constructor.
246
*/
247
virtual
Transport
*
duplMyselfAsTransport
()
const
;
248
249
250
//! virtual destructor
251
virtual
~SimpleTransport
();
252
253
//! Initialize the transport object
254
/*!
255
* Here we change all of the internal dimensions to be sufficient.
256
* We get the object ready to do property evaluations.
257
*
258
* @param tr Transport parameters for all of the species
259
* in the phase.
260
*/
261
virtual
bool
initLiquid
(
LiquidTransportParams
& tr);
262
263
//! Return the model id for this transport parameterization
264
virtual
int
model
()
const
{
265
return
cSimpleTransport;
266
}
267
268
269
//! Returns the mixture viscosity of the solution
270
/*!
271
* The viscosity is computed using the general mixture rules
272
* specified in the variable compositionDepType_.
273
*
274
* Solvent-only:
275
* \f[
276
* \mu = \mu_0
277
* \f]
278
* Mixture-average:
279
* \f[
280
* \mu = \sum_k {\mu_k X_k}
281
* \f]
282
*
283
* Here \f$ \mu_k \f$ is the viscosity of pure species \e k.
284
*
285
* units are Pa s or kg/m/s
286
*
287
* @see updateViscosity_T();
288
*/
289
virtual
doublereal
viscosity
();
290
291
//! Returns the pure species viscosities
292
/*!
293
* The pure species viscosities are to be given in an Arrhenius
294
* form in accordance with activated-jump-process dominated transport.
295
*
296
* units are Pa s or kg/m/s
297
*
298
* @param visc Return the species viscosities as a vector of
299
* length m_nsp
300
*/
301
virtual
void
getSpeciesViscosities
(doublereal*
const
visc);
302
303
//! Returns the binary diffusion coefficients
304
/*!
305
* @param ld
306
* @param d
307
*/
308
virtual
void
getBinaryDiffCoeffs
(
const
size_t
ld, doublereal*
const
d);
309
310
//! Get the Mixture diffusion coefficients
311
/*!
312
* @param d vector of mixture diffusion coefficients
313
* units = m2 s-1. length = number of species
314
*/
315
virtual
void
getMixDiffCoeffs
(doublereal*
const
d);
316
317
318
//! Return the thermal diffusion coefficients
319
/*!
320
* These are all zero for this simple implementaion
321
*
322
* @param dt thermal diffusion coefficients
323
*/
324
virtual
void
getThermalDiffCoeffs
(doublereal*
const
dt);
325
326
327
//! Returns the mixture thermal conductivity of the solution
328
/*!
329
* The thermal is computed using the general mixture rules
330
* specified in the variable compositionDepType_.
331
*
332
* Controlling update boolean = m_condmix_ok
333
*
334
* Units are in W/m/K or equivalently kg m / s3 / K
335
*
336
* Solvent-only:
337
* \f[
338
* \lambda = \lambda_0
339
340
* \f]
341
* Mixture-average:
342
* \f[
343
* \lambda = \sum_k {\lambda_k X_k}
344
* \f]
345
*
346
* Here \f$ \lambda_k \f$ is the thermal conductivity of pure species \e k.
347
*
348
* @see updateCond_T();
349
*/
350
351
virtual
doublereal
thermalConductivity
();
352
353
//! Get the electrical Mobilities (m^2/V/s).
354
/*!
355
* This function returns the mobilities. In some formulations
356
* this is equal to the normal mobility multiplied by faraday's constant.
357
*
358
* Frequently, but not always, the mobility is calculated from the
359
* diffusion coefficient using the Einstein relation
360
*
361
* \f[
362
* \mu^e_k = \frac{F D_k}{R T}
363
* \f]
364
*
365
* @param mobil_e Returns the mobilities of
366
* the species in array \c mobil_e. The array must be
367
* dimensioned at least as large as the number of species.
368
*/
369
virtual
void
getMobilities
(doublereal*
const
mobil_e);
370
371
//! Get the fluid mobilities (s kmol/kg).
372
/*!
373
* This function returns the fluid mobilities. Usually, you have
374
* to multiply Faraday's constant into the resulting expression
375
* to general a species flux expression.
376
*
377
* Frequently, but not always, the mobility is calculated from the
378
* diffusion coefficient using the Einstein relation
379
*
380
* \f[
381
* \mu^f_k = \frac{D_k}{R T}
382
* \f]
383
*
384
*
385
* @param mobil_f Returns the mobilities of
386
* the species in array \c mobil. The array must be
387
* dimensioned at least as large as the number of species.
388
*/
389
virtual
void
getFluidMobilities
(doublereal*
const
mobil_f);
390
391
//! Specify the value of the gradient of the voltage
392
/*!
393
*
394
* @param grad_V Gradient of the voltage (length num dimensions);
395
*/
396
virtual
void
set_Grad_V
(
const
doublereal*
const
grad_V);
397
398
//! Specify the value of the gradient of the temperature
399
/*!
400
* @param grad_T Gradient of the temperature (length num dimensions);
401
*/
402
virtual
void
set_Grad_T
(
const
doublereal*
const
grad_T);
403
404
//! Specify the value of the gradient of the MoleFractions
405
/*!
406
*
407
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
408
*/
409
virtual
void
set_Grad_X
(
const
doublereal*
const
grad_X);
410
411
//! Get the species diffusive velocities wrt to the averaged velocity,
412
//! given the gradients in mole fraction and temperature
413
/*!
414
* The average velocity can be computed on a mole-weighted
415
* or mass-weighted basis, or the diffusion velocities may
416
* be specified as relative to a specific species (i.e. a
417
* solvent) all according to the velocityBasis input parameter.
418
*
419
* Units for the returned velocities are m s-1.
420
*
421
* @param ndim Number of dimensions in the flux expressions
422
* @param grad_T Gradient of the temperature
423
* (length = ndim)
424
* @param ldx Leading dimension of the grad_X array
425
* (usually equal to m_nsp but not always)
426
* @param grad_X Gradients of the mole fraction
427
* Flat vector with the m_nsp in the inner loop.
428
* length = ldx * ndim
429
* @param ldf Leading dimension of the fluxes array
430
* (usually equal to m_nsp but not always)
431
* @param Vdiff Output of the diffusive velocities.
432
* Flat vector with the m_nsp in the inner loop.
433
* length = ldx * ndim
434
*/
435
virtual
void
getSpeciesVdiff
(
size_t
ndim,
436
const
doublereal* grad_T,
437
int
ldx,
438
const
doublereal* grad_X,
439
int
ldf,
440
doublereal* Vdiff);
441
442
//! Get the species diffusive velocities wrt to the averaged velocity,
443
//! given the gradients in mole fraction, temperature and electrostatic potential.
444
/*!
445
* The average velocity can be computed on a mole-weighted
446
* or mass-weighted basis, or the diffusion velocities may
447
* be specified as relative to a specific species (i.e. a
448
* solvent) all according to the velocityBasis input parameter.
449
*
450
* Units for the returned velocities are m s-1.
451
*
452
* @param ndim Number of dimensions in the flux expressions
453
* @param grad_T Gradient of the temperature
454
* (length = ndim)
455
* @param ldx Leading dimension of the grad_X array
456
* (usually equal to m_nsp but not always)
457
* @param grad_X Gradients of the mole fraction
458
* Flat vector with the m_nsp in the inner loop.
459
* length = ldx * ndim
460
* @param ldf Leading dimension of the fluxes array
461
* (usually equal to m_nsp but not always)
462
* @param grad_Phi Gradients of the electrostatic potential
463
* (length = ndim)
464
* @param Vdiff Output of the species diffusion velocities
465
* Flat vector with the m_nsp in the inner loop.
466
* length = ldx * ndim
467
*/
468
virtual
void
getSpeciesVdiffES
(
size_t
ndim,
const
doublereal* grad_T,
469
int
ldx,
const
doublereal* grad_X,
470
int
ldf,
const
doublereal* grad_Phi,
471
doublereal* Vdiff);
472
473
474
//! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity,
475
//! given the gradients in mole fraction and temperature
476
/*!
477
* units = kg/m2/s
478
*
479
* The diffusive mass flux of species \e k is computed from the following
480
* formula
481
*
482
* Usually the specified solution average velocity is the mass averaged velocity.
483
* This is changed in some subclasses, however.
484
*
485
* \f[
486
* j_k = - \rho M_k D_k \nabla X_k - Y_k V_c
487
* \f]
488
*
489
* where V_c is the correction velocity
490
*
491
* \f[
492
* V_c = - \sum_j {\rho M_j D_j \nabla X_j}
493
* \f]
494
*
495
*
496
* @param ndim The number of spatial dimensions (1, 2, or 3).
497
* @param grad_T The temperature gradient (ignored in this model).
498
* @param ldx Leading dimension of the grad_X array.
499
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
500
* @param ldf Leading dimension of the fluxes array.
501
* @param fluxes Output fluxes of species.
502
*/
503
virtual
void
getSpeciesFluxes
(
size_t
ndim,
const
doublereal*
const
grad_T,
504
size_t
ldx,
const
doublereal*
const
grad_X,
505
size_t
ldf, doublereal*
const
fluxes);
506
507
//! Return the species diffusive mass fluxes wrt to
508
//! the mass averaged velocity,
509
/*!
510
*
511
* units = kg/m2/s
512
*
513
* Internally, gradients in the in mole fraction, temperature
514
* and electrostatic potential contribute to the diffusive flux
515
*
516
*
517
* The diffusive mass flux of species \e k is computed from the following
518
* formula
519
*
520
* \f[
521
* j_k = - \rho M_k D_k \nabla X_k - Y_k V_c
522
* \f]
523
*
524
* where V_c is the correction velocity
525
*
526
* \f[
527
* V_c = - \sum_j {\rho M_j D_j \nabla X_j}
528
* \f]
529
*
530
* @param ldf stride of the fluxes array. Must be equal to
531
* or greater than the number of species.
532
* @param fluxes Vector of calculated fluxes
533
*/
534
virtual
void
getSpeciesFluxesExt
(
size_t
ldf, doublereal* fluxes);
535
536
protected
:
537
538
//! Handles the effects of changes in the Temperature, internally
539
//! within the object.
540
/*!
541
* This is called whenever a transport property is requested.
542
* The first task is to check whether the temperature has changed
543
* since the last call to update_T().
544
* If it hasn't then an immediate return is carried out.
545
*
546
* @internal
547
*
548
* @return Returns true if the temperature has changed, and false otherwise
549
*/
550
virtual
bool
update_T
();
551
552
//! Handles the effects of changes in the mixture concentration
553
/*!
554
* This is called for every interface call to check whether
555
* the concentrations have changed. Concentrations change
556
* whenever the pressure or the mole fraction has changed.
557
* If it has changed, the recalculations should be done.
558
*
559
* Note this should be a lightweight function since it's
560
* part of all of the interfaces.
561
*
562
* @internal
563
*/
564
virtual
bool
update_C
();
565
566
//! Update the temperature-dependent viscosity terms.
567
//! Updates the array of pure species viscosities, and the
568
//! weighting functions in the viscosity mixture rule.
569
/*!
570
* The flag m_visc_temp_ok is set to true.
571
*/
572
void
updateViscosity_T
();
573
574
//! Update the temperature-dependent parts of the mixture-averaged
575
//! thermal conductivity.
576
void
updateCond_T
();
577
578
//! Update the concentration parts of the viscosities
579
/*!
580
* Internal routine is run whenever the update_boolean
581
* is false. This routine will calculate
582
* internal values for the species viscosities.
583
*
584
* @internal
585
*/
586
void
updateViscosities_C
();
587
588
//! Update the binary diffusion coefficients wrt T.
589
/*!
590
* These are evaluated
591
* from the polynomial fits at unit pressure (1 Pa).
592
*/
593
void
updateDiff_T
();
594
595
596
private
:
597
//! Temperature dependence type
598
/*!
599
* The following coefficients are allowed to have simple
600
* temperature dependencies:
601
* mixture viscosity
602
* mixture thermal conductivity
603
* diffusitivy
604
*
605
* Types of temperature dependencies:
606
* 0 - Independent of temperature (only one implemented so far)
607
* 1 - extended arrhenius form
608
* 2 - polynomial in temperature form
609
*/
610
int
tempDepType_
;
611
612
//! Composition dependence of the transport properties
613
/*!
614
* The following coefficients are allowed to have simple
615
* composition dependencies
616
* mixture viscosity
617
* mixture thermal conductivity
618
*
619
*
620
* Types of composition dependencies
621
* 0 - Solvent values (i.e., species 0) contributes only
622
* 1 - linear combination of mole fractions;
623
*/
624
int
compositionDepType_
;
625
626
//! Boolean indicating whether to use the hydrodynamic radius formulation
627
/*!
628
* If true, then the diffusion coefficient is calculated from the
629
* hydrodynamic radius.
630
*/
631
bool
useHydroRadius_
;
632
633
//! Boolean indicating whether electro-migration term should be
634
//! added
635
/*!
636
*
637
*/
638
bool
doMigration_
;
639
640
//! Minimum temperature applicable to the transport property eval
641
doublereal
m_tmin
;
642
643
//! Maximum temperature applicable to the transport property evaluator
644
doublereal
m_tmax
;
645
646
//! Local Copy of the molecular weights of the species
647
/*!
648
* Length is Equal to the number of species in the mechanism.
649
*/
650
vector_fp
m_mw
;
651
652
//! Pure species viscosities in Arrhenius temperature-dependent form.
653
std::vector<LTPspecies*>
m_coeffVisc_Ns
;
654
655
//! Pure species thermal conductivities in Arrhenius temperature-dependent form.
656
/*!
657
*
658
*/
659
std::vector<LTPspecies*>
m_coeffLambda_Ns
;
660
661
662
//! Pure species viscosities in Arrhenius temperature-dependent form.
663
std::vector<LTPspecies*>
m_coeffDiff_Ns
;
664
665
666
//! Hydrodynamic radius in LTPspecies form
667
std::vector<LTPspecies*>
m_coeffHydroRadius_Ns
;
668
669
670
//! Internal value of the gradient of the mole fraction vector
671
/*!
672
* Note, this is the only gradient value that can and perhaps
673
* should reflect the true state of the mole fractions in the
674
* application solution vector. In other words no cropping or
675
* massaging of the values to make sure they are above zero
676
* should occur. - developing ....
677
*
678
* m_nsp is the number of species in the fluid
679
* k is the species index
680
* n is the dimensional index (x, y, or z). It has a length
681
* equal to m_nDim
682
*
683
* m_Grad_X[n*m_nsp + k]
684
*/
685
vector_fp
m_Grad_X
;
686
687
//! Internal value of the gradient of the Temperature vector
688
/*!
689
* Generally, if a transport property needs this
690
* in its evaluation it will look to this place
691
* to get it.
692
*
693
* No internal property is precalculated based on gradients.
694
* Gradients are assumed to be freshly updated before
695
* every property call.
696
*/
697
vector_fp
m_Grad_T
;
698
699
//! Internal value of the gradient of the Pressure vector
700
/*!
701
* Generally, if a transport property needs this
702
* in its evaluation it will look to this place
703
* to get it.
704
*
705
* No internal property is precalculated based on gradients.
706
* Gradients are assumed to be freshly updated before
707
* every property call.
708
*/
709
vector_fp
m_Grad_P
;
710
711
//! Internal value of the gradient of the Electric Voltage
712
/*!
713
* Generally, if a transport property needs this
714
* in its evaluation it will look to this place
715
* to get it.
716
*
717
* No internal property is precalculated based on gradients.
718
* Gradients are assumed to be freshly updated before
719
* every property call.
720
*/
721
vector_fp
m_Grad_V
;
722
723
724
// property values
725
726
727
728
//! Vector of Species Diffusivities
729
/*!
730
* Depends on the temperature. We have set the pressure dependence
731
* to zero for this liquid phase constituitve model
732
*
733
* units m2/s
734
*/
735
vector_fp
m_diffSpecies
;
736
737
//! Species viscosities
738
/*!
739
* Viscosity of the species
740
* Length = number of species
741
*
742
* Depends on the temperature. We have set the pressure dependence
743
* to zero for this model
744
*
745
* controlling update boolean -> m_visc_temp_ok
746
*/
747
vector_fp
m_viscSpecies
;
748
749
//! Internal value of the species individual thermal conductivities
750
/*!
751
* Then a mixture rule is applied to get the solution conductivities
752
*
753
* Depends on the temperature and perhaps pressure, but
754
* not the species concentrations
755
*
756
* controlling update boolean -> m_cond_temp_ok
757
*/
758
vector_fp
m_condSpecies
;
759
760
//! State of the mole fraction vector.
761
int
m_iStateMF
;
762
763
//! Local copy of the mole fractions of the species in the phase
764
/*!
765
* The mole fractions here are assumed to be bounded by 0.0 and 1.0
766
* and they are assumed to add up to one exactly. This mole
767
* fraction vector comes from the ThermoPhase object. Derivative
768
* quantities from this are referred to as bounded.
769
*
770
* Update info?
771
* length = m_nsp
772
*/
773
vector_fp
m_molefracs
;
774
775
776
//! Local copy of the concentrations of the species in the phase
777
/*!
778
* The concentrations are consistent with the m_molefracs
779
* vector which is bounded and sums to one.
780
*
781
* Update info?
782
* length = m_nsp
783
*/
784
vector_fp
m_concentrations
;
785
786
//! Local copy of the total concentration.
787
/*!
788
* This is consistent with the m_concentrations[] and
789
* m_molefracs[] vector.
790
*/
791
doublereal
concTot_
;
792
793
//! Mean molecular weight
794
doublereal
meanMolecularWeight_
;
795
796
//! Density
797
doublereal
dens_
;
798
799
//! Local copy of the charge of each species
800
/*!
801
* Contains the charge of each species (length m_nsp)
802
*/
803
vector_fp
m_chargeSpecies
;
804
805
//! Current Temperature -> locally stored
806
/*!
807
* This is used to test whether new temperature computations
808
* should be performed.
809
*/
810
doublereal
m_temp
;
811
812
813
//! Current value of the pressure
814
doublereal
m_press
;
815
816
817
//! Saved value of the mixture thermal conductivity
818
doublereal
m_lambda
;
819
820
//! Saved value of the mixture viscosity
821
doublereal
m_viscmix
;
822
823
//! work space
824
/*!
825
* Length is equal to m_nsp
826
*/
827
vector_fp
m_spwork
;
828
829
vector_fp
m_fluxes;
830
831
832
833
private
:
834
//! Boolean indicating that the top-level mixture viscosity is current
835
/*!
836
* This is turned false for every change in T, P, or C.
837
*/
838
bool
m_visc_mix_ok
;
839
840
//! Boolean indicating that weight factors wrt viscosity is current
841
bool
m_visc_temp_ok
;
842
843
//! Boolean indicating that mixture diffusion coeffs are current
844
bool
m_diff_mix_ok
;
845
846
//! Boolean indicating that binary diffusion coeffs are current
847
bool
m_diff_temp_ok
;
848
849
//! Flag to indicate that the pure species conductivities
850
//! are current wrt the temperature
851
bool
m_cond_temp_ok
;
852
853
//! Boolean indicating that mixture conductivity is current
854
bool
m_cond_mix_ok
;
855
856
857
//! Number of dimensions
858
/*!
859
* Either 1, 2, or 3
860
*/
861
size_t
m_nDim
;
862
863
//! Temporary variable that stores the rho Vc value
864
double
rhoVc
[3];
865
866
private
:
867
868
//! Throw an exception if this method is invoked.
869
/*!
870
* This probably indicates something is not yet implemented.
871
*
872
* @param msg Indicates the member function which is not implemented
873
*/
874
doublereal
err
(std::string msg)
const
;
875
876
};
877
}
878
#endif
879
880
881
882
883
884
Generated by
1.8.2