Cantera 2.6.0
MultiTransport.h
Go to the documentation of this file.
1/**
2 * @file MultiTransport.h
3 * Interface for class MultiTransport
4 */
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
9#ifndef CT_MULTITRAN_H
10#define CT_MULTITRAN_H
11
12// Cantera includes
13#include "GasTransport.h"
14
15namespace Cantera
16{
17//! Class MultiTransport implements multicomponent transport properties for
18//! ideal gas mixtures.
19/*!
20 * The implementation generally follows the procedure outlined in: R. J. Kee, M.
21 * J. Coltrin, and P. Glarborg, "Chemically Reacting Flow: Theory & Practice",
22 * John Wiley & Sons, 2003.
23 *
24 * @ingroup tranprops
25 */
27{
28public:
29 //! default constructor
30 /*!
31 * @param thermo Optional parameter for the pointer to the ThermoPhase object
32 */
34
35 virtual std::string transportType() const {
36 return (m_mode == CK_Mode) ? "CK_Multi" : "Multi";
37 }
38
39 //! Return the thermal diffusion coefficients (kg/m/s)
40 /*!
41 * Eqn. (12.126) displays how they are calculated. The reference work is
42 * from Dixon-Lewis.
43 *
44 * Eqns. (12.168) shows how they are used in an expression for the species
45 * flux.
46 *
47 * @param dt Vector of thermal diffusion coefficients. Units = kg/m/s
48 */
49 virtual void getThermalDiffCoeffs(doublereal* const dt);
50
51 virtual doublereal thermalConductivity();
52
53 virtual void getMultiDiffCoeffs(const size_t ld, doublereal* const d);
54
55 //! Get the species diffusive mass fluxes wrt to the mass averaged velocity,
56 //! given the gradients in mole fraction and temperature
57 /*!
58 * Units for the returned fluxes are kg m-2 s-1.
59 *
60 * @param ndim Number of dimensions in the flux expressions
61 * @param grad_T Gradient of the temperature (length = ndim)
62 * @param ldx Leading dimension of the grad_X array. (usually equal to
63 * m_nsp but not always)
64 * @param grad_X Gradients of the mole fraction. Flat vector with the
65 * m_nsp in the inner loop. length = ldx * ndim
66 * @param ldf Leading dimension of the fluxes array. (usually equal to
67 * m_nsp but not always)
68 * @param fluxes Output of the diffusive mass fluxes. Flat vector with the
69 * m_nsp in the inner loop. length = ldx * ndim
70 */
71 virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
72 size_t ldx, const doublereal* const grad_X,
73 size_t ldf, doublereal* const fluxes);
74
75 //! Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the
76 //! thermodynamic state at two nearby points.
77 /*!
78 * The molar diffusional fluxes are calculated with reference to the mass
79 * averaged velocity. This is a one-dimensional vector
80 *
81 * @param state1 Array of temperature, density, and mass
82 * fractions for state 1.
83 * @param state2 Array of temperature, density, and mass
84 * fractions for state 2.
85 * @param delta Distance from state 1 to state 2 (m).
86 * @param fluxes Output molar fluxes of the species. (length = m_nsp)
87 */
88 virtual void getMolarFluxes(const doublereal* const state1,
89 const doublereal* const state2,
90 const doublereal delta,
91 doublereal* const fluxes);
92
93 //! Get the mass diffusional fluxes [kg/m^2/s] of the species, given the
94 //! thermodynamic state at two nearby points.
95 /*!
96 * The specific diffusional fluxes are calculated with reference to the
97 * mass averaged velocity. This is a one-dimensional vector
98 *
99 * @param state1 Array of temperature, density, and mass
100 * fractions for state 1.
101 * @param state2 Array of temperature, density, and mass
102 * fractions for state 2.
103 * @param delta Distance from state 1 to state 2 (m).
104 * @param fluxes Output mass fluxes of the species. (length = m_nsp)
105 */
106 virtual void getMassFluxes(const doublereal* state1,
107 const doublereal* state2, doublereal delta,
108 doublereal* fluxes);
109
110 virtual void init(ThermoPhase* thermo, int mode=0, int log_level=0);
111
112protected:
113 //! Update basic temperature-dependent quantities if the temperature has
114 //! changed.
115 void update_T();
116
117 //! Update basic concentration-dependent quantities if the concentrations
118 //! have changed.
119 void update_C();
120
121 //! Update the temperature-dependent terms needed to compute the thermal
122 //! conductivity and thermal diffusion coefficients.
123 void updateThermal_T();
124
125 doublereal m_thermal_tlast;
126
127 //! Dense matrix for astar
129
130 //! Dense matrix for bstar
132
133 //! Dense matrix for cstar
135
136 vector_fp m_cinternal;
137
138 vector_fp m_sqrt_eps_k;
139 DenseMatrix m_log_eps_k;
140 vector_fp m_frot_298;
141 vector_fp m_rotrelax;
142
143 doublereal m_lambda;
144
145 // L matrix quantities
146 DenseMatrix m_Lmatrix;
147 DenseMatrix m_aa;
148 vector_fp m_a;
149 vector_fp m_b;
150
151 // work space
152 vector_fp m_spwork1, m_spwork2, m_spwork3;
153
154 //! Mole fraction vector from last L-matrix evaluation
156
157 void correctBinDiffCoeffs();
158
159 //! Boolean indicating viscosity is up to date
161 bool m_l0000_ok;
162 bool m_lmatrix_soln_ok;
163
164 //! Evaluate the L0000 matrices
165 /*!
166 * Evaluate the upper-left block of the L matrix.
167 * @param x vector of species mole fractions
168 */
169 void eval_L0000(const doublereal* const x);
170
171 //! Evaluate the L0010 matrices
172 /*!
173 * @param x vector of species mole fractions
174 */
175 void eval_L0010(const doublereal* const x);
176
177 //! Evaluate the L1000 matrices
178 void eval_L1000();
179
180 void eval_L0100();
181 void eval_L0001();
182 void eval_L1010(const doublereal* x);
183 void eval_L1001(const doublereal* x);
184 void eval_L0110();
185 void eval_L0101(const doublereal* x);
186 bool hasInternalModes(size_t j);
187
188 double pressure_ig();
189
190 virtual void solveLMatrixEquation();
191 DenseMatrix incl;
192 bool m_debug;
193};
194}
195#endif
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Definition: DenseMatrix.h:51
Class GasTransport implements some functions and properties that are shared by the MixTransport and M...
Definition: GasTransport.h:31
int m_mode
Type of the polynomial fits to temperature.
Definition: GasTransport.h:315
Class MultiTransport implements multicomponent transport properties for ideal gas mixtures.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return the thermal diffusion coefficients (kg/m/s)
void eval_L0000(const doublereal *const x)
Evaluate the L0000 matrices.
MultiTransport(ThermoPhase *thermo=0)
default constructor
virtual doublereal thermalConductivity()
Returns the mixture thermal conductivity in W/m/K.
virtual void getMultiDiffCoeffs(const size_t ld, doublereal *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
void update_T()
Update basic temperature-dependent quantities if the temperature has changed.
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...
vector_fp m_molefracs_last
Mole fraction vector from last L-matrix evaluation.
DenseMatrix m_astar
Dense matrix for astar.
void updateThermal_T()
Update the temperature-dependent terms needed to compute the thermal conductivity and thermal diffusi...
DenseMatrix m_cstar
Dense matrix for cstar.
virtual void init(ThermoPhase *thermo, int mode=0, int log_level=0)
Initialize a transport manager.
virtual std::string transportType() const
Identifies the Transport object type.
void update_C()
Update basic concentration-dependent quantities if the concentrations have changed.
void eval_L0010(const doublereal *const x)
Evaluate the L0010 matrices.
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.
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...
DenseMatrix m_bstar
Dense matrix for bstar.
void eval_L1000()
Evaluate the L1000 matrices.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
ThermoPhase & thermo()
Namespace for the Cantera kernel.
Definition: AnyMap.h:29
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:184