{
 "metadata": {
  "name": "",
  "signature": "sha256:27148bed2cbad8357ddcdc8e0ee434be3797107d2f692797bdf3a1e36c7e8d1a"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 6 - Dimensional analysis and model similitude"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3 - Pg 230"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the flow rate of water and pressure drop\n",
      "#Initialization of variables\n",
      "dg=0.5 #in\n",
      "dw=12. #in\n",
      "rhog=0.022 #slug/ft^3\n",
      "rhow=1.94 #slug/ft^3\n",
      "muw=2.34e-5 #lb-sec/ft^2\n",
      "mug=3.50e-7 #lb-sec/ft^2\n",
      "Qg=0.15 #ft^3/s\n",
      "dpg=100. #lb/ft^2\n",
      "#calculations\n",
      "Vr=dg/dw *rhog/rhow *muw/mug\n",
      "Qr=Vr*dw*dw /dg/dg\n",
      "Qw=Qr*Qg\n",
      "dpr=rhow/rhog *(Vr)*Vr\n",
      "dpw=dpr*dpg\n",
      "#results\n",
      "print '%s %.2f %s' %(\"Flow rate of water =\",Qw,\"ft^3/s\")\n",
      "print '%s %.1f %s' %(\"\\n Pressure drop =\",dpw,\"lb/ft^2\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Flow rate of water = 2.73 ft^3/s\n",
        "\n",
        " Pressure drop = 8.8 lb/ft^2\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 4 - Pg 231"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate the velocity ratio, time ratio, acceleration ratio and force ratio.\n",
      "#Initialization of variables\n",
      "import math\n",
      "Lr=1./10.\n",
      "rhom=2.\n",
      "rhop=1.94\n",
      "#calculations\n",
      "Vr=math.sqrt(Lr)\n",
      "Tr=Lr/Vr\n",
      "ar=Vr/Tr\n",
      "Fr=rhom/rhop *ar*Lr*Lr*Lr\n",
      "#results\n",
      "print '%s %.4f' %(\"Velocity ratio = \",Vr)\n",
      "print '%s %.4f' %(\"\\n Time ratio = \",Tr)\n",
      "print '%s %d' %(\"\\n Acceleration ratio = \",ar)\n",
      "print '%s %.6f' %(\"\\n Force ratio = \",Fr)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Velocity ratio =  0.3162\n",
        "\n",
        " Time ratio =  0.3162\n",
        "\n",
        " Acceleration ratio =  1\n",
        "\n",
        " Force ratio =  0.001031\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}