Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print('------ 325 K ------')
print('\t\t\t PC-SAFT\t Reference \tRelative error')
t = 325 # K
p = 101325 # Pa
# all reference values are from PC-SAFT implemented in Aspen Plus
# Toluene ----------
x = np.asarray([1.])
m = np.asarray([2.8149])
s = np.asarray([3.7169])
e = np.asarray([285.69])
pyargs = {'m':m, 's':s, 'e':e}
den = pcsaft_den(t, p, x, pyargs, phase='liq')
ref = -96.3692 # J mol^-1 K^-1
calc = pcsaft_sres(t, den, x, pyargs)
if print_result:
print('Toluene, liquid:\t\t', calc, ref, (calc-ref)/ref*100, 'J/mol/K')
assert abs((calc-ref)/ref*100) < 1e-2
den = pcsaft_den(t, p, x, pyargs, phase='vap')
ref = -0.71398 # J mol^-1 K^-1
calc = pcsaft_sres(t, den, x, pyargs)
if print_result:
print('Toluene, vapor:\t\t', calc, ref, (calc-ref)/ref*100, 'J/mol/K')
assert abs((calc-ref)/ref*100) < 1e-2
# Acetic acid ---------
m = np.asarray([1.3403])
s = np.asarray([3.8582])
e = np.asarray([211.59])
volAB = np.asarray([0.075550])
eAB = np.asarray([3044.4])