diff --git a/docs/tutorials/thermal_conductivity.ipynb b/docs/tutorials/thermal_conductivity.ipynb index a352562..2a59af6 100644 --- a/docs/tutorials/thermal_conductivity.ipynb +++ b/docs/tutorials/thermal_conductivity.ipynb @@ -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" ] }, { @@ -120,7 +122,7 @@ { "data": { "text/plain": [ - "0.016923428850625477" + "array([0.00018441])" ] }, "execution_count": 5, @@ -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)" ] }, { @@ -154,7 +178,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -170,15 +194,14 @@ }, { "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)" @@ -186,7 +209,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -195,7 +218,7 @@ "0.02593529043825696" ] }, - "execution_count": 8, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -215,7 +238,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -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)" ] }, { @@ -274,7 +298,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -290,7 +314,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ @@ -303,7 +327,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -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" ] }, { @@ -353,7 +377,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -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": [ { @@ -387,7 +411,7 @@ "0.10808664126899356" ] }, - "execution_count": 17, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" }