def test_mix_b(): mu_h2 = cm.mu_gas('H2', 773.15) mu_n2 = cm.mu_gas('N2', 773.15) mw_h2 = cm.mw('H2') mw_n2 = cm.mw('N2') mu_mix = cm.mu_herning([mu_h2, mu_n2], [mw_h2, mw_n2], [0.85, 0.15]) assert mu_mix == approx(252.81, rel=1e-2)
def test_mu_n2_full(): mu_n2, *stats = cm.mu_gas('N2', 773, full=True) cas, tmin, tmax, a, b, c, d = stats assert mu_n2 == approx(363.82, rel=1e-2) assert cas == '7727-37-9' assert tmin == approx(63.15, rel=1e-2) assert tmax == approx(1970.0, rel=1e-2) assert a == approx(4.465557, rel=1e-2) assert b == approx(0.63813778, rel=1e-2) assert c == approx(-0.0002659562, rel=1e-2) assert d == approx(5.411268e-08, rel=1e-2)
def test_mu_graham(): mu_h2 = cm.mu_gas('H2', 773.15) mu_n2 = cm.mu_gas('N2', 773.15) mu_mix = cm.mu_graham([mu_h2, mu_n2], [0.85, 0.15]) assert mu_mix == approx(207.37, rel=1e-2)
def test_mu_c2cl2f4(): mu_c2cl2f4 = cm.mu_gas('C2Cl2F4', 900, cas='374-07-2') assert mu_c2cl2f4 == approx(314.90, rel=1e-2)
def test_mu_ch4(): mu_ch4 = cm.mu_gas('CH4', 810) assert mu_ch4 == approx(234.21, rel=1e-2)
def test_mu_n2(): mu_n2 = cm.mu_gas('N2', 773) assert mu_n2 == approx(363.82, rel=1e-2)
def test_mu_h2(): mu_h2 = cm.mu_gas('H2', 404) assert mu_h2 == approx(113.18, rel=1e-2)
""" Determine viscosity of a gas at temperature or for a range of temperatures. """ import chemics as cm import matplotlib.pyplot as plt import numpy as np # Determine viscosity of gas at temperature [K] # ---------------------------------------------------------------------------- mu_h2 = cm.mu_gas('H2', 773.15) mu_n2 = cm.mu_gas('N2', 773.15) mu_ch4 = cm.mu_gas('CH4', 773.15) # Determine viscosity of a gas mixture # ---------------------------------------------------------------------------- mu_mix = cm.mu_graham([mu_h2, mu_n2, mu_ch4], [0.4, 0.1, 0.5]) # Use coefficients to plot viscosity for range of temperatures [K] # ---------------------------------------------------------------------------- results = cm.mu_gas('CH4', 833, full=True) mu_ch4 = results[0] tmin = results[2] tmax = results[3] a, b, c, d = results[4:] tk = np.arange(tmin, tmax + 1)