[Transport] Implement UnityLewisTransport::getMixDiffCoeffsMass

This commit is contained in:
Ray Speth 2018-06-06 23:51:33 -04:00
parent d4492f3ea3
commit a1c12b4a3b
2 changed files with 23 additions and 3 deletions

View file

@ -64,9 +64,24 @@ public:
throw NotImplementedError("UnityLewisTransport::getMixDiffCoeffsMole");
}
//! Not implemented for unity Lewis number approximation
//! Returns the unity Lewis number approximation based diffusion
//! coefficients [m^2/s].
/*!
* These are the coefficients for calculating the diffusive mass fluxes
* from the species mass fraction gradients, computed as
*
* \f[
* D_{km} = \frac{\lambda}{\rho c_p}
* \f]
*
* @param[out] d Vector of diffusion coefficients for each species (m^2/s).
* length m_nsp.
*/
virtual void getMixDiffCoeffsMass(double* const d){
throw NotImplementedError("UnityLewisTransport::getMixDiffCoeffsMass");
double Dm = thermalConductivity() / (m_thermo->density() * m_thermo->cp_mass());
for (size_t k = 0; k < m_nsp; k++) {
d[k] = Dm;
}
}
};
}

View file

@ -18,11 +18,16 @@ class TestTransport(utilities.CanteraTest):
def test_unityLewis(self):
self.phase.transport_model = 'UnityLewis'
alpha = self.phase.thermal_conductivity/(self.phase.density*self.phase.cp)
Dkm = self.phase.mix_diff_coeffs
Dkm_prime = self.phase.mix_diff_coeffs
Dkm = self.phase.mix_diff_coeffs_mass
eps = np.spacing(1) # Machine precision
self.assertTrue(all(np.diff(Dkm) < 2*eps))
self.assertNear(Dkm[0], alpha)
self.assertTrue(all(np.diff(Dkm_prime) < 2*eps))
self.assertNear(Dkm_prime[0], alpha)
def test_mixtureAveraged(self):
self.assertEqual(self.phase.transport_model, 'Mix')