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