Cantera 2.6.0
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"
16
17namespace 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: R. J. Kee, M. J. Coltrin, and P.
23 * Glarborg, "Chemically Reacting Flow: Theory & Practice", John Wiley & Sons,
24 * 2003.
25 *
26 * The viscosity is computed using the Wilke mixture rule (kg /m /s)
27 *
28 * \f[
29 * \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}.
30 * \f]
31 *
32 * Here \f$ \mu_k \f$ is the viscosity of pure species \e k, and
33 *
34 * \f[
35 * \Phi_{k,j} = \frac{\left[1
36 * + \sqrt{\left(\frac{\mu_k}{\mu_j}\sqrt{\frac{M_j}{M_k}}\right)}\right]^2}
37 * {\sqrt{8}\sqrt{1 + M_k/M_j}}
38 * \f]
39 *
40 * The thermal conductivity is computed from the following mixture rule:
41 * \f[
42 * \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k} \right)
43 * \f]
44 *
45 * It's used to compute the flux of energy due to a thermal gradient
46 *
47 * \f[
48 * j_T = - \lambda \nabla T
49 * \f]
50 *
51 * The flux of energy has units of energy (kg m2 /s2) per second per area.
52 *
53 * The units of lambda are W / m K which is equivalent to kg m / s^3 K.
54 * @ingroup tranprops
55 */
57{
58public:
59 //! Default constructor.
61
62 virtual std::string transportType() const {
63 return (m_mode == CK_Mode) ? "CK_Mix" : "Mix";
64 }
65
66 //! Return the thermal diffusion coefficients
67 /*!
68 * For this approximation, these are all zero.
69 *
70 * @param dt Vector of thermal diffusion coefficients. Units = kg/m/s
71 */
72 virtual void getThermalDiffCoeffs(doublereal* const dt);
73
74 //! Returns the mixture thermal conductivity (W/m /K)
75 /*!
76 * The thermal conductivity is computed from the following mixture rule:
77 * \f[
78 * \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k} \right)
79 * \f]
80 *
81 * It's used to compute the flux of energy due to a thermal gradient
82 *
83 * \f[
84 * j_T = - \lambda \nabla T
85 * \f]
86 *
87 * The flux of energy has units of energy (kg m2 /s2) per second per area.
88 *
89 * The units of lambda are W / m K which is equivalent to kg m / s^3 K.
90 *
91 * @returns the mixture thermal conductivity, with units of W/m/K
92 */
93 virtual doublereal thermalConductivity();
94
95 //! Get the Electrical mobilities (m^2/V/s).
96 /*!
97 * This function returns the mobilities. In some formulations this is equal
98 * to the normal mobility multiplied by Faraday's constant.
99 *
100 * Here, the mobility is calculated from the diffusion coefficient using the
101 * Einstein relation
102 *
103 * \f[
104 * \mu^e_k = \frac{F D_k}{R T}
105 * \f]
106 *
107 * @param mobil Returns the mobilities of the species in array \c mobil.
108 * The array must be dimensioned at least as large as the
109 * number of species.
110 */
111 virtual void getMobilities(doublereal* const mobil);
112
113 //! Update the internal parameters whenever the temperature has changed
114 /*!
115 * This is called whenever a transport property is requested if the
116 * temperature has changed since the last call to update_T().
117 */
118 virtual void update_T();
119
120 //! Update the internal parameters whenever the concentrations have changed
121 /*!
122 * This is called whenever a transport property is requested if the
123 * concentrations have changed since the last call to update_C().
124 */
125 virtual void update_C();
126
127 //! Get the species diffusive mass fluxes wrt to the mass averaged velocity,
128 //! given the gradients in mole fraction and temperature
129 /*!
130 * Units for the returned fluxes are kg m-2 s-1.
131 *
132 * The diffusive mass flux of species \e k is computed from
133 * \f[
134 * \vec{j}_k = -n M_k D_k \nabla X_k.
135 * \f]
136 *
137 * @param ndim Number of dimensions in the flux expressions
138 * @param grad_T Gradient of the temperature (length = ndim)
139 * @param ldx Leading dimension of the grad_X array
140 * (usually equal to m_nsp but not always)
141 * @param grad_X Gradients of the mole fraction. Flat vector with the
142 * m_nsp in the inner loop. length = ldx * ndim
143 * @param ldf Leading dimension of the fluxes array
144 * (usually equal to m_nsp but not always)
145 * @param fluxes Output of the diffusive mass fluxes. Flat vector with
146 * the m_nsp in the inner loop. length = ldx * ndim
147 */
148 virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
149 size_t ldx, const doublereal* const grad_X,
150 size_t ldf, doublereal* const fluxes);
151
152 virtual void init(ThermoPhase* thermo, int mode=0, int log_level=0);
153
154protected:
155 //! Update the temperature dependent parts of the species thermal
156 //! conductivities
157 /*!
158 * These are evaluated from the polynomial fits of the temperature and are
159 * assumed to be independent of pressure
160 */
161 void updateCond_T();
162
163 //! vector of species thermal conductivities (W/m /K)
164 /*!
165 * These are used in wilke's rule to calculate the viscosity of the
166 * solution. units = W /m /K = kg m /s^3 /K. length = m_kk.
167 */
169
170 //! Internal storage for the calculated mixture thermal conductivity
171 /*!
172 * Units = W /m /K
173 */
174 doublereal m_lambda;
175
176 //! Update boolean for the species thermal conductivities
178
179 //! Update boolean for the mixture rule for the mixture thermal conductivity
181};
182}
183#endif
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
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 MixTransport implements mixture-averaged transport properties for ideal gas mixtures.
Definition: MixTransport.h:57
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return the thermal diffusion coefficients.
virtual doublereal thermalConductivity()
Returns the mixture thermal conductivity (W/m /K)
virtual void update_T()
Update the internal parameters whenever the temperature has changed.
vector_fp m_cond
vector of species thermal conductivities (W/m /K)
Definition: MixTransport.h:168
bool m_spcond_ok
Update boolean for the species thermal conductivities.
Definition: MixTransport.h:177
virtual void getMobilities(doublereal *const mobil)
Get the Electrical mobilities (m^2/V/s).
void updateCond_T()
Update the temperature dependent parts of the species thermal conductivities.
MixTransport()
Default constructor.
doublereal m_lambda
Internal storage for the calculated mixture thermal conductivity.
Definition: MixTransport.h:174
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.
Definition: MixTransport.h:62
virtual void update_C()
Update the internal parameters whenever the concentrations have changed.
bool m_condmix_ok
Update boolean for the mixture rule for the mixture thermal conductivity.
Definition: MixTransport.h:180
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 ...
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