How to use the pcsaft.pcsaft_osmoticC function in pcsaft

To help you get started, we’ve selected a few pcsaft examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zmeri / PC-SAFT / tests / test_cython.py View on Github external
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

pcsaft

The PC-SAFT equation of state, including dipole, association and ion terms.

GPL-3.0
Latest version published 2 years ago

Package Health Score

39 / 100
Full package analysis

Similar packages