{
 "metadata": {
  "name": "",
  "signature": "sha256:ac2f423a0dd7909a3558159c9b6408459426072d293b0494654db2eec3dde604"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 28 : Heats of Solution and Mixing"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 28.1 page no. 869\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Ref_T = 77. ;\t\t\t#Reference temperature-[degree F]\n",
      "\n",
      "#(a)\n",
      "mol_NH3 = 1. ;\t\t\t# Moles of NH3 - [lb mol]\n",
      "mw_NH3 = 17. ;\t\t\t#Molecular t. of NH3 -[lb]\n",
      "mw_H2O = 18.  ;\t\t\t#Molecular t. of H2O -[lb]\n",
      "\n",
      "# Calculations and Results\n",
      "f1_NH3 = 3./100 ;\t\t\t# Fraction of NH3 in solution \n",
      "m_H2O = (mw_NH3/f1_NH3) - mw_NH3 ;\t\t\t# Mass of water in solution -[lb]\n",
      "mol_H2O = m_H2O/mw_H2O  ;\t\t\t# Moles of H2O in solution -[lb mol]\n",
      "\n",
      "print '(a)  Moles of H2O in solution is %.1f  lb mol . '%mol_H2O\n",
      "print '     As we can see that moles of water is 30 lb mol(approx), hence we will see H_soln from table corresponding to 30 lb mol water . '\n",
      "H_soln = -14800. ;\t\t\t# From table given in question in book -[Btu/lb mol NH3]\n",
      "print '     The amount of cooling needed is, %.0f Btu heat removed. '%(abs(H_soln))\n",
      "\n",
      "#(b)\n",
      "V = 100. ;\t\t\t# Volume of solution produced -[gal]\n",
      "f2_NH3 = 32./100 ;\t\t\t# Fraction of NH3 in solution \n",
      "sg_NH3 = .889 ;\t\t\t# Specific gravity of NH3 \n",
      "sg_H2O = 1.003 ;\t\t\t# Specific gravity of H2O\n",
      "d_soln = sg_NH3*62.4*sg_H2O*100/7.48 ;\t\t\t# Density of solution - [lb / 100 gal]\n",
      "NH3 = d_soln*f2_NH3/mw_NH3 ;\t\t\t# Mass of NH3 - [ lb mol/ 100 gal]\n",
      "m1_H2O = (mw_NH3/f2_NH3) - mw_NH3 ;\t\t\t# Mass of water in solution -[lb]\n",
      "mol1_H2O = m1_H2O/mw_H2O  ;\t\t\t# Moles of H2O in solution -[lb mol]\n",
      "\n",
      "print ' (b)  Moles of H2O in solution is %.1f  lb mol . '%mol1_H2O\n",
      "print '     As we can see that moles of water is 2 lb mol , hence we will see H_soln from table corresponding to 2 lb mol water . '\n",
      "H_soln = -13700 ;\t\t\t# From table given in question in book -[Btu/lb mol NH3]\n",
      "total_H = abs(NH3*H_soln) ;\t\t\t# Total heat removed from solution -[Btu]\n",
      "print '     The amount of cooling needed is, %.0f Btu heat removed. '%total_H\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)  Moles of H2O in solution is 30.5  lb mol . \n",
        "     As we can see that moles of water is 30 lb mol(approx), hence we will see H_soln from table corresponding to 30 lb mol water . \n",
        "     The amount of cooling needed is, 14800 Btu heat removed. \n",
        " (b)  Moles of H2O in solution is 2.0  lb mol . \n",
        "     As we can see that moles of water is 2 lb mol , hence we will see H_soln from table corresponding to 2 lb mol water . \n",
        "     The amount of cooling needed is, 191826 Btu heat removed. \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 28.2 page no. 872"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "from scipy.integrate import quad\n",
      "# Variables\n",
      "p = 100. ;\t\t\t# Mass of product - [kg]\n",
      "f_HCl = 25./100 ;\t\t\t#Fraction of HCl in product \n",
      "HCl = f_HCl*p ;\t\t\t# Mass of HCl in product - [kg]\n",
      "H2O = (1.-f_HCl)*p  ;\t\t\t# Mass of H2O in product -[kg]\n",
      "mw_HCl = 36.37 ;\t\t\t# Molecular weight of HCl -[kg]\n",
      "mw_H2O = 18.02 ;\t\t\t# Molecular weight of H2O -[kg]\n",
      "\n",
      "# Calculations\n",
      "mol_HCl = HCl /mw_HCl ;\t\t\t# Moles of HCl - [kg mol]\n",
      "mol_H2O = H2O /mw_H2O; \t\t\t# Moles of H2O - [kg mol]\n",
      "total_mol = mol_HCl + mol_H2O ;\t\t\t# Total no. of moles -[kg mol]\n",
      "mf_HCl = mol_HCl / total_mol  ;\t\t\t# mole fraction of HCl \n",
      "mf_H2O = mol_H2O / total_mol ; \t\t\t# mole fraction of H2O\n",
      "mr = mol_H2O/mol_HCl ;\t\t\t# Mole ratio of H2O to HCl \n",
      "MW = mf_HCl*mw_HCl + mf_H2O*mw_H2O ;\t\t\t# Molecular t. of solution-[kg]\n",
      "Ref_T = 25. ;\t\t\t#Reference temperature-[degree C]\n",
      "\n",
      "mol1_HCl = total_mol ;\t\t\t# Moles of HCl \t\t\t# Moles of HCl output -[g mol]\n",
      "Hf1_HCl = -157753. ;\t\t\t# Heat of formation of HCl output-[J/ g mol HCl ]\n",
      "Hf_HCl = -92311. ;\t\t\t# Heat of formation of HCl input-[J/ g mol HCl ]\n",
      "Hf_H2O = 0 ;\t\t\t# Heat of formation of H2O input-[J/ g mol HCl ]\n",
      "H1_HCl =  556. ;\t\t\t# Change in enthalpy during temperature change from 25 C to 35 C of HCl - [J/g mol] \n",
      "\n",
      "def f(T):\n",
      "    return (29.13 - 0.134*.01*T)\n",
      "\n",
      "H_HCl = quad(f,298,393)[0]\t# Change in enthalpy during temperature change from 25 C to 120 C of HCl - [J/g mol] \n",
      "\n",
      "H_H2O = 0 ;\t\t\t# Change in enthalpy during temperature change from 25 C to 25 C of H2O - [J/g mol] \n",
      "\n",
      "H_in = (Hf_HCl + H_HCl)*mol_HCl  + (Hf_H2O + H_H2O)*mol_H2O ;\t\t\t# Enthalpy change of input -[J]\n",
      "H_out = Hf1_HCl*mol_HCl +H1_HCl*mol1_HCl  ;\t\t\t# Enthalpy change of output -[J]\n",
      "\n",
      "del_H = H_out - H_in ;\t\t\t# Net enthalpy change n process - [J]\n",
      "Q = del_H; \t\t\t# By energy balance - [J]\n",
      "\n",
      "# Results\n",
      "print 'The amount of heat removed from the absorber by cooling water is, %.0f J. '%Q\n",
      "print 'It Seems answer is wrong in book'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The amount of heat removed from the absorber by cooling water is, -44159 J. \n",
        "It Seems answer is wrong in book\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      " Example 28.3  page no. 875\n"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "soln1 = 600. ; \t\t\t# Mass flow rate of entering solution 1 -[lb/hr]\n",
      "c1_NaOH = 10./100 ;\t\t\t# Fraction of NaOH in entering solution 1\n",
      "T1 = 200. ;\t\t\t# Temperature at entry \n",
      "soln2 = 400. ;\t\t\t# Mass flow rate of another solution 2 entering -[lb/hr]\n",
      "c2_NaOH = 50./100 ;\t\t\t# Fraction of NaOH in another entering solution 2\n",
      "\n",
      "# Calculations\n",
      "F = soln1 + soln2; \t\t\t# Mass flow rate of final solution - [lb/hr]\n",
      "F_NaOH =  c1_NaOH * soln1 + c2_NaOH * soln2 ;\t\t\t# Mass of NaOH in final solution-[lb]\n",
      "F_H2O = F - F_NaOH ;\t\t\t# Mass of H2O in final solution-[lb]\n",
      "H_soln1 = 152. ;\t\t\t# Specific enthalpy change for solution 1-[Btu/lb]\n",
      "H_soln2 = 290. ;\t\t\t# Specific enthalpy change for solution 2-[Btu/lb]\n",
      "H_F = (soln1*H_soln1 + soln2*H_soln2)/F ;\t\t\t# Specific enthalpy change for final solution -[Btu/lb]\n",
      "\n",
      "# Results\n",
      "print ' (a) The final temperature of the exit solution from figure E28.3 using the obtained condition of final solution is 232 degree F '\n",
      "\n",
      "cF = F_NaOH*100/F; \t\t\t# Concentration of final solution -[wt % NaOH ]\n",
      "print '  (b) The concentration of final solution is %.0f wt.%% NaOH . '%cF\n",
      "\n",
      "x = (F*H_F - F*175)/(1158.0 - 175) ;\t\t\t# H2O evaporated per hour -[lb]\n",
      "print '  (c) H2O evaporated per hour is %.1f lb . '%x\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " (a) The final temperature of the exit solution from figure E28.3 using the obtained condition of final solution is 232 degree F \n",
        "  (b) The concentration of final solution is 26 wt.% NaOH . \n",
        "  (c) H2O evaporated per hour is 32.8 lb . \n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": true,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}