Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
k_ij = np.asarray([[0, 0.317, 0],
[0.317, 0, -0.25],
[0, -0.25, 0]])
z = np.asarray([1., -1., 0.])
ref = 1.116 # source: R. A. Robinson and R. H. Stokes, Electrolyte Solutions: Second Revised Edition. Dover Publications, 1959.
t = 293.15 # K
s[2] = 2.7927 + 10.11*np.exp(-0.01775*t) - 1.417*np.exp(-0.01146*t) # temperature dependent segment diameter for water
k_ij[0,2] = -0.007981*t + 2.37999
k_ij[2,0] = -0.007981*t + 2.37999
dielc = dielc_water(t)
pyargs = {'m':m, 's':s, 'e':e, 'e_assoc':eAB, 'vol_a':volAB, 'k_ij':k_ij, 'z':z, 'dielc':dielc}
rho = pcsaft_den(t, 2339.3, x, pyargs, phase='liq')
result = pcsaft_osmoticC(t, rho, x, pyargs)
calc = result[0]
if print_result:
print('\n########## Test with aqueous NaCl ##########')
print('----- Osmotic coefficient at 293.15 K -----')
print(' Reference:', ref)
print(' PC-SAFT:', calc)
print(' Relative deviation:', (calc-ref)/ref*100, '%')
assert abs((calc-ref)/ref*100) < 2