{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "The iPSRV from Teus van der Stelt et al.\n",
      "$$\\kappa = \\kappa_0+\\kappa_1\\left\\lbrace \\sqrt{[A-D(T_r+B)]^2+E}+A-D(T_r+B) \\right\\rbrace\\sqrt{T_r+C}$$\n",
      "$$\\kappa_0 = 0.378893 + 1.4897153\\omega-0.17131848\\omega^2+0.0196554\\omega^3$$\n",
      "$$ p = \\frac{RT}{v-b}-\\frac{a}{v^2+2 b v-b^2}$$\n",
      "with\n",
      "A = 1.1\n",
      "B = 0.25\n",
      "C = 0.2\n",
      "D = 1.2\n",
      "E = 0.01\n",
      "\n",
      "For ethanol, the value $\\kappa_1$ is -0.03374\n",
      "\n",
      "For water, the value $\\kappa_1$ is -0.06635"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from CoolProp.CoolProp import Props\n",
      "from math import sqrt\n",
      "import numpy as np\n",
      "import matplotlib.pyplot as plt\n",
      "import scipy.optimize\n",
      "%matplotlib inline"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 64
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "kappa_dict = dict(Ethanol = -0.03374,\n",
      "                  Water = -0.06635,\n",
      "                  Propane = 0.03161)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 65
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Pure Fluids"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "T = 300 #[K]\n",
      "p = 3000 #[kPa]\n",
      "Fluid = 'Propane'\n",
      "rhoc = Props(Fluid,'rhocrit') #[kg/m^3]\n",
      "omega = Props(Fluid,'accentric') #[-]\n",
      "R = 8.314472/(Props(Fluid,'molemass'))\n",
      "Tc = Props(Fluid,'Tcrit')\n",
      "pc = Props(Fluid,'pcrit')\n",
      "T_r = T/Tc\n",
      "kappa_1 = kappa_dict[Fluid]\n",
      "rho_EOS = Props('D','T',T,'P',p,Fluid)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 66
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Ts = np.linspace(Props(Fluid,'Ttriple'),Tc,300)\n",
      "ps = Props('P','T',Ts,'Q',1,Fluid)\n",
      "plt.plot(Ts,ps)\n",
      "plt.xlabel('T [K]')\n",
      "plt.ylabel('p [kPa]')\n",
      "plt.yscale('log')\n",
      "plt.plot(T,p,'o')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 67,
       "text": [
        "[<matplotlib.lines.Line2D at 0x871c370>]"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAESCAYAAADqoDJEAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAH7BJREFUeJzt3XmYVOWZ9/Fvg6zi4BgmCoJToCBLWAQFFcFWUFmMxGhU\nEMfo4GhEcDJxQ983QoKIxoxENEheQAER0IgoINJELNPKLrIvArGRRQGXUZBFoev9466aqm6qu6u7\nluecqt/nus5VXadruTnd9F3PeoOIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIh4TnXXAVTgZGAx\nsAfY6jgWEREBqrkOoAIPADNdByEiIlGZThyTgL3AulLnewGbsVbFg+FzVwAbgf0Zi05ERDynG3Ae\nJRNHdWAbEABqAKuBVsBI4GlgATAbyMtkoCIi4h0BSiaOi4C3Y+4/FD4ibgX6pD8sERFJxEmuAwDO\nBHbG3N8FdIm5Pzmz4YiISHm8kDhCVX1io0aNQnv27EllLCIiuWAP9qG9Srwwq2o30CTmfhOs1VGh\nPXv2EAqFfHs8+uijzmNQ/O7jUPz+O/wceygUAmiUzB9tLySOlUBzbOyjJnAj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Pf8cP3rAX/F4j+Iv34GxVicjYHuwGWlvu/16186/nz8cf2vBvZh4xtlrdVL6tr7LXF8Fr7d\nD7yONaf2Yv3BAA2xC+ZlZcVbem1L4/A5L9lH9BduAtHmrFdjr4EljanA7PA5P13/SPwvEY3fbz8D\nsP3m5gGd8Nf1j4jEfz7+uP4XY91Sn2BdUJdj/wf8eO2TVhc4Jfz1ycAH2Oj/k0R3130Ibw2Ow4lr\nWMqKNzJAVRP7RLMd9/VSApSMvWHM178mumuxF2PPA6ZgTfZYfrn+ZcXvl59BA6LdOHWAvwM98M/1\nLyv+M2Ie4+XrH3Ep0VlVfrn2KdUU+8etxqYnRtZ+nIaNe3hxOm5kDcv3RNewlBfvw9jA1GbAdU3B\n0rHfjv0hW4v1786m5HiSl2IHmwFTjP2+RKZO9sI/1z9e/L3xz8+gLbAKi38t1t8O/rn+ZcXvl+sf\ncSnRWVV+ufYiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIpX2I6KL8T4jWpdhFbY9SMTx8LnIKuMi\nouUAOgH/ANoDN2I1EOYgIiJZr6y6DHDiZoqROjLtsKRxfsz3YreEEPEFv21yKOIlldnPpw22MedA\nrCxAVV5DxBNOch2ASA7Iw/Y1uhlY7DgWkaSpxSGSfiGs1vMd6P+cZAH9Eotkxj3h2z87jUIkBZQ4\nRDKjGBgAtARGOI5FJClKHCJVl2hp0MjjjmKV2a4BflXJ1xARkSxWejpuefLRdFzxGbU4RFLvW2wB\nYMMKHncj8BzwVdojEhEREREREREREREREREREREREZE0+f8uypooNMv09gAAAABJRU5ErkJggg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x83b4770>"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "A = 1.1\n",
      "B = 0.25\n",
      "C = 0.2\n",
      "D = 1.2\n",
      "E = 0.01\n",
      "kappa_0 = 0.378893 + 1.4897153*omega-0.17131848*omega**2+0.0196554*omega**3\n",
      "kappa = kappa_0+kappa_1*(sqrt((A-D*(T_r+B))**2+E)+A-D*(T_r+B) )*sqrt(T_r+C)\n",
      "alpha = (1+kappa*(1-sqrt(T_r)))**2\n",
      "a = 0.457235*R**2*Tc**2/pc*alpha\n",
      "b = 0.077796*R*Tc/pc"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 68
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "A = a*p/(R*R*T*T)\n",
      "B = b*p/(R*T)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 69
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Z = np.linspace(0,1)\n",
      "def f(Z):\n",
      "    return 1*Z**3+(-1+B)*Z**2+ (A-3*B*B-2*B)*Z -A*B+B**2+B**3\n",
      "plt.plot(Z,f(Z))\n",
      "plt.axhline(0,linestyle = '--')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 70,
       "text": [
        "<matplotlib.lines.Line2D at 0x8909b50>"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEACAYAAAC08h1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGZFJREFUeJzt3XuUVNWdt/GnA2jUqGiYpYkyoqByCcRgQPASW0WFSSJG\nTRwwXqJGvOD7rjVvVhzUhJ5M3nhZmqCD8YJ4d4LEAEFfFVCoaFTuF0FohB6IgEoMiCCgAlXvH7va\nbttuqO5TXaeqzvNZ66yu6tp9zvaAX3b/zj77gCRJkiRJkiRJkiRJkiRJkkrcQKAaWAHc0MjnlcCH\nwILsdnPBeiZJyrs2wEqgE9AOWAh0a9CmEphc0F5Jkpr0pYg/35cQ/KuBHcA4YHAj7SoiHkeSlCdR\ng/8wYE2992uz36svA5wILAKeA7pHPKYkKYK2EX8+k0Ob+UBHYBswCJgEHBPxuJKk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lib.figure.Figure at 0x85a6910>"
       ]
      }
     ],
     "prompt_number": 70
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Z = np.roots([1,B-1,A-2*B-3*B*B,-A*B+B**2+B**3])\n",
      "rho = p/(Z*R*T) # Z = p/(rho*R*T)\n",
      "rho"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 71,
       "text": [
        "array([  69.42536782-63.64922759j,   69.42536782+63.64922759j,\n",
        "        518.88328530 +0.j        ])"
       ]
      }
     ],
     "prompt_number": 71
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "rho_EOS"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 72,
       "text": [
        "495.5913139092507"
       ]
      }
     ],
     "prompt_number": 72
    },
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Mixtures"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "components = ['Ethanol','Water']\n",
      "z = [0.4, 0.6]\n",
      "#T = 562.8969961 #[K]\n",
      "T = 400 #[K]\n",
      "p = 12e6 #[Pa]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 117
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "omega = np.array([Props(f,'accentric') for f in components]) #[-]\n",
      "R = 8.314472 #[J/mol/K]\n",
      "Tc = [Props(f,'Tcrit') for f in components] #[K]\n",
      "pc = [Props(f,'pcrit')*1000 for f in components] #[Pa]\n",
      "\n",
      "A = 1.1\n",
      "B = 0.25\n",
      "C = 0.2\n",
      "D = 1.2\n",
      "E = 0.01\n",
      "\n",
      "kappa_0 = 0.378893 + 1.4897153*omega-0.17131848*omega**2+0.0196554*omega**3\n",
      "kappa_1 = [kappa_dict[f] for f in components]\n",
      "\n",
      "a,b = 0,0\n",
      "for i in range(len(components)):\n",
      "    \n",
      "    b += z[i]*0.077796*R*Tc[i]/pc[i]\n",
      "    \n",
      "    for j in range(len(components)):\n",
      "        kappa_i = kappa_0[i]+kappa_1[i]*(sqrt((A-D*(T/Tc[i]+B))**2+E)+A-D*(T/Tc[i]+B) )*sqrt(T/Tc[i]+C)\n",
      "        alpha_i = (1+kappa_i*(1-sqrt(T/Tc[i])))**2\n",
      "        a_i = 0.457235*R**2*Tc[i]**2/pc[i]*alpha_i\n",
      "        \n",
      "        kappa_j = kappa_0[j]+kappa_1[j]*(sqrt((A-D*(T/Tc[j]+B))**2+E)+A-D*(T/Tc[j]+B) )*sqrt(T/Tc[j]+C)\n",
      "        alpha_j = (1+kappa_j*(1-sqrt(T/Tc[j])))**2\n",
      "        a_j = 0.457235*R**2*Tc[j]**2/pc[j]*alpha_j\n",
      "        \n",
      "        if i != j:\n",
      "            k_ij = -0.3\n",
      "        else:\n",
      "            k_ij = 0\n",
      "            \n",
      "        a += z[i]*z[j]*(a_i*a_j)**0.5*(1-k_ij)\n",
      "\n",
      "AA = a*p/(R**2*T**2)\n",
      "BB = b*p/(R*T)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 118
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "coeffs = [1,BB-1,AA-2*BB-3*BB**2,-AA*BB+BB**2+BB**3]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 119
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Z = np.linspace(0,1)\n",
      "def f(Z):\n",
      "    return sum([a*Z**b for (a,b) in zip(coeffs,reversed(range(len(coeffs))))])\n",
      "plt.plot(Z,f(Z))\n",
      "plt.axhline(0,linestyle = '--')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 120,
       "text": [
        "<matplotlib.lines.Line2D at 0x97cd2d0>"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoA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23Lfbx\nf2qZR+euZK7FJqy8sy/x9X9Ysgtb4k/mWlwBPJt4vB7YADTAPgmlE1/nzZ9h/3PqABUoeXK3BeGd\n0EzmWtTGapwtXI3Mfclci4LGE95VPclciwuw+2fKYSP+5UAj90J0TTLXYjDQN/G4OvaLoapL8bmt\nDslN7voyb7YFVmMJrU/ie90TXwe9lHh9GfaRNqxKuhZjsMmqgze+fep2gC5K5u/FQWFO/JDctfgD\ntrJnOeHe46Kka1ENmIbliuXYxHcYTcLmMQ5gn/juI33zpoiIiIiIiIiIiIiIiIiIiIiIiIiIiIiI\niIiIv/0/GIpr6V1/g5sAAAAASUVORK5CYII=\n",
       "text": [
        "<matplotlib.figure.Figure at 0x966b4d0>"
       ]
      }
     ],
     "prompt_number": 120
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Z = np.roots(coeffs)\n",
      "rho = p/(Z*R*T) # Z = p/(rho*R*T), rho in [mol/m^3]\n",
      "rho"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 121,
       "text": [
        "array([  1234.16865590-3249.94868206j,   1234.16865590+3249.94868206j,\n",
        "        24827.37270034   +0.j        ])"
       ]
      }
     ],
     "prompt_number": 121
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}