diff --git a/include/cantera/transport/UnityLewisTransport.h b/include/cantera/transport/UnityLewisTransport.h index e4f4c49f8..9ad655212 100644 --- a/include/cantera/transport/UnityLewisTransport.h +++ b/include/cantera/transport/UnityLewisTransport.h @@ -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; + } } }; } diff --git a/interfaces/cython/cantera/test/test_transport.py b/interfaces/cython/cantera/test/test_transport.py index 0848fad2b..318faa97a 100644 --- a/interfaces/cython/cantera/test/test_transport.py +++ b/interfaces/cython/cantera/test/test_transport.py @@ -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')