A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

download A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

of 85

Transcript of A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    1/222

    Scilab Textbook Companion for

    A Textbook Of Chemical Engineering

    Thermodynamics

    by K. V. Narayanan1

    Created byApurti Marodia

    B.TechChemical Engineering

    NIT Tiruchirappalli

    College TeacherDr. Prakash Kotecha

    Cross-Checked by

    August 10, 2013

    1Funded by a grant from the National Mission on Education through ICT,http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilabcodes written in it can be downloaded from the ”Textbook Companion Project”section at the website http://scilab.in

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    2/222

    Book Description

    Title:   A Textbook Of Chemical Engineering Thermodynamics

    Author:   K. V. Narayanan

    Publisher:  Prentice Hall Of India, New Delhi

    Edition:   15

    Year:   2011

    ISBN:   978-81-203-1732-1

    1

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    3/222

    Scilab numbering policy used in this document and the relation to theabove book.

    Exa  Example (Solved example)

    Eqn  Equation (Particular equation of the above book)

    AP  Appendix to Example(Scilab Code that is an Appednix to a particularExample of the above book)

    For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 meansa scilab code whose theory is explained in Section 2.3 of the book.

    2

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    4/222

    Contents

    List of Scilab Codes   4

    1 Introduction and Basic Concepts   11

    2 First Law of Thermodynamics   18

    3 PVT Behaviour And Heat Effects   34

    4 Second Law of Thermodynamics   51

    5 Some Applications of the Laws of Thermodynamics   72

    6 Thermodynamic Properties of Pure Fluids   105

    7 Properties of Solutions   130

    8 Phase equilibria   155

    9 Chemical Reaction Equilibria   194

    3

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    5/222

    List of Scilab Codes

    Exa 1.1 To find mans mass and weight on earth   . . . . . . . . 11Exa 1.2 To find height of manometer fluid   . . . . . . . . . . . 12Exa 1.3 To find height from ground and Kinetic Energy   . . . . 13Exa 1.4 To determine the power developed in man  . . . . . . . 13Exa 1.5 To determine the force exerted pressure work done and

    change in potential energy . . . . . . . . . . . . . . . . 14Exa 1.6 To determine work done by gas   . . . . . . . . . . . . . 15Exa 1.7 To find the work done on surrounding   . . . . . . . . . 16Exa 2.1 To find change in internal energy   . . . . . . . . . . . . 18Exa 2.2 To find heat liberated work done and change in internal

    energy . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Exa 2.3 To find the heat energy dissipated by brakes . . . . . . 20Exa 2.4 To find internal energy change during each step and

    work done during adiabatic process . . . . . . . . . . . 20Exa 2.5 To find change in internal energy and enthalpy   . . . . 22Exa 2.6 To find internal energy of saturated liquid and internal

    energy and enthalpy of saturated vapour  . . . . . . . . 23Exa 2.7 To calculate molar internal energy change and molar

    enthalpy change   . . . . . . . . . . . . . . . . . . . . . 24Exa 2.8 To determine the theoretical horsepower developed   . . 25Exa 2.9 To find temperature of water delivered to second storage

    tank   . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26Exa 2.10 To find change in enthalpy and maximum enthalpy change   27Exa 2.11 To determine heat transfer rates   . . . . . . . . . . . . 28

    Exa 2.12 To find change in internal energy enthalpy heat suppliedand work done   . . . . . . . . . . . . . . . . . . . . . . 29

    Exa 2.13 To determine change in internal energy and change inenthalpy   . . . . . . . . . . . . . . . . . . . . . . . . . 31

    4

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    6/222

    Exa 3.1 To find the molar volume of air   . . . . . . . . . . . . . 34

    Exa 3.2 Theoretical problem   . . . . . . . . . . . . . . . . . . . 35Exa 3.3 To determine heat and work effects for each step   . . . 35Exa 3.4 To calculate change in internal energy change in en-

    thalpy work done and heat supplied   . . . . . . . . . . 37Exa 3.5 To determine work done and amount of heat transferred   39Exa 3.6 To compare the pressures   . . . . . . . . . . . . . . . . 40Exa 3.7 To calculate the volume   . . . . . . . . . . . . . . . . . 41Exa 3.8 Theoretical problem   . . . . . . . . . . . . . . . . . . . 43Exa 3.9 To calculate compressibility factor and molar volume   . 43Exa 3.10 To calculate heat of formation of methane gas  . . . . . 46Exa 3.11 To calculate heat of formation of chloroform . . . . . . 47

    Exa 3.12 To calculate standard heat of reaction at 773 K   . . . . 47Exa 3.13 To determine heat added or removed   . . . . . . . . . . 48Exa 3.14 To calculate theoretical flame temperature . . . . . . . 49Exa 4.1 To calculate the maximum efficiency   . . . . . . . . . . 51Exa 4.2 To determine minimum amount of work done and heat

    given to surrounding   . . . . . . . . . . . . . . . . . . . 52Exa 4.3 To determine efficiency of proposed engine . . . . . . . 53Exa 4.4 To calculate entropy of evaporation . . . . . . . . . . . 54Exa 4.5 To determine change in entropy . . . . . . . . . . . . . 54Exa 4.6 To calculate the entropy change . . . . . . . . . . . . . 55

    Exa 4.7 To determine change in entropy . . . . . . . . . . . . . 56Exa 4.8 To determine the change in entropy   . . . . . . . . . . 57Exa 4.9 To calculate the total entropy change . . . . . . . . . . 58Exa 4.10 To calculate entropy of 1 kmole of air   . . . . . . . . . 59Exa 4.11 To determine change in entropy for the reaction . . . . 59Exa 4.12 Theoretical problem   . . . . . . . . . . . . . . . . . . . 61Exa 4.13 To calculate change in entropy and check whether the

    process is reversible   . . . . . . . . . . . . . . . . . . . 61Exa 4.14 To determine the change in entropy of system  . . . . . 62Exa 4.15 To calculate entropy change  . . . . . . . . . . . . . . . 64Exa 4.16 To calculate entropy change in the process . . . . . . . 66

    Exa 4.17 To calculate loss in capacity of doing work . . . . . . . 67Exa 4.18 To calculate total change in entropy and available work   68Exa 4.19 To calculate the molar entropy of metal   . . . . . . . . 69Exa 4.20 To calculate the absolute entropy of water vapour . . . 70Exa 5.1 To calculate the pressure at exit   . . . . . . . . . . . . 72

    5

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    7/222

    Exa 5.2 To determine quality of steam flowing through the pipe   73

    Exa 5.3 To determine the discharge velocity   . . . . . . . . . . 74Exa 5.4 To determine thermodynamic properties at throat andcritical pressure . . . . . . . . . . . . . . . . . . . . . . 75

    Exa 5.5 Theoretical problem   . . . . . . . . . . . . . . . . . . . 77Exa 5.6 Theoretical problem   . . . . . . . . . . . . . . . . . . . 77Exa 5.7 To calculate work required and temperature after com-

    pression   . . . . . . . . . . . . . . . . . . . . . . . . . . 78Exa 5.8 To calculate work required and temperature   . . . . . . 79Exa 5.9 To determine the least amount of power   . . . . . . . . 80Exa 5.10 To determine COP heat rejected and lowest temperature   81Exa 5.11 To determine COP at given conditions   . . . . . . . . . 82

    Exa 5.12 To determine power requirement and refrigeration ca-pacity in tonnes   . . . . . . . . . . . . . . . . . . . . . 83

    Exa 5.13 To calculate the COP and refrigeration circulation rate   84Exa 5.14 To determine the COP and air circulation rate   . . . . 86Exa 5.15 To verify that given heat pump is equivalent to 30 kW

    pump   . . . . . . . . . . . . . . . . . . . . . . . . . . . 87Exa 5.16 To determine the amount of fuel burned   . . . . . . . . 88Exa 5.17 To calculate fraction of liquid in inlet stream and tem-

    perature . . . . . . . . . . . . . . . . . . . . . . . . . . 89Exa 5.18 To determine fraction of air liquified and temperature

    of air   . . . . . . . . . . . . . . . . . . . . . . . . . . . 90Exa 5.19 To determine ideal Rankine cycle efficiency thermal ef-ficiency and rate of steam production   . . . . . . . . . 92

    Exa 5.20 To determine the work output thermal efficiency andrate of steam circulation  . . . . . . . . . . . . . . . . . 94

    Exa 5.21 To determine fraction of steam withdrawn and thermalefficiency of cycle . . . . . . . . . . . . . . . . . . . . . 96

    Exa 5.22 To determine mean effective pressure  . . . . . . . . . . 98Exa 5.23 To determine work done thermal effeciency and mean

    effective pressure   . . . . . . . . . . . . . . . . . . . . . 100Exa 5.24 To determine temperature pressure work and thermal

    effeciency   . . . . . . . . . . . . . . . . . . . . . . . . . 102Exa 6.1 To determine change in entropy of system   . . . . . . . 105Exa 6.2 To calculate vapour pressure of water at 363 K   . . . . 106Exa 6.3 To determine the melting point of mercury at 10 bar   . 107Exa 6.4 To calculate increase in entropy of solid magnesium . . 108

    6

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    8/222

    Exa 6.5 Theoretical problem   . . . . . . . . . . . . . . . . . . . 109

    Exa 6.6 Theoretical problem   . . . . . . . . . . . . . . . . . . . 109Exa 6.7 To calculate internal energy enthalpy entropy and freenergy for 1 mole of nitrogen   . . . . . . . . . . . . . . 110

    Exa 6.8 To calculate entropy change and mean heat capacity   . 111Exa 6.9 Theoretical problem   . . . . . . . . . . . . . . . . . . . 113Exa 6.10 To calculate Cv for mercury . . . . . . . . . . . . . . . 114Exa 6.11 Theoretical problem   . . . . . . . . . . . . . . . . . . . 115Exa 6.12 Theoretical problem   . . . . . . . . . . . . . . . . . . . 115Exa 6.13 Theoretical problem   . . . . . . . . . . . . . . . . . . . 116Exa 6.14 Theoretical problem   . . . . . . . . . . . . . . . . . . . 117Exa 6.15 Theoretical problem   . . . . . . . . . . . . . . . . . . . 117

    Exa 6.16 Theoretical problem   . . . . . . . . . . . . . . . . . . . 118Exa 6.17 Theoretical problem   . . . . . . . . . . . . . . . . . . . 118Exa 6.18 Theoretical problem   . . . . . . . . . . . . . . . . . . . 119Exa 6.19 Theoretical problem   . . . . . . . . . . . . . . . . . . . 119Exa 6.20 Theoretical problem   . . . . . . . . . . . . . . . . . . . 120Exa 6.21 To estimate the fugacity of ammonia   . . . . . . . . . . 121Exa 6.22 To determine the fugacity of gas   . . . . . . . . . . . . 121Exa 6.23 To determine the fugacity coeffeceint at given pressure   122Exa 6.24 Theoretical problem   . . . . . . . . . . . . . . . . . . . 123Exa 6.25 To determine the fugacity of pure ethylene . . . . . . . 124

    Exa 6.26 To determine fugacity and fugacity coeffecient of steam   124Exa 6.27 To estimate fugacity of ammonia   . . . . . . . . . . . . 125Exa 6.28 To calculate the fugacity of liquid water   . . . . . . . . 126Exa 6.29 To determine the fugacity of n butane in liquid state at

    given conditions   . . . . . . . . . . . . . . . . . . . . . 127Exa 6.30 To determine the activity of solid magnesium   . . . . . 128Exa 7.1 Theoretical problem   . . . . . . . . . . . . . . . . . . . 130Exa 7.2 To find the volume of mixture . . . . . . . . . . . . . . 130Exa 7.3 To find the required volume of methanol and water  . . 132Exa 7.4 To calculate the volume of water to be added and vol-

    ume of dilute alcohol solution   . . . . . . . . . . . . . . 133

    Exa 7.5 Theoretical problem   . . . . . . . . . . . . . . . . . . . 134Exa 7.6 To determine enthalpies of pure components and at in-

    finite dilution  . . . . . . . . . . . . . . . . . . . . . . . 135Exa 7.7 To calculate the partial molar volume of the components   136Exa 7.8 Theoretical problem   . . . . . . . . . . . . . . . . . . . 137

    7

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    9/222

    Exa 7.9 Theoretical problem   . . . . . . . . . . . . . . . . . . . 138

    Exa 7.10 To estimate the solubility of oxygen in water at 298 K   139Exa 7.11 To confirm that mixture conforms to Raoults Law andto determine Henrys Law constant   . . . . . . . . . . . 140

    Exa 7.12 To calculate activity and activity coeffecient of chloro-form . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    Exa 7.13 To determine fugacity fugacity coeffecient Henrys Lawconstant and activity coeffecient   . . . . . . . . . . . . 143

    Exa 7.14 Theoretical problem   . . . . . . . . . . . . . . . . . . . 144Exa 7.15 Theoretical problem   . . . . . . . . . . . . . . . . . . . 145Exa 7.16 Theoretical problem   . . . . . . . . . . . . . . . . . . . 146Exa 7.17 To determine enthalpies at infinite dilution   . . . . . . 146

    Exa 7.18 Theoretical problem   . . . . . . . . . . . . . . . . . . . 147Exa 7.19 To determine change in entropy for the contents of the

    vessel   . . . . . . . . . . . . . . . . . . . . . . . . . . . 148Exa 7.20 To determine heat of formation of LiCl in 12 moles of 

    water   . . . . . . . . . . . . . . . . . . . . . . . . . . . 149Exa 7.21 To calculate the free energy of mixing   . . . . . . . . . 150Exa 7.22 To calculate the mean heat capacity of 20 mol percent

    solution   . . . . . . . . . . . . . . . . . . . . . . . . . . 151Exa 7.23 To find the final temperature attained   . . . . . . . . . 153Exa 7.24 Theoretical problem   . . . . . . . . . . . . . . . . . . . 153

    Exa 8.1 Theoretical problem   . . . . . . . . . . . . . . . . . . . 155Exa 8.2 Theoretical problem   . . . . . . . . . . . . . . . . . . . 155Exa 8.3 Theoretical problem   . . . . . . . . . . . . . . . . . . . 156Exa 8.4 Theoretical problem   . . . . . . . . . . . . . . . . . . . 157Exa 8.5 Theoretical problem   . . . . . . . . . . . . . . . . . . . 157Exa 8.6 To determine composition of vapour and liquid in equi-

    librium   . . . . . . . . . . . . . . . . . . . . . . . . . . 158Exa 8.7 To determine pressure at the beginning and at the end

    of the process . . . . . . . . . . . . . . . . . . . . . . . 159Exa 8.8 To determine temperature pressure and compositions  . 160Exa 8.9 To construct boiling point and equilibrium point diagram   163

    Exa 8.10 Theoretical problem   . . . . . . . . . . . . . . . . . . . 165Exa 8.11 To calculate van Laar constants . . . . . . . . . . . . . 165Exa 8.12 To calculate activity coeffecients in a solution containing

    10 percent alcohol   . . . . . . . . . . . . . . . . . . . . 166

    8

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    10/222

    Exa 8.13 To calculate equilibrium vapour composition for solu-

    tion containing 20 mole percent hydrazine   . . . . . . . 167Exa 8.14 Theoretical problem   . . . . . . . . . . . . . . . . . . . 169Exa 8.15 To determine the total pressure   . . . . . . . . . . . . . 170Exa 8.16 To construct the Pxy diagram   . . . . . . . . . . . . . 171Exa 8.17 To determine the composition and total pressure of azeotrope   172Exa 8.18 Theoretical problem   . . . . . . . . . . . . . . . . . . . 174Exa 8.19 To calculate equilibrium pressure and composition   . . 174Exa 8.20 To determine parameters in Wilsons equation   . . . . . 177Exa 8.21 To alculate bubble and dew point and the composition   179Exa 8.22 To calculate bubble and dew point temperatures   . . . 182Exa 8.23 To test whetherthe given data are thermodynamically

    consistent or not   . . . . . . . . . . . . . . . . . . . . . 185Exa 8.24 Theoretical problem   . . . . . . . . . . . . . . . . . . . 186Exa 8.25 To estimate the constants in Margules equation  . . . . 187Exa 8.26 To calculate the partial pressure of water in vapour phase   188Exa 8.27 to calculate under three phase equilibrium  . . . . . . . 189Exa 8.28 To prepare temperature composition diagram   . . . . . 191Exa 9.1 Theoretical problem   . . . . . . . . . . . . . . . . . . . 194Exa 9.2 Theoretical problem   . . . . . . . . . . . . . . . . . . . 194Exa 9.3 Theoretical problem   . . . . . . . . . . . . . . . . . . . 195Exa 9.4 Theoretical problem   . . . . . . . . . . . . . . . . . . . 196

    Exa 9.5 Theoretical problem   . . . . . . . . . . . . . . . . . . . 196Exa 9.6 To calculate equilibrium constant  . . . . . . . . . . . . 197Exa 9.7 To calculate equilibrium constant at 500 K   . . . . . . 198Exa 9.8 To alculate standard free energy change and heat of for-

    mation   . . . . . . . . . . . . . . . . . . . . . . . . . . 199Exa 9.9 To estimate free energy change and equilibrium constant

    at 700 K   . . . . . . . . . . . . . . . . . . . . . . . . . 200Exa 9.10 to calculate equilibrium constant at 600 K  . . . . . . . 201Exa 9.11 To calculate equilibrium constant at 500K   . . . . . . . 202Exa 9.12 To find the value of n   . . . . . . . . . . . . . . . . . . 203Exa 9.13 To determine the percent conversion   . . . . . . . . . . 205

    Exa 9.14 To calculate fractional dissociation of steam   . . . . . . 206Exa 9.15 To determine conversion of nitrogen affected by argon   207Exa 9.16 To calculate the fractional dissociation of steam . . . . 208Exa 9.17 To calculate the fractional distillation of steam   . . . . 210Exa 9.18 To evaluate the percent conversion of CO   . . . . . . . 211

    9

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    11/222

    Exa 9.19 To determine the composition of gases leaving the reactor   212

    Exa 9.20 To evaluate the equilibrium constant   . . . . . . . . . . 214Exa 9.21 To calculate the decomposition pressure and tempera-ture at 1 bar   . . . . . . . . . . . . . . . . . . . . . . . 215

    Exa 9.22 To evaluate wt of iron produced per 100 cubic m of gasadmitted   . . . . . . . . . . . . . . . . . . . . . . . . . 216

    Exa 9.23 To calculate the composition at equilibrium assumingideal behaviour   . . . . . . . . . . . . . . . . . . . . . . 218

    Exa 9.24 To determine the number of degrees of freedom   . . . . 220

    10

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    12/222

    Chapter 1

    Introduction and Basic

    Concepts

    Scilab code Exa 1.1  To find mans mass and weight on earth

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 13   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 15

    6   c l e ar a ll ;

    7   clc ;

    8

    9

    10   // Given :11   F = 300;   // [N]12   g _ l oc a l = 4 .5 ;   / / l o c a l g r a v i t a t i o n a l a c c e l e r a t i o n [m/

    s ̂ 2 ]13   g _ e ar t h = 9 .8 1;   // e ar th ’ s g r a v i t a t i o n a l a c c e l e r a t i o n

    [m/ s ̂ 2 ]1415

    16   / /To f i n d man ’ s mass and w ei g ht on e a r t h17   m = F / g_ lo ca l ; / / m a ss o f man [ k g ]

    11

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    13/222

    18   w = m * g_ ea rt h ;   / / w ei g h t o f man on e a r t h [ N]

    19   mprintf ( ’ Mass o f man i s %f kg ’ , m ) ;20   mprintf ( ’ \nWeight o f man o n e a r th i s %f N ’ , w ) ;21

    22

    23   //e nd

    Scilab code Exa 1.2  To find height of manometer fluid

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 13   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 25

    6   c l e ar a ll ;

    7   clc ;

    8

    9

    10   // Given :11   p 1 = 1 . 15 * 10 ^ 5;   / / m e a su r ed p r e s s u r e [ N/mˆ 2 ]

    12   p 2 = 1 . 01 3 25 * 10 ^ 5;   / / a t m o s p h e r i c p r e s s u r e [ N/mˆ 2 ]13   s g = 2 .9 5;   / / s p e c i f i c g r a v i t y o f f l u i d14

    15   / /To f i n d h e i g ht o f manometer f l u i d16   p = p 1 - p 2 ;   / / d i f f e r e n c e i n p r e s s u r e17   // U si ng e q ua t i on 1 . 2 ( P age no . 6 )18   h = p / ( sg * ( 1 0^ 3 ) * 9 .8 0 67 ) ;   / / h e i g h t o f m an om et er

    f l u i d [m]19   mprintf ( ’ H ei gh t o f manometer f l u i d i s %f m’ , h ) ;20

    2122   //e nd

    12

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    14/222

    Scilab code Exa 1.3  To find height from ground and Kinetic Energy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 13   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 35

    6   c l e ar a ll ;

    7   clc ;

    8

    9

    10   //Gi v e n

    11   P E = 1 . 5* 1 0^ 3 ;   / / p o t e n t i a l e n e r g y [ J ]12   m = 10;   // m ass i n kg13   u = 50;   // v e l o c i t y i n m/ s14

    15   / /To f i n d h e i g ht from g ro un d and k i n e t i c e ne rg y16   // U si ng e q ua t i on 1 . 8 ( P age no . 8 )17   h = P E /( m * 9 .8 0 67 ) ; // h e i g h t fro m g ro un d i n m18

    19   // U si ng e q ua t i on 1 . 9 ( P age no . 8 )20   K E = 0 .5 * m *( u ^ 2) ; // K i ne t i c e ne rg y i n J21   mprintf (

     ’ H ei g ht f ro m g ro un d i s %f m ’, h ) ;

    22   mprintf ( ’ \ n K i n e t i c E ne rg y o f body i s %3 . 2 e J ’ , K E ) ;23

    24

    25   //e nd

    Scilab code Exa 1.4  To determine the power developed in man

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 13   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 45

    13

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    15/222

    6   c l e ar a ll ;

    7   clc ;8

    9

    10   //Gi v e n11   F = 600;   // w e ig h t i n N12   t = 120;   // t im e i n s e c13   h = 0. 18 ;   / / h e i gh t o f s t a i r s i n m14

    15   / /To d e t er m i ne t h e p ow er d e v el o p ed i n man16   S = 20* h;   // t o t a l v e r t i c a l d i s pl ac em en t i n m17   W = F * S ;   // work d on e i n J

    18   P = W / t ;   // p o we r d e v e l o p e d19   mprintf ( ’ P ower d e v el o p ed i s %i W’ , P ) ;20

    21

    22   //e nd

    Scilab code Exa 1.5   To determine the force exerted pressure work doneand change in potential energy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 13   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 55

    6   c l e ar a ll ;

    7   clc ;

    8

    9

    10   // Given :11   A = ( % pi / 4 ) * (0 .1 ^ 2) ;   / / a r e a i n mˆ 212   P = 1 . 01 3 25 * 10 ^ 5;   / / p r e s s u r e i n N/mˆ 213   m = 50;   // mass o f p i s t on and w ei gh t i n kg14   g = 9. 81 ;   / / a c c e l e r a t i o n due t o g r a v i t y (N/mˆ 2)

    14

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    16/222

    15

    1617   / /To d et er m in e t he f o r c e e x e rt e d p r e s s u r e work do ne

    and c ha ng e i n p o t e n t i a l e ne rg y18   / / ( a )19   F a = P *A ;   / / f o r c e e x e rt e d by a tm os ph er e i n N20   F p = m *g ;   // f o r c e e x er t ed by p i s t o n and w ei gh t i n N21   F = Fp + Fa ;   // t o t a l f o r c e e x e r t e d i n N22   mprintf ( ’ T ot al f o r c e e x e rt e d by t he a tm os ph er e , t he

    p i s t o n and t he w ei gh t i s %f N ’ , F ) ;23

    24   / / ( b )

    25   P g = F /A ;   / / p r e s s u r e o f g a s i n N/mˆ226   mprintf ( ’ \ n P re s su r e o f g as i s %5 . 4 e Pa ’ , P g ) ;27

    28   // ( c )29   S = 0.4;   / / d i s p la c e me n t o f g as i n m30   W = F * S ;   // work done by g as i n J31   mprintf ( ’ \nWork d on e by g a s i s %f J ’ , W ) ;32

    33   / / ( d )34   P E = m *g *S ;   // c ha n ge i n p o t e n t i a l e ne rg y i n J35   mprintf (

     ’ \nChange i n p o t e n t i a l e ne rg y i s %f J ’, P E ) ;

    36

    37   //e nd

    Scilab code Exa 1.6  To determine work done by gas

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 1

    3   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 65

    6

    7   c l e ar a ll ;

    15

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    17/222

    8   clc ;

    910

    11   // Given :12   //P/D = c o n st an t , wh ere P i s p r e s s u r e and D i s

    d i a m e t e r13   / / P = ( 2∗1 0 ˆ 5 )∗D14   D f = 2. 5;   / / f i n a l d i a m et e r (m)15   D i = 0. 5;   // i n i t i a l di am et er (m)16

    17   / / To d e t e r m i ne wo rk d on e by g a s18   / / Work d o ne = i n t e g r a l ( PdV )

    19   //W = i n t g ( ( 2 ∗1 0 ˆ 5∗D) d( pi /6) ( Dˆ3) ) . . . . t ha t i s20   W = ( % p i / 4) * 1 0 ^ 5 * (( D f ^ 4 ) - D i ^ 4) ;

    21   mprintf ( ’ Work d on e by g a s i s %6 . 4 e J ’ , W ) ;22

    23   //e nd

    Scilab code Exa 1.7  To find the work done on surrounding

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 13   / / I n t r o d u c t i o n and B a s i c C on ce pt s4   // E xampl e 75

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   T = 300;   / / t e m p e r a tu r e i n K13   P = 6 .5 *1 0^ 5;   / / p r e s s u r e i n N/mˆ 214   P a = 1 . 01 3 25 * 10 ^ 5;   / / a t m o s p h e r i c p r e s s u r e i n N/mˆ 215   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t

    16

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    18/222

    16   m = 2 ;   // mass o f g as ( kg )

    17   M = 44;   / / m o l ec u l ar w ei hg t o f g as1819   / /To f i n d t h e work d on e o n s u r r o un d i n g20   n = m / M ;   // n i s number o f k mo le s21   V i = ( n * R *1 0^ 3* T ) / P ;   / / i n i t i a l v o lu m e i n mˆ 322   V f = 2* Vi ;   / / f i n a l vo lum e i n mˆ 323   V = V f - V i ;   // c h a n ge i n v ol um e24   P s = P a + (5 0 00 * 9. 8 06 7 ) ;   / / p r e s s u r e on s u r r o u n d i n g s25   W = Ps *V ;   // work d on e on t h e s u r r o u n d i n g s26   mprintf ( ’ Work d on e on s u r r o u n d i n g s i s %5 . 2 e J ’ , W ) ;27

    2829   //e nd

    17

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    19/222

    Chapter 2

    First Law of Thermodynamics

    Scilab code Exa 2.1  To find change in internal energy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 15

    6

    7   c l e ar a ll ;8   clc ;

    9

    10

    11   //Gi v e n12   W = - 2. 25 *7 45 . 7;   // w ork d on e on s ys te m i n J / s13   Q = - 3 40 0 *( 1 0 ^3 ) / 3 6 0 0;   / / h ea t t r a n s f e r r e d t o t he

    s ur r o un d in g i n J / s14

    15   //To f i n d t he c ha nge i n i n t e r n a l e ne rg y

    16   // U si ng e q ua t i on 2 . 4 ( P age no . 2 6)17   U = Q - W;   // c ha ng e i n i n t e r n a l e ne rg y i n J / s18   mprintf ( ’ I n t e r n a l e ne rg y o f sy st e m i n c r e a s e s by %f J

    / s ’ , U ) ;19

    18

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    20/222

    20   //e nd

    Scilab code Exa 2.2   To find heat liberated work done and change in in-ternal energy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 2

    56

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   //Gi v e n12   T = 298;   / / t e m p e r a tu r e i n K13   P = 101;   / / p r e s s u r e i n kPa14   n _ ir on = 2;   // m ol es o f i r o n r e a ct e d15   Q = - 83 1. 08 ;   // h ea t l i b e r a t e d i n kJ

    16   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t17

    18   / /To f i n d h ea t l i b e r a t e d work done and c ha ng e i ni n t e r n a l e ne rg y

    19   mprintf ( ’ H eat l i b e r a t e d d ur in g t h e r e a c t i o n i s %f k J’ , Q ) ;

    20   n _ o xy g en = 1 .5 ;   // m o le s o f o xyg en r e a c t ed21

    22   // U si ng i d e a l g as e q ua t i on P ( Vf  −Vi )=nRT and W=P( Vf −Vi )

    23   W = - 1.5 * R* T ;   // work d on e b y s ys te m i n J2425   // U si ng e q ua t i on 2 . 4 ( P age no . 2 6)26   U = ( Q *1 0^ 3) - W ;   // c h a ng e i n i n t e r n a l e n er gy i n J27   mprintf ( ’ \nWork d on e by g a s i s %f J ’ , W ) ;

    19

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    21/222

    28   mprintf ( ’ \nChange i n i n t e r n a l e ne rg y i s %6 . 3 e J ’ , U ) ;

    2930   //e nd

    Scilab code Exa 2.3  To find the heat energy dissipated by brakes

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s

    4   // E xampl e 356

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   //Gi v e n12   u = 20;   / / s pe ed o f c a r i n m/ s13   z = 30;   // h e i g ht v e r t i c a l l y a bo ve t he bottom o f h i l l

    i n m

    14   m = 14 00 ;   // mass o f c ar i n kg15

    16   / /To f i n d t he h ea t e ne rg y d i s s i p a t e d by b ra k e s17   // U si ng e q ua t i on 2 . 3 ( P age no . 2 6)18   K E = - 0. 5* m * ( u ^2 ) ;   // c ha n ge i n k i n e t i c e ne rg y i n J19   P E = - m *9 .8 1* z ;   // c h a ng e i n p o t e n t i a l e ne rg y i n J20   Q = -( KE + PE ) ;   // h ea t d i s s i p a t e d by b ra k e s i n J21   mprintf ( ’ H eat d i s s i p a t e d by b ra k e s i s %3 . 2 e J ’ , Q ) ;22

    23   //e nd

    Scilab code Exa 2.4  To find internal energy change during each step andwork done during adiabatic process

    20

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    22/222

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s

    2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 45

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   // S te p 1 : c o ns t an t p r e s s ur e p r o c e s s

    13   // S t ep 2 : c o s t a n t volume p r o c e s s14   // S te p 3 : a d i b a t i c p r oc e ss15

    16   / /To f i n d i n t e r n a l e ne rg y c ha nge d ur in g e a ch s t epand work done d u ri n g a d i a b a t i c p r o c e s s

    17

    18   / / For s t e p 119   W 1 = -50;   // work r e c e i v e d i n J20   Q 1 = -25;   / / h ea t gv en o ut i n J21   U 1 = Q1 - W1 ;   // i n t e r n a l e ne rg y c h ang e i n J22   mprintf (

     ’ Change i n i n t e r n a l e ne rg y f o r c on s ta n tp r e s s u r e p r oc e ss i s %i J ’ , U 1 ) ;23

    24   / / For s t e p 225   W 2 = 0;   // work done f o r c o n st a n t volume p r o c e s s i s

    z e r o26   Q 2 = 75;   / / h ea t r e c e i v e d i n J27   U 2 = Q2 ;   // i n t e r n a l e ne rg y c h an ge i n J28   mprintf ( ’ \nChange i n i n t e r n a l e ne rg y f o r c on s ta n t

    volume p r o c e s s i s %i J ’ , U 2 ) ;29

    30   / / For s t e p 331   Q 3 = 0;   // no h ea t e xc ha ng e i n a d i a b a t i c p r o c es s32   / / S i n ce t he p r o c e s s i s c y c l i c33   // U3+U2+U1 = 0 ;34   U 3 = -( U1 + U2 ) ;

    21

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    23/222

    35   W 3 = - U3 ;   // work d on e i n J

    36   mprintf ( ’ \nWork d one d u ri n g a d i a b a t i c p r o c e s s i s %iJ ’ , W 3 ) ;37

    38   //e nd

    Scilab code Exa 2.5  To find change in internal energy and enthalpy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s

    2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 55

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   n _ w at e r = 1 0^ 3;   // m o le s o f w at er

    13   T = 373;   // t e m pe a r t u r e (K)14   P = 1 01 .3 ;   / / p r e s s u r e ( k Pa )15   s v _ l i qu i d = 0 . 0 01 0 4 ;   / / s p e c i f i c v o lu m e o f l i q u i d (m

    ˆ 3 / k m o l )16   s v _v a po u r = 1 .6 75 ;   // s p e c i f i c volume o f vapou r (mˆ3/

    k mol )17   Q = 1 .0 3* 10 ^3 ;   / / h e a t a dd ed i n kJ18

    19   / /To f i n d c h an ge i n i n t e r n a l e ne rg y and e nt ha l p y20   W = P * n _ w a te r * ( s v _ va p ou r - s v _ l i qu i d ) * 1 0^ - 3 ;   //

    e x p an s i o n work d on e i n kJ21   U = Q - W;   // c ha ng e i n i n t e r n a l e ne rg y i n kJ22

    23   / / For c o ns t an t p r e s su r e p r o c es s24   H = Q ;   / / e n t ha l p y c ha ng e i n kJ

    22

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    24/222

    25   mprintf ( ’ Change i n i n t e r n a l e ne rg y i s %f kJ ’ , U ) ;

    26   mprintf ( ’ \nChange i n e n t ha l p y i s %3 . 2 e kJ ’ , H ) ;2728   //e nd

    Scilab code Exa 2.6  To find internal energy of saturated liquid and inter-nal energy and enthalpy of saturated vapour

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s

    2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 65

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   T = 233;   / / t e m p e r a tu r e i n K

    13   V P = 1 . 00 5 *1 0 ^3 ;   // v a po ur p r e s s u r e o f CO2 i n kPa14   s v _ l i qu i d = 0 . 9* 1 0^ - 3 ;   / / s p e c i f i c v ol um e o f l i q u i d

    CO2 i n mˆ3/k g15   s v _ v a po u r = 3 8 .2 * 10 ^ - 3 ;   // s p e c i c i f i c volume o f CO2

    v a po u r i n mˆ 3 / k g16   L = 3 20 .5 ;   // l a t e n t h ea t o f v a p o r i s a t i o n o f CO2 i n

    k J /k g17   / / Assuming a t t h e s e c o n d i t i o n s CO2 i s s a t u r a t ed

    l i q u i d s o18   H 1 = 0;   // e nt ha lp y i n l i q u i d s t a t e

    1920   / /To f i n d i n t e r n a l e ne rg y o f s a tu r a t ed l i q u i d andi n t e r n a l e ne rg y and e nt ha l p y o f s a t ur a t ed v a pou r

    21   // For s a t ur a t e d l i q u i d22   U 1 = H1 - ( V P * s v_ l iq u id ) ;   // i n t e r n a l e n e r g y i n l i q u i d

    23

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    25/222

    s t a t e i n kJ /kg

    23   / / For s a t u r a t e d v ap ou r24   H v = H1 +L ;   / / e n th a lp y o f s a t u r a t ed v ap ou r i n kJ / kg25   U v = Hv - ( V P * s v_ v ap o ur ) ;   // i n t e r n a l e ne rg y i n v ap ou r

    s t a t e i n kJ /kg26   mprintf ( ’ I n t e r n a l Energy o f s a tu r at e d l i q u i d i s %f  

    kJ/kg ’ , U 1 ) ;27   mprintf ( ’ \ n En th al py o f v ap ou r s t a t e i s %f kJ / kg ’ , H v )

    ;

    28   mprintf ( ’ \ n I n t e rn a l Energy o f v apo ur s t a t e i s %f k J/kg ’ , U v ) ;

    29

    30   //e nd

    Scilab code Exa 2.7  To calculate molar internal energy change and molarenthalpy change

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s

    4   // E xampl e 75

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   I = 0.5;   / / c u r r e n t i n A mp er es13   V = 12;   / / v o l t a g e i n v o l t s

    14   t = 5* 60 ;   // t im e i n s e c15   m = 0 .7 98 ;   // mass o f w at er v a p or i se d i n g16   M = 18;   / / m o l ec u l ar mass o f w at er i n g17

    18   //To c a l c u l a t e m ol ar i n t e r n a l e ne rg y c ha ng e and

    24

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    26/222

    m ol a r e n t h a l p y c ha n ge

    19   Q = ( I * V* t / 10 0 0) ;   / / e l e c t r i c e n e r g y s u p p l i e d i n k J20   // R e f e r r i n g e q ua t i on 2 . 1 0 ( P age no . 2 9)21   H = ( Q* M) /m ;   // m o la r e n t ha l p y c ha ng e i n kJ / mo le22

    23   / /BY i d e a l g a s e q u a t i o n PV=RT24   / / R e f e r r i n g e qu a ti o n 2 . 9 f o r c on s ta n t p r e s s ur e

    p r o c e s s ( P age no . 2 9)25   U = H - ( 8 .3 1 4* 1 0^ - 3 * 3 73 ) ;   // m ol ar i n t e r n a l e ne rg y

    c ha n ge i n kJ / m ol e26   mprintf ( ’ Mo lar E nt ha lp y c ha ng e d u ri n g t he p r o c e s s i s

    %i k J / m o l e ’ , H ) ;

    27   mprintf ( ’ \n Mo la r I n t e r a n l E ne rg y c h a ng e d u r in g t h ep r o c e s s i s %f kJ / mole ’ , U ) ;

    28

    29   //e nd

    Scilab code Exa 2.8  To determine the theoretical horsepower developed

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s

    2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 85

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :

    12   m = 16 50 ;   // mass o f s tea m u se d i n kg / hr13   H 1 = 3 20 0;   / / e n t ha l p y a t 1 36 8 kPa and 6 45 K i n kJ / kg14   H 2 = 2 69 0;   / / e n t ha l p y a t 1 37 kPa and 6 45 K i n kJ / kg15

    16   / /To d et er m in e t he t h e o r e t i c a l h or se po we r d e ve l op e d

    25

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    27/222

    17   / / U s in g e q u a t i o n 2 . 1 3 ( P age no . 3 2 )

    18   Q = 0 ;   // s i n c e t he p r oc e ss i s a d i a b a t i c19   z = 0 ;   // a ss umi ng t ha t i n l e t and d i s c ha r g e o f  t u r b i n e a re a t s ame l e v e l

    20   u = 0 ;   / / f e e d a nd d i s c h a r g e v e l o c i t i e s b e i n g e q u a l21   W s = -( H2 - H 1) ;

    22   W j = W s * 10 ^3 * m / 3 60 0;   // work done by t u r b i n e i n J23   W = Wj / 7 45 .7 ;   // work done by t u r b i n e i n hp24   mprintf ( ’ Work d on e by t u r b i n e i s %f hp ’ , W ) ;25

    26   //e nd

    Scilab code Exa 2.9   To find temperature of water delivered to second stor-age tank

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 95

    6   c l e ar a ll ;7   clc ;

    8

    9

    10   // Given :11   m = 2 5* 10 ^3 ;   // mass f l o w r a t e o f w a te r i n kg /h12   P = 2 ;   // p ow er s u p p l i e d by m oto r i n hp13   q = 4 20 00 ;   / / h e at g i v e n i n kJ / min14   z = 20;   // e l e v a t i o n i n m15   T = 368;   / / t e m p e r a tu r e i n K

    16   T o = 27 3;   / / s t a nd a r d t e m pe r a tu r e i n K17   C p = 4. 2;   / / s p e c i f i c h e a t o f w a te r i n kJ / kg K18

    19   / /To f i n d t em pe ra tu re o f w a te r d e l i v e r e d t o s ec on ds t o r a g e t an k

    26

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    28/222

    20   W = ( P * 7 45 .7 * 10 ^ - 3 * 36 0 0) / m ;   // work d on e p e r kg o f  

    w a t e r pumped i n k J / kg21   Q = q *6 0/ m ;   // h ea t g i v en o ut p er kg o f f l u i d22   P E = 0 9. 8 1* z * 1 0^ - 3 ;   // c ha ng e i n p o t e n t i a l e ne rg y i n

    k J /k g23

    24   // U si ng e q ua t i on 2 . 1 3 ( P age no . 3 2)25   H = - Q+ W -PE ;

    26   //H = H2−H127   H 1 = Cp * (T - To ) ;

    28   H 2 = H1 +H ;

    29   / / L et T1 b e t he t em p er a tu re a t s ec on d s t o r a g e t an k

    30   T 1 = T o +( H 2 / Cp ) ;31   mprintf ( ’ T em pe ra tu re o f w at er a t s e co n d s t o r a g e t an k

    i s %i K ’ , T 1 ) ;32

    33   //e nd

    Scilab code Exa 2.10  To find change in enthalpy and maximum enthalpychange

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 105

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    1011   // Given :12   D 1 = 25;   // i n t e r n a l d i am et e r o f p i pe i n mm13   u 1 = 10;   // u ps tr ea m v e l o c i t y i n m/ s14   D 2 = 50;   // d o wn st re am d i a m e t e r o f p i p e i n mm

    27

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    29/222

    15   / / S i n ce t h e r e i s no e x t e r n al d e v i c e f o r a d di n g o r

    r em o vi n g e n e r g y a s wo rk16   / /Q = 0 , Ws = 017

    18   / / To f i n d c h an g e i n e n t h a l p y and maximum e n t h a l p yc h a n g e

    19

    20   / / ( a )21   / / L e t A1 n ad A2 b e u p s tr e am a nd d ow ns tr ea m

    c r o s s s e c t i o n a l a r e as o f p ip e22   u 2 = ( ( D1 / D 2 ) ^2 ) * u1 ;   // d own st re am v e l o c i t y i n m/ s23   H = 0 .5 *( u 1 ^2 - u 2 ^ 2) ;   // c ha ng e i n e n th a lp y i n J /kg

    24   mprintf ( ’ C hange i n e n t ha l p y i s %f J / kg ’ , H ) ;25

    26   / / ( b )27   / / F o r maximum e n t h a l p y c h a n g e28   u 2 = 0;

    29   H m ax = 0 .5 * u1 ^ 2 ;   / / ( J / k g )30   mprintf ( ’ \nMaximum e n t h a l p y c h n ag e f o r a s u dd e n

    e nl a rg e me n t i n p i pe i s %f J /kg ’ , H m a x ) ;31

    32   //e nd

    Scilab code Exa 2.11  To determine heat transfer rates

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 115

    67   c l e ar a ll ;

    8   clc ;

    9

    10

    28

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    30/222

    11   // Given :

    12   // At i n l e t :13   T 1 = 29 3;   // Tempera ture (K)14   P 1 = 3 0 0+ 1 36 . 8;   / / P r e s s u r e ( k Pa )15

    16   / / At e x i t :17   T 2 = 45 3;   // Tempera ture (K)18   P 2 = 1 36 .8 ;   / / P r e s s u r e ( k Pa )19   C p = 2 9. 4;   / / s p e c i f i c h e a t c a p a c i t y a t c o n s t a n t

    p r e s s u r e i n kJ / kmol20   m = 10 00 ;   // m ass o f h yd ro ge n i n kg21   M = 2. 02 ;   / / m o l e c u l a r m as s o f h y dr o ge n

    2223   / /To d et er mi ne h ea t t r a n s f e r r a t e s24   // N e gl e c ti n g t he k i n e t i c nd p o t e n t i a l e ne rg y c ha ng es25   / / Assuming t he p r o c e s s t o be o c c u r in g t hr ou gh a

    number o f s t e p s26

    27   / / St e p 1 be i s ot h er m al and s t e p 2 be i s o b a r i c28   H 1 = 0;   // c han ge i n e nt ha lp y f o r s t ep 129   H 2 = ( m / M ) * Cp * ( T 2 - T 1 ) / 1 00 0 ;   // c ha ng e i n e n th a lp y f o r

    s t e p 2 i n k J30   H = H2 + H1 ;

    31   Q = H ;   // h e a t t r a n s f e r r e d i n c o i l s i n kJ32   mprintf ( ’ Heat t r a n s f e r r e d i n c o i l s i s %f k J ’ , Q ) ;33

    34   //e nd

    Scilab code Exa 2.12   To find change in internal energy enthalpy heat sup-plied and work done

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s4   // E xampl e 12

    29

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    31/222

    5

    67   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   m = 10;   // mass o f a i r i n kg13   P 1 = 10 0;   // i n i t i a l pr e s su r e ( k Pa )14   T 1 = 30 0;   // i n i t i a l te mp er at ur e (K)15   T 2 = 60 0;   / / f i n a l t e m p e r a tu r e (K)16   R = 8 .3 14 ;   / / i d e a l g a s c o n s t a n t ( k J / km ol K )

    17   C p = 2 9. 09 9;   / / s p e c i f i c h e a t c a p a c i t y a t c o n s t a n tp r e s s u r e ( k J /kmol K)

    18   C v = 2 0. 78 5;   / / s p e c i f i c h e a t c a p a c i t y a t c o n s t s a n tv o lu m e ( k J / k mo l K)

    19   M = 29;   / / m o l ec u l ar w ei gh t o f a i r20

    21   / /To d et er m in e c ha ng e i n i n t e r n a l e ne rg y e n th a lp yh e at s u p p l i e d and work d on e

    22   n = m / M ;   / / number o f m o le s o f g a s ( k mo l )23   V 1 = ( n * R* T 1 )/ P 1 ;   / / i n i t i a l v ol um e o f a i r (mˆ 3 )24

    25   / / ( a )26   / / C o ns t an t v ol um e p r o c e s s27   V 2 = V1 ;   // f i n a l v ol ume28   // Change i n i n t e r n a l e ne rg y U = n∗ in t g (CvdT) . . . so29   U = n * Cv * ( T2 - T 1 ) ;   // c ha ng e i n i n t e r n a l e ne rg y ( kJ )30   Q = U ;   / / h e a t s u p p l i e d ( k J )31   W = 0 ;   / / w or k d o ne32   H = U + ( n* R *( T2 - T 1 ) ) ;   / / c h an ge i n e n t ha l p y ( k J )33   disp ( ’ F or c o n s t a n t v olu me p r o c e s s ’ ) ;34   mprintf ( ’ \nChange i n i n t e r n a l e ne rg y i s %i kJ ’ , U ) ;

    35   mprintf ( ’ \nHeat s u p p l i e d i s %i kJ ’ , Q ) ;36   mprintf ( ’ \nWork d on e i s %i kJ ’ , W ) ;37   mprintf ( ’ \nChange i n e n t ha l p y i s %i kJ ’ , H ) ;38

    39   / / ( b )

    30

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    32/222

    40   / / Co ns ta nt p r e s s u r e p r o c e s s

    41   / / Change i n e n t ha l p y H = n∗ in t g (CpdT) . . . so42   H = n * Cp * ( T2 - T 1 ) ;   / / c h an ge i n e n t h al p y ( k J )43   Q = H ; / / h e a t s u p p l i e d ( k J )44   U = H - ( n *R * ( T2 - T 1 ) ) ;// c ha ng e i n i n t e r n a l e ne rg y ( kJ )45   W = Q - U;   / / w or k d o ne ( k J )46   mprintf ( ’ \n\nFor c o n st a n t p r e s s u r e p r o c e s s ’ ) ;47   mprintf ( ’ \n\nChange i n i n t e r n a l e ne rg y i s %i kJ ’ , U ) ;48   mprintf ( ’ \nHeat s u p p l i e d i s %i kJ ’ , Q ) ;49   mprintf ( ’ \nWork d on e i s %i kJ ’ , W ) ;50   mprintf ( ’ \nChange i n e n t ha l p y i s %i kJ ’ , H ) ;51

    52   //e nd

    Scilab code Exa 2.13  To determine change in internal energy and changein enthalpy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 23   / / F i r s t Law o f T he rm o dy na m ic s

    4   // E xampl e 135

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   R = 8 .3 14 ;   / / i d e a l g a s c o n s t a n t ( k J / km ol K )13   C v = 2 0. 8;   / / s p e c i f i c h e a t c a p a c i t y a t c o n s t a n t

    volume (kJ/kmol K)14   C p = 2 9. 1;   / / s p e c i f i c h e a t c a p a c i t y a t c o n s t a n tp r e s s u r e ( k J / k mo l K)

    15   P 1 = 10;   // i n i t i a l p r e s s u r e ( bar )16   T 1 = 28 0;   / / i n i t i a l t e m p e r a t u r e i n K

    31

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    33/222

    17   P 2 = 1;   / / f i n a l p r e s s u r e ( b a r )

    18   T 2 = 34 0;   / / f i n a l t e m p e r a tu r e (K)1920   / /To d et er m in e t he c ha ng e i n i n t e r n a l e ne rg y and

    c ha ng e i n e n t ha l p y21   / / S o l u t i o n22   n = 1 ;   // b a s i s : 1 kmol o f i d e a l g as23   V 1 = ( n * R* T 1 ) /( P 1 * 10 0) ;   // i n i t i a l volume in mˆ324   V 2 = ( n * R* T 2 ) /( P 2 * 10 0) ;   / / f i n a l v ol ume i n mˆ 325

    26   / / Assuming t he c h ang e i n s t a t e i s o c c u r i ng a l on g t hef o l l o w i n g two s t ep p r o c es s

    27   / / 1 . A c o n st a n t volume p r o c e s s i n whi ch t he p r e s s u r ei s r ed uc e d t o t he f i n a l v al ue P2 and t he

    t em p er a tu r e g e t s r ed uc ed t o T228   / / L e t Po a nd V od en ot e t h e p r e s s u r e and v ol um e o f  

    s y s t e m a f t e r t h i s s t e p29   P o = P2 ;

    30   V o = V1 ;

    31   T o = ( P o * 10 0* V o ) /( n * R );

    32   U 1 = C v *( To - T 1 ) ;

    33   H 1 = U 1 +( V 1 * 10 0* ( P2 - P 1 ) ) ;

    34   W 1 = 0;

    35   Q 1 = U1 ;

    36

    37   // 2 . A c on st an t p r e s s u r e p r o c e s s i n which t he g as i sh ea te d t o t he f i n a l t em pe ra tu re T2 and t he f i n a lv ol ume V2

    38   H 2 = C p *( T2 - T o ) ;

    39   U 2 = H2 - 10 0* ( V2 - V 1 ) ;

    40   Q 2 = H2 ;

    41   W 2 = Q2 - U2 ;

    42

    43   / / For a c t ua l p r o c e s s44   U = U1 + U2 ;   // c ha ng e i n i n t e r n a l e ne rg y ( kJ )45   H = H1 + H2 ;   / / c h an ge i n e n t ha l p y ( k J )46   mprintf ( ’ Change i n i n t e r n a l e ne rg y i s %f kJ ’ , U ) ;47   mprintf ( ’ \nChange i n e n t ha l p y i s %f kJ ’ , H ) ;

    32

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    34/222

    48

    49   //e nd

    33

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    35/222

    Chapter 3

    PVT Behaviour And Heat

    Effects

    Scilab code Exa 3.1  To find the molar volume of air

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 15

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   T = 350;   / / t e m p e r a tu r e i n K13   P = 10 ^5 ;   / / p r e s s u r e i n N/mˆ 214   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t

    1516   / /To f i n d t he m ol ar volume o f a i r17

    18   V = ( R* T) /P ;   / / m o l ar v ol um e i n mˆ 319   mprintf ( ’ Mo la r v ol um e o f a i r i s %3 . 2 e c u b i c m/ mol ’ ,V

    34

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    36/222

    ) ;

    2021   //e nd

    Scilab code Exa 3.2   Theoretical problem

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s

    4   // E xampl e 256

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12

    13

    14   / /The g i v e n pr obl e m i s t h e o r e t i c a l and d oe s no t

    i n v o l v e any n u m e ri c a l c o mp ut a ti on15

    16   //e nd

    Scilab code Exa 3.3  To determine heat and work effects for each step

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 3

    3   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 35

    6

    7   c l e ar a ll ;

    35

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    37/222

    8   clc ;

    910

    11   // Given :12   C p = 2 9. 3;   / / s p e c i f i c h e a t a t c o n s t a n t p r e s s u r e ( k J /

    kmol K)13   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t14

    15   / /To d e t er m i ne h e at and work e f f e c t s f o r e ac h s t e p16

    17   // S t ep 1 : Gas i s h ea te d a t c o n st a n t volume18   T 1 = 30 0;   / / t e m p e r at u r e i n K

    19   P 1 = 1;   / / i n i t i a l p r e s s u r e i n b a r20   P 2 = 2;   // f i n a l p r e s s u r e i n b a r21   T 2 = ( P2 / P1 ) * T1 ;   // f i n a l t em p er at u re i n K22   C v = Cp - R;   / / s p e c i f i c h e a t a t c o n s t a n t v ol um e23   W 1 = 0;   // work done i s z e ro a s volume r em ai ns

    c o n s t a n t24   Q 1 = C v *( T2 - T 1 ) ;   / / h e at s u p p l i e d i n kJ / kmol25   mprintf ( ’ F or s t e p 1 ’ ) ;26   mprintf ( ’ \nWork done i n s t e p 1 i s %i ’ , W 1 ) ;27   mprintf ( ’ \nHeat s u p p l i e d i n s t e p 1 i s %f k J/ kmol ’ , Q1

    ) ;

    28

    29   / / S te p 2 : The p r oc e ss i s a d i a b a t i c30   Q 2 = 0;   / / t he p r oc e ss i s a d i a b a t i c31   P 3 = 1;   // p r e s s u r e a f t e r s t e p 2 i n b a r32   g am a = ( Cp / Cv ) ;

    33   T 3 = ( ( P 3 / P2 ) ^ ( ( g am a - 1 ) / g am a ) ) * T 2 ;   / / t e m p e r a t u r ea f t e r s te p 2

    34   W 2 = ( C v *( T2 - T 3 ) ) ;   // w or k d on e by s y s t em35   mprintf ( ’ \n\nFor s t e p 2 ’ ) ;36   mprintf ( ’ \nHeat s u pp l ie d i n s t e p 2 i s %i ’ , Q2 );

    37   mprintf ( ’ \nWork done by s ys te m i n s t e p 2 i s %f kJ /kmol ’ , W 2 ) ;

    38

    39   // S te p 3 : The p r oc e ss i s i s o b a r i c40   T 4 = 30 0;   / / t em p er at u re a f t e r s t e p 3 (K)

    36

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    38/222

    41   Q 3 = C p *( T4 - T 3 ) ;   // h ea t s u p p l i e d d u ri n g s t e p 3 ( kJ /

    k mol )42   U = ( C v *( T4 - T 3 ) ) ;   // c ha ng e i n i n t e r n a l e ne rg y d ur in gs t e p 3 ( k J / km ol )

    43   W 3 = Q3 - U;   / / U s i n g f i r s t l a w o f t h er m od y n am i c s44   mprintf ( ’ \n\nFor s t e p 3 ’ ) ;45   mprintf ( ’ \nHeat g i v e n o ut by t he sy st e m i n s t ep 3 i s

    %f k J /k mol ’ , Q 3 ) ;46   mprintf ( ’ \nWork d one on t he s ys te m i n s t e p 3 i s %f  

    kJ/kmol ’ , W 3 ) ;47

    48   //e nd

    Scilab code Exa 3.4  To calculate change in internal energy change in en-thalpy work done and heat supplied

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 3

    3   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 45

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t

    13   C p = 30;   / / s p e c i f i c h e a t a t c o n s t a n t p r e s s u r e ( J / m olK)14

    15   //To c a l c u l a t e c h an ge i n i n t e r n a l e ne rg y c ha nge i ne n t ha l p y work d on e a nd h e at s u p p l i e d

    37

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    39/222

    16

    17   // ( a ) : Gas i s exp an ded i s o t h e r m a l l y18   T = 600;   / / t e m p e r a tu r e i n K19   P 1 = 5;   / / i n i t i a l p r e s s u r e i n b a r20   P 2 = 4;   // f i n a l p r e s s u r e i n b a r21   U 1 = 0;   // s i n c e t h e p r o c e s s i s i s ot h er m a l22   H 1 = 0;   // s i n c e t h e p r o c e s s i s i s ot h er m a l23   W 1 = ( R* T* log ( P 1 / P 2 ) ) ;   / / work d on e d u r in g t h e

    p r o c e s s24   Q 1 = W1 ;   // h ea t s u p p l i e d d u ri n g t he p r o c e s s25   mprintf ( ’ When g a s i s e xp an ded i s o t h e r m a l l y ’ ) ;26   mprintf ( ’ \nChange i n i n t e r n a l e ne rg y i n i s o t he r m al

    p r o c es s i s %i ’ , U 1 ) ;27   mprintf ( ’ \nChange i n e n th a lp y i n i s o t h e r m a l p r o c e s s

    i s %i ’ , H 1 ) ;28   mprintf ( ”\nWork done d u ri n g t he p r o c e s s i s %f k J/

    kmol” , W 1 ) ;29   mprintf ( ’ \nHeat s u p pl i e d d ur in g t he p r o c es s i s %f kJ

    /kmol ’ , Q 1 ) ;30

    31   / / ( b ) : Gas i s h ea te d a t c o n st a n t volume32   V = 0.1;   / / v o lu m e (mˆ 3 )33   P 1 = 1;

      // i n i t i a l p r es s u re ( bar )34   T 1 = 29 8;   // i n i t i a l te mp er at ur e (K)35   T 2 = 40 0;   / / f i n a l t e m p e r a tu r e (K)36   n = ( ( P1 * V * 10 ^ 5) / ( R * T1 ) ) ;   // number o f m ol es o f g a s37   C v = Cp - R;   / / s p e c i f i c h e a t a t c o n s t a n t v o lu m e ( J / m ol

    K)38   U 2 = n * Cv * ( T2 - T 1 ) ;   // c ha ng e i n i n t e r n a l e ne rg y ( J )39   H 2 = n * Cp * ( T2 - T 1 ) ;   / / c h an ge i n e n t ha l p y ( J )40   W 2 = 0;   / / i s o c h o r i c p r o c es s41   Q 2 = U2 + W2 ;   / / h e a t s u p p l i e d ( J )42   mprintf ( ’ \n\nWhen g a s i s h e at e d a t c o n s t a n t v ol um e ’ )

    ;43   mprintf ( ’ \nChange i n i n t e r n a l e ne rg y i s %f J ’ , U 2 ) ;44   mprintf ( ’ \nChange i n e n t ha l p y i s %f J ’ , H 2 ) ;45   mprintf ( ’ \nWork d one d u ri n g t he p r o c e s s i s %i ’ , W 2 )

    ;

    38

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    40/222

    46   mprintf ( ’ \nHeat s u p pl i e d d ur in g t he p r o c es s i s %f J ’

    , Q 2 ) ;47

    48   //e nd

    Scilab code Exa 3.5  To determine work done and amount of heat trans-ferred

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 55

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   function [ y] = Cv (T );

    13   y = 2 7 . 45 2 8 +( 6 . 1 83 9 * (1 0 ^ - 3 ) * T ) - ( 8. 9 93 2 *( 1 0^ - 7 ) * (

    T ^ 2 ) ) - R ;

    14   e n d f u n c t i o n

    15

    16   m = 20;   / / mass o f a i r ( k g )17   n = 1. 25 ;   // p o l y t r o p i c c o n st a n t18   P 1 = 1;   // i n i t i a l p r es s u re ( bar )19   P 2 = 5;   / / f i n a l p r e s s u r e ( b a r )

    20   T 1 = 30 0;   // t e m pe r at u r e ( K)21   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t22   M = 29;   / / m o l ec u l ar wt o f a i r23

    24   / / To d e t e r m i ne wo rk d on e and amount o f h e a t

    39

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    41/222

    t r a n s f e r r e d

    2526   / / ( a ) : Work d on e b y t h e c o mp r es s o r p e r c y c l e27   n _m ol e = m /M ;   // m o l es o f a i r ( k mol )28   V 1 = ( ( n _ mo l e * 1 0 ^ 3* R * T 1 ) / ( P 1 * 1 0 ^5 ) ) ;   // i n i t i a l

    vol ume (mˆ3 )29   V 2 = ( V 1 *( ( P1 / P 2 ) ^( 1/ n ) ) ) ;   / / f i n a l v o lu m e (mˆ 3 )30

    31   / / S i n c e t h e p r o c e s s i s p o l y t r o p i c P (Vˆ n )=c ( s ayc o n s t a n t )

    32   c = P 1 * 10 ^ 5* ( V 1 ^n ) ;

    33   / / f u n c t i o n [ z ] = f ( V) ;

    34   // z = c / (V ˆ 1 . 25 ) ;35   / / e n d f u n c t i o n36   //W1 = i n t g ( V1 , V2 , f ) ; so37   W = ( c / (1 - n ) ) * ( ( V 2 ^ ( - n + 1) ) - ( V1 ^ ( - n + 1 ) ) ) / 1 00 0 ;

    38   mprintf ( ’ Work d on e by c o m p r e ss o r i s %4 . 3 e J ’ , W * 1 0 0 0 );

    39

    40   / / ( b ) : Amount o f h ea t t r a n s f e r r e d t o s u rr o un d i ng41   T 2 = ( ( T1 * V 2 * P2 ) / ( V1 * P 1 )) ;   / / f i n a l temp i n K42   U1 =   intg ( T 1 , T 2 , C v ) ;

    43   U = U1 * n _m ol e ;  // c ha ng e i n i n t e r n a l e ne rg y ( kJ )44   Q = U + W ;   // h e at s u p p l i e d

    45   mprintf ( ’ \nChnage i n i n t e r n a l e ne rg y i s %f k J ’ , U ) ;46   mprintf ( ’ \nHeat s u p p l i e d i s %f kJ ’ , Q ) ;47

    48   //e nd

    Scilab code Exa 3.6  To compare the pressures

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 6

    40

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    42/222

    5

    67   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   V = 0 .3 82 1* 1 0^ - 3   // mol ar v ol ume (mˆ3/mol )13   T = 313;   / / t e m p e r a t u r e (K)14   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t15   a = 0 .3 65 ; b = 4 .2 8* 10 ^ -5 ;   / / V an de r W aa ls c o n s t a n t16

    17   / /To co mp ar e t h e p r e s s u r e s18

    19   / / ( a ) : I d e a l g as e qu a ti o n20   P = ( ( R* T ) /( V * 1 0^ 5) ) ;   / / p r e s s u r e i n b ar21   mprintf ( ’ P r es s ur e o bt ai ne d by i d e a l g as e q u at i on i s

    %f b a r ’ , P ) ;22

    23   / / ( b ) : Van d e r Wa al s e q u a t i o n24   P = ( ( (( R * T ) / ( V - b ) ) - (a / ( V ^ 2 ) ) ) / ( 10 ^ 5 ) ) ;

    25   mprintf ( ’ \ n P r e s su r e o b t a i ne d by Van d e r Waals

    e q ua t i on i s %f b ar ’, P ) ;

    26

    27   //e nd

    Scilab code Exa 3.7  To calculate the volume

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 3

    3   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 75

    6

    7   c l e ar a ll ;

    41

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    43/222

    8   clc ;

    910   / / To f i n d A pp ro x V a lu e11   function [ A ] = a p p r o x ( V , n )

    12   A = round ( V * 1 0 ^ n ) / 1 0 ^ n ; //V−V al ue n−To what p l a c e13   funcprot (0)

    14   e n d f u n c t i o n

    15

    16

    17   // Given :18   T = 300;   // t e m pe r at u r e (K)19   P = 100;   // pr e s su r e ( bar )

    20   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t21   a = 0 .1 37 8; b = 3 .1 8* 10 ^ - 5;   // Van d e r w a al s c o n s t a n t22

    23   / /To c a l c u l a t e t he vo lume24

    25   / / ( a ) : I d e a l g as e qu a ti o n26   V _ i d e a l = a p p ro x ( ( ( R * T ) /( P * 1 0 ^ 5) ) , 6) ;

    27   mprintf ( ’ Volume c a l c u l a t e d by i d e a l g as e q u a ti on i s%4 . 2 e c u b i c m ’ , V _ i d e a l ) ;

    28

    29  / / ( b ) : Van d e r Wa al s e q u a t i o n30   function   [ y ] = f ( V ) ;

    31   y = ( ( P * 1 0 ^ 5 ) + ( a / ( V ^ 2 ) ) ) * ( V - b ) - ( R * T ) ;   / / f u n c t i o nt o c a l c u l a t e d i f f e r e n c e be tw e en c a l c u l a t e da nd a s su m ed v o lu m e

    32   e n d f u n c t i o n

    33

    34   V _ re al = 0;

    35   for   i = 0 . 20 : 0. 0 1: 0 .3 0   / /Van d e r w a a l s v ol um e s h o u l dbe n e a rl y e qu a l t o I d e a l g as valoume

    36   r es = a p p ro x ( f ( i * 1 0^ - 3 ) , 0) ;

    37   for   j = -5:538   if ( j = = r e s )   // f o r v er y s ma l l d i f f e r e n c e i may

    be t ak en a s e x ac t volume39   V _r ea l = i * 10 ^ - 3;

    40   end

    42

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    44/222

    41   end

    42   end43   mprintf ( ’ \nVolume c a l c u l a t e d by V an d e r Wa al se q ua t i on i s %3 . 2 e c u b ic m ’ , V _ r e a l ) ;

    44

    45   //e nd

    Scilab code Exa 3.8   Theoretical problem

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 85

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10   // Given :11

    12   / /The g i v e n pr obl e m i s t h e o r e t i c a l and d oe s no ti n v o l v e any n u m e ri c a l c o mp ut a ti on

    13

    14   //e nd

    Scilab code Exa 3.9  To calculate compressibility factor and molar volume

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s

    2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 95

    6

    43

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    45/222

    7   c l e ar a ll ;

    8   clc ;9

    10   / / To f i n d A pp ro x V a lu e11   function [ A ] = a p p r o x ( V , n )

    12   A = round ( V * 1 0 ^ n ) / 1 0 ^ n ; //V−V al ue n−To what p l a c e13   funcprot (0)

    14   e n d f u n c t i o n

    15

    16

    17   // Given :18   T = 500;   / / t e m p e r a t u r e (K)

    19   P = 10;   // pr e s su r e ( bar )20   R = 8 .3 14 ;   / / i d e a l g as c o n st a n t21   B = - 2. 19 *1 0^ - 4 ; C = - 1 . 73 *1 0^ - 8 ;   // V i r i a l

    c o e f f e c i e n t s22   T c = 5 12 .6 ;   // c r i t i c a l te mp er at ur e23   P c = 81;   // c r i t i c a l pr e s su r e24

    25   //To c a l c u l a t e c o m p r e s s i b i l i t y f a c t o r and m ol arvolume

    26

    27  / / ( a ) : T ru n ca t ed f or m o f v i r i a l e q u a t i o n28   V _ i d e a l = a p p ro x ( ( ( R * T ) /( P * 1 0 ^ 5) ) , 7) ;   / / i d e a l g as

    volume29   function   [ z] = f1 (V )

    30   z = ( ( ( R * T ) /( P * 1 0 ^ 5) ) * ( 1 + ( B / V ) + ( C /( V ^ 2 ) ) ) ) ;   //f u n c t i o n f o r o b t a i n i n g v ol um e by v i r i a le q u a t i o n

    31   e n d f u n c t i o n

    32

    33   / / l o o p f o r h i t a nd t r i a l metho d34   f lag = 1;

    35   while ( f l a g = = 1 )36   V _ v ir i a l = a p p ro x ( f 1 ( V _ i d ea l ) , 7) ;

    37   if (approx(V_ideal ,5)==approx(V_virial ,5))

    38   fl ag = 0;

    39   break ;

    44

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    46/222

    40   else

    41   V _i d ea l = V _ vi r ia l ;42   end

    43   end

    44   mprintf ( ’ V olume o b t a i n e d vy v i r i a l e q u a t i o n i s %4 . 3 ec u b ic m ’ , V _ v i r i a l ) ;

    45   Z = a p pr o x ( ( ( P * 1 0^ 5 * V _ v i r ia l ) / ( T * R ) ) , 3) ;   //c o m p r e s s i b i l i t y f a c t o r

    46   mprintf ( ’ \ n C o mp r e ss i b i lt y f a c t o r f o r v i r i a l e q ua t io ni s %f ’ , Z ) ;

    47

    48   / / ( b ) : R e d l i c h Kwong E q u a t io n

    49   / / C o n s ta n t s i n R e d l i c h Kwong e q u a t i o n50   a = a p pr o x ( ( ( 0 . 4 27 8 * ( R ^ 2 ) * ( Tc ^ 2 . 5 ) ) / ( Pc * 1 0 ^ 5) ) , 4) ;

    51   b = a p pr o x ( ( ( 0 . 08 6 7 * R * T c ) /( P c * 1 0 ^ 5) ) , 9) ;

    52

    53   V _ i d e a l = a p p ro x ( ( ( R * T ) /( P * 1 0 ^ 5) ) , 7) ;   / / i d e a l g asvolume

    54

    55   / / F u n ct i on t o f i n d vo lum e b y R e d l ic h Kwong e q u a t i o n56   function   [ x] = f2 (V )

    57   x = ( ( R * T ) /( P * 1 0 ^ 5 ) ) + b - (( a * ( V - b ) ) / (( T ^ 0 . 5 ) * ( P

    * 1 0 ^ 5 ) * V * ( V + b ) ) ) ;

    58   e n d f u n c t i o n

    59

    60   / / l o o p f o r h i t a nd t r i a l metho d61   f lag = 1;

    62   while ( f l a g = = 1 )

    63   V _ r ed l i ch = a p pr o x ( f 2 ( V _ i de a l ) , 7 ) ;

    64   if (approx(V_ideal ,5)==approx(V_redlich ,5))

    65   fl ag = 0;

    66   break ;

    67   else

    68   V _i d ea l = V _ re d li c h ;69   end

    70   end

    71   mprintf ( ’ \n\nVol ume o b t a i n e d by R e d l i c h KwongE q ua t io n i s %4 . 3 e c u b i c m/ mol ’ , V _ r e d l i c h ) ;

    45

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    47/222

    72   Z = a p pr o x ( ( ( P * 1 0^ 5 * V _ r e d li c h ) / ( T * R ) ) , 3) ;   //

    c o m p r e s s i b i l i t y f a c t o r73   mprintf ( ’ \ n C o m p r e s s b i l i ty f a c t o r by R e d l ic h Kwonge q ua t i on i s %f ’ , Z ) ;

    74

    75   //e nd

    Scilab code Exa 3.10  To calculate heat of formation of methane gas

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 105

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :

    12   H a = - 89 0. 94 ;   // s ta nd ar d h ea t f o r r e a c t i o n a ( kJ )13   H b = - 39 3. 78 ;   // s ta nd ar d h ea t f o r r e a c t i o n b ( kJ )14   H c = - 28 6. 03 ;   // s ta nd ar d h ea t f o r r e a c t i o n c ( kJ )15

    16   / /To c a l c u l a t e h ea t o f f or ma t i o n o f methane g as17   // c ∗2 + b   −   a g i v e s t he f o rm a t io n o f methane fro m

    e l e m e n t s18   H f = ( 2* H c ) +Hb - H a ;

    19   mprintf ( ’ H ea t o f f o r m a ti o n o f meth an e i s %f kJ / mol ’ ,H f ) ;

    2021   //e nd

    46

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    48/222

    Scilab code Exa 3.11  To calculate heat of formation of chloroform

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 115

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   H a = - 50 9. 93 ;   // h ea t o f c om bu st i on o f r e a c t i o n a ( kJ

    )13   H b = - 29 6. 03 ;   / / h ea t o f c om bu st i on o f r e a c t i o n b ( kJ

    )14   H c = - 39 3. 78 ;   // h ea t o f c om bu st i on o f r e a c t i o n c ( kJ

    )15   H d = - 16 7. 57 ;   / / h ea t o f c om bu st i on o f r e a c t i o n d ( kJ

    )16

    17  //To c a l c u l a t e h ea t o f f or ma t i o n o f c hl o ro f o r m18   // c + ( 3∗d )   −a   −b g i v e s c hl o ro f or m from i t s e l e me nt s

    19   H f = H c +( 3* H d ) - Ha - H b ;

    20   mprintf ( ’ H eat o f f or ma t i o n o f c h lo r of o rm i s %f k J/mol ’ , H f ) ;

    21

    22   //e nd

    Scilab code Exa 3.12  To calculate standard heat of reaction at 773 K

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s

    47

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    49/222

    4   // E xampl e 12

    56

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   H o = - 16 49 87 ;   // s ta nd ar d h ea t o f r e a c t i o n a t 298 K

    i n J13   T 1 = 29 8;

    14   T 2 = 77 3;   // t e m pe r at u r e ( K)

    1516   / /To c a l c u l a t e s ta nd ar d h ea t o f r e a c t i o n a t 773 K17   a l p h a = ( 2 * 29 . 1 6) + 1 3 .4 1 - 2 6 . 7 5 - ( 4 * 26 . 8 8) ;

    18   b e tt a = ( ( 2 *1 4 . 4 9) + 7 7. 0 3 - 4 2 . 26 - ( 4* 4 . 35 ) ) * 1 0 ^ - 3;

    19   g a m a = ( ( 2 * - 2 . 0 2 ) - 1 8 . 7 4 + 1 4 . 2 5 + (4 * 0 . 3 3 ) ) * 1 0 ^ - 6 ;

    20

    21   // U si ng e q ua t i on 3 . 5 4 ( P age no . 6 7)22   H 1 = H o - ( a l ph a * T 1 ) - ( b e tt a * ( T 1 ^ 2) / 2 ) - ( g a ma * ( T 1 ^ 3 ) / 3 ) ;

    23

    24   / / At 7 73 K25   H r = H 1 + ( a lp h a * T 2 ) +( b e t t a * ( T 2 ^ 2) / 2 ) + ( g a ma * ( T 2 ^ 3 ) / 3 ) ;

    26   mprintf ( ’ H eat o f r e a c t i o n a t 773 K i s %f kJ ’ , Hr/ 1 0 0 0 ) ;

    27

    28   //e nd

    Scilab code Exa 3.13  To determine heat added or removed

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 135

    48

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    50/222

    6

    7   c l e ar a ll ;8   clc ;

    9

    10

    11   // Given :12   T o = 29 8;   / / s t a n d a r d t e m p e r a t u r e (K )13   T 1 = 40 0;   / / t e m p e r at u r e o f r e a c t a n t s (K)14   T 2 = 60 0;   / / t e mp e r at u r e o f p r o d u ct s (K)15   H o = - 28 3. 02 8;   / / s t a nd a r d h e at o f r e a c t i o n ( k J/ mol )16

    17   / / To d e t e r m i ne h e a t a dd ed o r r em ov ed

    18   // Ba si s :19   n _CO = 1;   / / m o le s o f CO r e a c t e d20   n _O2 = 1; // m o le s o f o xy gen s u p p l i e d21   n _ N2 = 1 * 79 / 21 ;   // m ol es o f n i t r o g e n22   n 1_ O2 = 0 .5 ;   // m o le s o f o xyg en r e q u i r e d23   n _C O2 = 1;   // m o le s o f c ar bo n d i o x i de f or me d24

    25   H 1 = ( ( n _ O2 * 2 9 .7 0 ) + ( n _ N2 * 2 9 . 1 0 ) + ( n _C O * 2 9 . 1 0) ) * ( T o - T 1

    ) / 1 0 0 0 ;   // e nt ha l p y o f c o o l i n g o f r e a c t an t s26   H 2 = ( ( n 1 _O 2 * 2 9 . 7 0) + ( n _ N 2 * 2 9 . 10 ) + ( n _ C O2 * 4 1 .4 5 ) ) * ( T2 -

    T o ) / 1 0 0 0 ;  / / e n th a lp y o f h e a ti n g t he p r od u ct s27   H r = H1 + Ho + H2 ;

    28   mprintf ( ’ H eat s u p pl i e d i s %f kJ ’ , H r ) ;29

    30   //e nd

    Scilab code Exa 3.14  To calculate theoretical flame temperature

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 33   //P−V−T B e ha v io u r and Hea t E f f e c t s4   // E xampl e 145

    49

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    51/222

    6

    7   c l e ar a ll ;8   clc ;

    9

    10

    11   // Given :12   T o = 29 8;   / / s t a n d a r d t e m p e r a tu r e (K)13   T 1 = 37 3;   / / t e mp e r at u r e o f r e a c t a n t s (K)14   H o = 2 83 17 8;   / / s t a n d a r d h e a t o f c o mb u s ti o n ( J / m ol )15

    16   //To c a l c u l a t e t h e o r e t i c a l f la me t em pe ra tu re17   // Ba si s :

    18   n _CO = 1;   / / m o l es o f CO19   n _O2 = 1;   // m o le s o f o xy gen s u p p l i e d20   n 1_ O2 = 0 .5 ;   // m o le s o f o xyg en r e a c t ed21   n _C O2 = 1;   // m o le s o f c ar bo n d i o x i de f or me d22   n _ N2 = 7 9/ 21 ;   // m ol es o f n i t r o g e n23

    24   H 1 = ( ( n _ O2 * 3 4 .8 3 ) + ( n _ N2 * 3 3 . 0 3 ) + ( n _C O * 2 9 . 2 3) ) * ( T o - T 1

    ) ;   // e nt ha l p y o f c o o l i n g o f r e a c t an t s25   // U si ng e q ua t i on 3 . 5 5 ( P age no . 6 9)26   H 2 = Ho - H1 ;

    27   T f = H 2 / (( n 1 _ O 2 * 3 4 . 83 ) + ( n _ N 2 * 3 3 .0 3 ) + ( n _ C O2 * 5 3 .5 9 ) )

    +298;   / / f l a m e t e m p e r a t u r e28   mprintf ( ’ T h e o r e t i c a l f la m e t em p er at u re i s %f K ’ , T f ) ;29

    30   //e nd

    50

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    52/222

    Chapter 4

    Second Law of 

    Thermodynamics

    Scilab code Exa 4.1  To calculate the maximum efficiency

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 43   / / S e c o n d Law o f T he rm o dy na m ic s4   // E xampl e 15

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   T 1 = 70 0;   / / t e m p e r at u r e o f h e a t s o u r c e (K)13   T 2 = 30 0;   / / t e m p e r at u r e o f h e a t s i n k (K)14

    15   //To c a l c u l a t e t he maximum e f f i c i e n c y16   e f f = ( ( T 1 - T 2 ) / T 1 ) ;   // e f f i c i e n c y o f a h ea t e ng i n e17   mprintf ( ’ Maximum e f f i c i e n c y o f h ea t e n g in e i s %f ’ ,

    e f f ) ;

    18

    51

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    53/222

    19

    20   //e nd

    Scilab code Exa 4.2   To determine minimum amount of work done andheat given to surrounding

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 43   / / S e c o n d Law o f T he rm o dy na m ic s

    4   // E xampl e 25

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10   // Given :11   m = 1 ;   / / m as s o f w a te r ( k g )12   T 1 = 30 0;   / / t e m p e r at u r e o f s u r r o u n d i n g (K)13   T 2 = 27 3;   / / t e m p e r a t u r e o f w a t e r (K)14   H f = 3 34 .1 1;   // l a t e n t h ea t o f f u s i o n o f i c e ( kJ /kg )

    1516

    17   / / To d e t e r m i n e minimum a mo unt o f w or k a nd h e a t g i v e nu pt o s u r r o u nd i n g

    18

    19   / / ( a )20   Q 2 = m *Hf ;   / / h e a t a b so b ed a t t e m p e ra t u r e T221   W = ( ( Q2 * ( T1 - T 2 ) ) / T2 ) ;   //minimumm amount o f work

    r e q u i r e d22   mprintf ( ’ Minimum amount o f wo rk r e q u i r e d i s %f kJ ’ ,W

    ) ;23

    24   / / ( b )25   / /Q1 i s t he h ea t g i ve n up t he s ur r o u nd i n g26   Q 1 = W +Q2 ;

    52

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    54/222

    27   mprintf ( ’ \nHeat g i ve n u pt o s u rr o un d i ng i s %f kJ ’ , Q 1 )

    ;28

    29

    30   //e nd

    Scilab code Exa 4.3  To determine efficiency of proposed engine

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s

    2   / / C ha p te r 43   / / S e c o n d Law o f T he rm o dy na m ic s4   // E xampl e 35

    6

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   P _o ut = 4 .5 ;   / / o u t p u t p o we r ( h p )

    13   P _i n = 6 .2 5;   // in pu t power (kW)14   T 1 = 1 00 0;   / / s o u r c e t e m p e r a t u r e (K)15   T 2 = 50 0;   / / s i n k t e m p e r a t u r e (K)16

    17   / /To d e t e rm in e e f f i c i e n c y o f p ro po se d e ng i ne18   e p = ( ( P _ ou t * 7 4 5 . 7) / ( P _ i n * 1 0 0 0) ) ;   // pr o pos e d

    e f f i c i e n c y19   mprintf ( ’ E f f i c i e n c y o f p ro po se d e ng i ne i s %f ’ , e p ) ;20

    21   e m = ( ( T1 - T 2 ) / T1 ) ;   // maximum e f f i c i e n c y

    22   mprintf ( ’ \nThe maximum e f f i c i e n y i s %f ’ , e m ) ;23   mprintf ( ’ \nHence t he c la im o f t he p ro po se d e ng i ne i si m p o s s i b l e ’ ) ;

    24

    25

    53

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    55/222

    26   //e nd

    Scilab code Exa 4.4  To calculate entropy of evaporation

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 43   / / S e c o n d Law o f T he rm o dy na m ic s4   // E xampl e 45

    67   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   P = 500;   / / p r e s s u r e o f d ry s a t u r a t e d s te am ( kPa )13

    14   / / From s te am t a b l e s15   H v = 2 10 6;   / / l a t e n t h ea t o f v a p o r i s a t i o n ( kJ / kg )16   T = 425;   / / s a t u r a t i o n t e m p e r at u r e (K)

    1718   / /To c a l c u l a t e t he e nt ro py o f e v ap o r a t io n19   / / By e q u a t i on 4 . 2 5 ( P age no . 9 3 )20   S v = ( Hv / T) ;   / / e n t r o p y c h a ng e a c co m pa n yi n g

    v a p o r i s a t i o n21   mprintf ( ’ En tr opy o f e v a p or a t i on i s %f kJ / kg K ’ , S v ) ;22

    23   //e nd

    Scilab code Exa 4.5  To determine change in entropy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 4

    54

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    56/222

    3   / / S e c o n d Law o f T he rm o dy na m ic s

    4   // E xampl e 556

    7   c l e ar a ll ;

    8   clc ;

    9

    10

    11   // Given :12   m = 2 ;   / / m ass o f g a s ( k g )13   T 1 = 27 7;   // i n i t i a l te mp er at ur e (K)14   T 2 = 36 8;   / / f i n a l t e m p e r a tu r e (K)

    15   C v = 1 .4 2;   / / s p e c i f i c g e a t a t c o n s t a n t v ol um e ( k J / k gK)

    16

    17   / /To d e t er m i ne c ha ng e i n e n tr o py18   // U si ng e q ua t i on 4 . 3 1 ( P age no . 9 4)19   S = ( m * C v * log ( T 2 / T 1 ) ) ;   / / c h a n g e i n e n t r o p y ( k J /K)20   mprintf ( ’ C hange i n e n tr o p y i s %f kJ /K ’ , S ) ;21

    22

    23   //e nd

    Scilab code Exa 4.6  To calculate the entropy change

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 43   / / S e c o n d Law o f T he rm o dy na m ic s4   // E xampl e 65

    67   c l e ar a ll ;

    8   clc ;

    9

    10

    55

  • 8/20/2019 A Textbook Of Chemical Engineering Thermodynamics_K. V. Narayanan (1).pdf

    57/222

    11   // Given :

    12   T = 300;   / / t e m p e r a tu r e i n K13   P 1 = 10;   // i n i t i a l p r e s s u r e ( bar )14   P 2 = 1;   / / f i n a l p r e s s u r e ( b a r )15   R = 8 .3 14 ;   / / i e a l g as c o ns t an t16

    17   / /To c a l c u l a t e t he e nt ro p y c ha ng e18   / / U si ng e q u a t i o n 4 . 3 3 ( Page no . 9 4 )19   S = ( R * log ( P 1 / P 2 ) ) ;   / / ( k J / k m o l K )20   mprintf ( ’ E n to py c ha n ge i s %f kJ / km ol K ’ , S ) ;21

    22

    23   //e nd

    Scilab code Exa 4.7  To determine change in entropy

    1   / /A T ex tb o ok o f C h em i c al E n g i n e e r i n g T he rm od yn am ic s2   / / C ha p te r 43   / / S e c o n d Law o f T he rm o dy na m ic s4   // E xampl e 14

    56

    7   c l e ar a ll ;

    8   clc ;