{ "metadata": { "name": "", "signature": "sha256:042171008edad2dcea90c81036564026ff0ecc789ee16d3a2ccb0122fde141e9" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 20: Pressure Transient Theory and Surge Control" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 20.3, Page 692" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "\n", " #Initializing the variables\n", "c = 1250;\n", "Dt = 0.02;\n", "Dv = 0.5;\n", "rho = 1000;\n", "v =0.5;\n", "\n", " #Calculations\n", "cDt = c*Dt;\n", "Dp = rho*c*Dv;\n", "DOv_DOt = Dv/Dt;\n", "vDOv_DOt = v*Dv/cDt;\n", "DOp_DOt = Dp/Dt;\n", "vDOp_DOx = v*Dp/cDt;\n", "Error = [vDOv_DOt*100/DOv_DOt ,vDOp_DOx*100/DOp_DOt];\n", "print \"The percentage errors are :\",Error,\"\\nThese are very small hence can be neglected\"" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The percentage errors are : [0.04, 0.04] \n", "These are very small hence can be neglected\n" ] } ], "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example 20.5, Page 705" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "import math\n", "\n", "\n", " #Initializing the variables\n", "f = 0;\n", "Atunnel = 1.227;\n", "Ashaft = 12.57;\n", "Q =2;\n", "L = 200;\n", "g = 9.81; \n", "\n", " #Calculations\n", "Zmax = (Q/Ashaft)*(Ashaft*L/(Atunnel*g))**0.5;\n", "T = 2*math.pi*(Ashaft*L/(Atunnel*g))**0.5;\n", "\n", "print \"Peak water level (m) :\",round(Zmax,3)\n", "print \"Mass Oscillation Period (s) :\",round(T,1)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Peak water level (m) : 2.299\n", "Mass Oscillation Period (s) : 90.8\n" ] } ], "prompt_number": 3 } ], "metadata": {} } ] }