Cantera  2.1.2
MultiTransport.h
Go to the documentation of this file.
1 /**
2  * @file MultiTransport.h
3  * Interface for class MultiTransport
4  */
5 
6 // Copyright 2001 California Institute of Technology
7 
8 #ifndef CT_MULTITRAN_H
9 #define CT_MULTITRAN_H
10 
11 // Cantera includes
12 #include "GasTransport.h"
14 
15 namespace Cantera
16 {
17 
18 class GasTransportParams;
19 
20 //! Class MultiTransport implements multicomponent transport properties for
21 //! ideal gas mixtures.
22 /*!
23  * The implementation generally follows the procedure outlined in Kee,
24  * Coltrin, and Glarborg, "Theoretical and Practical Aspects of Chemically
25  * Reacting Flow Modeling," Wiley Interscience.
26  *
27  * @ingroup tranprops
28  */
30 {
31 protected:
32 
33  //! default constructor
34  /*!
35  * @param thermo Optional parameter for the pointer to the ThermoPhase object
36  */
38 
39 public:
40  virtual int model() const {
41  if (m_mode == CK_Mode) {
42  return CK_Multicomponent;
43  } else {
44  return cMulticomponent;
45  }
46  }
47 
48  //! Return the thermal diffusion coefficients (kg/m/s)
49  /*!
50  * Eqn. (12.126) displays how they are calculated. The reference work is from
51  * Dixon-Lewis.
52  *
53  * Eqns. (12.168) shows how they are used in an expression for the species flux.
54  *
55  * @param dt Vector of thermal diffusion coefficients. Units = kg/m/s
56  */
57  virtual void getThermalDiffCoeffs(doublereal* const dt);
58 
59  virtual doublereal thermalConductivity();
60 
61  virtual void getMultiDiffCoeffs(const size_t ld, doublereal* const d);
62 
63  //! Get the species diffusive mass fluxes wrt to the mass averaged velocity,
64  //! given the gradients in mole fraction and temperature
65  /*!
66  * Units for the returned fluxes are kg m-2 s-1.
67  *
68  * @param ndim Number of dimensions in the flux expressions
69  * @param grad_T Gradient of the temperature
70  * (length = ndim)
71  * @param ldx Leading dimension of the grad_X array
72  * (usually equal to m_nsp but not always)
73  * @param grad_X Gradients of the mole fraction
74  * Flat vector with the m_nsp in the inner loop.
75  * length = ldx * ndim
76  * @param ldf Leading dimension of the fluxes array
77  * (usually equal to m_nsp but not always)
78  * @param fluxes Output of the diffusive mass fluxes
79  * Flat vector with the m_nsp in the inner loop.
80  * length = ldx * ndim
81  */
82  virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
83  size_t ldx, const doublereal* const grad_X,
84  size_t ldf, doublereal* const fluxes);
85 
86  //! Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the thermodynamic
87  //! state at two nearby points.
88  /*!
89  * The molar diffusional fluxes are calculated with reference to the mass averaged
90  * velocity. This is a one-dimensional vector
91  *
92  * @param state1 Array of temperature, density, and mass
93  * fractions for state 1.
94  * @param state2 Array of temperature, density, and mass
95  * fractions for state 2.
96  * @param delta Distance from state 1 to state 2 (m).
97  * @param fluxes Output molar fluxes of the species.
98  * (length = m_nsp)
99  */
100  virtual void getMolarFluxes(const doublereal* const state1,
101  const doublereal* const state2,
102  const doublereal delta,
103  doublereal* const fluxes);
104 
105  //! Get the mass diffusional fluxes [kg/m^2/s] of the species, given the
106  //! thermodynamic state at two nearby points.
107  /*!
108  * The specific diffusional fluxes are calculated with reference to the
109  * mass averaged velocity. This is a one-dimensional vector
110  *
111  * @param state1 Array of temperature, density, and mass
112  * fractions for state 1.
113  * @param state2 Array of temperature, density, and mass
114  * fractions for state 2.
115  * @param delta Distance from state 1 to state 2 (m).
116  * @param fluxes Output mass fluxes of the species.
117  * (length = m_nsp)
118  */
119  virtual void getMassFluxes(const doublereal* state1,
120  const doublereal* state2, doublereal delta,
121  doublereal* fluxes);
122 
123  //! Initialize the transport operator with parameters from GasTransportParams object
124  /*!
125  * @param tr input GasTransportParams object
126  */
127  virtual bool initGas(GasTransportParams& tr);
128 
129  friend class TransportFactory;
130 
131 protected:
132  //! Update basic temperature-dependent quantities if the temperature has changed.
133  void update_T();
134 
135  //! Update basic concentration-dependent quantities if the concentrations have changed.
136  void update_C();
137 
138  //! Update the temperature-dependent terms needed to compute the thermal
139  //! conductivity and thermal diffusion coefficients.
140  void updateThermal_T();
141 
142  doublereal m_thermal_tlast;
143 
144  // property values
145  std::vector<std::vector<int> > m_poly;
146  std::vector<vector_fp> m_astar_poly;
147  std::vector<vector_fp> m_bstar_poly;
148  std::vector<vector_fp> m_cstar_poly;
149  std::vector<vector_fp> m_om22_poly;
150 
151  //! Dense matrix for astar
153 
154  //! Dense matrix for bstar
156 
157  //! Dense matrix for cstar
159 
160  //! Dense matrix for omega22
162 
163 public:
164  vector_fp m_crot;
165  vector_fp m_cinternal;
166  vector_fp m_zrot;
167  vector_fp m_eps;
168  vector_fp m_sigma;
169  vector_fp m_alpha;
170  DenseMatrix m_dipole;
171 
172 protected:
173  vector_fp m_sqrt_eps_k;
174  DenseMatrix m_log_eps_k;
175  vector_fp m_frot_298;
176  vector_fp m_rotrelax;
177 
178  doublereal m_lambda;
179 
180  // L matrix quantities
181  DenseMatrix m_Lmatrix;
182  DenseMatrix m_aa;
183  //DenseMatrix m_Lmatrix;
184  vector_fp m_a;
185  vector_fp m_b;
186 
187  // work space
188  vector_fp m_spwork1, m_spwork2, m_spwork3;
189 
190  //! Mole fraction vector from last L-matrix evaluation
192 
193  void correctBinDiffCoeffs();
194 
195  //! Boolean indicating viscosity is up to date
196  bool m_abc_ok;
197  bool m_l0000_ok;
198  bool m_lmatrix_soln_ok;
199 
200  //! Evaluate the L0000 matrices
201  /*!
202  * Evaluate the upper-left block of the L matrix.
203  * @param x vector of species mole fractions
204  */
205  void eval_L0000(const doublereal* const x);
206 
207  //! Evaluate the L0010 matrices
208  /*!
209  * @param x vector of species mole fractions
210  */
211  void eval_L0010(const doublereal* const x);
212 
213  //! Evaluate the L1000 matrices
214  void eval_L1000();
215 
216  void eval_L0100();
217  void eval_L0001();
218  void eval_L1010(const doublereal* x);
219  void eval_L1001(const doublereal* x);
220  void eval_L0110();
221  void eval_L0101(const doublereal* x);
222  bool hasInternalModes(size_t j);
223 
224  doublereal pressure_ig() {
226  }
227 
228  virtual void solveLMatrixEquation();
229  DenseMatrix incl;
230  bool m_debug;
231 };
232 }
233 #endif
virtual doublereal thermalConductivity()
Returns the mixture thermal conductivity in W/m/K.
void eval_L1000()
Evaluate the L1000 matrices.
Definition: L_matrix.h:69
DenseMatrix m_bstar
Dense matrix for bstar.
This structure holds transport model parameters relevant to transport in ideal gases with a kinetic t...
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return the thermal diffusion coefficients (kg/m/s)
virtual int model() const
Transport model.
Factory class for creating new instances of classes derived from Transport.
DenseMatrix m_astar
Dense matrix for astar.
virtual void getMassFluxes(const doublereal *state1, const doublereal *state2, doublereal delta, doublereal *fluxes)
Get the mass diffusional fluxes [kg/m^2/s] of the species, given the thermodynamic state at two nearb...
thermo_t * m_thermo
pointer to the object representing the phase
DenseMatrix m_cstar
Dense matrix for cstar.
void update_T()
Update basic temperature-dependent quantities if the temperature has changed.
doublereal molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:597
MultiTransport(thermo_t *thermo=0)
default constructor
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:101
int m_mode
Type of the polynomial fits to temperature.
Definition: GasTransport.h:160
vector_fp m_molefracs_last
Mole fraction vector from last L-matrix evaluation.
virtual void getMolarFluxes(const doublereal *const state1, const doublereal *const state2, const doublereal delta, doublereal *const fluxes)
Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the thermodynamic state at two ne...
void eval_L0000(const doublereal *const x)
Evaluate the L0000 matrices.
Definition: L_matrix.h:23
virtual void getMultiDiffCoeffs(const size_t ld, doublereal *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
virtual bool initGas(GasTransportParams &tr)
Initialize the transport operator with parameters from GasTransportParams object. ...
void updateThermal_T()
Update the temperature-dependent terms needed to compute the thermal conductivity and thermal diffusi...
thermo_t & thermo()
Class MultiTransport implements multicomponent transport properties for ideal gas mixtures...
doublereal temperature() const
Temperature (K).
Definition: Phase.h:528
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
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:66
virtual void getSpeciesFluxes(size_t ndim, const doublereal *const grad_T, size_t ldx, const doublereal *const grad_X, size_t ldf, doublereal *const fluxes)
Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole ...
bool m_abc_ok
Boolean indicating viscosity is up to date.
void eval_L0010(const doublereal *const x)
Evaluate the L0010 matrices.
Definition: L_matrix.h:46
DenseMatrix m_om22
Dense matrix for omega22.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Definition: DenseMatrix.h:70
Class GasTransport implements some functions and properties that are shared by the MixTransport and M...
Definition: GasTransport.h:16
void update_C()
Update basic concentration-dependent quantities if the concentrations have changed.