Cantera
Install
User Guide
Examples
Reference
Develop
Community
4.0.0a2
Toggle main menu visibility
Loading...
Searching...
No Matches
MixTransport.h
Go to the documentation of this file.
1
/**
2
* @file MixTransport.h
3
* Headers for the MixTransport object, which models transport properties
4
* in ideal gas solutions using a mixture averaged approximation
5
* (see @ref tranprops and @link Cantera::MixTransport MixTransport @endlink) .
6
*/
7
8
// This file is part of Cantera. See License.txt in the top-level directory or
9
// at https://cantera.org/license.txt for license and copyright information.
10
11
#ifndef CT_MIXTRAN_H
12
#define CT_MIXTRAN_H
13
14
#include "
GasTransport.h
"
15
#include "
cantera/numerics/DenseMatrix.h
"
16
17
namespace
Cantera
18
{
19
//! Class MixTransport implements mixture-averaged transport properties for
20
//! ideal gas mixtures.
21
/*!
22
* The model is based on that described in Kee, et al. @cite kee2003.
23
*
24
* Specific mixture-averaged formulas are implemented by:
25
* - viscosity()
26
* - thermalConductivity()
27
* - getMixDiffCoeffs()
28
* - getMixDiffCoeffsMole()
29
* - getMixDiffCoeffsMass()
30
* - getThermalDiffCoeffs()
31
* - getMobilities()
32
*
33
* @ingroup tranprops
34
*/
35
class
MixTransport
:
public
GasTransport
36
{
37
public
:
38
//! Default constructor.
39
MixTransport
() =
default
;
40
41
string
transportModel
()
const override
{
42
return
(
m_mode
== CK_Mode) ?
"mixture-averaged-CK"
:
"mixture-averaged"
;
43
}
44
45
//! Return the thermal diffusion coefficients [kg/m/s]
46
/*!
47
* Model by S. Chapman and T.G. Cowling @cite chapman1970.
48
* For more information about this implementation and its validation,
49
* see T. Zirwes and A. Kronenburg @cite zirwes2025.
50
*
51
* The thermal diffusion coefficient of species @f$ k @f$ is computed from
52
* @f[
53
* D_k^{T}= \frac{1}{2}\rho\frac{M_k}{\bar{M}}D_{mk}'\Theta_k
54
* @f]
55
* with
56
* @f[
57
* \Theta_k=\frac{15}{2}\frac{\bar{M}^2}{\rho}\sum_i\left(\frac{1.2C_{ki}^*-1}{D_{ki}}\right)\left(\frac{Y_k\frac{\eta_i}{M_i}a_i-Y_i\frac{\eta_k}{M_k}a_k}{M_k+M_i}\right)
58
* @f]
59
* where @f$ C_{k,i}^* @f$ is a reduced collision integral and
60
* @f[
61
* a_k=\left(1+\frac{1.065}{2\sqrt{2}X_k}\sum_{i\ne k}X_i\Phi_{k,i}\right)^{-1},
62
* @f]
63
* with @f$ \Phi_{k,i} @f$ the Wilke mixing operator. The thermodiffusion
64
* coefficients are then normalized with
65
* @f[
66
* \hat{D}^T_k=D^T_k-Y_k\sum_i D^T_i.
67
* @f]
68
* This ensures that the sum of all thermodiffusion coefficients
69
* and thus the sum of all thermodiffusion fluxes are zero.
70
*
71
* @param[out] dt Vector of thermal diffusion coefficients
72
*/
73
void
getThermalDiffCoeffs
(span<double> dt)
override
;
74
75
//! Returns the mixture thermal conductivity [W/m/K]
76
/*!
77
* The thermal conductivity is computed from the following mixture rule:
78
* @f[
79
* \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k} \right)
80
* @f]
81
*
82
* It's used to compute the flux of energy due to a thermal gradient
83
*
84
* @f[
85
* \mathbf{q} = - \lambda \nabla T
86
* @f]
87
*/
88
double
thermalConductivity
()
override
;
89
90
//! Get the electrical mobilities [m²/V/s]
91
/*!
92
* This function returns the mobilities. Here, the mobility is calculated from the
93
* diffusion coefficient using the Einstein relation:
94
*
95
* @f[
96
* \mu^e_k = \frac{F D_{km}'}{R T}
97
* @f]
98
*
99
* @param mobil Returns the mobilities of the species in array @c mobil.
100
* The array must be dimensioned at least as large as the
101
* number of species.
102
*/
103
void
getMobilities
(span<double> mobil)
override
;
104
105
//! Update the internal parameters whenever the temperature has changed
106
/*!
107
* This is called whenever a transport property is requested if the
108
* temperature has changed since the last call to update_T().
109
*/
110
void
update_T
()
override
;
111
112
//! Update the internal parameters whenever the concentrations have changed
113
/*!
114
* This is called whenever a transport property is requested if the
115
* concentrations have changed since the last call to update_C().
116
*/
117
void
update_C
()
override
;
118
119
//! Get the species diffusive mass fluxes [kg/m²/s] with respect to the mass
120
//! averaged velocity, given the gradients in mole fraction and temperature.
121
/*!
122
* The diffusive mass flux of species @e k is computed from
123
* @f[
124
* \mathbf{j}_k = -\rho \frac{M_k}{\overline{M}} D_{km}' \nabla X_k.
125
* @f]
126
*
127
* @param ndim Number of dimensions in the flux expressions
128
* @param[in] grad_T Gradient of the temperature (length `ndim`)
129
* @param ldx Leading dimension of the `grad_X` array (usually equal to the number
130
* of species)
131
* @param[in] grad_X Gradients of the mole fractions; flattened matrix such that
132
* @f$ dX_k/dx_n = \tt{ grad\_X[n*ldx+k]} @f$ is the gradient of species *k*
133
* in dimension *n*. Length is `ldx` * `ndim`.
134
* @param ldf Leading dimension of the `fluxes` array (usually equal to the number
135
* of species)
136
* @param[out] fluxes The diffusive mass fluxes; flattened matrix such that
137
* @f$ j_{kn} = \tt{ fluxes[n*ldf+k]} @f$ is the flux of species *k*
138
* in dimension *n*. Length is `ldf` * `ndim`.
139
*/
140
void
getSpeciesFluxes
(
size_t
ndim, span<const double> grad_T,
141
size_t
ldx, span<const double> grad_X,
142
size_t
ldf, span<double> fluxes)
override
;
143
144
void
init
(shared_ptr<ThermoPhase>
thermo
,
int
mode=0)
override
;
145
146
protected
:
147
//! Update the temperature dependent parts of the species thermal
148
//! conductivities
149
/*!
150
* These are evaluated from the polynomial fits of the temperature and are
151
* assumed to be independent of pressure
152
*/
153
void
updateCond_T
();
154
155
//! vector of species thermal conductivities [W/m/K]
156
/*!
157
* These are used in Wilke's rule to calculate the viscosity of the
158
* solution. length = #m_nsp.
159
*/
160
vector<double>
m_cond
;
161
162
//! Internal storage for the calculated mixture thermal conductivity [W/m/K]
163
double
m_lambda
= 0.0;
164
165
//! Update boolean for the species thermal conductivities
166
bool
m_spcond_ok
=
false
;
167
168
//! Update boolean for the mixture rule for the mixture thermal conductivity
169
bool
m_condmix_ok
=
false
;
170
};
171
}
172
#endif
DenseMatrix.h
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
GasTransport.h
Cantera::GasTransport::m_mode
int m_mode
Type of the polynomial fits to temperature.
Definition
GasTransport.h:302
Cantera::MixTransport::update_T
void update_T() override
Update the internal parameters whenever the temperature has changed.
Definition
MixTransport.cpp:162
Cantera::MixTransport::thermalConductivity
double thermalConductivity() override
Returns the mixture thermal conductivity [W/m/K].
Definition
MixTransport.cpp:33
Cantera::MixTransport::m_spcond_ok
bool m_spcond_ok
Update boolean for the species thermal conductivities.
Definition
MixTransport.h:166
Cantera::MixTransport::m_lambda
double m_lambda
Internal storage for the calculated mixture thermal conductivity [W/m/K].
Definition
MixTransport.h:163
Cantera::MixTransport::updateCond_T
void updateCond_T()
Update the temperature dependent parts of the species thermal conductivities.
Definition
MixTransport.cpp:189
Cantera::MixTransport::update_C
void update_C() override
Update the internal parameters whenever the concentrations have changed.
Definition
MixTransport.cpp:175
Cantera::MixTransport::getMobilities
void getMobilities(span< double > mobil) override
Get the electrical mobilities [m²/V/s].
Definition
MixTransport.cpp:23
Cantera::MixTransport::m_cond
vector< double > m_cond
vector of species thermal conductivities [W/m/K]
Definition
MixTransport.h:160
Cantera::MixTransport::getThermalDiffCoeffs
void getThermalDiffCoeffs(span< double > dt) override
Return the thermal diffusion coefficients [kg/m/s].
Definition
MixTransport.cpp:52
Cantera::MixTransport::transportModel
string transportModel() const override
Identifies the model represented by this Transport object.
Definition
MixTransport.h:41
Cantera::MixTransport::MixTransport
MixTransport()=default
Default constructor.
Cantera::MixTransport::init
void init(shared_ptr< ThermoPhase > thermo, int mode=0) override
Initialize a transport manager.
Definition
MixTransport.cpp:17
Cantera::MixTransport::m_condmix_ok
bool m_condmix_ok
Update boolean for the mixture rule for the mixture thermal conductivity.
Definition
MixTransport.h:169
Cantera::MixTransport::getSpeciesFluxes
void getSpeciesFluxes(size_t ndim, span< const double > grad_T, size_t ldx, span< const double > grad_X, size_t ldf, span< double > fluxes) override
Get the species diffusive mass fluxes [kg/m²/s] with respect to the mass averaged velocity,...
Definition
MixTransport.cpp:128
Cantera::Transport::thermo
ThermoPhase & thermo()
Phase object.
Definition
Transport.h:111
Cantera
Namespace for the Cantera kernel.
Definition
AnyMap.cpp:595
include
cantera
transport
MixTransport.h
Generated by
1.17.0