Exemple #1
0
def test_Hvap():
    """Test the enthalpy of vaporization function to see if it is working correctly."""
    # Toluene
    print('##########  Test with toluene  ##########')
    x = np.asarray([1.])
    m = np.asarray([2.8149])
    s = np.asarray([3.7169])
    e = np.asarray([285.69])
    pyargs = {}

    ref = 33500.  # source: DIPPR correlation
    p = 90998.  # source: reference equation of state from Polt, A.; Platzer, B.; Maurer, G., Parameter der thermischen Zustandsgleichung von Bender fuer 14 mehratomige reine Stoffe, Chem. Tech. (Leipzig), 1992, 44, 6, 216-224.
    calc = pcsaft_Hvap(p, x, m, s, e, 380., pyargs)[0]
    print('----- Enthalpy of vaporization at 380 K -----')
    print('    Reference:', ref, 'J mol^-1')
    print('    PC-SAFT:', calc, 'J mol^-1')
    print('    Relative deviation:', (calc - ref) / ref * 100, '%')

    # Water
    print('\n##########  Test with water  ##########')
    m = np.asarray([1.2047])
    e = np.asarray([353.95])
    volAB = np.asarray([0.0451])
    eAB = np.asarray([2425.67])
    pyargs = {'e_assoc': eAB, 'vol_a': volAB}

    ref = 44761.23  # source: IAWPS95 EOS
    p = 991.82  # source: IAWPS95 EOS
    t = 280
    s = np.asarray(
        [2.7927 + 10.11 * np.exp(-0.01775 * t) - 1.417 * np.exp(-0.01146 * t)])
    calc = pcsaft_Hvap(p, x, m, s, e, t, pyargs)[0]
    print('----- Enthalpy of vaporization at 280 K -----')
    print('    Reference:', ref, 'J mol^-1')
    print('    PC-SAFT:', calc, 'J mol^-1')
    print('    Relative deviation:', (calc - ref) / ref * 100, '%')

    # Butyl acetate
    print('\n##########  Test with butyl acetate  ##########')
    m = np.asarray([2.76462805])
    s = np.asarray([4.02244938])
    e = np.asarray([263.69902915])
    dpm = np.asarray([1.84])
    dip_num = np.asarray([4.99688339])
    pyargs = {'dipm': dpm, 'dip_num': dip_num}

    ref = 32280.  # source: DIPPR correlation
    p = 362200.  # source: DIPPR correlation
    calc = pcsaft_Hvap(p, x, m, s, e, 450., pyargs)[0]
    print('----- Enthalpy of vaporization at 450 K -----')
    print('    Reference:', ref, 'J mol^-1')
    print('    PC-SAFT:', calc, 'J mol^-1')
    print('    Relative deviation:', (calc - ref) / ref * 100, '%')

    return None
Exemple #2
0
def test_Hvap():
    """Test the enthalpy of vaporization function to see if it is working correctly."""
    # Toluene
    print('##########  Test with toluene  ##########')
    x = np.asarray([1.])
    m = np.asarray([2.8149])
    s = np.asarray([3.7169])
    e = np.asarray([285.69])

    ref = 33500. # source: DIPPR correlation
    p = 90998. # source: reference equation of state from Polt, A.; Platzer, B.; Maurer, G., Parameter der thermischen Zustandsgleichung von Bender fuer 14 mehratomige reine Stoffe, Chem. Tech. (Leipzig), 1992, 44, 6, 216-224.
    calc = pcsaft_Hvap(p, x, m, s, e, 380.)[0]
    print('----- Enthalpy of vaporization at 380 K -----')
    print('    Reference:', ref, 'J mol^-1')
    print('    PC-SAFT:', calc, 'J mol^-1')
    print('    Relative deviation:', (calc-ref)/ref*100, '%')

    # Water
    print('\n##########  Test with water  ##########')
    m = np.asarray([1.2047])
    e = np.asarray([353.95])
    volAB = np.asarray([0.0451])
    eAB = np.asarray([2425.67])

    ref = 44761.23 # source: IAWPS95 EOS
    p = 991.82 # source: IAWPS95 EOS
    t = 280
    s = np.asarray([2.7927 + 10.11*np.exp(-0.01775*t) - 1.417*np.exp(-0.01146*t)])
    calc = pcsaft_Hvap(p, x, m, s, e, t, e_assoc=eAB, vol_a=volAB)[0]
    print('----- Enthalpy of vaporization at 280 K -----')
    print('    Reference:', ref, 'J mol^-1')
    print('    PC-SAFT:', calc, 'J mol^-1')
    print('    Relative deviation:', (calc-ref)/ref*100, '%')

    # dimethyl ether
    print('\n##########  Test with dimethyl ether  ##########')
    m = np.asarray([2.2634])
    s = np.asarray([3.2723])
    e = np.asarray([210.29])
    dpm = np.asarray([1.3])
    dip_num = np.asarray([1.0])

    ref = 17410. # source: DIPPR correlation
    p = 937300. # source: DIPPR correlation
    calc = pcsaft_Hvap(p, x, m, s, e, 315., dipm=dpm, dip_num=dip_num)[0]
    print('----- Enthalpy of vaporization at 315 K -----')
    print('    Reference:', ref, 'J mol^-1')
    print('    PC-SAFT:', calc, 'J mol^-1')
    print('    Relative deviation:', (calc-ref)/ref*100, '%')

    return None