Beispiel #1
0
import numpy as np

from Sindri.Properties import DeltaProp
from Sindri.compounds import MixtureProp, SubstanceProp
from Sindri.eos import EOS

methane = SubstanceProp("methane", "CH4")
water = SubstanceProp("water", "H2O")

dblmethae = MixtureProp([methane, methane], [0.3, 0.7])
sglmethae = MixtureProp([methane], [1.0])


def test_class_constructor():
    k = [[0, 0], [0, 0]]
    eosname = "Peng and Robinson (1976)"
    eos = EOS(dblmethae, k, eosname)


def test_Props_for_single_compound_peng_and_robinson():
    k = [[0]]
    sglmethae = MixtureProp([methane], [1.0])
    eosname = "Peng and Robinson (1976)"
    eos = EOS(sglmethae, k, eosname)
    P, T = 1e5, 150
    zs = eos.getZfromPT(P, T)
    vs = eos.getVfromPT(P, T)
    zmin, zmax = np.min(zs), np.max(zs)
    vmin, vmax = np.min(vs), np.max(vs)
    PvpAW = eos.mix.substances[0].getPvpAW(T)
    pvp_expected = 10.47 * 1e5  # Pa
Beispiel #2
0
import numpy as np

from Sindri.Factories.EOSMixFactory import createEOSMix as VLE
from Sindri.compounds import SubstanceProp

methane = SubstanceProp("methane", "CH4")
ethane = SubstanceProp("ethane", "C2H4")
water = SubstanceProp("water", "H2O")
heptane = SubstanceProp("heptane", "C7H16")
pentane = SubstanceProp("pentane", "C5H12")
hexane = SubstanceProp("hexane", "C6H14")


def test_peneloux1982():

    eosname = "Péneloux, et al. (1982)"
    eq = VLE([methane, methane], eosname)

    p = 1e5
    t = 300
    y = [0.5, 0.5]
    i = 0

    z = eq.getZfromPT(p, t, y)
    phi = eq.getPhi_i(i, y, p, t, np.min(z))
    print(phi)


def test_PR1976():

    eosname = "Peng and Robinson (1976)"
import numpy as np

# from Sindri.VLE import *
from Sindri.Factories.EOSMixFactory import createEOSMix as VLE
from Sindri.compounds import SubstanceProp

methane = SubstanceProp("methane", "CH4")
ethane = SubstanceProp("ethane", "C2H4")
water = SubstanceProp("water", "H2O")
heptane = SubstanceProp("heptane", "C7H16")
pentane = SubstanceProp("pentane", "C5H12")
hexane = SubstanceProp("hexane", "C6H14")
benzene = SubstanceProp("benzene", "C6H6")
isobutanol = SubstanceProp("2-methyl-1-propanol (isobutanol)", "C4H10O")
cyclopentane = SubstanceProp("cyclopentane", "C5H10")

eosname = "Peng and Robinson (1976)"
k2 = [[0, 0], [0, 0]]


def test_phi_i_vrau():
    eosname = "Peng and Robinson (1976)"
    eq = VLE([benzene, isobutanol, cyclopentane], eosname)
    x = [0.2, 0.3, 0.5]
    t = 315
    p = 0.5e6
    zs = eq.getZfromPT(p, t, x)
    zvap = np.max(zs)
    zliq = np.min(zs)
    phi_vap = eq.getPhi_i(0, x, p, t, zvap)
    phi_liq = eq.getPhi_i(0, x, p, t, zliq)