{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 7: Ideal Gases" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.1: Theoretical_problem.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chemical Engineering Thermodynamics\n", "//Chapter 7\n", "//Ideal Gases\n", "\n", "//Example 7.1\n", "clear;\n", "clc;\n", "\n", "//Given\n", "//The given example is a theoretical problem and it does not involve any numerical computation\n", "//end" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.2: Theoretical_problem.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chemical Engineering Thermodynamics\n", "//Chapter 7\n", "//Ideal Gases\n", "\n", "//Example 7.2\n", "clear;\n", "clc;\n", "\n", "//Given\n", "//The given example is a theoretical problem and it does not involve any numerical computation\n", "//end" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.3: EX7_3.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chemical Engineering Thermodynamics\n", "//Chapter 7\n", "//Ideal Gases\n", "\n", "//Example 7.3\n", "clear;\n", "clc;\n", "\n", "//Given\n", "P1 = 15;//initial pressure in Kgf/cm^2\n", "P2 = 1;//final pressure in Kgf/cm^2\n", "V1 = 0.012;//initial volume in m^3\n", "V2 = 0.06;//final volume in m^3\n", "T1 = 420;//initial temperature in K\n", "M = 28;//molecular weight of the gas\n", "Cp = 0.25;//specific heat at constant pressure in Kcal/Kg K\n", "R = 1.98;//gas constant in Kcal/Kg mole K\n", "R2 = 848;//gas constant in mKgf/Kgmole K\n", "//Cv = a+0.0005*T1; Specific heat at constant volume\n", "\n", "//To Calculate the final temperature of the ideal gas, work done in an open and closed system,internal energy change for the process\n", "//(a)Calculation of final temperature\n", "//Using ideal gas law:(P*V)/(R*T)\n", "T2 = (P2*V2*T1)/(P1*V1);\n", "mprintf('(a)The final temperature is %d K',T2);\n", "\n", "//(b)Calculation of work in an open and closed system\n", "//From equation 7.22(page no 147): P1*(V1^n)=P2*(V2^n)\n", "n = (log(P2/P1))/(log(V1/V2));\n", "//From equation 7.25(page no 149)\n", "W = ((P1*V1)-(P2*V2))/(n-1)*10^4;//work in mKgf\n", "W1 = W/427;//Work in Kcal\n", "mprintf('\n (b)The work in a closed system is %f Kcal',W1);\n", "Ws = n*W1;//from equation 7.28(page no 149)\n", "mprintf('\n The work in an open system is %f Kcal',Ws);\n", "\n", "//(c)Calculation of internal energy change\n", "R1 = R/M;//gas constant in Kcal/Kg\n", "Cv = Cp-R1;//specific heat at constant volume in Kcal/Kg K\n", "a = Cv-(0.0005*T1);\n", "m = (P1*10^4*V1*M)/(R2*T1);//mass of gas in Kg\n", "function y = f(T)\n", " y = m*(a+(0.0005*T));\n", "endfunction\n", "del_E = intg(T1,T2,f);//internal energy change in Kcal/Kg\n", "del_E1 = M*del_E;//internal energy change in Kcal/Kgmole\n", "mprintf('\n (c)The internal energy change for the process is %f Kcal/Kgmole',del_E1);" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.4: Theoretical_problem.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chemical Engineering Thermodynamics\n", "//Chapter 7\n", "//Ideal Gases\n", "\n", "//Example 7.4\n", "clear;\n", "clc;\n", "\n", "//Given\n", "//The given example is a theoretical problem and it does not involve any numerical computation\n", "//end" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 7.5: EX7_5.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Chemical Engineering Thermodynamics\n", "//Chapter 7\n", "//Ideal Gases\n", "\n", "//Example 7.5\n", "clear;\n", "clc;\n", "\n", "//Given\n", "P1 = 1;//Initial pressure of air in atm\n", "T1 = 15+273;//Initial temperature in K\n", "P2 = 5;//Final pressure of air in atm\n", "T2 = 15+273;//Final temperature in K\n", "Cv = 5;//specific heat of air at constant volume in Kcal/Kgmole K\n", "Cp = 7;//specific heat of air at constant pressure in Kcal/Kgmole K\n", "R = 0.082;//gas constant in atm-m^3/Kgmole K\n", "R1 = 2;//gas constant in Kcal/Kgmole K\n", "//From the P-V diagram given in page no 155:\n", "//Line 12 represents Isothermal process\n", "//Line b2,c2 & 1a represent Isometric process\n", "//Line a2 & 1c represent Isobaric process\n", "//Line 1b reprsent Adiabatic process\n", "\n", "//To find Approx Value\n", "function[A]=approx(V,n)\n", " A=round(V*10^n)/10^n;//V-Value n-To what place\n", " funcprot(0)\n", "endfunction \n", "\n", "//To Compute del_H, del_E, Q, W, del_S for the processes given above.\n", "//To indicate the quantities that are state functions \n", "//To verify that the work required in an isothermal process is less than that in an adiabatic process\n", "\n", "//Basis:1 Kgmole of air\n", "V1 = (R*T1)/P1;//Initial volume in cubic meter\n", "V2 = (R*T2)/P2;//Final volume in cubic meter\n", "\n", "//(i)Isothermal path 12\n", "//Equations 7.7 to 7.9 will be used (page no 145)\n", "del_E_12 = Cv*(T2-T1);\n", "del_H_12 = Cp*(T2-T1);\n", "W_12 = R1*T1*log(P1/P2);\n", "Q_12 = W_12;\n", "del_S_12 = approx((R1*log(P1/P2)),4);\n", "mprintf('\n(i)For isothermal process or path 12 change in internal energy is %f',del_E_12);\n", "mprintf('\n For isothermal process or path 12 change in enthalpy is %f',del_H_12);\n", "mprintf('\n For isothermal process or path 12 heat released is %f Kcal',Q_12);\n", "mprintf('\n For isothermal process or path 12 work is %f Kcal',W_12);\n", "mprintf('\n For isothermal process or path 12 change in entropy is %f Kcal/Kgmole K',del_S_12);\n", "\n", "//(ii)Path 1a2 = 1a(isometric)+a2(isobaric)\n", "//Equation 7.1 to 7.6 will be used (page no 144 & 145)\n", "Pa = P2;\n", "Ta = (Pa/P1)*T1;//in K\n", "Q_1a = Cv*(Ta-T1);\n", "del_E_1a = Q_1a;\n", "del_H_1a = Cp*(Ta-T1);\n", "W_1a = 0;// Constant volume process\n", "del_E_a2 = Cv*(T2-Ta);\n", "del_H_a2 = Cp*(T2-Ta);\n", "Q_a2 = del_H_a2;\n", "W_a2 = P2*(V2-V1)*((10^4*1.03)/427);\n", "del_H_1a2 = del_H_1a+del_H_a2;\n", "del_E_1a2 = del_E_1a+del_E_a2;\n", "Q_1a2 = Q_1a+Q_a2;\n", "W_1a2 = W_1a+W_a2;\n", "del_S_1a = Cv*log(Ta/T1);\n", "del_S_a2 = Cp*log(T2/Ta);\n", "del_S_1a2 = approx((del_S_1a+del_S_a2),4);\n", "mprintf('\n\n(ii)For path 1a2 change in internal energy is %f',del_E_1a2);\n", "mprintf('\n For path 1a2 change in enthalpy is %f',del_H_1a2);\n", "mprintf('\n For path 1a2 heat released is %f Kcal',Q_1a2);\n", "mprintf('\n For path 1a2 work is %f Kcal',W_1a2);\n", "mprintf('\n For path 1a2 change in entropy is %f Kcal/Kgmole K',del_S_1a2);\n", "\n", "//(iii)Path 1b2 = 1b(adiabatic)+b2(isometric)\n", "//From equation 7.11 (page no 146)\n", "y = Cp/Cv;\n", "Tb = T1*((V1/V2))^(y-1);\n", "//From equation 7.1 to 7.3,7.10 & 7.21,(page no 144,146,147)\n", "Q_1b = 0;//adiabatic process\n", "del_E_1b = Cv*(Tb-T1);\n", "del_H_1b = Cp*(Tb-T1);\n", "W_1b = -del_E_1b;\n", "Q_b2 = Cv*(T1-Tb);\n", "del_H_b2 = Cp*(T1-Tb);\n", "W_b2 = 0;//constant volume prcess\n", "del_E_b2 = Cv*(T2-Tb);\n", "del_H_1b2 = del_H_1b+del_H_b2;\n", "del_E_1b2 = del_E_1b+del_E_b2;\n", "W_1b2 = W_1b+W_b2;\n", "Q_1b2 = Q_1b+Q_b2;\n", "del_S_1b2 = approx((Cv*log(T1/Tb)),4);\n", "mprintf('\n\n(iii)For path 1b2 change in internal energy is %f',del_E_1b2);\n", "mprintf('\n For path 1b2 change in enthalpy is %f',del_H_1b2);\n", "mprintf('\n For path 1b2 heat released is %f Kcal',Q_1b2);\n", "mprintf('\n For path 1b2 work is %f Kcal',W_1b2);\n", "mprintf('\n For path 1b2 change in entropy is %f Kcal/Kgmole K',del_S_1b2);\n", "\n", "//(iv)Path 1c2 = 1c(isobaric)+c2(isometric);\n", "Pc = P1;\n", "Vc = V2;\n", "Tc = (Pc/P2)*T2;\n", "del_E_1c = Cv*(Tc-T1);\n", "Q_1c = Cp*(Tc-T1);\n", "del_H_1c = Q_1c;\n", "W_1c = P1*(Vc-V1)*((10^4*1.03)/427);\n", "del_E_c2 = Cv*(T2-Tc);\n", "Q_c2 = del_E_c2;\n", "del_H_c2 = Cp*(T2-Tc);\n", "W_c2 = 0;//constant volume process\n", "del_E_1c2 = del_E_1c+del_E_c2;\n", "del_H_1c2 = del_H_1c+del_H_c2;\n", "Q_1c2 = Q_1c+Q_c2;\n", "W_1c2 = W_1c+W_c2;\n", "del_S_1c = Cp*log(Tc/T1);\n", "del_S_c2 = Cv*log(T2/Tc);\n", "del_S_1c2 = approx((del_S_1c+del_S_c2),4);\n", "mprintf('\n\n(iv)For path 1c2 change in internal energy is %f',del_E_1c2);\n", "mprintf('\n For path 1c2 change in enthalpy is %f',del_H_1c2);\n", "mprintf('\n For path 1c2 heat released is %f Kcal',Q_1c2);\n", "mprintf('\n For path 1c2 work is %f Kcal',W_1c2);\n", "mprintf('\n For path 1c2 change in entropy is %f Kcal/Kgmole K',del_S_1c2);\n", "\n", "//Determination of state & path functions\n", "if((del_E_12 == del_E_1a2)&(del_E_12 == del_E_1b2)&(del_E_12 == del_E_1c2))\n", " mprintf('\n\n del_E is a state function');\n", "else\n", " mprintf('\n\n del_E is a path function');\n", "end\n", "if((del_H_12 == del_H_1a2)&(del_H_12 == del_H_1b2)&(del_H_12 == del_H_1c2))\n", " mprintf('\n\n del_H is a state function');\n", "else\n", " mprintf('\n\n del_H is a path function');\n", "end\n", "if(del_S_12 == del_S_1a2)&(del_S_12 == del_S_1b2)&(del_S_12 == del_S_1c2)\n", " mprintf('\n\n del_S is a state function');\n", "else\n", " mprintf('\n\n del_S is a path function');\n", "end\n", "if((Q_12 == Q_1a2)&(Q_12 == Q_1b2)&(Q_12 == Q_1c2))\n", " mprintf('\n\n Q is a state function');\n", "else\n", " mprintf('\n\n Q is a path function');\n", "end\n", "if((W_12 == W_1a2)&(W_12 == W_1b2)&(W_12 == W_1c2))\n", " mprintf('\n\n W is a state function');\n", "else\n", " mprintf('\n\n W is a path function');\n", "end\n", "\n", "//Comparison of work required by isothermal & adiabatic process\n", "if(-(W_12)<-(W_1b2))\n", " mprintf('\n\n Work required by isothermal process is less than the work required by an adiabatic process');\n", "else\n", " mprintf('\n\n Statement is incorrect');\n", "end\n", "//end" ] } ], "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 }