summaryrefslogtreecommitdiff
path: root/mechanics_of_fluid/Chapter5-_1.ipynb
blob: bc9d154f58c9648ddb1639370cf7a34bfe4e7a61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
 "metadata": {
  "name": "",
  "signature": "sha256:cc924f0db45ef8f074cc8f1d8a1ee198ea5115e6305e3da74ea78f614afb5f88"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Chapter5- Physical Similarity and Dimensional Analysis"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The total resistance of the prototype\n",
      "u_p=10.; ## m/s\n",
      "scale=1/25.;  ## l_m/l_p\n",
      "L=125.; ## m\n",
      "meu=1.235*10**(-6); ## m**2/s\n",
      "meu_p=1.188*10**(-6); ## m**2/s\n",
      "rho_p=1025.; ## kg/m**3\n",
      "rho_m=1000.; ## kg/m**3\n",
      "A=3500.; ## wetted surface in m**2\n",
      "\n",
      "u_m=u_p*math.sqrt(scale);\n",
      "\n",
      "d=L*scale;\n",
      "Re=d*u_m/meu; ## Reynolds no.\n",
      "C_F=0.075/(math.log10(Re)-2)**2; ## Skin friction coefficient\n",
      "\n",
      "res_skin=rho_m/2*u_m**2*(A*scale**2)*C_F;\n",
      "\n",
      "res_tot=54.2; ## N\n",
      "\n",
      "F_resid_m=res_tot-res_skin;\n",
      "\n",
      "F_resid_p=F_resid_m*rho_p/rho_m/scale**3;\n",
      "\n",
      "Re_p=u_p*L/meu_p;\n",
      "\n",
      "C_F_p=0.075/(math.log10(Re_p)-2)**2+0.0004;\n",
      "C_F_pnew=1.45*C_F_p;\n",
      "\n",
      "res_friction=rho_p/2*u_p**2*A*C_F_pnew;\n",
      "\n",
      "Resistance=F_resid_p+res_friction;\n",
      "print'%s %.1f %s'%(\"The total resistance of the prototype\",Resistance,\"N\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total resistance of the prototype 809273.4 N\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg 184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Maximum speed of the redesigned torpedo\n",
      "\n",
      "A=0.88; ## ratio of A2 and A1\n",
      "C_D=0.85; ## ratio of C_D2 to C_D1\n",
      "P=1.20; ## ratio of P2 to P1\n",
      "V1=11.; ## m/s\n",
      "\n",
      "V2=V1*(P/A/C_D)**(1/3.);\n",
      "print'%s %.2f %s'%(\"Maximum speed of the redesigned torpedo =\",V2,\"m/s\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum speed of the redesigned torpedo = 12.88 m/s\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}