Scilab Textbook Companion for
Introduction To Chemical Engineering
by S. K. Ghoshal, S. K. Sanyal And S. Datta
1
Created by
Himanshu Bhatia
Btech
Chemical Engineering
IIT Guwahati
College Teacher
Dr Prakash Kotecha
Cross-Checked by
Ganesh R
October 3, 2013
1Funded by a grant from the National Mission on Education through ICT, http://spoken-tutorial.org/NMEICT-Intro. This Textbook Companion and Scilab codes written in it can be downloaded from the ”Textbook Companion Project” section at the website http://scilab.in
Book Description
Title: Introduction To Chemical Engineering Author: S. K. Ghoshal, S. K. Sanyal And S. Datta
Publisher: Tata McGraw Hill Education Pvt. Ltd., New Delhi Edition: 1
Year: 2006
Scilab numbering policy used in this document and the relation to the above 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 particular Example of the above book)
For example, Exa 3.51 means solved example 3.51 of this book. Sec 2.3 means a scilab code whose theory is explained in Section 2.3 of the book.
Contents
List of Scilab Codes 4
1 Introduction 9
2 Physico Chemical Calculations 23
3 Material and Energy Balances 46
4 Flow Of Fluids 73
5 Heat Transfer 87
6 Mass Transfer 100
7 Chemical Kinetics 115
8 Measuring Devices 124
List of Scilab Codes
Exa 1.1 Air composition . . . 9
Exa 1.2 Volume calculation . . . 10
Exa 1.3 Gas Composition . . . 10
Exa 1.4 Volume calculation . . . 12
Exa 1.5 Amount of CO2 released. . . 12
Exa 1.6 Vapor pressure . . . 13
Exa 1.7 Duhring Plot calculations . . . 14
Exa 1.8 Vapor Pressure of Mixture . . . 14
Exa 1.9 Vapor pressure . . . 15
Exa 1.10 Flow relation . . . 16
Exa 1.11 Average Velocity . . . 16
Exa 1.12 Velocity determination . . . 17
Exa 1.13 Velocity determination . . . 18
Exa 1.14 Dimensional analysis . . . 19
Exa 1.15 Dimensional analysis . . . 19
Exa 1.16 Dynamic similarity . . . 19
Exa 1.17 Dynamic similarity . . . 20
Exa 1.18 Nomographic chart . . . 21
Exa 1.19 Calculation using Nomograph . . . 22
Exa 2.1 Ideal gas system . . . 23
Exa 2.2 Mixture properties . . . 23
Exa 2.3 Equivalent metal mass . . . 24
Exa 2.4 Purity of Sodium Hydroxide. . . 25
Exa 2.5 Carbon content formulation . . . 26
Exa 2.6 Combustion of gas . . . 26
Exa 2.7 Sulphuric acid preparation . . . 27
Exa 2.8 Molarity Molality Normality Calculation . . . 28
Exa 2.10 Precipitation of KClO3 . . . 29
Exa 2.11 Solubility of CO2 . . . 29
Exa 2.12 Vapor pressure calculation. . . 30
Exa 2.13 Boiling point calculation . . . 30
Exa 2.14 Colligative properties . . . 31
Exa 2.15 Huggins Equation . . . 32
Exa 2.16 Molecular Formula . . . 32
Exa 2.17 Molecular Formula . . . 33
Exa 2.18 Molecular Formula . . . 34
Exa 2.19 Molecular Formula . . . 35
Exa 2.20 Metal deposition . . . 35
Exa 2.21 EMF of cell . . . 36
Exa 2.22 EMF of cell . . . 37
Exa 2.23 EMF of cell . . . 37
Exa 2.24 Silver deposition . . . 38
Exa 2.25 Electroplating time. . . 38
Exa 2.26 Water hardness . . . 39
Exa 2.27 Water hardness . . . 39
Exa 2.28 Water hardness . . . 40
Exa 2.29 Mixture composition . . . 41
Exa 2.30 Mixture composition . . . 42
Exa 2.31 Mixture properties . . . 43
Exa 2.32 Humidity . . . 44
Exa 3.1 Coal consumption . . . 46
Exa 3.2 Nitric acid preparation. . . 47
Exa 3.3 HCl production . . . 47
Exa 3.4 Acetylene consumption . . . 48
Exa 3.5 Screen effectiveness . . . 49
Exa 3.6 Absorption . . . 50 Exa 3.7 Extraction . . . 51 Exa 3.8 Distillation . . . 52 Exa 3.9 Distillation . . . 53 Exa 3.10 Crystallization . . . 54 Exa 3.11 crystallization . . . 55 Exa 3.12 Drying . . . 55
Exa 3.13 Conditioning of air . . . 56
Exa 3.14 Ammonia Synthesis . . . 57
Exa 3.16 Enthalpy calculation . . . 59
Exa 3.17 Enthalpy of formation . . . 59
Exa 3.18 Combustion . . . 60
Exa 3.19 Heat of reaction . . . 61
Exa 3.20 Heat transfer . . . 61
Exa 3.21 Calorific value . . . 62
Exa 3.22 Coal combustion . . . 62
Exa 3.23 Coal combustion . . . 64
Exa 3.24 Petrol combustion . . . 66
Exa 3.25 Air supply . . . 67
Exa 3.26 CO2 cooling . . . 68
Exa 3.27 Heating area . . . 68
Exa 3.28 Distillation column . . . 69
Exa 3.29 Crystallization . . . 71
Exa 3.30 Combustion . . . 72
Exa 4.1 Water compressibility . . . 73
Exa 4.2 Isothermal Compressibility . . . 73
Exa 4.3 Viscosity . . . 74
Exa 4.4 Streamline flow . . . 74
Exa 4.5 Frictional losses . . . 74
Exa 4.6 Velocity profile . . . 75
Exa 4.7 Velocity profile . . . 75
Exa 4.8 Boundary layer . . . 75
Exa 4.9 Pipe flow . . . 76
Exa 4.10 Temperature rise . . . 77
Exa 4.11 Bernoulli equation . . . 78
Exa 4.12 Power requirements . . . 78
Exa 4.13 Hagen Poiseulle equation . . . 79
Exa 4.14 Pressure Head calculation . . . 80
Exa 4.15 Level difference calculation . . . 80
Exa 4.16 Energy cost calculation . . . 81
Exa 4.17 Pressure loss . . . 82
Exa 4.18 Pressure gradient . . . 82
Exa 4.19 Flow rate . . . 83
Exa 4.20 Pipe dimensions . . . 84
Exa 4.21 Pressure gradient . . . 84
Exa 4.22 Minimum fluidization velocity . . . 85
Exa 5.1 Heat conduction . . . 87
Exa 5.2 Heat conduction . . . 87
Exa 5.3 Heat conduction through sphere . . . 88
Exa 5.4 Composite wall . . . 89
Exa 5.5 Composite Pipeline . . . 90
Exa 5.6 Parellel Resistance . . . 91
Exa 5.7 Heat transfer coefficient . . . 92
Exa 5.8 Heat transfer coefficient . . . 93
Exa 5.9 Earth Temperature. . . 94
Exa 5.10 Earth Temperature. . . 94
Exa 5.11 Equilibrium temperature . . . 95
Exa 5.12 Equilibrium temperature . . . 95
Exa 5.13 Temperature calculation . . . 96
Exa 5.14 Solar constant . . . 96
Exa 5.15 Evaporator . . . 97
Exa 5.16 Evaporator . . . 98
Exa 5.17 Evaporator . . . 98
Exa 6.1 Diffusivity . . . 100
Exa 6.2 Absorption . . . 100
Exa 6.3 Equimolar counter diffusion . . . 101
Exa 6.4 Resistane to diffusion . . . 101
Exa 6.5 Vapor diffusion . . . 102
Exa 6.6 Flux of HCl . . . 102
Exa 6.7 Vaporization . . . 103
Exa 6.8 Gas Absorption. . . 104
Exa 6.9 Equilibrium Composition . . . 105
Exa 6.10 Equilibrium Composition . . . 105
Exa 6.11 Vapor Liquid Equilibrium . . . 106
Exa 6.12 Distillation Column . . . 106
Exa 6.13 Distillation . . . 107
Exa 6.14 Steam Distillation . . . 108
Exa 6.15 Mcabe Thiele Method . . . 108
Exa 6.16 Liquid liquid extraction . . . 109
Exa 6.17 Liquid liquid extraction . . . 110
Exa 6.18 Humidity calculation . . . 110
Exa 6.19 Drying operation . . . 111
Exa 6.20 Crystallization . . . 112
Exa 7.1 Constant volume reaction . . . 115
Exa 7.2 Rate of reaction . . . 115
Exa 7.3 Rate of reaction . . . 115
Exa 7.4 Order of reaction . . . 116
Exa 7.5 Rate Expression . . . 116
Exa 7.6 Volume function . . . 117
Exa 7.7 Pressure time relation . . . 117
Exa 7.8 Entropy changes . . . 117
Exa 7.9 Hydrocarbon cracking . . . 118
Exa 7.10 Equilibrium conversion . . . 118
Exa 7.11 Equilibrium conversion . . . 119
Exa 7.12 Concentration calculation . . . 119
Exa 7.13 Equilibrium conversion . . . 120
Exa 7.14 Equilibrium shifts . . . 121
Exa 7.15 Rate equation . . . 121
Exa 7.16 Rate of reaction . . . 123
Exa 8.1 Specific gravity . . . 124
Exa 8.2 Specific gravity . . . 124
Exa 8.3 Specific gravity . . . 125
Exa 8.4 Mixture density . . . 125
Exa 8.5 Viscosity calculation . . . 126
Exa 8.6 Solution viscosity . . . 126
Exa 8.7 Flow rate calculation . . . 127
Exa 8.8 Venturi meter. . . 128
Exa 8.9 Venturi meter. . . 129
Exa 8.10 Pitot tube . . . 130
Exa 8.11 Rotameter capacity . . . 131
Exa 8.12 Flow rate calculation . . . 131
Exa 9.1 Coiled tube pressure drop . . . 133
Exa 9.2 Heat exchanger pressure drop . . . 134
Exa 9.3 Heat exchanger area . . . 135
Exa 9.4 Batch distillation . . . 136
Exa 9.5 Gas mixture exit temperature . . . 137
Chapter 1
Introduction
Scilab code Exa 1.1 Air composition
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 1 . 1 p a g e number 1 9 \ n \ n ” ) 4 // t o f i n d c o m p o s i t i o n o f a i r by w e i g h t 5 y _ o x y g e n = 0.21 // m o l e f r a c t i o n o f o x y g e n 6 y _ n i t r o g e n = 0.79 // m o l e f r a c t i o n o f n i t r o g e n 7 m o l a r _ m a s s _ o x y g e n = 32 8 m o l a r _ m a s s _ n i t r o g e n = 28 9 10 m o l a r _ m a s s _ a i r = y _ o x y g e n * m o l a r _ m a s s _ o x y g e n + y _ n i t r o g e n * m o l a r _ m a s s _ n i t r o g e n ; 11 m a s s _ f r a c t i o n _ o x y g e n = y _ o x y g e n * m o l a r _ m a s s _ o x y g e n / m o l a r _ m a s s _ a i r ; 12 m a s s _ f r a c t i o n _ n i t r o g e n = y _ n i t r o g e n * m o l a r _ m a s s _ n i t r o g e n / m o l a r _ m a s s _ a i r ; 13 14 p r i n t f( ” mass f r a c t i o n o f o x y g e n = %f \ n \ n ” , m a s s _ f r a c t i o n _ o x y g e n ) 15 p r i n t f( ” mass f r a c t i o n o f n i t r o g e n = %f \ n \ n ” , m a s s _ f r a c t i o n _ n i t r o g e n ) 16
17 V1 = 22.4 // i n l i t e r s 18 P1 = 760 // i n mm Hg 19 P2 = 7 3 5 . 5 6 // i n mm Hg 20 T1 = 273 // i n K 21 T2 = 298 // i n K 22 23 V2 = ( P1 * T2 * V1 ) /( P2 * T1 ) ; 24 d e n s i t y = m o l a r _ m a s s _ a i r / V2 ; 25 26 p r i n t f( ” d e n s i t y = %f gm/ l ” , d e n s i t y )
Scilab code Exa 1.2 Volume calculation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 1 . 2 p a g e number 2 0 \ n \ n ” ) 4 // f i n d t h e v o l u m e o c c u p i e d by p r o p a n e 5 6 m a s s _ p r o p a n e = 1 4 . 2 // i n kg 7 m o l a r _ m a s s =44 // i n kg 8 m o l e s =( m a s s _ p r o p a n e * 1 0 0 0 ) / m o l a r _ m a s s ; 9 v o l u m e = 2 2 . 4 * m o l e s ; // i n l i t e r s 10 11 p r i n t f( ” v o l u m e = %d l i t e r s \ n \ n ” , v o l u m e )
Scilab code Exa 1.3 Gas Composition
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 1 . 3 p a g e number 2 0 \ n \ n ” ) 4 // t o f i n d t h e a v e r a g e w e i g h t , w e i g h t c o m p o s i t i o n , g a s v o l u m e i n a b s e n c e o f SO2 5 y _ C O 2 = 0 . 2 5 ;
y_CO = 0 . 0 0 2 ;
7 y _ S O 2 = 0 . 0 1 2 ;
8 y_N2 = 0 . 6 8 0 ;
9 y_O2 = 0 . 0 5 6 ;
10
11 Mm = y _ C O 2 *44+ y_CO *28+ y _ S O 2 *64+ y_N2 *28+ y_O2 *32;
12 p r i n t f ( ” \ n m o l a r mass = %d \ n ” , Mm ) 13 14 p r i n t f( ” \ n f i n d i n g w e i g h t c o m p o s i t i o n \ n ” ) 15 w _ C O 2 = y _ C O 2 * 4 4 * 1 0 0 / Mm ; 16 p r i n t f ( ” \ n w e i g h t C O 2 = %f \ n \ n ” , w _ C O 2 ) 17 w_CO = y_CO * 2 8 * 1 0 0 / Mm ; 18 p r i n t f ( ” w e i g h t C O = %f \ n \ n ” , w_CO ) 19 w _ S O 2 = y _ S O 2 * 6 4 * 1 0 0 / Mm ; 20 p r i n t f ( ” w e i g h t S O 2 = %f \ n \ n ” , w _ S O 2 ) 21 w_N2 = y_N2 * 2 8 * 1 0 0 / Mm ; 22 p r i n t f ( ” w e i g h t N 2 = %f \ n \ n ” , w_N2 ) 23 w_O2 = y_O2 * 3 2 * 1 0 0 / Mm ; 24 p r i n t f ( ” w e i g h t O 2 = %f \ n \ n ” , w_O2 ) 25 26 p r i n t f( ” i f SO2 i s r emoved \ n \ n ” ) 27 v _ C O 2 = 25; 28 v_CO = 0.2; 29 v_N2 = 6 8 . 0 ; 30 v_O2 = 5.6; 31 v = v _ C O 2 + v_CO + v_N2 + v_O2 ; 32 v 1 _ C O 2 = ( v _ C O 2 * 1 0 0 / 9 8 . 8 ) ; 33 34 p r i n t f ( ” volume CO2 = %f \ n \ n ” , v 1 _ C O 2 ) 35 v 1 _ C O = ( v_CO * 1 0 0 / 9 8 . 8 ) ; 36 p r i n t f ( ” volume CO = %f \ n \ n ” , v 1 _ C O ) 37 v 1 _ N 2 = ( v_N2 * 1 0 0 / 9 8 . 8 ) ; 38 p r i n t f ( ” v o l u m e N 2 = %f \ n \ n ” , v 1 _ N 2 ) 39 v 1 _ O 2 = ( v_O2 * 1 0 0 / 9 8 . 8 ) ; 40 p r i n t f ( ” v o l u m e O 2 = %f \ n \ n ” , v 1 _ O 2 )
Scilab code Exa 1.4 Volume calculation 1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 1 . 4 p a g e number 2 4 \ n \ n ” ) 4 // t o f i n d v o l u m e o f NH3 d i s s o l v a b l e i n w a t e r 5 6 p =1 // atm 7 H =2.7 // atm 8 x = p / H ; 9 10 m o l e _ r a t i o = ( x ) /(1 - x ) ; 11 m o l e s _ o f _ w a t e r = ( 1 0 0 * 1 0 0 0 ) /18; 12 m o l e s _ o f _ N H 3 = m o l e _ r a t i o * m o l e s _ o f _ w a t e r ; 13 14 p r i n t f( ” m o l e s o f NH3 d i s s o l v e d = %f \ n \ n ” , m o l e s _ o f _ N H 3 ) 15 16 v o l u m e _ N H 3 =( m o l e s _ o f _ N H 3 * 2 2 . 4 * 2 9 3 ) / 2 7 3 ; 17 p r i n t f( ” v o l u m e o f NH3 d i s s o l v e d = %f l i t e r s ” , v o l u m e _ N H 3 )
Scilab code Exa 1.5 Amount of CO2 released
1 clc 2 c l e a r 3 4 p r i n t f( ” e x a m p l e 1 . 5 p a g e number 2 4 \ n \ n ” ) 5 6 // t o c a l c u l a t e amount o f CO2 r e l e a s e d by w a t e r 7 p =746 // i n mm Hg 8 H = 1 . 0 8 * 1 0 ^ 6 // i n mm Hg , Henry ’ s c o n s t a n t
10 x = p / H ; // m o l e f r a c t i o n o f CO2 11 X = x * ( 4 4 / 1 8 ) ; // mass r a t i o o f CO2 i n w a t e r 12 13 i n i t i a l _ C O 2 = 0 . 0 0 5 ; // kg CO2/ kg H20 14 G = 1 0 0 0 * ( i n i t i a l _ C O 2 - X ) ; 15 16 p r i n t f( ”CO2 g i v e n up by 1 c u b i c m e t e r o f w a t e r = %f kg CO2/ c u b i c m e t e r H20 ” ,G )
Scilab code Exa 1.6 Vapor pressure
1 clc 2 c l e a r 3 4 p r i n t f( ’ e x a m p l e 1 . 6 p a g e number 27 \ n \ n ’ ) 5 // t o f i n d v a p o r p r e s s r e o f e t h y l a l c h o h a l 6 7 pa1 = 2 3 . 6 ; //VP o f e t h y l a l c h o h a l a t 10 d e g r e e C 8 pa3 =760 //VP o f e t h y l a l c h o h a l a t 7 8 . 3 d e g r e e C i n mm Hg 9 pb1 = 9.2 //VP o f e t h y l w a t e r a t 10 d e g r e e C i n mm Hg 10 pb3 =332 //VP o f e t h y l w a t e r a t 7 8 . 3 d e g r e e C i n mm Hg 11 12 C =(l o g 1 0( pa1 / pa3 ) /(l o g 1 0( pb1 / pb3 ) ) ) ; 13 14 pb2 =149 //VP o f w a t e r a t 60 d e g r e e C i n mm Hg 15 16 pas =( pb3 / pb2 ) ; 17 pa = C *l o g 1 0( pas ) ; 18 pa2 = pa3 / ( 1 0 ^ pa ) ; 19
20 p r i n t f( ” v a p o r p r e s s u r e o f e t h y l a l c h o l o h a t 60 d e g r e e C = %f mm Hg” , pa2 )
Scilab code Exa 1.7 Duhring Plot calculations
1 clc 2 c l e a r 3 4 p r i n t f( ’ e x a m p l e 1 . 7 p a g e number 28 \ n \ n ’ ) 5 6 // t o f i n d v a p o r p r e s s u r e u s i n g d u h r i n g p l o t 7 8 t1 = 41 // i n d e g r e e C 9 t2 =59 // i n d e g r e e C 10 t h e t a _ 1 =83 // i n d e g r e e C 11 t h e t a _ 2 =100 // i n d e g r e e C 12 13 K = ( t1 - t2 ) /( theta_1 - t h e t a _ 2 ) ; 14 t = 5 9 + ( K * ( 1 0 4 . 2 - 1 0 0 ) ) ; 15 16 p r i n t f ( ” b o i l i n g p o i n t o f S C l 2 a t 8 8 0 T o r r = %f d e g r e e c e l c i u s ” ,t )
Scilab code Exa 1.8 Vapor Pressure of Mixture
1 clc 2 c l e a r 3 p r i n t f( ’ e x a m p l e 1 . 8 p a g e number 2 9 \ n \ n ’ ) 4 // t o f i n d t h e amount o f s t e a m r e l e a s e d 5 6 v p _ C 6 H 6 = 520 // i n t o r r 7 v p _ H 2 O = 225 // i n t o r r 8 m a s s _ w a t e r =18
m a s s _ b e n z e n e =78 10 11 a m o u n t _ o f _ s t e a m = ( v p _ H 2 O / v p _ C 6 H 6 ) /( m a s s _ b e n z e n e / m a s s _ w a t e r ) ; 12 13 p r i n t f( ” amount o f s t e a m = %f ” , a m o u n t _ o f _ s t e a m )
Scilab code Exa 1.9 Vapor pressure
1 clc 2 c l e a r 3 p r i n t f( ’ e x a m p l e 1 . 9 p a g e number 3 0 \ n \ n ’ ) 4 5 // t o f i n d e q u i l i b r i u m v a p o r l i q u i d c o m p o s i t i o n 6 p0b = 385 // v a p o r p r e s s u e o f b e n z e n e a t 60 d e g r e e C i n t o r r 7 p0t =140 // v a p o r p r e s s u e o f t o l u e n e a t 60 d e g r e e C i n t o r r 8 xb = 0 . 4 ; 9 xt = 0 . 6 ; 10 11 pb = p0b * xb ; 12 pt = p0t * xt ; 13 P = pb + pt ; 14 15 p r i n t f( ” t o t a l p r e s s u r e = %f t o r r \ n \ n ” ,P ) 16 17 yb = pb / P ; 18 yt = pt / P ; 19 p r i n t f( ” v a p o r c o m p o s i t i o n o f b e n z e n e = %f \ n v a p o r c o m p o s i t i o n o f t o l u e n e = %f \ n \ n ” ,yb , yt ) 20 21 // f o r l i q u i d b o i l i n g a t 90 d e g r e e C and 7 6 0 t o r r , l i q u i d p h a s e c o m p o s i t i o n 22 // x =(760 −408) / ( 1 0 1 3 − 4 0 8 ) ;
23 ( 1 0 1 3 * x ) + ( 4 0 8 * ( 1 - x ) ) = = 7 6 0 ;
24 p r i n t f( ” m o l e f r a c t i o n o f b e n z e n e i n l i q u i d m i x t u r e = %f \ n m o l e f r a c t i o n o f t o l u e n e i n l i q u i d m i x t u r e = %f ” ,x ,1 - x )
Scilab code Exa 1.10 Flow relation
1 clc 2 c l e a r 3 4 p r i n t f( ’ e x a m p l e 1 . 1 0 p a g e number 3 3 \ n ’ ) 5 6 // t o f i n d r e l a t i o n b e t w e e n f r i c t i o n f a c t o r and r e y n o l d ’ s number 7
8 // l o g f=y , l o g Re=x , l o g a=c
9 s i g m a _ x = 2 3 . 3 9 3 ; 10 s i g m a _ y = - 1 2 . 4 3 7 ; 11 s i g m a _ x 2 = 9 1 . 4 5 6 12 s i g m a _ x y = - 4 8 . 5 5 4 ; 13 m = ( ( 6 * s i g m a _ x y ) -( s i g m a _ x * s i g m a _ y ) ) /(6* sigma_x2 -( s i g m a _ x ) ^2) ; 14 p r i n t f( ”m = %f \ n ” , m ) 15 16 c =(( s i g m a _ x 2 * s i g m a _ y ) -( s i g m a _ x y * s i g m a _ x ) ) /(6* sigma_x2 -( s i g m a _ x ) ^2) ; 17 p r i n t f( ” c = %f \ n ” , c ) 18 19 p r i n t f( ” f = 0 . 0 8 4 ∗ Re ˆ − 0 . 2 5 6 ” )
Scilab code Exa 1.11 Average Velocity
c l e a r 3 p r i n t f( ” e x a m p l e 1 . 1 1 p a g e number 3 5 \ n \ n ” ) 4 5 // t o f i n d t h e a v e r a g e v e l o c i t y 6 7 u = [ 2 ; 1 . 9 2 ; 1 . 6 8 ; 1 . 2 8 ; 0 . 7 2 ; 0 ] ; 8 r = [ 0 ; 1 ; 2 ; 3 ; 4 ; 5 ] ; 9 10 z = u .* r ; 11 plot( r , z ) 12 t i t l e ( ” v a r i a t i o n o f u r w i t h r ” ) 13 x l a b e l ( ” r ” ) 14 y l a b e l ( ” u r ” ) 15 16 // by g r a p h i c a l i n t e g r a t i o n , we g e t 17 u _ a v g = ( 2 / 2 5 ) * 1 2 . 4 18 p r i n t f( ” a v e r a g e v e l o c i t y = %f cm/ s \ n ” , u_avg )
Scilab code Exa 1.12 Velocity determination
1 clc 2 c l e a r 3 4 p r i n t f( ’ e x a m p l e 1 . 1 2 p a g e number 3 7 \ n ’ ) 5 6 // t o f i n d t h e a v e r a g e v e l o c i t y 7 p r i n t f( ’ u s i n g t r a p e z o i d r u l e \ n ’ ) 8 9 n = 6; 10 h = (3 - 0) / n ; 11 I = ( h /2) * ( 0 + 2 * 0 . 9 7 + 2 * 1 . 7 8 + 2 * 2 . 2 5 + 2 * 2 . 2 2 + 2 * 1 . 5 2 + 0 ) ; 12 u _ a v g = ( 2 / 3 ^ 2 ) * I ; 13 14 p r i n t f( ” a v e r a g e v e l o c i t y = %f cm/ s \ n ” , u_avg ) 15
16 disp( ’ S i m p s o n s r u l e ’ ) 17 18 n = 6; 19 h = 3/ n ; 20 I = ( h /3) * ( 0 + 4 * ( 0 . 9 7 + 2 . 2 5 + 1 . 5 2 ) + 2 * ( 1 . 7 8 + 2 . 2 2 ) +0) ; 21 u _ a v g = ( 2 / 3 ^ 2 ) * I ; 22 23 p r i n t f( ” a v e r a g e v e l o c i t y = %f cm/ s \ n ” , u_avg )
Scilab code Exa 1.13 Velocity determination
1 clc 2 c l e a r 3 4 p r i n t f( ’ e x a m p l e 1 . 1 3 p a g e number 3 8 \ n \ n ’ ) 5 6 // t o f i n d t h e s e t t l i n g v e l o c i t y a s a f u n c t i o n o f t i m e 7 z0 = 3 0 . 8 4 ; 8 z1 = 2 9 . 8 9 ; 9 z2 = 2 9 . 1 0 ; 10 h = 4; 11 12 u 1 _ t 0 = ( -3* z0 +4* z1 - z2 ) /(2* h ) ; 13 u 1 _ t 4 = ( - z0 + z2 ) /(2* h ) ; 14 u 1 _ t 8 = ( z0 -4* z1 +3* z2 ) /(2* h ) ; 15 16 // c o n s i d e r i n g d a t a s e t f o r t = 4 , 8 , 1 2 min 17 z0 = 2 9 . 8 9 ; 18 z1 = 2 9 . 1 0 ; 19 z2 = 2 8 . 3 0 ; 20 u 2 _ t 4 = ( -3* z0 +4* z1 - z2 ) /(2* h ) ; 21 u 2 _ t 8 = ( - z0 + z2 ) /(2* h ) ; 22 u 2 _ t 1 2 = ( z0 -4* z1 +3* z2 ) /(2* h ) ; 23
24 // c o n s i d e r i n g d a t a s e t f o r t = 8 , 1 2 , 1 6 min 25 z0 = 2 9 . 1 0 ; 26 z1 = 2 8 . 3 0 ; 27 z2 = 2 7 . 5 0 ; 28 u 3 _ t 8 = ( -3* z0 +4* z1 - z2 ) /(2* h ) ; 29 u 3 _ t 1 2 = ( - z0 + z2 ) /(2* h ) ; 30 u 3 _ t 1 6 = ( z0 -4* z1 +3* z2 ) /(2* h ) ; 31 32 // t a k i n g a v e r a g e 33 u_t4 = ( u 1 _ t 4 + u 2 _ t 4 ) /2; 34 u_t8 = ( u 1 _ t 8 + u 2 _ t 8 + u 3 _ t 8 ) /3; 35 u _ t 1 2 = ( u 2 _ t 1 2 + u 3 _ t 1 2 ) /2; 36 37 p r i n t f( ” u t 0 = %f cm/ min \ n u t 4 = %f cm/ min \ n u t 8 = %f cm/ min \ n u t 1 2 = %f / n cm/ min \ n u t 1 6 =%f / n cm/ min ” , u1_t0 , u_t4 , u_t8 , u_t12 , u3_t16 )
Scilab code Exa 1.14 Dimensional analysis
1 p r i n t f( ’ e x a m p l e 1 . 1 4 p a g e number 45 ’ )
2 disp ( ” t h i s i s a t h e o r i t i c a l q u e s t i o n , book s h a l l be r e f e r r e d f o r s o l u t i o n ” )
Scilab code Exa 1.15 Dimensional analysis
1 p r i n t f( ’ e x a m p l e 1 . 1 5 p a g e number 46 ’ )
2 disp ( ” t h i s i s a t h e o r i t i c a l q u e s t i o n , book s h a l l be r e f e r r e d f o r s o l u t i o n ” )
1 clc 2 c l e a r 3 p r i n t f( ’ e x a m p l e 1 . 1 6 p a g e number 4 9 \ n ’ ) 4 5 // t o f i n d t h e f l o w r a t e and p r e s s u r e d r o p 6 d e n s i t y _ w a t e r =988 // i n kg /m3 7 v i s c o s i t y _ w a t e r = 5 5 * 1 0 ^ - 5 // i n Ns /m2 8 d e n s i t y _ a i r = 1 . 2 1 // i n kg /m3 9 v i s c o s i t y _ a i r = 1 . 8 3 * 1 0 ^ - 5 // i n Ns /m2 10 L =1 // l e n g t h i n m 11 12 L1 =10* L // l e n g t h i n m 13 Q = 0 . 0 1 3 3 ; 14 15 Q1 =(( Q * d e n s i t y _ w a t e r * v i s c o s i t y _ a i r * L ) /( L1 * v i s c o s i t y _ w a t e r * d e n s i t y _ a i r ) ) 16 17 p r i n t f( ” f l o w r a t e = %f c u b i c m e t e r / s \ n ” , Q1 ) 18 19 // e q u a t i n g e u l e r number 20 21 p = 9 . 8 0 6 7 * 1 0 ^ 4 ; // p r e s s u r e i n p a s c a l 22 p1 =( p * d e n s i t y _ w a t e r * Q ^2* L ^4) /( d e n s i t y _ a i r * Q1 ^2* L1 ^4) ; 23 24 p r i n t f( ” p r e s s u r e d r o p c o r r e s p o n d i n g t o 1 kp / s q u a r e cm = %f kP/ s q u a r e cm” , p1 / p )
Scilab code Exa 1.17 Dynamic similarity
1 clc
2 c l e a r
3 p r i n t f( ’ e x a m p l e 1 . 1 7 p a g e number 5 0 \ n ’ )
4
7 L =1 // l e n g t h o f p r o t o t y p e i n m 8 L1 =10* L // l e n g t h o f mo del i n m 9 d e n s i t y _ p r o t o t y p e = 2 . 6 5 //gm/ c c 10 d e n s i t y _ w a t e r =1 //gm/ c c 11 12 d e n s i t y _ m o d e l =( L ^3*( d e n s i t y _ p r o t o t y p e - d e n s i t y _ w a t e r ) ) /( L1 ^3) +1; 13 14 p r i n t f( ” s p e c i f i c g r a v i t y o f p l a s t i c = %f ” , d e n s i t y _ m o d e l )
Scilab code Exa 1.18 Nomographic chart
1 clc 2 c l e a r 3 p r i n t f( ’ e x a m p l e 1 . 1 8 p a g e number 5 3 \ n \ n ’ ) 4 5 // t o f i n d e r r o r i n a c t u a l d a t a and n o m o g r a p h i c c h a t v a l u e 6 7 // f o r my 8 ly = 8 // i n cm 9 my = ly / ( ( 1 / 0 . 2 5 ) - ( 1 / 0 . 5 ) ) ; 10 lz = 1 0 . 1 5 // i n cm 11 mz = lz / ( ( 1 / 2 . 8 5 ) - ( 1 / 6 . 7 6 ) ) ; 12 mx = ( my * mz ) /( my + mz ) ; 13 p r i n t f( ”mx = %f cm\ n ” , mx ) 14 err = ( ( 1 - 0 . 9 9 4 5 ) / 0 . 9 9 4 5 ) * 1 0 0 ; 15 p r i n t f( ” \ n e r r o r = %f \ n ” , err ) 16 17 x = 2 18 y = 0 . 5 : 0 . 5 : 2 . 5 ; 19 20 plot( x , y )
21 t i t l e ( ” nomograph ” ) 22 x l a b e l ( ” x ” ) 23 y l a b e l ( ” y ” ) 24 25 x = 3 26 y = 0 . 4 : 0 . 2 : 2 ; 27 plot( x , y )
Scilab code Exa 1.19 Calculation using Nomograph
1 clc 2 c l e a r 3 p r i n t f( ’ e x a m p l e 1 . 1 9 p a g e number 5 4 \ n ’ ) 4 5 // t o f i n d t h e e c o n o m i c p i p e d i a m e t e r f r o m nomograph 6 // f r o m t h e nomograph , we g e t t h e v a l u e s o f w and d e n s i t y 7 8 w =450 // i n kg / h r 9 d e n s i t y = 1 0 0 0 // i n kg /m3 10 d =16 // i n mm 11 12 u =( w / d e n s i t y ) / ( 3 . 1 4 * d ^ 2 / 4 ) ; 13 Re = u * d e n s i t y * d / 0 . 0 0 1 ; 14 15 if Re > 2 1 0 0 then p r i n t f( ” f l o w i s t u r b u l e n t and d= %f mm” ,d )
16 else disp ( ” f l o w i s l a m i n a r and t h i s nomograph i s n o t v a l i d ” )
Chapter 2
Physico Chemical Calculations
Scilab code Exa 2.1 Ideal gas system
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 p a g e number 7 1 \ n \ n ” ) 4 5 // t o f i n d t h e v o l u m e o f o x y g e n t h a t c a n be o b t a i n e d 6 7 p1 =15 // i n b a r 8 p2 = 1 . 0 1 3 // i n b a r 9 t1 =283 // i n K 10 t2 =273 // i n K 11 v1 =10 // i n l 12 13 v2 = p1 * v1 * t2 /( t1 * p2 ) ; 14 15 p r i n t f( ” v o l u m e o f o x y g e n = %f l i t e r s ” , v2 )
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 p a g e number 7 1 \ n \ n ” ) 4 5 // t o f i n d v o l u m e t r i c c o m p o s i t i o n , p a r t i a l p r e s s u e o f e a c h g a s and t o t a l p r e s s u r e o f m i x t u r e 6 7 nCO2 = 2 / 4 4 ; // m o l e s o f CO2 8 nO2 = 4 / 3 2 ; // m o l e s o f O2 9 nCH4 = 1 . 5 / 1 6 ; // m o l e s o f CH4 10 11 t o t a l _ m o l e s = nCO2 + nO2 + nCH4 ; 12 yCO2 = nCO2 / t o t a l _ m o l e s ; 13 yO2 = nO2 / t o t a l _ m o l e s ; 14 yCH4 = nCH4 / t o t a l _ m o l e s ; 15 16 p r i n t f ( ” C o m p o s i t i o n o f m i x t u r e = \nCH4 = %f \nO2 = %f \ n CO2 = %f \ n \ n ” , yCH4 , yO2 , yCO2 )
17 18 pCO2 = nCO2 * 8 . 3 1 4 * 2 7 3 / ( 6 * 1 0 ^ - 3 ) ; 19 pO2 = nO2 * 8 . 3 1 4 * 2 7 3 / ( 6 * 1 0 ^ - 3 ) ; 20 pCH4 = nCH4 * 8 . 3 1 4 * 2 7 3 / ( 6 * 1 0 ^ - 3 ) ; 21 22 p r i n t f ( ” p r e s s u r e o f CH4 = %f kPa \ n p r e s s u r e o f O2 = %f kPa \ n p r e s s u r e o f CO2 =%f kPa \ n \ n ” , pCH4
*10^ -3 , pO2 *10^ -3 , pCO2 *10^ -3)
23
24 t o t a l _ p r e s s u r e = pCO2 + pCH4 + pO2 ;
25 p r i n t f ( ” t o t a l p r e s s u r e = %f Kpa” , t o t a l _ p r e s s u r e *10^ -3)
Scilab code Exa 2.3 Equivalent metal mass
1 clc
3 p r i n t f( ” e x a m p l e 2 . 3 p a g e number 7 2 \ n \ n ” ) 4 5 // t o f i n d e q u i v a l e n t mass o f m e t a l 6 7 P = 1 0 4 . 3 // t o t a l p r e s s u r e i n KPa 8 pH2O =2.3 // i n KPa 9 pH2 = P - pH2O ; // i n KPa 10 11 VH2 = 2 0 9 * pH2 * 2 7 3 / ( 2 9 3 * 1 0 1 . 3 ) 12 13 p r i n t f( ” v o l u m e o f h y d r o g e n o b t a i n e d = %f ml \ n \ n ” , VH2 ) 14 15 // c a l c u l a t i n g amount o f m e t a l h a v i n g 1 1 . 2 l o f h y d r o g e n 16 17 m = 3 5 0 / 1 9 6 . 0 8 * 1 1 . 2 // mass o f m e t a l i n grams 18 p r i n t f( ” mass o f m e t a l e q u i v a l e n t t o 1 1 . 2 l i t r e / mol o f h y d r o g e n = %f gm” ,m )
Scilab code Exa 2.4 Purity of Sodium Hydroxide
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 4 p a g e number 7 2 \ n \ n ” ) 4 5 // t o f i n d NaCl c o n t e n t i n NaOH s o l u t i o n 6 7 w =2 // i n gm 8 m = 0 . 2 8 7 // i n gm 9 10 // p r e c i p i t a t e f r o m 5 8 . 5 gm o f NaCl = 1 4 3 . 4gm 11 12 m N a C l = 5 8 . 5 / 1 4 3 . 4 * m ; 13
14 p r i n t f( ” mass o f NaCl = %f gm\ n ” , mNaCl )
15
16 p e r c e n t a g e _ N a C l = m N a C l / w * 1 0 0 ;
17 p r i n t f( ” amount o f NaCl = %f ” , p e r c e n t a g e _ N a C l )
Scilab code Exa 2.5 Carbon content formulation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 5 p a g e number 7 2 \ n \ n ” ) 4 5 // t o f i n d t h e c a r b o n c o n t e n t i n s a m p l e 6 7 w = 4 . 7 3 // i n gm5 8 VCO2 = 5 . 3 0 // i n l i t e r s 9 10 w e i g h t _ C O 2 = 4 4 / 2 2 . 4 * VCO2 ; 11 c a r b o n _ c o n t e n t = 1 2 / 4 4 * w e i g h t _ C O 2 ; 12 13 p e r c e n t a g e _ c o n t e n t =( c a r b o n _ c o n t e n t / w ) * 1 0 0 ; 14 15 p r i n t f( ” p e r c e n t a g e amount o f c a r b o n i n s a m p l e = %f ” , p e r c e n t a g e _ c o n t e n t )
Scilab code Exa 2.6 Combustion of gas
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 6 p a g e number 7 3 \ n \ n ” ) 4 // t o f i n d t h e v o l u m e o f a i r 5 6 v o l u m e _ H 2 =0.5 // i n m3 7 v o l u m e _ C H 4 = 0 . 3 5 // i n m3
8 v o l u m e _ C O = 0 . 0 8 // i n m3 9 v o l u m e _ C 2 H 4 = 0 . 0 2 // i n m3 10 v o l u m e _ o x y g e n = 0 . 2 1 // i n m3 i n a i r 11 12 // r e q u i r e d o x y g e n f o r v a r i o u s g a s e s 13 H2 = 0 . 5 * v o l u m e _ H 2 ; 14 CH4 =2* v o l u m e _ C H 4 ; 15 CO = 0 . 5 * v o l u m e _ C O ; 16 C2H4 =3* v o l u m e _ C 2 H 4 ; 17 18 t o t a l _ O 2 = H2 + CH4 + CO + C2H4 ; 19 o x y g e n _ r e q u i r e d = t o t a l _ O 2 / v o l u m e _ o x y g e n ; 20 21 p r i n t f( ” amount o f o x y g e n r e q u i r e d = %f c u b i c m e t e r ” , o x y g e n _ r e q u i r e d )
Scilab code Exa 2.7 Sulphuric acid preparation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 7 p a g e number 7 3 \ n \ n ” ) 4 5 // t o f i n d t h e v o l u m e o f s u l p h u r i c a c i d and mass o f w a t e r consumed 6 7 d e n s i t y _ H 2 S O 4 = 1.10 // i n g / ml 8 m a s s _ 1 = 100* d e n s i t y _ H 2 S O 4 ; // mass o f 1 0 0 ml o f 15% s o l u t i o n 9 m a s s _ H 2 S O 4 = 0 . 1 5 * m a s s _ 1 ; 10 d e n s i t y _ s t d = 1.84 // d e n s i t y o f 96% s u l p h u r i c a c i d 11 m a s s _ s t d = 0 . 9 6 * d e n s i t y _ s t d ; // mass o f H2SO4 i n 1 ml 96% H2SO4 12 13 v o l u m e _ s t d = m a s s _ H 2 S O 4 / m a s s _ s t d ; // v o l u m e o f 96 %H2SO4
14 m a s s _ w a t e r = m a s s _ 1 - m a s s _ H 2 S O 4 ;
15
16 p r i n t f( ” v o l u m e o f 0 . 9 6 H2SO4 r e q u i r e d = %f ml ” , v o l u m e _ s t d )
17 p r i n t f( ” \ nmass o f w a t e r r e q u i r e d = %f g ” , m a s s _ w a t e r )
Scilab code Exa 2.8 Molarity Molality Normality Calculation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 8 p a g e number 7 3 \ n \ n ” ) 4 5 // t o f i n d m o l a r i t y , m o l a l i t y and n o r m a l i t y 6 7 w _ H 2 S O 4 = 0 . 1 5 // i n gm/1gm s o l u t i o n 8 d e n s i t y = 1 . 1 0 // i n gm/ ml 9 m = d e n s i t y * 1 0 0 0 ; // mass p e r l i t e r 10 w e i g h t = m * w _ H 2 S O 4 ; // H2SO4 p e r l i t e r s o l u t i o n 11 m o l a r _ m a s s =98; 12 13 M o l a r i t y = w e i g h t / m o l a r _ m a s s ; 14 p r i n t f( ” M o l a r i t y = %f mol / l \ n \ n ” , M o l a r i t y ) 15 16 e q u i v a l e n t _ m a s s =49; 17 n o r m a l i t y = w e i g h t / e q u i v a l e n t _ m a s s ; 18 p r i n t f( ” N o r m a l i t y = %f N\ n \ n ” , n o r m a l i t y ) 19 20 m o l a l i t y = 1 7 6 . 5 / m o l a r _ m a s s ; 21 p r i n t f( ” M o l a l i t y = %f ” , m o l a l i t y )
Scilab code Exa 2.9 Normality calculation
c l e a r 3 p r i n t f( ” e x a m p l e 2 . 9 p a g e number 7 4 \ n \ n ” ) 4 5 m o l a r _ m a s s _ B a C l 2 = 2 0 8 . 3 ; // i n gm 6 e q u i v a l e n t _ H 2 S O 4 = 0 . 1 4 4 ; 7 n o r m a l i t y = e q u i v a l e n t _ H 2 S O 4 * 1 0 0 0 / 2 8 . 8 ; 8 9 p r i n t f( ” N o r m a l i t y = %f N” , n o r m a l i t y )
Scilab code Exa 2.10 Precipitation of KClO3
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 0 p a g e number 7 4 \ n \ n ” ) 4 5 // t o f i n d amount o f KClO3 p r e c i p i t a t e d 6 7 s o l u b i l i t y _ 7 0 = 3 0 . 2 // i n gm/ 1 0 0gm 8 w _ s o l u t e = s o l u b i l i t y _ 7 0 * 3 5 0 / 1 3 0 . 2 ; // i n gm 9 10 w _ w a t e r =350 - w _ s o l u t e ; 11 s o l u b i l i t y _ 3 0 = 1 0 . 1 // i n gm/ 1 0 0gm 12 p r e c i p i t a t e =( s o l u b i l i t y _ 7 0 - s o l u b i l i t y _ 3 0 ) * w _ w a t e r /100 13 14 p r i n t f( ” amount p r e c i p i t a t e d = %f gm” , p r e c i p i t a t e )
Scilab code Exa 2.11 Solubility of CO2
1 clc
2 c l e a r
3 p r i n t f( ” e x a m p l e 2 . 1 1 p a g e number 7 4 \ n \ n ” )
5 // t o f i n d t h e p r e s s u r e f o r s o l u b i l i t y o f CO2 6 7 a b s o r b t i o n _ c o e f f i c i e n t = 1 . 7 1 // i n l i t e r s 8 m o l a r _ m a s s =44; 9 s o l u b i l i t y = a b s o r b t i o n _ c o e f f i c i e n t * m o l a r _ m a s s / 2 2 . 4 ; // i n gm 10 p r e s s u r e =8/ s o l u b i l i t y * 1 0 1 . 3 ; 11 12 p r i n t f( ” p r e s s u r e r e q u i r e d = %f kPa ” , pr es su re )
Scilab code Exa 2.12 Vapor pressure calculation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 2 p a g e number 7 4 \ n \ n ” ) 4 5 // t o f i n d t h e v a p o r p r e s s u r e o f w a t e r 6 7 w _ w a t e r =540 // i n gm 8 w _ g l u c o s e =36 // i n gm 9 m _ w a t e r =18; // m o l a r mass o f w a t e r 10 m _ g l u c o s e = 1 8 0 ; // m o l a r mass o f g l u c o s e 11 12 x =( w _ w a t e r / m _ w a t e r ) /( w _ w a t e r / m _ w a t e r + w _ g l u c o s e / m _ g l u c o s e ) ; 13 p = 8 . 2 * x ; 14 d e p r e s s i o n =8.2 - p ; 15 16 p r i n t f( ” d e p r e s s i o n i n v a p o r p r e s s u r e = %f Pa ” , d e p r e s s i o n * 1 0 0 0 )
clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 3 p a g e number 7 5 \ n \ n ” ) 4 5 // t o f i n d t h e b o i l i n g p o i n t o f s o l u t i o n 6 7 w _ g l u c o s e =9 // i n gm 8 w _ w a t e r =100 // i n gm 9 E = 0 . 5 2 ; 10 m = 9 0 / 1 8 0 ; // m o l e s / 1 0 0 0gm w a t e r 11 12 d e l t a _ t = E * m ; 13 b o i l i n g _ p o i n t = 1 0 0 + d e l t a _ t ; 14 15 p r i n t f( ” b o i l i n g p o i n t o f w a t e r = %f d e g r e e C ” , b o i l i n g _ p o i n t )
Scilab code Exa 2.14 Colligative properties
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 4 p a g e number 7 5 \ n \ n ” ) 4 5 // t o f i n d t h e m o l a r mass and o s m o t i c p r e s s u r e 6 7 K = 1 . 8 6 ; 8 c =15 // c o n c e n t r a t i o n o f a l c o h o l 9 d e l t a _ t = 1 0 . 2 6 ; 10 11 m = d e l t a _ t / K ; // m o l a l i t y 12 M = c /( m *85) ; // m o l a r mass 13 p r i n t f( ” m o l a r mass = %f gm\ n \ n ” , M * 1 0 0 0 ) 14 15 d e n s i t y = 0 . 9 7 // g / ml 16 cm = c * d e n s i t y /( M * 1 0 0 ) ;
17 p r i n t f( ” m o l a r c o n c e n t r a t i o n o f a l c o h o l = %f m o l e s / l \ n \ n ” , cm )
18
19 p = cm * 8 . 3 1 4 * 2 9 3 // o s m o t i c p r e s s u r e
20 p r i n t f( ” o s m o t i c p r e s s u r e = %f Mpa\ n \ n ” ,p /1000)
Scilab code Exa 2.15 Huggins Equation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 5 p a g e number 7 5 \ n \ n ” ) 4 5 // t o f i n d u i n , M v , k ’ 6 7 u_in = 0 . 5 7 5 // f r o m t h e g r a p h 8 u_s = 0 . 2 9 5 // i n mPa−s 9 10 M_v = ( u_in / ( 5 . 8 0 * 1 0 ^ - 5 ) ) ^ ( 1 / 0 . 7 2 ) ; 11 u _ r e d = 0 . 6 2 8 ; // i n d l / g 12 13 c = 0.40 // i n g / d l
14 k = ( u_red - u_in ) /(( u_in ^2) * c ) ;
15
16 p r i n t f( ” k = %f \nMv = %f \ n u i n = %f d l /gm” ,k , M_v , u_in )
Scilab code Exa 2.16 Molecular Formula
1 clc
2 c l e a r
3 p r i n t f( ” e x a m p l e 2 . 1 6 p a g e number 7 6 \ n \ n ” )
4
7 C = 5 4 . 5 //% o f c a r b o n 8 H2 =9.1 //% o f h y d r o g e n 9 O2 = 3 6 . 4 //% o f o x y g e n 10 x = C /12; // number o f c a r b o n m o l e c u l e s 11 y = O2 /16; // number o f o x y g e n m o l e c u l e s 12 z = H2 /2 // number o f h y d r o g e n m o l e c u l e s 13 m o l a r _ m a s s =88; 14 d e n s i t y =44; 15 16 r a t i o = m o l a r _ m a s s / d e n s i t y ; 17 x = r a t i o *2; 18 y = r a t i o *1; 19 z = r a t i o *4; 20 21 p r i n t f( ” x = %f , y = %f , z = %f ” ,x ,y , z ) 22 p r i n t f( ” \ n \ n f o r m u l a o f b u t y r i c a c i d i s = C4H8O2” )
Scilab code Exa 2.17 Molecular Formula
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 7 p a g e number 7 7 \ n \ n ” ) 4 5 // t o f i n d m o l e c u l a r f o e m u l a 6 C = 9 3 . 7 5 //% o f c a r b o n 7 H2 = 6 . 2 5 //% o f h y d r o g e n 8 x = C /12 // number o f c a r b o n atoms 9 y = H2 /2 // number o f h y d r o g e n atoms 10 m o l a r _ m a s s =64 11 d e n s i t y = 4 . 4 1 * 2 9 ; 12 13 r a t i o = d e n s i t y / m o l a r _ m a s s ; 14 15 x = r a t i o *5;
16 y = r a t i o *4;
17 18
19 p r i n t f( ” x = %f , y = %f ” ,x , y )
20 p r i n t f( ” \ n \ n f o r m u l a o f b u t y r i c a c i d i s = C10H8 ” )
Scilab code Exa 2.18 Molecular Formula
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 8 p a g e number 7 7 \ n \ n ” ) 4 5 // t o f i n d m o l e c u l a r f o r m u l a 6 C = 5 0 . 6 9 //% o f c a r b o n 7 H2 = 4 . 2 3 //% o f h y d r o g e n 8 O2 = 4 5 . 0 8 //% o f o x y g e n 9 a = C /12; // number o f c a r b o n m o l e c u l e s 10 c = O2 /16; // number o f o x y g e n m o l e c u l e s 11 b = H2 /2; // number o f h y d r o g e n m o l e c u l e s 12 m o l a r _ m a s s =71; 13 14 f u n c t i o n M = f ( m ) 15 M = ( 2 . 0 9 * 1 0 0 0 ) / ( 6 0 * m ) ; 16 17 e n d f u n c t i o n 18 19 M = f ( ( 1 . 2 5 / 5 . 1 ) ) ; 20 21 p r i n t f( ” a c t u a l m o l e c u l a r mass = %f \ n \ n ” ,M ) 22 23 r a t i o = M / m o l a r _ m a s s ; 24 a = r a t i o *3; 25 b = r a t i o *3; 26 c = r a t i o *2; 27
29 p r i n t f( ” a = %f , b = %f , c = %f ” ,a ,b , c )
30 p r i n t f( ” \ n \ n f o r m u l a o f b u t y r i c a c i d i s = C6H6O4” )
Scilab code Exa 2.19 Molecular Formula
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 1 9 p a g e number 7 8 \ n \ n ” ) 4 5 // t o f i n d t h e m o l e c u l a r f o r m u l a 6 C = 6 4 . 6 //% o f c a r b o n 7 H2 =5.2 //% o f h y d r o g e n 8 O2 = 1 2 . 6 //% o f o x y g e n 9 N2 =8.8 //% o f n i t r o g e n 10 Fe =8.8 //% o f i r o n 11 12 a = C /12; // number o f c a r b o n m o l e c u l e s 13 c = 8 . 8 / 1 4 ; // number o f n i t r o g e n m o l e c u l e s 14 b = H2 /2; // number o f h y d r o g e n m o l e c u l e s 15 d = O2 /16; // number o f o x y g e n m o l e c u l e s 16 e = Fe /56 // number o f i r o n atoms 17 18 cm = 2 4 3 . 4 / ( 8 . 3 1 * 2 9 3 ) // c o n c e n t r a t i o n 19 20 m o l a r _ m a s s = 6 3 . 3 / cm ; 21 22 p r i n t f( ” a = %f , b = %f , c = %f , d = %f , e = %f ” ,a *6.5 , b *6.5 , c *6.5 , d *6.5 , e * 6 . 5 ) 23 p r i n t f( ” \ n \ n f o r m u l a o f b u t y r i c a c i d i s = C34H33N4O5Fe ” )
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 0 p a g e number 7 8 \ n \ n ” ) 4 5 // t o f i n d s e q u e n c e o f d e p o s i t i o n 6 E1 = -0.25; 7 E2 = 0 . 8 0 ; 8 E3 = 0 . 3 4 ; 9 10 a =[ E1 ; E2 ; E3 ]; 11 b =g s o r t( a ) ; 12 13 p r i n t f( ” s o r t e d p o t e n t i a l i n v o l t s =” ) 14 disp ( b ) 15 disp ( ” E2>E3>E1 ” ) 16 disp ( ” s i l v e r >c o p p e r > n i c k e l ” )
Scilab code Exa 2.21 EMF of cell
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 1 p a g e number 7 9 \ n \ n ” ) 4 5 // t o f i n d t h e emf o f c e l l 6 7 E 0 _ Z n = -0.76; 8 E 0 _ P b = -0.13; 9 c_Zn = 0 . 1 ; 10 c_Pb = 0 . 0 2 ; 11 12 E_Zn = E 0 _ Z n + ( 0 . 0 5 9 / 2 ) *l o g 1 0( c_Zn ) ; 13 E_Pb = E 0 _ P b + ( 0 . 0 5 9 / 2 ) *l o g 1 0( c_Pb ) ; 14 E = E_Pb - E_Zn ; 15 16 p r i n t f( ” emf o f c e l l = %f V” ,E )
17 p r i n t f( ” \ n \ n S i n c e p o t e n t i a l o f l e a d i s g r e a t e r t h a n t h a t o f z i n c t h u s r e d u c t i o n w i l l o c c u r a t l e a d e l e c t r o d e and o x i d a t i o n w i l l o c c u r a t z i n c e l e c t r o d e ” )
Scilab code Exa 2.22 EMF of cell
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 2 p a g e number 7 9 \ n \ n ” ) 4 5 // t o f i n d t h e emf o f c e l l 6 E 0 _ A g = 0 . 8 0 ; 7 E 0 _ A g N O 3 = 0 . 8 0 ; 8 c_Ag = 0 . 0 0 1 ; 9 c _ A g N O 3 = 0 . 1 ; 10 11 E_Ag = E 0 _ A g + ( 0 . 0 5 9 ) *l o g 1 0( c_Ag ) ; 12 E _ A g N O 3 = E 0 _ A g N O 3 + ( 0 . 0 5 9 ) *l o g 1 0( c _ A g N O 3 ) ; 13 E = E_AgNO3 - E_Ag ; 14 15 p r i n t f( ” emf o f c e l l = %f V” ,E ) 16 p r i n t f( ” \ n \ n s i n c e E i s p o s i t i v e , t h e l e f t hand e l e c t r o d e w i l l be a n o d e and t h e e l e c t r o n w i l l t r a v e l i n t h e e x t e r n a l c i r c u i t f r o m t h e l e f t hand t o t h e r i g h t hand e l e c t r o d e ” )
Scilab code Exa 2.23 EMF of cell
1 clc
2 c l e a r
3 p r i n t f( ” e x a m p l e 2 . 2 3 p a g e number 7 9 \ n \ n ” )
5 // t o f i n d emf o f c e l l 6 pH =12; //pH o f s o l u t i o n 7 E_H2 =0; 8 E2 = -0.059* pH ; 9 E = E_H2 - E2 ; 10 p r i n t f( ”EMF o f c e l l = %f V” ,E )
Scilab code Exa 2.24 Silver deposition
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 4 p a g e number 8 0 \ n \ n ” ) 4 5 // t o f i n d amount o f s i l v e r d e p o s i t e d 6 I =3 // i n Ampere 7 t =900 // i n s 8 m_eq = 1 0 7 . 9 // i n gm/ mol 9 F = 9 6 5 0 0 ; 10 11 m =( I * t * m_eq ) / F ; 12 p r i n t f( ” mass = %f gm” , m )
Scilab code Exa 2.25 Electroplating time
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 5 p a g e number 8 0 \ n \ n ” ) 4 5 // t o f i n d t h e t i m e f o r e l e c t r o p l a t i n g 6 v o l u m e = 1 0 * 1 0 * 0 . 0 0 5 ; // i n cm3 7 mass = v o l u m e * 8 . 9 ; 8 F = 9 6 5 0 0 ; 9 a t o m i c _ m a s s = 5 8 . 7 // i n amu
10 c u r r e n t =2.5 // i n Ampere 11 12 c h a r g e = ( 8 . 9 * F *2) / a t o m i c _ m a s s ; 13 y i e l d = 0 . 9 5 ; 14 a c t u a l _ c h a r g e = c h a r g e /( y i e l d * 3 6 0 0 ) ; 15 t = a c t u a l _ c h a r g e / c u r r e n t ; 16 17 p r i n t f( ” t i m e r e q u i r e d = %f h o u r s ” ,t )
Scilab code Exa 2.26 Water hardness
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 6 p a g e number 8 0 \ n \ n ” ) 4 5 // t o f i n d h a r d n e s s o f w a t e r 6 m _ M g S O 4 =90 // i n ppm 7 M g S O 4 _ p a r t s = 1 2 0 ; 8 C a C O 3 _ p a r t s = 1 0 0 ; 9 10 h a r d n e s s =( C a C O 3 _ p a r t s / M g S O 4 _ p a r t s ) * m _ M g S O 4 ; 11 12 p r i n t f( ” h a r d n e s s o f w a t e r = %f mg/ l ” , ha rd ne ss )
Scilab code Exa 2.27 Water hardness
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 6 p a g e number 8 0 \ n \ n ” ) 4 5 m1 = 162 // mass o f c a l c i u m b i c a r b o n a t e i n mg 6 m2 = 73 // mass o f magnesium b i c a r b o n a t e i n mg 7 m3 = 136 // mass o f c a l s i u m s u l f a t e i n mg
8 m4 = 95 // mass o f magnesium c l o r i d e 9 m5 = 500 // mass o f s o d i u m c l o r i d e i n mg 10 m6 = 50 // mass o f p o t a s s i u m c l o r i d e i n mg 11 12 c o n t e n t _ 1 = m1 * 1 0 0 / m1 ; // c o n t e n t o f c a l c i u m b i c a r b o n a t e i n mg 13 c o n t e n t _ 2 = m2 * 1 0 0 / ( 2 * m2 ) ; // c o n t e n t o f magnesium b i c a r b o n a t e i n mg 14 c o n t e n t _ 3 = m3 * 1 0 0 / m3 ; // c o n t e n t o f c a l s i u m s u f a t e i n mg 15 c o n t e n t _ 4 = m4 * 1 0 0 / m4 ; // c o n t e n t o f magnesium c l o r i d e 16 17 // p a r t 1 18 19 t e m p _ h a r d n e s s = c o n t e n t _ 1 + c o n t e n t _ 2 ; // d e p e n d s on b i c a r b o n a t e o n l y 20 t o t a l _ h a r d n e s s = c o n t e n t _ 1 + c o n t e n t _ 2 + c o n t e n t _ 3 + c o n t e n t _ 4 ; 21 p r i n t f( ” t o t a l h a r d n e s s = %f \ n t e m p o r a r y h a r d n e s s = %f \ n ” , temp_hardness , t o t a l _ h a r d n e s s ) 22 23 // p a r t 2 24 w t _ l i m e = ( 7 4 / 1 0 0 ) *( c o n t e n t _ 1 +2* c o n t e n t _ 2 + c o n t e n t _ 4 ) ; 25 a c t u a l _ l i m e = w t _ l i m e / 0 . 8 5 ; 26 p r i n t f( ” amount o f l i m e r e q u i r e d = %f \ n ” , a c t u a l _ l i m e ) 27 28 s o d a _ r e q u i r e d = ( 1 0 6 / 1 0 0 ) *( c o n t e n t _ 1 + c o n t e n t _ 4 ) ; 29 a c t u a l _ s o d a = s o d a _ r e q u i r e d / 0 . 9 8 ; 30 p r i n t f( ” amount o f s o d a r e q u i r e d = %f \ n ” , a c t u a l _ s o d a )
clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 8 p a g e number 8 2 \ n \ n ” ) 4 5 // t o f i n d h a r d n e s s o f w a t e r 6 7 v o l u m e _ N a C l =50 // i n l 8 c _ N a C l = 5 0 0 0 // i n mg/ l 9 10 m = v o l u m e _ N a C l * c _ N a C l ; 11 e q u i v a l e n t _ N a C l = 5 0 / 5 8 . 5 ; 12 13 h a r d n e s s = e q u i v a l e n t _ N a C l * m ; 14 15 p r i n t f( ” h a r d n e s s o f w a t e r = %f mg/ l ” , ha rd ne ss /1000)
Scilab code Exa 2.29 Mixture composition
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 2 9 p a g e number 8 2 \ n \ n ” ) 4 5 // t o f i n d t h e t o t a l v a p o r p r e s s u r e and m o l a r c o m p o s i t i o n s 6 7 m _ b e n z e n e = 55 // i n kg 8 m _ t o l u e n e = 28 // i n kg 9 m _ x y l e n e = 17 // i n kg 10 11 m o l e _ b e n z e n e = m _ b e n z e n e /78; 12 m o l e _ t o l u e n e = m _ t o l u e n e /92; 13 m o l e _ x y l e n e = m _ x y l e n e / 1 0 6 ; 14 15 m o l e _ t o t a l = m o l e _ b e n z e n e + m o l e _ t o l u e n e + m o l e _ x y l e n e ; 16 x _ b e n z e n e = m o l e _ b e n z e n e / m o l e _ t o t a l ;
17 x _ t o l u e n e = m o l e _ t o l u e n e / m o l e _ t o t a l ; 18 x _ x y l e n e = m o l e _ x y l e n e / m o l e _ t o t a l ; 19 20 P = x _ b e n z e n e * 1 7 8 . 6 + x _ t o l u e n e * 7 4 . 6 + x _ x y l e n e *28; 21 p r i n t f( ” t o t a l p r e s s u r e = %f kPa \ n ” ,P ) 22 23 b e n z e n e = ( x _ b e n z e n e * 1 7 8 . 6 * 1 0 0 ) / P ; 24 t o l u e n e = ( x _ t o l u e n e * 7 4 . 6 * 1 0 0 ) / P ; 25 x y l e n e = ( x _ x y l e n e * 2 8 * 1 0 0 ) / P ; 26 27 p r i n t f( ” x y l e n e = %f \ n t o l u e n e = %f \ n b e n z e n e = %f ” , xylene , toluene , b e n z e n e )
Scilab code Exa 2.30 Mixture composition
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 3 0 p a g e number 8 3 \ n \ n ” ) 4 5 // t o f i n d t h e m i x t u r e c o m p o s i t i o n 6 7 v a p o r _ p r e s s u r e =8 // i n kPa 8 p r e s s u r e =100 // i n kPa 9 10 // p a r t 1 11 v o l u m e =1 // i n m3 12 v o l u m e _ e t h a n o l = v o l u m e *( v a p o r _ p r e s s u r e / p r e s s u r e ) ; 13 v o l u m e _ a i r =1 - v o l u m e _ e t h a n o l ; 14 p r i n t f( ” v o l u m e t r i c c o m p o s i t i o n : − \ n a i r c o m p o s i t i o n = %f \ n e t h a n o l c o m p o s t i o n = %f ” , v o l u m e _ a i r *100 , v o l u m e _ e t h a n o l * 1 0 0 ) 15 16 // p a r t 2 17 m o l a r _ m a s s _ e t h a n o l =46; 18 m o l a r _ m a s s _ a i r = 2 8 . 9 ;
19 m a s s _ e t h a n o l = 0 . 0 8 * m o l a r _ m a s s _ e t h a n o l ; // i n kg 20 m a s s _ a i r = 0 . 9 2 * m o l a r _ m a s s _ a i r ; // i n kg 21 f r a c t i o n _ e t h a n o l =( m a s s _ e t h a n o l * 1 0 0 ) /( m a s s _ a i r + m a s s _ e t h a n o l ) ; 22 f r a c t i o n _ a i r =( m a s s _ a i r * 1 0 0 ) /( m a s s _ a i r + m a s s _ e t h a n o l ) ; 23 p r i n t f( ” \ n \ n c o m p o s i t i o n by w e i g h t : −\ n A i r = %f E t h a n o l v a p o r = %f ” , fraction_air , f r a c t i o n _ e t h a n o l ) 24 25 // p a r t 3 26 m i x t u r e _ v o l u m e = 2 2 . 3 * ( 1 0 1 . 3 / 1 0 0 ) * ( 2 9 9 / 2 7 3 ) ; // i n m3 27 w e i g h t _ e t h a n o l = m a s s _ e t h a n o l / m i x t u r e _ v o l u m e ; 28 p r i n t f( ” \ n \ n w e i g h t o f e t h a n o l / c u b i c m e t e r = %f Kg” , w e i g h t _ e t h a n o l ) 29 30 // p a r t 4 31 w _ e t h a n o l = m a s s _ e t h a n o l / m a s s _ a i r ; 32 p r i n t f( ” \ n \ n w e i g h t o f e t h a n o l / kg v a p o r f r e e a i r = %f Kg” , w _ e t h a n o l ) 33 34 // p a r t 5 35 m o l e s _ e t h a n o l = 0 . 0 8 / 0 . 9 2 ; 36 p r i n t f( ” \ n \ nkmol o f e t h a n o l p e r kmol o f v a p o r f r e e a i r = %f ” , m o l e s _ e t h a n o l )
Scilab code Exa 2.31 Mixture properties
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 3 1 p a g e number 8 4 \ n \ n ” ) 4 5 // t o f i n d r e l a t i v e s a t u r a t i o n and dew p o i n t 6 7 v a p o r _ p r e s s u r e =8 // i n kPa 8 v o l u m e _ e t h a n o l = 0 . 0 5 ;
9 10 // b a s i s 1 kmol o f m i x t u r e 11 12 p a r t i a l _ p r e s s u r e = v o l u m e _ e t h a n o l * 1 0 0 ; 13 r e l a t i v e _ s a t u r a t i o n = p a r t i a l _ p r e s s u r e / v a p o r _ p r e s s u r e ; 14 m o l e _ r a t i o = v o l u m e _ e t h a n o l /(1 - v o l u m e _ e t h a n o l ) ; 15 p r i n t f( ” m o l e r a t i o = %f \ n r e l a t i v e s a t u r a t i o n = %f ” , m o l e _ r a t i o , r e l a t i v e _ s a t u r a t i o n * 1 0 0 ) 16 17 // b a s i s 1 kmol s a t u r a t e d g a s m i x t u r e a t 1 0 0 kPa 18 v o l u m e _ v a p o r = ( 8 / 1 0 0 ) * 1 0 0 ; 19 e t h a n o l _ v a p o r = v o l u m e _ v a p o r / 1 0 0 ; 20 a i r _ v a p o r =1 - e t h a n o l _ v a p o r ; 21 s a t u r a t i o n _ r a t i o = e t h a n o l _ v a p o r / a i r _ v a p o r ; 22 p e r c e n t a g e _ s a t u r a t i o n = m o l e _ r a t i o / s a t u r a t i o n _ r a t i o ; 23 24 p r i n t f( ” \ n \ n p e r c e n t a g e s a t u r a t i o n = %f ” , p e r c e n t a g e _ s a t u r a t i o n ) 25 26 // dew p o i n t 27 p r i n t f( ” \ n \ n c o r r e s p o n d i n g t o p a r t i a l p r e s s u r e o f 5 kPa we g e t a dew p o i n t o f 1 7 . 3 d e g r e e c e l c i u s ” )
Scilab code Exa 2.32 Humidity
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 2 . 3 2 p a g e number 8 4 \ n \ n ” ) 4 5 // t o f i n d t h e p r o p e r t i e s o f humid a i r 6 7 p = 4.24 // i n kPa 8 H _ r e l = 0.8; 9 p _ p a r t i a l = p * H _ r e l ; 10 m o l a l _ H = p _ p a r t i a l /(100 - p _ p a r t i a l ) ;
11 p r i n t f( ” i n i t i a l m o l a l h u m i d i t y = %f \ n \ n ” , molal_H ) 12 13 // p a r t 2 14 P = 200 // i n kPa 15 p _ p a r t i a l = 1.70 // i n kPa 16 f i n a l _ H = p _ p a r t i a l /( P - p _ p a r t i a l ) ; 17 p r i n t f( ” f i n a l m o l a l h u m i d i t y = %f \ n \ n ” , final_H ) 18 19 // p a r t 3 20 p _ d r y a i r = 100 - 3 . 3 9 ; 21 v = 1 0 0 * ( p _ d r y a i r / 1 0 1 . 3 ) * ( 2 7 3 / 3 0 3 ) ; 22 m o l e s _ d r y a i r = v / 2 2 . 4 ; 23 v a p o r _ i n i t i a l = m o l a l _ H * m o l e s _ d r y a i r ; 24 v a p o r _ f i n a l = f i n a l _ H * m o l e s _ d r y a i r ; 25 w a t e r _ c o n d e n s e d = ( v a p o r _ i n i t i a l - v a p o r _ f i n a l ) *18; 26 p r i n t f( ” amount o f w a t e r c o n d e n s e d = %f \ n \ n ” , w a t e r _ c o n d e n s e d ) 27 28 // p a r t 4 29 t o t a l _ a i r = m o l e s _ d r y a i r + v a p o r _ f i n a l ; 30 f i n a l _ v = 2 2 . 4 * ( 1 0 1 . 3 / 2 0 0 ) * ( 2 8 8 / 2 7 3 ) * t o t a l _ a i r ; 31 p r i n t f( ” f i n a l v o l u m e o f wety a i r = %f \ n \ n ” , final_v )
Chapter 3
Material and Energy Balances
Scilab code Exa 3.1 Coal consumption
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 p a g e number 9 0 \ n \ n ” ) 4 5 // t o f i n d t h e c o a l c o n s u m p t i o n 6 w_C = 0.6; // amount o f c a r b o n i n c o a l 7 N 2 _ c o n t e n t = 40 // i n m3 p e r 1 0 0m3 a i r 8 9 a i r _ c o n s u m e d = N 2 _ c o n t e n t / 0 . 7 9 ; 10 w e i g h t _ a i r = a i r _ c o n s u m e d * ( 2 8 . 8 / 2 2 . 4 ) ; 11 O 2 _ c o n t e n t = a i r _ c o n s u m e d * 3 2 * ( 0 . 2 1 / 2 2 . 4 ) ; // i n kg 12 13 H 2 _ c o n t e n t = 20 // i n m3 14 15 s t e a m _ c o n s u m e d = H 2 _ c o n t e n t * ( 1 8 / 2 2 . 4 ) ; 16 17 C _ c o n s u m p t i o n 1 = ( 1 2 / 1 8 ) * s t e a m _ c o n s u m e d ; // i n r e a c t i o n 1 18 C _ c o n s u m p t i o n 2 = ( 2 4 / 3 2 ) * O 2 _ c o n t e n t ; // i n r e a c t i o n 2 19
t o t a l _ c o n s u m p t i o n = C _ c o n s u m p t i o n 1 + C _ c o n s u m p t i o n 2 ;
21 c o a l _ c o n s u m p t i o n = t o t a l _ c o n s u m p t i o n / w_C ;
22
23 p r i n t f( ” c o a l c o n s u m p t i o n = %f kg ” , c o a l _ c o n s u m p t i o n )
Scilab code Exa 3.2 Nitric acid preparation
1 clc
2 c l e a r
3 p r i n t f( ” e x a m p l e 3 . 2 p a g e number 9 1 \ n \ n ” )
4
5 // t o f i n d amount o f ammonia and a i r consumed
6 7 N H 3 _ r e q u i r e d = ( 1 7 / 6 3 ) * 1 0 0 0 ; //NH3 r e q u i r e d f o r 1 t o n o f n i t r i c a c i d 8 N O _ c o n s u m p t i o n = 0 . 9 6 ; 9 H N O 3 _ c o n s u m p t i o n = 0 . 9 2 ; 10 N H 3 _ c o n s u m e d = N H 3 _ r e q u i r e d /( N O _ c o n s u m p t i o n * H N O 3 _ c o n s u m p t i o n ) ; 11 v o l u m e _ N H 3 = N H 3 _ c o n s u m e d * ( 2 2 . 4 / 1 7 ) ; 12 p r i n t f( ” v o l u m e o f ammonia consumed= %f c u b i c m e t r e / h ” , v o l u m e _ N H 3 ) 13 14 N H 3 _ c o n t e n t = 11 //% by v o l u m e 15 a i r _ c o n s u m p t i o n = v o l u m e _ N H 3 * ( ( 1 0 0 - 1 1 ) /11) ; 16 p r i n t f( ” \ n \ n v o l u m e o f a i r consumed = %f c u b i c m e t r e / h ” , a i r _ c o n s u m p t i o n )
Scilab code Exa 3.3 HCl production
1 clc
2 c l e a r
4
5 // t o f i n d t h e c o n s u m p t i o n o f NaCl and H2SO4 i n HCl c o n s u m p t i o n 6 7 H C l _ p r o d u c t i o n = 500 // r e q u i r e d t o be p r o d u c e d i n kg 8 N a C l _ r e q u i r e d = ( 1 1 7 / 7 3 ) * H C l _ p r o d u c t i o n ; 9 y i e l d = 0 . 9 2 ; 10 p u r i t y _ N a C l = 0 . 9 6 ; 11 12 a c t u a l _ N a C l = N a C l _ r e q u i r e d /( p u r i t y _ N a C l * y i e l d ) ; 13 p r i n t f( ” amount o f NaCl r e q u i r e d = %f kg ” , a c t u a l _ N a C l ) 14 15 p u r i t y _ H 2 S O 4 = 0 . 9 3 ; 16 H 2 S O 4 _ c o n s u m p t i o n = ( 9 8 / 7 3 ) *( H C l _ p r o d u c t i o n /( y i e l d * p u r i t y _ H 2 S O 4 ) ) ;
17 p r i n t f( ” \ n \ namount o f H2SO4 consumed = %f kg ” , H 2 S O 4 _ c o n s u m p t i o n )
18
19 N a 2 S O 4 _ p r o d u c e d = ( 1 4 2 / 7 3 ) * H C l _ p r o d u c t i o n ;
20 p r i n t f( ” \ n \ namount o f Na2SO4 p r o d u c e d = %f kg ” , N a 2 S O 4 _ p r o d u c e d )
Scilab code Exa 3.4 Acetylene consumption
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 4 p a g e number 9 2 \ n \ n ” ) 4 5 // t o f i n d t h e p e r i o d o f s e r v i c e 6 7 C 2 H 2 _ p r o d u c e d = ( 1 / 6 4 ) * 0 . 8 6 ; // i n kmol 8 v o l u m e _ C 2 H 2 = C 2 H 2 _ p r o d u c e d * 2 2 . 4 * 1 0 0 0 ; // i n l 9
10 // a s s u m i n g i d e a l b e h a v i o u r ,
11 v o l u m e = ( 1 0 0 / 1 0 1 . 3 ) * ( 2 7 3 / ( 2 7 3 + 3 0 ) ) ;
12 time = ( v o l u m e _ C 2 H 2 / v o l u m e ) * ( 1 / 6 0 ) ;
13 p r i n t f( ” t i m e o f s e r v i c e = %f h r ” , time )
Scilab code Exa 3.5 Screen effectiveness
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 5 p a g e number 9 2 \ n \ n ” ) 4 5 // t o f i n d t h e s c r e e n e f f e c t i v e n e s s 6 7 xv = 0 . 8 8 ; 8 xf = 0 . 4 6 ; 9 xl = 0 . 3 2 ; 10 F = 100 // i n kg 11 12 L = ( F *( xf - xv ) ) /( xl - xv ) ; 13 V = F - L ; 14 p r i n t f( ”L = %f Kg \nV = %f Kg” ,L , V ) 15 Eo = ( V * xv ) /( F * xf ) ; 16 17 p r i n t f( ” \ n \ n e f f e c t i v e n e s s b a s e d on o v e r s i z e d p a r t i c e s = %f \ n \ n ” , Eo ) 18 Eu = ( L *(1 - xl ) ) /( F *(1 - xf ) ) ; 19 20 p r i n t f( ” e f f e c t i v e n e s s b a s e d on u n d e r s i z e d p a r t i c e s = %f ” , Eu ) 21 E = Eu * Eo ; 22 23 p r i n t f( ” \ n \ n o v e r a l l e f f e c t i v e n e s s = %f ” ,E )
Scilab code Exa 3.6 Absorption 1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 6 p a g e number 9 4 \ n \ n ” ) 4 5 // t o f i n d t h e f l o w r a t e and c o n c e n t r a t i o n 6 7 G1 = 3600 // i n m3/ h 8 P = 1 0 6 . 6 // i n kPa 9 T = 40 // i n d e g r e e C 10 q = G1 *( P / 1 0 1 . 3 ) * ( 2 7 3 / ( ( 2 7 3 + T ) ) ) ; // i n m3/ s 11 m = q / 2 2 . 4 ; // i n kmol / h 12 y1 = 0 . 0 2 ; 13 Y1 = y1 /(1 - y1 ) ; 14 15 p r i n t f( ” m o l e r a t i o o f b e n z e n e = %f kmol b e n z e n e / kmol d r y g a s ” , Y1 ) 16 17 Gs = m *(1 - y1 ) ; 18 p r i n t f( ” \ n \ n m o l e s o f b e n z e n e f r e e g a s = %f kmol d r y g a s / h ” , Gs ) 19 20 // f o r 95% r e m o v a l 21 Y2 = Y1 * ( 1 - 0 . 9 5 ) ; 22 p r i n t f( ” \ n \ n f i n a l m o l e r a t i o o f b e n z e n e = %f kmol b e n z e n e / kmol d r y g a s ” , Y2 ) 23 24 x2 = 0 . 0 0 2 25 X2 = 0 . 0 0 2 / ( 1 - 0 . 0 0 2 ) ; 26 27 // a t e q u i l i b r i u m y ∗ = 0 . 2 4 0 6X 28 // p a r t 1 29 // f o r o i l r a t e t o be minimum t h e wash o i l l e a v i n g t h e a b s o r b e r must be i n e q u i l i b r i u m w i t h t h e e n t e r i n g g a s 30 31 y1 = 0 . 0 2 ;
x1 = y1 / ( 0 . 2 4 0 6 ) ; 33 X1 = x1 /(1 - x1 ) ; 34 m i n _ L s = Gs *(( Y1 - Y2 ) /( X1 - X2 ) ) ; 35 p r i n t f( ” \ n \ nminimum Ls r e q u i r e d = %f kg / h ” , min_Ls * 2 6 0 ) 36 37 // f o r 1 . 5 t i m e s o f t h e minimum 38 Ls = 1.5* m i n _ L s ; 39 p r i n t f( ” \ n \ n f l o w r a t e o f wash o i l = %f kg / h ” , Ls *260) 40 X1 = X2 + ( Gs *(( Y1 - Y2 ) / Ls ) ) ; 41 p r i n t f( ” \ n \ n c o n c e n t r a t i o n o f b e n z e n e i n wash o i l = %f kmol b e n z e n e / kmol wash o i l ” , X1 )
Scilab code Exa 3.7 Extraction
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 7 p a g e number 9 5 \ n \ n ” ) 4 5 // t o f i n d t h e e x t r a c t i o n o f n i c o t i n e 6 xf = 0.01 7 Xf = xf /(1 - xf ) ; 8 Feed = 100 // f e e d i n kg 9 c _ n i c o t i n e = Feed * Xf ; // n i c o t i n e c o n c i n f e e d 10 c _ w a t e r = Feed *(1 - Xf ) // w a t e r c o n c i n f e e d 11 12 // p a r t 1 13 f u n c t i o n[ f ] = F1 ( x ) 14 f u n c p r o t(0) 15 f = ( x / 1 5 0 ) -0.9*((1 - x ) /99) ; 16 e n d f u n c t i o n 17 18 // i n i t i a l g u e s s 19 x = 10; 20 y = f s o l v e( x , F1 ) ;
21 p r i n t f( ” amount o f n i c o t i n e remov ed N = %f kg ” ,y ) 22 // p a r t 2 23 f u n c t i o n[ f ] = F1 ( x ) 24 f = ( x /50) -0.9*((1 - x ) /99) ; 25 e n d f u n c t i o n 26 27 // i n i t i a l g u e s s 28 x = 10; 29 N1 = f s o l v e( x , F1 ) ;
30 p r i n t f( ” \ n \ namount o f n i c o t i n e rem oved i n s t a g e 1 , N1 = %f kg ” , N1 ) 31 f u n c t i o n[ f ] = F1 ( x , N1 ) 32 f = ( x /50) -0.9*((1 - x - N1 ) /99) ; 33 e n d f u n c t i o n 34 35 // i n i t i a l g u e s s 36 x = 10; 37 N2 = f s o l v e( x , F1 ) ;
38 p r i n t f( ” \ n \ namount o f n i c o t i n e rem oved i n s t a g e 2 , N2 = %f kg ” , N2 ) 39 f u n c t i o n[ f ] = F1 ( x , N1 , N2 ) 40 f = ( x /50) -0.9*((1 - x - N2 - N1 ) /99) ; 41 e n d f u n c t i o n 42 43 // i n i t i a l g u e s s 44 x = 10; 45 N3 = f s o l v e( x , F1 ) ; 46 47 p r i n t f( ” \ n \ namount o f n i c o t i n e re moved i n s t a g e 3 , N3 = %f kg ” , N3 ) 48 N = N1 + N2 + N3 ; 49 p r i n t f( ” \ n \ n t o t a l amount o f n i c o t i n e removed = %f kg ” ,N )
clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 8 p a g e number 9 6 \ n \ n ” ) 4 5 // t o f i n d t h e amount o f w a t e r i n r e s i d u e 6 7 v p _ w a t e r = 3 1 . 0 6 // i n kPa 8 v p _ b e n z e n e = 7 2 . 9 2 // i n kPa 9 10 P = v p _ w a t e r + v p _ b e n z e n e ; 11 x _ b e n z e n e = v p _ b e n z e n e / P ; 12 x _ w a t e r = v p _ w a t e r / P ; 13 14 i n i t i a l _ w a t e r = 5 0 / 1 8 ; // i n kmol o f w a t e r 15 i n i t i a l _ b e n z e n e = 5 0 / 7 8 // i n kmol o f b e n z e n e 16 w a t e r _ e v a p o r a t e d = i n i t i a l _ b e n z e n e *( x _ w a t e r / x _ b e n z e n e ) ; 17 w a t e r _ l e f t = ( i n i t i a l _ w a t e r - w a t e r _ e v a p o r a t e d ) ; 18 19 p r i n t f( ” amount o f w a t e r l e f t i n r e s i d u e = %f kg ” , w a t e r _ l e f t *18)
Scilab code Exa 3.9 Distillation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 9 p a g e number 9 7 \ n \ n ” ) 4 5 // t o f i n d t h e v a p o r c o n t e n t o f d i m e t h y l a n a l i n e 6 po_D = 4.93 // i n kPa 7 po_W = 96.3 // i n kPa 8 n = 0.75 // v a p o r i z a t i o n e f f i c i e n c y 9 10 P = n * po_D + po_W ; 11 p r i n t f( ”P = %f kPa ” , P )
12 13 x _ w a t e r = 9 6 . 3 / 1 0 0 ; 14 x _ d i m e t h y l a n a l i n e = 1 - x _ w a t e r ; 15 w t _ d i m e t h y l a n a l i n e = ( x _ d i m e t h y l a n a l i n e * 1 2 1 ) /( x _ d i m e t h y l a n a l i n e * 1 2 1 + x _ w a t e r *18) ; 16 p r i n t f( ” \ n \ n w e i g h t o f d i m e t h y l a n a l i n e i n w a t e r = %f ” , w t _ d i m e t h y l a n a l i n e * 1 0 0 ) 17 18 // p a r t 1 19 n = 0.8; 20 po_D = 32 // i n kPa 21 a c t u a l _ v p = n * po_D ; 22 p _ w a t e r = 100 - a c t u a l _ v p ; 23 s t e a m _ r e q u i r e d = ( p _ w a t e r *18) /( a c t u a l _ v p * 1 2 1 ) ; 24 p r i n t f( ” \ n \ namount o f s t e a m r e q u i r e d = %f kg s t e a m / kg d i m e t h y l a n a l i n e ” , s t e a m _ r e q u i r e d ) 25 26 // p a r t 2 27 x _ w a t e r = p _ w a t e r / 1 0 0 ; 28 w t _ w a t e r = x _ w a t e r * 1 8 / ( x _ w a t e r *18+(1 - x _ w a t e r ) * 1 2 1 ) ; 29 p r i n t f( ” \ n \ n w e i g h t o f w a t e r v a p o r = %f \ n w e i g h t o f d i m e t h y l a n a l i n e =%f ” , wt _w at er *100 ,100*(1 - wt _w at er ) )
Scilab code Exa 3.10 Crystallization
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 0 p a g e number 9 8 \ n \ n ” ) 4 5 // t o f i n d t h e amount o f w a t e r e v a p o r a t e d 6 xf = 0 . 1 5 ; 7 xl = ( 1 1 4 . 7 ) / ( 1 1 4 . 7 + 1 0 0 0 ) ; 8 xc = 1; 9
10 K 2 C r 2 O 7 _ f e e d = 1 0 0 0 * 0 . 1 5 ; // i n kg 11 12 n = 0.8; 13 C = n * K 2 C r 2 O 7 _ f e e d ; 14 V = ( K 2 C r 2 O 7 _ f e e d -120 - 8 8 0 * 0 . 1 0 3 ) / ( - 0 . 1 0 3 ) ; 15 16 p r i n t f( ” amount o f w a t e r e v a p o r a t e d = %f kg ” ,V )
Scilab code Exa 3.11 crystallization
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 0 p a g e number 9 8 \ n \ n ” ) 4 5 // t o f i n d t h e y i e l d o f c r y s t a l s 6 7 xc = 1 0 6 / 2 8 6 ; 8 xf = 0 . 2 5 ; 9 xl = 2 7 . 5 / 1 2 7 . 5 ; 10 11 w a t e r _ p r e s e n t = 100*(1 - xf ) ; // i n kg 12 V = 0 . 1 5 * 7 5 ; // i n kg 13 C = ( 1 0 0 * xf - 8 8 . 7 * xl ) /( xc - xl ) ; 14 N a 2 C O 3 _ f e e d = 25/ xc ; 15 16 y i e l d = ( C / N a 2 C O 3 _ f e e d ) * 1 0 0 ; 17 18 p r i n t f( ” y i e l d = %f ” , y i e l d )
Scilab code Exa 3.12 Drying
1 clc
3 p r i n t f( ” e x a m p l e 3 . 1 2 p a g e number 9 9 \ n \ n ” ) 4 5 // t o f i n d t h e f r a c t i o n o f a i r r e c i r c u l a t e d 6 7 r = 50 // w e i g h t o f d r y a i r p a s s i n g t h r o u g h d r i e r 8 w1 = 1.60 // i n kg p e r kg d r y s o l i d 9 w2 = 0.1 // i n kg / kg d r y s o l i d 10 H0 = 0 . 0 1 6 // i n kg w a t e r v a p o r / kg d r y a i r 11 H2 = 0 . 0 5 5 // i n kg w a t e r v a p o r / kg d r y a i r 12 13 y = 1 - ( w1 - w2 ) /( r *( H2 - H0 ) ) ; 14 p r i n t f( ” f r a c t i o n o f a i r r e c i r c u l a t e d = %f ” ,y ) 15 16 H1 = H2 - ( w1 - w2 ) / r ; 17 p r i n t f( ” \ n \ n h u m i d i t y o f a i r e n t e r i n g t h e d r i e r = %f kg w a t e r v a p o r / kg kg d r y a i r ” , H1 ) 18 19 // c h e c k 20 H11 = H2 * y + H0 *(1 - y ) ; 21 if H1 == H11 then p r i n t f( ” \ n \ n f r a c t i o n o f a i r r e c i r c u l a t e d = %f \ n v e r i f i e d ” ,y ) 22 end
Scilab code Exa 3.13 Conditioning of air
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 3 p a g e number 1 0 0 \ n \ n ” ) 4 5 // t o f i n d t h e v o l u m e t r i c f l o w r a t e and f r a c t i o n o f a i r p a s s i n g t h r o u g h t h e c o o l e r 6 7 // b a s i s 60m3/ h o f c o n d i t i o n e d a i r a t 25 d e g r e e C and 60% RH 8
Hf = 0 . 0 1 2 ; 10 Hi = 0 . 0 3 3 ; 11 H1 = 0 . 0 0 7 5 ; 12 13 w a t e r _ v a p o r = Hf /18; // i n kmol o f w a t e r v a p o r 14 d r y _ a i r = 1 / 2 8 . 9 ; // i n kmol 15 t o t a l _ m a s s = w a t e r _ v a p o r + d r y _ a i r ; 16 17 v o l u m e = 2 2 . 4 * ( 2 9 8 / 2 7 3 ) * t o t a l _ m a s s ; 18 w e i g h t = 60/ v o l u m e ; 19 p r i n t f( ” w e i g h t o f d r y a i r h a n d l e d p e r h r = %f kg ” , w e i g h t ) 20 21 // p a r t 1 22 i n l e t _ w a t e r v a p o r = 0 . 0 3 3 / 1 8 ; // i n kmol o f w a t e r v a p o r 23 v o l u m e _ i n l e t = 2 2 . 4 * ( 3 0 8 / 2 7 3 ) *( i n l e t _ w a t e r v a p o r + d r y _ a i r ) ; 24 p r i n t f( ” \ n \ n v o l u m e t r i c f l o w r a t e o f i n l e t a i r = %f c u b i c m e t e r ” , v o l u m e _ i n l e t * weight ) 25 26 // p a r t 2 27 y = ( Hf - Hi ) /( H1 - Hi ) ; 28 p r i n t f( ” \ n \ n f r a c t i o n o f i n l e t a i r p a s s i n g t h r o u g h c o o l e r = %f ” ,y )
Scilab code Exa 3.14 Ammonia Synthesis
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 4 p a g e number 1 0 2 \ n \ n ” ) 4 5 // t o f i n d t h e f r a c t i o n o f p u r g e d r e c y c l e and t o t a l y i e l d 6
7 // x− m o l e s o f N2 and H2 r e c y c l e d ; y − m o l e s o f N2 H2 p u r g e d 8 9 A r _ f r e s h f e e d = 0.2; 10 // a r g o n i n f r e s h f e e d i s e q u a l t o a r g o n i n p u r g e 11 12 y = 0 . 2 / 0 . 0 6 3 3 ; // a r g o n i n p u r g e = 0 . 0 6 3 3 y 13 x = ( 0 . 7 9 * 1 0 0 - y ) / ( 1 - 0 . 7 9 ) ; 14 p r i n t f( ” y = %f kmol \ nx = %f kmol ” ,y , x ) 15 16 // p a r t 1 17 f r a c t i o n = y / x ; 18 p r i n t f( ” \ n \ n f r a t i o n o f r e c y c l e t h a t i s p u r g e d = %f ” , f r a c t i o n ) 19 20 // p a r t 2 21 y i e l d = 0 . 1 0 5 * ( 1 0 0 + x ) ; 22 p r i n t f( ” \ n \ n o v e r a l l y i e l d o f ammonia = %f kmol ” , y i e l d )
Scilab code Exa 3.15 Enthalpy calculation
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 5 p a g e number 1 0 7 \ n \ n ” ) 4 5 // t o f i n d c h a n g e i n e n t h a l p y 6 H 0 _ C H 4 = -74.9 // i n kJ 7 H 0 _ C O 2 = -393.5 // i n kJ 8 H 0 _ H 2 O = -241.8 // i n kJ 9 10 d e l t a _ H 0 = H 0 _ C O 2 +2* H0_H2O - H 0 _ C H 4 ; 11 p r i n t f( ” c h a n g e i n e n t h a l p y = %f kJ ” , de lt a_ H0 )
Scilab code Exa 3.16 Enthalpy calculation 1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 6 p a g e number 1 0 7 \ n \ n ” ) 4 5 // t o c o m p a r e t h e e n t h a l p y c h a n g e i n two r e a c t i o n s 6 7 H 0 _ g l u c o s e = -1273 // i n kJ 8 H 0 _ e t h a n o l = -277.6 // i n kJ 9 H 0 _ C O 2 = -393.5 // i n kJ 10 H 0 _ H 2 O = -285.8 // i n kJ 11 12 // f o r r e a c t i o n 1 13 d e l t a _ H 1 = 2* H 0 _ e t h a n o l +2* H0_CO2 - H 0 _ g l u c o s e ; 14 p r i n t f( ” e n t h a l p y c h a n g e i n r e a c t i o n 1 = %f KJ” , d e l t a _ H 1 ) 15 16 // f o r r e a c t i o n 2 17 d e l t a _ H 2 = 6* H 0 _ H 2 O +6* H0_CO2 - H 0 _ g l u c o s e ; 18 p r i n t f( ” \ n \ n e n t h a l p y c h a n g e i n r e a c t i o n 2 = %f kJ ” , d e l t a _ H 2 ) 19
20 if delta_H1 > d e l t a _ H 2 then disp ( ” r e a c t i o n 2 s u p p l i e s more e n e r g y ” )
21 else disp ( ” r e a c t i o n 1 s u p p l i e s more e n e r g y ” )
22 end
Scilab code Exa 3.17 Enthalpy of formation
1 clc
3 p r i n t f( ” e x a m p l e 3 . 1 7 p a g e number 1 0 8 \ n \ n ” ) 4 5 // t o f i n d e n t h a l p y o f f o r m a t i o n o f CuSO4 . 5 H2O 6 7 d e l t a _ H 2 = 11.7 // i n kJ / mol 8 m _ C u S O 4 = 16 // i n gm 9 m _ H 2 O = 384 // i n gm 10 11 d e l t a _ H 3 = -(( m _ C u S O 4 + m _ H 2 O ) * 4 . 1 8 * 3 . 9 5 * 1 5 9 . 6 ) / ( 1 6 * 1 0 ^ 3 ) 12 d e l t a _ H 1 = d e l t a _ H 3 - d e l t a _ H 2 ; 13 14 p r i n t f( ” e n t h a l p y o f f o r m a t i o n = %f kJ / mol ” , de lt a_ H1 )
Scilab code Exa 3.18 Combustion
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 8 p a g e number 1 0 8 \ n \ n ” ) 4 5 // t o f i n d t h e t e m p e r a t u r e o f c o m b u s t i o n 6 7 H _ c o m b u s t i o n = 1 5 6 0 0 0 0 // i n kJ / kmol 8 H 0 _ C O 2 = 5 4 . 5 6 // i n kJ / kmol 9 H 0 _ O 2 = 35.2 // i n kJ / kmol 10 H 0 _ s t e a m = 4 3 . 3 8 // i n kJ / kmol 11 H 0 _ N 2 = 3 3 . 3 2 // i n kJ / kmol 12 13 t = H _ c o m b u s t i o n /(2* H 0 _ C O 2 +3* H 0 _ s t e a m + 0 . 8 7 5 * H 0 _ O 2 + 1 6 . 4 6 * H 0 _ N 2 ) ; 14 15 p r i n t f( ” t h e o r i t i c a l t e m p e r a t u r e o f c o m b u s t i o n = %f d e g r e e C” ,t )
Scilab code Exa 3.19 Heat of reaction 1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 1 9 p a g e number 1 0 9 \ n \ n ” ) 4 5 // t o f i n d t h e h e a t o f r e a c t i o n and c o n s u m p t i o n o f c o k e 6 7 H _ N a C l = 4 1 0 . 9 // i n MJ/ kmol 8 H _ H 2 S O 4 = 8 1 1 . 3 // i n MJ/ kmol 9 H _ N a 2 S O 4 = 1384 // i n MJ/ kmol 10 H _ H C l = 92.3 // i n MJ/ kmol 11 12 Q = H _ N a 2 S O 4 + 2* H _ H C l -2* H_NaCl - H _ H 2 S O 4 ; 13 p r i n t f( ” h e a t o f r e a c t i o n = %f MJ\ n \ n ” ,Q ) 14 15 h e a t _ r e q u i r e d = 6 4 . 5 * ( 5 0 0 / 7 3 ) ; 16 c o k e _ c o n s u m p t i o n = h e a t _ r e q u i r e d /19 17 p r i n t f( ” amount o f c o k e o v e n g a s consumed = %f c u b i c m e t e r ” , c o k e _ c o n s u m p t i o n )
Scilab code Exa 3.20 Heat transfer
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 2 0 p a g e number 1 0 9 \ n \ n ” ) 4 5 // t o f i n d t h e r a t e o f h e a t f l o w 6 7 c p _ w a t e r = 1 4 6 . 5 // i n k j / kg 8 c p _ s t e a m = 3040 // i n kJ / kg
9 d = 0 . 1 0 2 // i n m 10 u = 1.5 // i n m/ s 11 d e n s i t y = 1000 // i n kg /m3 12 13 m = ( 3 . 1 4 / 4 ) * d ^2* u * d e n s i t y ; 14 Q = m *( cp_steam - c p _ w a t e r ) ; 15 16 p r i n t f( ” r a t e o f h e a t f l o w = %f kW” ,Q )
Scilab code Exa 3.21 Calorific value
1 clc
2 //EXAMPLE 3 . 2 1
3 // To f i n d t h e c a l o r i f i c v a l u e o f c o a l
4 disp( ’ t h i s i s a t h e o r i t i c a l p r o b l e m . R e f e r t h e book f o r s o l u t i o n ’ )
Scilab code Exa 3.22 Coal combustion
1 clc 2 c l e a r 3 p r i n t f( ” e x a m p l e 3 . 2 2 p a g e number 1 1 0 \ n \ n ” ) 4 5 // t o f i n d t h e amount o f a i r r e q u i r e d f o r c o m b u s t i o n and c o m p o s i t i o n o f f l u e g a s 6 wt_C = 0.75 // i n kg 7 w t _ H 2 = 0.05 // i n kg 8 w t _ O 2 = 0.12 // i n kg 9 w t _ N 2 = 0.03 // i n kg 10 wt_S = 0.01 // i n kg 11 w t _ a s h = 0.04 // i n kg 12 13 O2_C = wt_C * ( 3 2 / 1 2 ) ; // i n kg
14 O 2 _ H 2 = w t _ H 2 * ( 1 6 / 2 ) ; // i n kg 15 O2_S = wt_S * ( 3 2 / 3 2 ) ; // i n kg 16 O 2 _ r e q u i r e d = O2_C + O 2 _ H 2 + O2_S ; 17 18 o x y g e n _ s u p p l i e d = O 2 _ r e q u i r e d - w t _ O 2 ; 19 a i r _ n e e d e d = o x y g e n _ s u p p l i e d / 0 . 2 3 ; 20 p r i n t f( ” amount o f a i r r e q u i r e d = %f kg ” , a i r _ n e e d e d ) 21 22 v o l u m e = ( 2 2 . 4 / 2 8 . 8 ) * a i r _ n e e d e d ; 23 p r i n t f( ” \ n \ n v o l u m e o f a i r n e e d e d = %f c u b i c m e t e r ” , v o l u m e ) 24 25 a i r _ s u p p l i e d = 1 . 2 0 * a i r _ n e e d e d ; 26 N 2 _ s u p p l i e d = a i r _ s u p p l i e d * 0 . 7 7 ; 27 t o t a l _ N 2 = N 2 _ s u p p l i e d + w t _ N 2 ; 28 29 O 2 _ f l u e g a s = a i r _ s u p p l i e d * 0 . 2 3 - o x y g e n _ s u p p l i e d ; 30 31 w t _ C O 2 = wt_C + O2_C ; 32 w t _ S O 2 = wt_S + O2_S ; 33 34 m o l e s _ C O 2 = w t _ C O 2 /44; 35 m o l e s _ S O 2 = w t _ S O 2 /64; 36 m o l e s _ N 2 = t o t a l _ N 2 /28; 37 m o l e s _ O 2 = O 2 _ f l u e g a s /32; 38 t o t a l _ m o l e s = m o l e s _ C O 2 + m o l e s _ S O 2 + m o l e s _ N 2 + m o l e s _ O 2 ; 39 40 x _ C O 2 = m o l e s _ C O 2 / t o t a l _ m o l e s ; 41 x _ S O 2 = m o l e s _ S O 2 / t o t a l _ m o l e s ; 42 x_N2 = m o l e s _ N 2 / t o t a l _ m o l e s ; 43 x_O2 = m o l e s _ O 2 / t o t a l _ m o l e s ; 44 45 p r i n t f( ” \ n \nCO2 = %f ” , x _ C O 2 * 1 0 0 ) 46 p r i n t f( ” \ n \ nSO2 = %f ” , x _ S O 2 * 1 0 0 ) 47 p r i n t f( ” \ n \nN2 = %f ” , x_N2 * 1 0 0 ) 48 p r i n t f( ” \ n \nO2 = %f ” , x_O2 * 1 0 0 )