Ejemplo n.º 1
0
def test_combustor():
    db = Elementdb()
    fuels = db.getmixturedata([("CH4   RRHO", 0.9168), ("C2H6", 0.0686),
                               ("C3H8", 0.0070), ("C4H10 n-butane", 0.0011)])

    combustor = Combustor(fuels, 1, db)
    assert_almost_equals(combustor.heat_of_comb(423.15), 49245710.116662093)
Ejemplo n.º 2
0
def test_combustor():
    db = Elementdb()
    fuels = db.getmixturedata([("CH4   RRHO", 0.9168),
                               ("C2H6", 0.0686),
                               ("C3H8", 0.0070),
                               ("C4H10 n-butane", 0.0011)])

    combustor = Combustor(fuels, 1, db)
    assert_almost_equals(combustor.heat_of_comb(423.15), 49245710.116662093)
Ejemplo n.º 3
0
def test_simplecombustor():
    db = Elementdb()
    methane = db.getelementdata("CH4   RRHO")
    combustor = SimpleCombustor(methane, 1.1, db)
    assert combustor.heat_of_comb(298.15) == 50027136.34030433

    # Test Ta
    butane = db.getelementdata('C4H10 n-butane')
    combustor = SimpleCombustor(butane, 1, db)
    assert combustor.heat_of_comb(298.15) == 45720359.22491768
Ejemplo n.º 4
0
def test_simplecombustor():
    db = Elementdb()
    methane = db.getelementdata("CH4   RRHO")
    combustor = SimpleCombustor(methane,1.1,db)
    assert combustor.heat_of_comb(298.15) == 50027136.34030433

    # Test Ta
    butane = db.getelementdata('C4H10 n-butane')
    combustor = SimpleCombustor(butane,1,db)
    assert combustor.heat_of_comb(298.15) == 45720359.22491768
Ejemplo n.º 5
0
def test_wark():
    """
    This function runs the 10.7 example from Wark and Richard's
    Thermodynamics, Spanish translation.
    """
    db = Elementdb()
    gas = db.getmixturedata([("AIR", 1), ("H2O", 0.015)])
    ma = MoistAir(gas)
    assert ma.w == 0.0093294500500255822
    assert ma.phi(Pressure(14.7).unit('psi'),
                  Temperature(70).unit('F')) == 0.59790008408358786
    assert ma.wet_bulb_T(Pressure(14.7).unit('psi')) == 286.14757997335232
Ejemplo n.º 6
0
def test_enthalpy():
    db = Elementdb()
    oxygen = db.getelementdata("O2 REF ELEMENT")
    enthalpy = oxygen.ho(298.15)
    assert_almost_equals(enthalpy, 1.94293914332e-05)
Ejemplo n.º 7
0
def test_nio():
    """Test NiO phases"""
    db = Elementdb()
    eq_(db.search('NiO'),
        ['NiO  Solid-A', 'NiO  Solid-B', 'NiO  Solid-C', 'NiO  Liquid'])
Ejemplo n.º 8
0
def test_enthalpy():
    db = Elementdb()
    oxygen = db.getelementdata("O2 REF ELEMENT")
    enthalpy = oxygen.ho(298.15)
    pytest.approx(enthalpy, 1.94293914332e-05)
Ejemplo n.º 9
0
def test_nio():
    """Test NiO phases"""
    db = Elementdb()
    assert db.search('NiO') == ['NiO  Solid-A', 'NiO  Solid-B', 'NiO  Solid-C', 'NiO  Liquid']