diff options
Diffstat (limited to 'Fundamentals_Of_Thermodynamics/Chapter4.ipynb')
-rwxr-xr-x | Fundamentals_Of_Thermodynamics/Chapter4.ipynb | 198 |
1 files changed, 198 insertions, 0 deletions
diff --git a/Fundamentals_Of_Thermodynamics/Chapter4.ipynb b/Fundamentals_Of_Thermodynamics/Chapter4.ipynb new file mode 100755 index 00000000..eed9d20a --- /dev/null +++ b/Fundamentals_Of_Thermodynamics/Chapter4.ipynb @@ -0,0 +1,198 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:da3557673ab31ece618ad10f5b0d3ef78112ff36bd0b260e508d99211060a1c9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 4:WORK AND HEAT"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.1:PG-96"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 1\n",
+ "#work done during different processes\n",
+ "import math\n",
+ "\n",
+ "P1=200 #initial pressure inside cylinder in kPa\n",
+ "V2=0.1 #in m^3\n",
+ "V1=0.04 #initial volume of gas in m^3\n",
+ "\n",
+ "W1=P1*(V2-V1) #work done in isobaric process in kJ\n",
+ "print\"\\n hence,the work done during the isobaric process is\",round(W1,2),\"kJ. \\n\"\n",
+ "\n",
+ "W2=P1*V1*math.log(V2/V1) #work done in isothermal process in kJ\n",
+ "print\"\\n hence,the work done in isothermal process is\",round(W2,2),\"kJ. \\n\"\n",
+ "\n",
+ "P2=P1*(V1/V2)**(1.3) #final pressure according to the given process\n",
+ "W3=(P2*V2-P1*V1)/(1-1.3)\n",
+ "print\"\\n hence,the work done during the described process is\",round(W3,2),\"kJ. \\n\"\n",
+ "\n",
+ "W4=0 #work done in isochoric process\n",
+ "print\"\\n hence,the work done in the isochoric process is\",round(W4,3),\"kJ. \\n\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ " hence,the work done during the isobaric process is 12.0 kJ. \n",
+ "\n",
+ "\n",
+ " hence,the work done in isothermal process is 7.33 kJ. \n",
+ "\n",
+ "\n",
+ " hence,the work done during the described process is 6.41 kJ. \n",
+ "\n",
+ "\n",
+ " hence,the work done in the isochoric process is 0.0 kJ. \n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.3:PG-99"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 3\n",
+ "\n",
+ "#work produced\n",
+ "\n",
+ "Psat=190.2 #in kPa\n",
+ "P1=Psat #saturation pressure in state 1\n",
+ "vf=0.001504 #in m^3/kg\n",
+ "vfg=0.62184 #in m^3/kg\n",
+ "x1=0.25 #quality\n",
+ "v1=vf+x1*vfg #specific volume at state 1 in m^3/kg\n",
+ "v2=1.41*v1 #specific volume at state 2 in m^3/kg\n",
+ "P2=600 #pressure in state 2 in kPa from Table B.2.2\n",
+ "m=0.5 #mass of ammonia in kg\n",
+ "W=m*(P1+P2)*(v2-v1)/2 #woork produced by ammonia in kJ\n",
+ "print \"The final pressure is\",round(P2),\"kPa\\n\"\n",
+ "print \"hence,work produced by ammonia is\",round(W,2),\"kJ\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "The final pressure is 600.0 kPa\n",
+ "\n",
+ "hence,work produced by ammonia is 12.71 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.4:PG-100"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 4\n",
+ "\n",
+ "#calculating work done\n",
+ "\n",
+ "v1=0.35411 #specific volume at state 1 in m^3/kg\n",
+ "v2=v1/2 \n",
+ "m=0.1 #mass of water in kg\n",
+ "P1=1000 #pressure inside cylinder in kPa\n",
+ "W=m*P1*(v2-v1) #in kJ\n",
+ "print \"the work in the overall process is\",round(W,1),\"kJ\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the work in the overall process is -17.7 kJ\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex4.7:PG-108"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#example 7\n",
+ "#heat transfer\n",
+ "k=1.4 #conductivity of glass pane in W/m-K\n",
+ "A=0.5 #total surface area of glass pane\n",
+ "dx=0.005 #thickness of glasspane in m\n",
+ "dT1=20-12.1 #temperature difference between room air and outer glass surface temperature in celsius\n",
+ "Q=-k*A*dT1/dx #conduction through glass slab in W\n",
+ "h=100 #convective heat transfer coefficient in W/m^2-K \n",
+ "dT=12.1-(-10) #temperature difference between warm room and colder ambient in celsius\n",
+ "Q2=h*A*dT #heat transfer in convective layer in W\n",
+ "#result\n",
+ "print \"the rate of heat transfer in the glass and convective layer is\",round(Q2),\"kW.\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "the rate of heat transfer in the glass and convective layer is 1105.0 kW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |