{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Chapter 1 : Fluid Properties" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.1 Page no 8" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Desnity of air at 20 deg C and 50 psia = 4.1 kg/m**3" ] } ], "source": [ "# Density of air\n", "\n", "#Given \n", "\n", "Mw = 29.0 # Molecular weight of air\n", "\n", "R = 8323/Mw # Universal gas constant\n", "\n", "T = 273 + 20 # temperature in K\n", "\n", "p = 50*144*47.88 # Pressure in N/m**2\n", "\n", "# Solution\n", "\n", "rho = p/(R*T) # from the state law\n", "\n", "print \"Desnity of air at 20 deg C and 50 psia = \",round(rho,2),\"kg/m**3\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.2 Page no 12" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reduction in volume = 0.045 %\n" ] } ], "source": [ "# Reduction in volume\n", "\n", "# Given\n", "\n", "dP = 10**6 # Pressure drop in N/m**2\n", "\n", "V = 1 # Volume in m**3\n", "\n", "bta = 2.2*10**9 # Bulk modulus of elasticity in N/m**2\n", "\n", "# Solution\n", "\n", "dV = -dP*V/bta # Change in volume in m**3\n", "\n", "v = -dV*100\n", "\n", "print \"Reduction in volume = \",round(v,3),\"%\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.3 Page no 13" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Volume reduction = -3.57e-06 m**3\n", "Negative sign indicates the volume has reduced" ] } ], "source": [ "# Volume reduction\n", "\n", "# Given\n", "\n", "bta1 = 2.28*10**9 # Bulk modulus of elasticity at 20 deg C and 103.4 N/m**2\n", "\n", "bta2 = 2.94*10**9 # Bulk modulus of elasticity at 20 deg C and 1034 N/m**2\n", "\n", "p1 = 103.4 # Pressure in N/m**2\n", "\n", "p2 = 1034 # Pressure in N/m**2\n", "\n", "# Solution \n", "\n", "bavg = (bta1+bta2)/2 # bulk modulus average in N/m**2\n", "\n", "dP = p2-p1 # pressure drop in N/m**2\n", "\n", "V = 10 # Volume in m**3\n", "\n", "dV = dP*V/bavg # Change in volume in m**3\n", "\n", "v = -dV\n", "\n", "print \"Volume reduction = \",round(v,8),\"m**3\"\n", "\n", "print \"Negative sign indicates the volume has reduced\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.4 Page no 14" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "An increase in pressure by 2 psia will result in a volume reduction of -0.0173 ft**3\n" ] } ], "source": [ "# Volume reduction \n", "\n", "# Given\n", "\n", "patm = 14.6 # Atmospheric pressure in psia\n", "\n", "p1 = 100 # gauge pressure at point 1 in psia\n", "\n", "p2 = 102 # gauge pressure at point 2 in psia\n", "\n", "V = 1 # volume in m**3\n", "# solution\n", "\n", "p = p1+patm # absolute pressure in psia\n", "\n", "b = p # for isothermal air\n", "\n", "p1 = p2+patm # absolute pressure in psia\n", "\n", "b1 = p1 # for isothermal air\n", "\n", "dP = p1 - p # change in pressure\n", "\n", "bavg = (b1+b)/2 # average bulk modulus of elasticity in N/m**2\n", "\n", "dV = dP*V/bavg\n", "\n", "v = -dV\n", "\n", "print \"An increase in pressure by 2 psia will result in a volume reduction of\",round(v,4),\"ft**3\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.5 Page no 14" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Sonic velocity in air at 68 deg F = 1126.0 ft/s\n" ] } ], "source": [ "# Sonic velocity of air\n", "\n", "from math import *\n", "\n", "# Given\n", "\n", "k = 1.4 # gas constant\n", "\n", "R = 1716 # Universal gas constant in ft.lb/slug^oR\n", "\n", "T = 68+460 # temperature in *oR\n", "\n", "# solution\n", "\n", "c = sqrt(k*R*T)\n", "\n", "print \"Sonic velocity in air at 68 deg F = \",round(c,0),\"ft/s\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.6 Page no 19" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Force required to move the piston by 1 m/s = 2.83 N\n" ] } ], "source": [ "# Force required to move the piston\n", "\n", "from math import *\n", "\n", "# Given\n", "\n", "d = 0.05 # diameter of cylinder 1 in m\n", "\n", "l = 0.2 # length of the cylinder in meters\n", "\n", "d1 = 0.052 # diameter of cylinder in m\n", "\n", "mu = 0.09 # Viscosity of oil in Ns/m**2\n", "\n", "U = 1 # velocity in m/s\n", "\n", "Y = (d1-d)/2 # clearance between the two cylinders in m\n", "\n", "A = pi*l*d # area in m**2\n", "\n", "# Solution \n", "\n", "tau = mu*U/Y # Shear stress in N/m**2\n", "\n", "F = tau*A # Shear foce in N\n", "\n", "print \"Force required to move the piston by 1 m/s = \",round(F,2),\"N\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.7 Page no 20" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " (a) Distance between the walls = 1.0 cm\n", " (b) Shear stress = 0.0001005 N/m**2\n", " (c) Shear Stress at 20 um from the plate = 0.000100098 N/m**2\n", " (d) Location of maximum velocity = 0.005 m\n", "Above calculation indicates that the zero shear stress and the maximum velocity occurs at the same location which is half way between the plate \n", "This also is in conformity with the fact that , in a flowing fluid, the velocity is maximum where shear stress is zero\n" ] } ], "source": [ "# Distance between the walls; Shear Stress; Location of maximum velocity\n", "\n", "from math import *\n", "\n", "from sympy import *\n", "\n", "# Given\n", "\n", "mu = 1.005*10**-3 # Viscosity of water in Ns/m**2\n", "\n", "# Solution \n", "\n", "# Part a\n", "\n", "# Velocity is given by the formula u = 10*(0.01*y-y**2)\n", "\n", "# two boundary conditions must be satisfied\n", "\n", "# at y=0;u=0 at the bottom of the plate\n", "\n", "# at y=Y ; u = 0 at top of the plate\n", "\n", "Y = 0.01 # Distance between the walls\n", "\n", "Y1 = Y*100\n", "\n", "print \" (a) Distance between the walls = \",round(Y1,1),\"cm\"\n", "\n", "# Part b\n", "\n", "# tau = mu*du/dy # Newtons law of viscosity\n", "\n", "# differentiate u wrt y\n", "\n", "y = Symbol('y')\n", "\n", "u = 10*(0.01*y-y**2)\n", "\n", "uprime = u.diff(y)\n", "\n", "y = 0\n", "\n", "U = uprime\n", "\n", "#print U\n", "# for y =0 at the bottom plate we get \n", "\n", "U1 = 0.01 # from U\n", "\n", "tau = mu*10*U1 # shear stress in N/m**2\n", "\n", "print \" (b) Shear stress = \",round(tau,9),\"N/m**2\"\n", "\n", "# Part c\n", "\n", "# Shaer stress at 20um from the wall\n", "\n", "tau1 = mu*10*(0.01-2*20*10**-6) # using the equation of U and y = 20*10**-6 calc shear stress in N/m**2\n", "\n", "print \" (c) Shear Stress at 20 um from the plate = \",round(tau1,9),\"N/m**2\"\n", "\n", "# Part D\n", "\n", "# Distance at which shaer stress is zero can be found from the location of maximum velocity \n", "\n", "# equating uprime = 0\n", "\n", "y1 = 0.01/2 # shear stress location\n", "\n", "print \" (d) Location of maximum velocity = \",round(y1,3),\"m\"\n", "\n", "print \"Above calculation indicates that the zero shear stress and the maximum velocity occurs at the same location which is half way between the plate\",\"\\n\",\"This also is in conformity with the fact that , in a flowing fluid, the velocity is maximum where shear stress is zero\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.8 Page 24" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " (a) For linear distribution of velocity , shaft torque = 10.86 m.N\n", " (b) For non-linear distribution of velocity , shaft torque = 10.86 m.N\n" ] } ], "source": [ "# Shaft torque for linear and non linear distribution of velocity \n", "from math import *\n", "# Given\n", "\n", "d = 0.1 # diameter of shaft in m\n", "\n", "l = 0.2 # length of the shaft in m\n", "\n", "t = 0.00002 # thickness in m\n", "\n", "N = 30 # RPM of shaft\n", "\n", "U = pi*d*30/60 # velocity in m/s\n", "\n", "r1 = d/2\n", "\n", "r2 = r1 + t # radius of bearing in m\n", "\n", "mu = 0.44 # Viscosity of SAE-30 oil in Ns/m**2\n", "\n", "# Solution\n", "\n", "# part a\n", "\n", "F = 2*pi*r1*l*mu*U/t\n", "\n", "T =F*r1\n", "\n", "print \" (a) For linear distribution of velocity , shaft torque = \",round(T,2),\"m.N\"\n", "\n", "# part b\n", "\n", "F1 = 2*pi*l*mu*U/log(r2/r1)\n", "\n", "\n", "T1 =F1*r1\n", "\n", "print \" (b) For non-linear distribution of velocity , shaft torque = \",round(T1,2),\"m.N\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.9 Page 26" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Watts of energy lost in overcoming friction at 300 RPM = 1108.0 Watts\n" ] } ], "source": [ "# Watts of energy lost to overcome friction\n", "from math import *\n", "# Given\n", "\n", "mu = 0.44 # viscosity of the oil in Ns/m**2\n", "\n", "N = 300 # RPM of the shaft\n", "\n", "t = 0.00025 # thickness of the film oil in m\n", "\n", "r1 = 0.15 # radius in m\n", "\n", "r2 = 0.1 # radius in m\n", "\n", "T = pi**2*mu*N*(r1**4-r2**4)/(60*t)\n", "\n", "P = T*2*pi*N/60\n", "\n", "print \"Watts of energy lost in overcoming friction at 300 RPM = \",round(P,0),\"Watts\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.10 Page no 28" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Excessive pressure inside the droplet = 29.2 N" ] } ], "source": [ "# Excessive pressure inside droplet\n", "\n", "# Given\n", "\n", "d = 0.01 # diameter in m\n", "\n", "sigma = 0.073 # surface tension in N/m\n", "\n", "# Solution \n", "\n", "dP = 4*sigma/d # pressure excessive\n", "\n", "print \"Excessive pressure inside the droplet = \",round(dP,2),\"N\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 1.11 Page no 31" ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The alcohol will rise to a height of 5.7 mm in the glass tube" ] } ], "source": [ "# Height to which alcohol will rise\n", "\n", "# Given\n", "\n", "sigma = 0.022 # surface tension in N/m\n", "\n", "gma = 9789 # specific weight\n", "\n", "S = 0.79 # specific gravity\n", "\n", "d = 0.002 # diameter in m\n", "\n", "# Solution \n", "\n", "\n", "h =4*sigma*1000/(gma*S*d) # capillary height in m\n", "\n", "print \"The alcohol will rise to a height of\",round(h,1),\"mm in the glass tube\"" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "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.3" } }, "nbformat": 4, "nbformat_minor": 0 }