Skip to content

Commit

Permalink
replace v with PR
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMVale committed Dec 25, 2023
1 parent ce48700 commit 360baa1
Showing 1 changed file with 57 additions and 33 deletions.
90 changes: 57 additions & 33 deletions docs/tutorials/thermal_conductivity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@
"metadata": {},
"outputs": [],
"source": [
"from polykin.properties.thermal_conductivity import KVPC_stiel_thodos"
"from polykin.properties.thermal_conductivity import KVPC_stiel_thodos\n",
"from polykin.properties.eos import PengRobinson\n",
"import numpy as np"
]
},
{
Expand All @@ -120,7 +122,7 @@
{
"data": {
"text/plain": [
"0.016923428850625477"
"array([0.00018441])"
]
},
"execution_count": 5,
Expand All @@ -129,9 +131,31 @@
}
],
"source": [
"v = 184e-6 # m³/mol, with Peng-Robinson\n",
"\n",
"KVPC_stiel_thodos(v=v, M=28.05e-3, Tc=282.4, Pc=50.4e5, Zc=0.280)"
"Tc = 282.4 # K\n",
"Pc = 50.4e5 # Pa\n",
"eos = PengRobinson(Tc, Pc, w=0.089)\n",
"v = eos.v(350., 100e5, np.array([1.])) # m³/mol\n",
"v"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.016870676177529628"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"KVPC_stiel_thodos(v=v[0], M=28.05e-3, Tc=Tc, Pc=Pc, Zc=0.280)"
]
},
{
Expand All @@ -154,7 +178,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -170,23 +194,22 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"T = 350. # temperature, K\n",
"\n",
"y = np.array([0.5, 0.5]) # mole fractions, mol/mol\n",
"T = 350. # temperature, K\n",
"y = np.array([0.5, 0.5]) # mole fractions, mol/mol\n",
"M = np.array([28.05e-3, 42.08e-3]) # molar masses, kg/mol\n",
"\n",
"k = np.array([kv_ethylene(T), kv_propylene(T)]) # pure kv, W/(m.K)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -195,7 +218,7 @@
"0.02593529043825696"
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -215,7 +238,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -231,32 +254,33 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"0.03818087671826145"
"0.03832154985250473"
]
},
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"v = 112e-6 # m³/mol, with Peng-Robinson\n",
"\n",
"y = np.array([0.5, 0.5]) # molmol\n",
"M = np.array([28.05e-3, 42.08e-3]) # kg/mol\n",
"\n",
"Zc = np.array([0.280, 0.274])\n",
"Pc = np.array([50.4e5, 46.0e5]) # Pa\n",
"Tc = np.array([282.4, 364.9]) # K\n",
"Pc = np.array([50.4e5, 46.0e5]) # Pa\n",
"Zc = np.array([0.280, 0.274])\n",
"w = np.array([0.089, 0.144]) # kg/kg \n",
"\n",
"KVMXPC_stiel_thodos(v, y, M, Tc, Pc, Zc, w)"
"eos = PengRobinson(Tc, Pc, w)\n",
"v = eos.v(T=350., P=100e5, y=y) # m³/mol\n",
"\n",
"KVMXPC_stiel_thodos(v[0], y, M, Tc, Pc, Zc, w)"
]
},
{
Expand All @@ -274,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -290,7 +314,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -303,7 +327,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -336,12 +360,12 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [],
"source": [
"from polykin.properties.thermal_conductivity import KLMX2_li\n",
"from polykin.properties.equations import DIPPR105"
"from polykin.properties.equations import DIPPR105\n",
"from polykin.properties.thermal_conductivity import KLMX2_li"
]
},
{
Expand All @@ -353,7 +377,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -366,19 +390,19 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"w = np.array([0.5, 0.5]) # mass fractions\n",
"T = 350. # temperature, K\n",
"w = np.array([0.5, 0.5]) # mass fractions\n",
"T = 350. # temperature, K\n",
"k = np.array([kl_styrene(T), kl_butadiene(T)]) # pure kl\n",
"rho = np.array([dl_styrene(T)*104.152, dl_butadiene(T)*54.092]) # pure rhol"
]
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"outputs": [
{
Expand All @@ -387,7 +411,7 @@
"0.10808664126899356"
]
},
"execution_count": 17,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit 360baa1

Please sign in to comment.