summaryrefslogtreecommitdiff
path: root/Basic_Fluid_Mechanics_by_Peerless/7-Steady_one_dimensional_Irreversible_flow.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Basic_Fluid_Mechanics_by_Peerless/7-Steady_one_dimensional_Irreversible_flow.ipynb')
-rw-r--r--Basic_Fluid_Mechanics_by_Peerless/7-Steady_one_dimensional_Irreversible_flow.ipynb402
1 files changed, 402 insertions, 0 deletions
diff --git a/Basic_Fluid_Mechanics_by_Peerless/7-Steady_one_dimensional_Irreversible_flow.ipynb b/Basic_Fluid_Mechanics_by_Peerless/7-Steady_one_dimensional_Irreversible_flow.ipynb
new file mode 100644
index 0000000..49cabdd
--- /dev/null
+++ b/Basic_Fluid_Mechanics_by_Peerless/7-Steady_one_dimensional_Irreversible_flow.ipynb
@@ -0,0 +1,402 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Steady one dimensional Irreversible flow"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.10: ex_10.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"p2= 67.2 //lbf/in^2\n",
+"p1= 63 //lbf/in62\n",
+"r= 1.4\n",
+"n= 0.6\n",
+"T1= 870 //R\n",
+"ma1= 0.8 //ft/sec\n",
+"//CALCULATIONS\n",
+"dt= (p2/p1)^((r-1)/r)-1\n",
+"dt1= dt/n\n",
+"T2= T1*(1+dt1)\n",
+"Ts1= T1*(1+0.5*(r-1)*ma1^2)\n",
+"ps1= p1*(1+0.5*(r-1)*ma1^2)^(r/(r-1))\n",
+"ps2= p2*(Ts1/T2)^(r/(r-1))\n",
+"dp= ps1-ps2\n",
+"//RESULTS\n",
+" printf ('dT = %.5f ',dt)\n",
+" printf ('\n dT1 = %.5f ',dt1)\n",
+" printf ('\n Temperature = %.f R',T2)\n",
+" printf ('\n Temperature = %.1f R',Ts1)\n",
+" printf ('\n Pressure = %.1f lbf/in^2',ps1)\n",
+" printf ('\n Pressure = %.1f lbf/in^2',ps2)\n",
+" printf ('\n pressure difference = %.1f lbf/in^2',dp)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.11: ex_11.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"r= 1.4\n",
+"ma3= 3 //ft/sec\n",
+"ps= 80 //lbf/ft^2\n",
+"Ts= 840 //R\n",
+"r1= 53.3 //ft lbm/ft^3\n",
+"A3= 2 //in^2\n",
+"g= 32.2 //ft/sec^2\n",
+"ma1= 1.6\n",
+"//CALCULATIONS\n",
+"R= (1+(r-1)*0.5*ma3^2)^(r/(r-1))\n",
+"p3= ps/R\n",
+"R1= 1+0.5*(r-1)*ma3^2\n",
+"T3= Ts/R1\n",
+"w3= p3*144/(r1*T3)\n",
+"V3= ma3*sqrt(r*r1*g*T3)\n",
+"m= w3*V3*A3/144\n",
+"ra= ((r+1)/(2*r*ma1^2-(r-1)))^(1/(r-1))*(0.5*(r+1)*ma1^2/(1+0.5*(r-1)*ma1^2))^(r/(r-1))\n",
+"ps2= ps*ra\n",
+"dp= ps-ps2\n",
+"//RESULTS\n",
+" printf ('outlet pressure = %.2f lbf/in^2',p3)\n",
+" printf ('\n outlet temperature = %.f R',T3)\n",
+" printf ('\n mass flow rate = %.3f lbm/sec',m)\n",
+" printf ('\n mass flow rate = %.3f lbm/sec',m)\n",
+" printf ('\n ps2 = %.1f lbf/in^2',ps2)\n",
+" printf ('\n pressure difference = %.1f lbf/in^2',dp)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.1: ex_1.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"r= 1.5\n",
+"f= 0.025\n",
+"//CALCULATIONS\n",
+"r1= (2/f)*(r^2-1)\n",
+"//RESULTS\n",
+"printf ('ratio L/D2 = %.f',r1)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.2: ex_2.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"a= 6 //degrees\n",
+"r= 1.5\n",
+"l= 100 //ft\n",
+"f= 0.025\n",
+"K= 0.15\n",
+"//CALCULATIONS\n",
+"R= r^4-1\n",
+"R1= cotd(a/2)*(1-(1/r))\n",
+"p1= f*l\n",
+"p2= 2.5*(l-p1)/l\n",
+"p3= (1-r^2)^2\n",
+"p4= K*p3\n",
+"pt= p4+p2\n",
+"//RESULTS\n",
+"printf ('lowest ratio = %.2f',R)\n",
+"printf ('\n contribtuion of friction in pipe = %.1f lbf/ft^2',p1)\n",
+"printf ('\n contribtuion of diffuser in pipe = %.3f lbf/ft^2',p2)\n",
+"printf ('\n stagnant pressure drop = %.3f lbf/ft^2',p3)\n",
+"printf ('\n contribtuion of friction in pipe after reduction = %.3f lbf/ft^2',pt)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.3: ex_3.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"d= 4 //in\n",
+"q= 0.5 //ft^3/sec\n",
+"w= 62.4 //lb/ft^3\n",
+"u= 2.7*10^-5 //lbf sec/ft^2\n",
+"e= 0.0005 //ft\n",
+"g= 32.1 //ft/sec^2\n",
+"f= 0.0235\n",
+"lt= 400 //ft\n",
+"//CALCULATIONS\n",
+"V= 4*q/(%pi*(d/12)^2)\n",
+"Re= w*V*(d/12)/(u*g)\n",
+"r= e/(d/12)\n",
+"dz= (V^2/(2*g))*(1.7+f*lt/(d/12))\n",
+"//RESULTS\n",
+"printf ('mean flow velocity = %.2f ft/sec',V)\n",
+"printf ('\n Reynolds number = %.2e',Re)\n",
+"printf ('\n Relative roughness = %.4f',r)\n",
+"printf ('\n difference in the levels of water = %.1f ft',dz)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.4: ex_4.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"d= 4 //in\n",
+"v= 6.64 //ft/sec\n",
+"//CALCULATIONS\n",
+"Q= %pi*0.25*(d/12)^2*v\n",
+"//RESULTS\n",
+"printf ('Flow rate= %.3f ft^3/sec',Q)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.5: ex_5.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"d= 0.366 //ft\n",
+"i= 12\n",
+"//CALCULATIONS\n",
+"pd= d*i\n",
+"//RESULTS\n",
+"printf ('Required pipe diameter = %.2f in',pd)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.6: ex_6.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"Ps1= 1050 //lbf/ft^2\n",
+"fr= 10.7\n",
+"p= 36.6 //lbf/ft^2\n",
+"p1= 195 //lbf/ft^2\n",
+"fr1= 16\n",
+"fr2= 1.8\n",
+"//CALCULATIONS\n",
+"p2= fr*p\n",
+"dp= Ps1-p2\n",
+"lc= dp/p\n",
+"sp= Ps1+p1-p*(fr1+fr2)\n",
+"lc1= sp/p\n",
+"//RESULTS\n",
+"printf ('Pressure = %.f lbf/ft^2',p1)\n",
+"printf ('\n pressure difference = %.f lbf/ft^2',dp)\n",
+"printf ('\n Loss coefficient = %.f ',lc)\n",
+"printf ('\n Loss coefficient = %.1f ',lc1)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.7: ex_7.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"p1= 50 //lbf/in^2\n",
+"R= 96.3 //ft lbf/lbm R\n",
+"T= 80 //F\n",
+"p2= 20 //lbf/in^2\n",
+"r= 1.31\n",
+"u= 2.34*10^-7 //lbf sec/ft^2\n",
+"e= 0.00005 //ft\n",
+"m= 5*10^4 //lbm/sec\n",
+"d= 1.5 //ft\n",
+"g= 32.2 //ft/sec^2\n",
+"f= 0.113\n",
+"//CALCULATIONS\n",
+"w1= p1*144/(R*(460+T))\n",
+"V1= 4*(m/3600)/(%pi*w1*d^2)\n",
+"Ma1= V1/(r*R*g*(460+T))^0.5\n",
+"Re= w1*V1*d/(u*g)\n",
+"dx= (((1/(r*Ma1^2))*10*(1-(p2/p1)^2))+log(p2/p1))*d/f\n",
+"//RESULTS\n",
+"printf ('density = %.3f lbm/ft^3',w1)\n",
+"printf ('\n mean flow velocity = %.1f ft/sec',V1)\n",
+"printf ('\n Match number = %.4f ',Ma1)\n",
+"printf ('\n Reynolds number = %.2e ',Re)\n",
+"printf ('\n Length of pipe = %.2e ft',dx)"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 7.9: ex_9.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"clc\n",
+"//initialisation of variables\n",
+"clear\n",
+"r= 1.4\n",
+"R= 53.3 //ft lbf/lbm R\n",
+"g= 32.2 //ft/sec^2\n",
+"T1= 410 //R\n",
+"v= 2500 //ft/sec\n",
+"P1= 628 //lbf/in^2\n",
+"//CALCULATIONS\n",
+"v1= sqrt(r*g*R*T1)\n",
+"Ma1= v/v1\n",
+"Ts1= T1*(1+0.5*(r-1)*Ma1^2)\n",
+"Ps1= P1*(1+0.5*(r-1)*Ma1^2)^(r/(r-1))\n",
+"Ps2= Ps1*((r+1)/(2*r*Ma1^2-r+1))^(1/(r-1))*(0.5*(r+1)*Ma1^2/(1+0.5*(r-1)*Ma1^2))^(r/(r-1))\n",
+"//RESULTS\n",
+"printf ('acoustic velocity = %.f ft/sec',v1)\n",
+"printf ('\n Match number = %.2f ',Ma1)\n",
+"printf ('\n Stagnition temperature = %.f R',Ts1)\n",
+"printf ('\n Stagnition pressure = %.f lbf/ft^2',Ps1)\n",
+"printf ('\n Stagnition pressure = %.f lbf/ft^2',Ps2)"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}