{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# CHAPTER19:TURBULENT BOUNDARY LAYERS"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example E01 : Pg 612"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The total frictional drag is: (a)D = 1351.89748485 N\n",
      "(b) D = 65392.0 N\n"
     ]
    }
   ],
   "source": [
    "# All the quantities are expressed in SI units\n",
    "# (a)\n",
    "from math import sqrt\n",
    "Re_c = 1.36e7;                    # as obtained from ex. 18.1a\n",
    "rho_inf = 1.22;                   # freestream air denstiy\n",
    "S = 40.;                           # plate planform area\n",
    "# hence, from eq.(19.2)\n",
    "Cf = 0.074/Re_c**0.2;\n",
    "V_inf = 100.;\n",
    "# hence, for one side of the plate\n",
    "D_f = 1./2.*rho_inf*V_inf**2.*S*Cf;\n",
    "# the total drag on both the surfaces is\n",
    "D = 2.*D_f;\n",
    "print\"The total frictional drag is: (a)D =\",D,\"N\"\n",
    "# (b)\n",
    "Re_c = 1.36e8;                    # as obtained from ex. 18.1b\n",
    "# hence, from fig 19.1 we have\n",
    "Cf = 1.34*10.**-3.;\n",
    "V_inf = 1000.;\n",
    "# hence, for one side of the plate\n",
    "D_f = 1./2.*rho_inf*V_inf**2.*S*Cf;\n",
    "# the total drag on both the surfaces is\n",
    "D = 2.*D_f;\n",
    "print\"(b) D =\",D,\"N\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example E02 : Pg 612"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The total frictional drag is:D = 51916.421508 N\n"
     ]
    }
   ],
   "source": [
    "# All the quantities are expressed in SI units\n",
    "# from ex 18.2\n",
    "from math import sqrt\n",
    "Re_c_star = 3.754e7;                # Reynolds number at the trailing edge of the plate\n",
    "rho_star = 0.574;\n",
    "ue = 1000.;                          # velocity of the upper plate\n",
    "S = 40.;                             # plate planform area\n",
    "# from eq.(19.3) we have\n",
    "Cf_star = 0.074/Re_c_star**0.2;\n",
    "# hence, for one side of the plate\n",
    "D_f = 1./2.*rho_star*ue**2.*S*Cf_star;\n",
    "# the total drag on both the surfaces is\n",
    "D = 2.*D_f;\n",
    "print\"The total frictional drag is:D =\",D,\"N\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example E03 : Pg 615"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The total frictional drag is:D = 4967.70450221 N\n"
     ]
    }
   ],
   "source": [
    "# All the quantities are expressed in SI units\n",
    "import math \n",
    "Me = 2.94;                          # mach number of the flow over the upper plate\n",
    "ue = 1000.;\n",
    "Te = 288.;                           # temperature of the upper plate\n",
    "ue = 1000.;                          # velocity of the upper plate\n",
    "S = 40.;                             # plate planform area\n",
    "Pr = 0.71;                          # Prandlt number of air at standard condition\n",
    "gam = 1.4;                          # ratio of specific heats\n",
    "\n",
    "# the recovery factor is given as\n",
    "r = Pr**(1./3.);\n",
    "\n",
    "# for M = 2.94\n",
    "T_aw = Te*(1.+r*(2.74-1.));\n",
    "T_w = T_aw;                          # since the flat plate has an adiabatic wall\n",
    "\n",
    "# from the Meador-Smart equation\n",
    "T_star = Te*(0.5*(1.+T_w/Te) + 0.16*r*(gam-1.)/2.*Me**2.);\n",
    "\n",
    "# from the equation of state\n",
    "p_star=1.\n",
    "R=1.\n",
    "rho_star = p_star/R/T_star;\n",
    "\n",
    "# from eq.(15.3)\n",
    "mue0=1.\n",
    "T0=1.\n",
    "c=1.\n",
    "mue_star = mue0*(T_star/T0)**1.5*(T0+110.)/(T_star+110.);\n",
    "\n",
    "# thus\n",
    "Re_c_star = rho_star*ue*c/mue_star;\n",
    "\n",
    "# from eq.(18.22)\n",
    "Cf_star = 0.02667/Re_c_star**0.139;\n",
    "\n",
    "# hence, the frictional drag on one surface of the plate is\n",
    "D_f = 1./2.*rho_star*ue**2.*S*Cf_star;\n",
    "\n",
    "# thus, the total frictional drag is given by\n",
    "D = 2.*D_f;\n",
    "\n",
    "print\"The total frictional drag is:D =\",D,\"N\""
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [Root]",
   "language": "python",
   "name": "Python [Root]"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
