Cantera  4.0.0a1
Loading...
Searching...
No Matches
UnityLewisTransport.h
Go to the documentation of this file.
1/**
2 * @file UnityLewisTransport.h
3 * Headers for the UnityLewisTransport object, which models transport
4 * properties in ideal gas solutions using the unity Lewis number
5 * approximation
6 * (see @ref tranprops and @link Cantera::UnityLewisTransport UnityLewisTransport @endlink) .
7 */
8
9// This file is part of Cantera. See License.txt in the top-level directory or
10// at https://cantera.org/license.txt for license and copyright information.
11
12#ifndef CT_UNITYLEWISTRAN_H
13#define CT_UNITYLEWISTRAN_H
14
15#include "MixTransport.h"
17
18namespace Cantera
19{
20//! Class UnityLewisTransport implements the unity Lewis number approximation
21//! for the mixture-averaged species diffusion coefficients. Mixture-averaged
22//! transport properties for viscosity and thermal conductivity are inherited
23//! from the MixTransport class.
24//! @ingroup tranprops
26{
27public:
28 UnityLewisTransport() = default;
29
30 string transportModel() const override {
31 return "unity-Lewis-number";
32 }
33
34 //! Returns the unity Lewis number approximation based diffusion
35 //! coefficients [m²/s].
36 /*!
37 * Returns the unity Lewis number approximation based diffusion coefficients
38 * for a gas, appropriate for calculating the mass averaged diffusive flux
39 * with respect to the mass averaged velocity using gradients of the mole
40 * fraction.
41 *
42 * @f[
43 * D^\prime_{km} = \frac{\lambda}{\rho c_p}
44 * @f]
45 *
46 * In order to obtain the expected behavior from a unity Lewis number model,
47 * this formulation requires that the correction velocity be computed as
48 *
49 * @f[
50 * V_c = \sum \frac{W_k}{\overline{W}} D^\prime_{km} \nabla X_k
51 * @f]
52 *
53 * @param[out] d Vector of diffusion coefficients for each species. length #m_nsp.
54 */
55 void getMixDiffCoeffs(span<double> d) override {
56 checkArraySize("UnityLewisTransport::getMixDiffCoeffs", d.size(), m_nsp);
57 double Dm = thermalConductivity() / (m_thermo->density() * m_thermo->cp_mass());
58 for (size_t k = 0; k < m_nsp; k++) {
59 d[k] = Dm;
60 }
61 }
62
63 //! Thermal diffusion is not enabled in the unity Lewis number model.
64 /*!
65 * @param[out] dt Thermal diffusion coefficients all set to zero.
66 */
67 void getThermalDiffCoeffs(span<double> dt) override {
68 checkArraySize("UnityLewisTransport::getThermalDiffCoeffs", dt.size(), m_nsp);
69 for (size_t k = 0; k < m_nsp; k++) {
70 dt[k] = 0.0;
71 }
72 }
73
74 //! Not implemented for unity Lewis number approximation
75 void getMixDiffCoeffsMole(span<double> d) override {
76 throw NotImplementedError("UnityLewisTransport::getMixDiffCoeffsMole");
77 }
78
79 //! Returns the unity Lewis number approximation based diffusion
80 //! coefficients [m²/s].
81 /*!
82 * These are the coefficients for calculating the diffusive mass fluxes
83 * from the species mass fraction gradients, computed as
84 *
85 * @f[
86 * D_{km} = \frac{\lambda}{\rho c_p}
87 * @f]
88 *
89 * @param[out] d Vector of diffusion coefficients for each species; length #m_nsp.
90 */
91 void getMixDiffCoeffsMass(span<double> d) override {
92 checkArraySize("UnityLewisTransport::getMixDiffCoeffsMass", d.size(), m_nsp);
93 double Dm = thermalConductivity() / (m_thermo->density() * m_thermo->cp_mass());
94 for (size_t k = 0; k < m_nsp; k++) {
95 d[k] = Dm;
96 }
97 }
98};
99}
100#endif
Headers for the MixTransport object, which models transport properties in ideal gas solutions using a...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures.
double thermalConductivity() override
Returns the mixture thermal conductivity [W/m/K].
An error indicating that an unimplemented function has been called.
shared_ptr< ThermoPhase > m_thermo
pointer to the object representing the phase
Definition Transport.h:432
size_t m_nsp
Number of species in the phase.
Definition Transport.h:435
Class UnityLewisTransport implements the unity Lewis number approximation for the mixture-averaged sp...
void getMixDiffCoeffsMole(span< double > d) override
Not implemented for unity Lewis number approximation.
void getMixDiffCoeffsMass(span< double > d) override
Returns the unity Lewis number approximation based diffusion coefficients [m²/s].
void getThermalDiffCoeffs(span< double > dt) override
Thermal diffusion is not enabled in the unity Lewis number model.
void getMixDiffCoeffs(span< double > d) override
Returns the unity Lewis number approximation based diffusion coefficients [m²/s].
string transportModel() const override
Identifies the model represented by this Transport object.
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
void checkArraySize(const char *procedure, size_t available, size_t required)
Wrapper for throwing ArraySizeError.