Skip to content

Commit

Permalink
add MUMXPC_dean_stiel
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Dec 9, 2023
1 parent 18ceab6 commit 4166a7c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
28 changes: 27 additions & 1 deletion src/polykin/properties/viscosity/vapor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
from polykin.types import FloatVector, FloatOrArray

import numpy as np
from math import sqrt
from scipy.constants import R

__all__ = ['MUVMX2_herning',
'MUVPC_jossi',
'MUMXPC_dean_stiel',
'MUV_lucas',
'MUVMX_lucas']
'MUVMX_lucas'
]

# %% Mixing rules

Expand Down Expand Up @@ -96,6 +99,29 @@ def MUVPC_jossi(rhor: float,
return (a**4 - 1)/xi


def MUMXPC_dean_stiel(V: float,
y: FloatVector,
M: FloatVector,
Tc: FloatVector,
Pc: FloatVector,
Zc: FloatVector,
) -> float:

M_mix = np.dot(y, M)
Tc_mix = np.dot(y, Tc)
Zc_mix = np.dot(y, Zc)
Vc = Zc*R*Tc/Pc
Vc_mix = np.dot(y, Vc)
Pc_mix = Zc_mix*R*Tc_mix/Vc_mix

rhor = Vc_mix/V
# xi = 1e3*Tc_mix**(1/6)/(sqrt(M_mix*1e3)*(Pc_mix/101325)**(2/3))
xi = 6.87e4*Tc_mix**(1/6)/(sqrt(M_mix)*(Pc_mix)**(2/3))
a = 10.8e-5*(np.exp(1.439*rhor) - np.exp(-1.111*rhor**1.858))

return a/xi


# %% Estimation methods

def MUV_lucas(T: float,
Expand Down
32 changes: 29 additions & 3 deletions tests/properties/test_viscosity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#
# Copyright Hugo Vale 2023

from polykin.properties.viscosity import MUVMX2_herning, MUVPC_jossi, \
MUV_lucas, MUVMX_lucas, MULMX2_perry
from polykin.properties.viscosity import MUVMX2_herning, MULMX2_perry, \
MUVPC_jossi, MUMXPC_dean_stiel, \
MUV_lucas, MUVMX_lucas

import numpy as np
from scipy.constants import R


def test_MUVMX2_herning():
Expand All @@ -25,7 +27,31 @@ def test_MUVPC_jossi():
rhor = 263/243.8
M = 58.12e-3
mu_pc = MUVPC_jossi(rhor, M, Tc, Pc)
assert np.isclose(mu_pc, (273-120)*1e-7, rtol=2e-2)
assert np.isclose(mu_pc, 1.53e-5, rtol=2e-2)


def test_MUMXPC_dean_stiel_1():
"Example 9-11, p. 425"
y = np.array([1.])
M = np.array([58.12e-3])
Tc = np.array([408.2])
Pc = np.array([36.5e5])
Zc = Pc*263e-6/(R*Tc)
V = 243.8e-6
mu_pc = MUMXPC_dean_stiel(V, y, M, Tc, Pc, Zc)
assert np.isclose(mu_pc, 1.53e-5, rtol=0.1)


def test_MUMXPC_dean_stiel_2():
"Example 23, p. 2-363, Perry's"
y = np.array([0.6, 0.4])
M = np.array([16.04e-3, 44.10e-3])
Tc = np.array([-110.4, 96.7]) + 273.15
Pc = np.array([4.593e6, 4.246e6])
Zc = np.array([0.288, 0.281])
V = 1/3.55e3
mu_pc = MUMXPC_dean_stiel(V, y, M, Tc, Pc, Zc)
assert np.isclose(mu_pc, 3.7e-6, rtol=0.1)


def test_MUV_lucas():
Expand Down

0 comments on commit 4166a7c

Please sign in to comment.