P. K. Nag. Engineering Thermodynamics (776119), страница 6
Текст из файла (страница 6)
8 MPa, 0 . 9 5 d r yx = 0.95;hf = 721.11; hfg = 2048;h2 = hf + ( x * hfg ) ;h3 = (( w1 * h1 ) +( w2 * h2 ) ) / w3 ;59// I n t e r p o l a t i o nH = [2769.1 2839.3];T = [170.43 200];t3 = interpln ([ H ; T ] ,2790) ;s3 = 6.7087;s4 = s3 ;x4 = ( s3 -1.7766) /5.1193;h4 = 604.74+( x4 *2133.8) ;V4 = sqrt (2000*( h3 - h4 ) ) ;disp ( ” d e g r e e ” ,t3 - T (1) ,” The c o n d i t i o n o f s u p e r h e a ta f t e r mixing ”)19 disp ( ”m/ s e c ” ,V4 , ” The v e l o c i t y o f steam l e a v i n g t h en o z z l e i s ”)9101112131415161718Scilab code Exa 9.9 Calculation of moisture of steam123456h2 = 2716.2; hf = 844.89; hfg = 1947.3;x1 = ( h2 - hf ) / hfg ;h3 = 2685.5;x4 = ( h3 - hf ) / hfg ;disp ( x1 , ” The q u a l i t y o f steam i n p i p e l i n e i s ” )disp ( ”%” ,100 -( x4 *100) ,”Maximum m o i s t u r e i s ” )Scilab code Exa 9.10 Finding the quantity of steam in pipeline12345678// At 0 . 1 Mpa , 110 d e g r e eh2 = 2696.2; hf = 844.89; hfg = 1947.3;x2 = ( h2 - hf ) / hfg ;vf = 0.001023; // a t T = 70 d e g r e eV = 0.000150; // I n m3m1 = V / vf ;m2 = 3.24;x1 = ( x2 * m2 ) /( m1 + m2 ) ;609disp ( x1 , ” The q u a l i t y o f t h e steam i n t h e p i p e l i n ei s ”)Scilab code Exa 9.11 Calculation of heat transferred in a steam bolier12345678910111213// P = 1MPavf = 0.001127; vg = 0.1944;hg = 2778.1; uf = 761.68;ug = 2583.6; ufg = 1822;// I n i t i a l a n f f i n a l massVis = 5; Viw = 5;Vfs = 6 ; Vfw = 4 ;//ms = (( Viw / vf ) +( Vis / vg ) ) - (( Vfw / vf ) +( Vfs / vg ) ) ;U1 = (( Viw * uf / vf ) +( Vis * ug / vg ) ) ;Uf = (( Vfw * uf / vf ) +( Vfs * ug / vg ) ) ;Q = Uf - U1 +( ms * hg )disp ( ” kJ ” ,Q , ” The h e a t t r a n s f e r d u r i n g t h e p r o c e s s i s”)Scilab code Exa 9.12 Calculations on heat transfer in a cylinder and piston system12345678910m = 0.02; d = 0.28; l = 0.305;P1 = 0.6 e06 ; P2 = 0.12 e06 ;// At 0 .
6 MPa, t = 200 d e g r e ev1 = 0.352; h1 = 2850.1;V1 = m * v1 ;Vd = ( %pi /4) * d ^2* l ;V2 = V1 + Vd ;n = log ( P1 / P2 ) / log ( V2 / V1 ) ;W12 = (( P1 * V1 ) -( P2 * V2 ) ) /( n -1) ;disp (n , ” The v a l u e o f n i s ” ) ;6111121314151617181920disp ( ” J ” ,W12 , ” The work done by t h e steam i s ” )v2 = V2 / m ;vf = 0.0010476; vfg = 1.4271;x2 = ( v2 - vf ) / vfg ;// At 0 . 1 2MPauf = 439.3; ug = 2512.0;u2 = uf + ( x2 *( ug - uf ) ) ;u1 = h1 -( P1 * v1 *1 e -03) ;Q12 = m *( u2 - u1 ) + ( W12 /1000) ;disp ( ” kJ ” ,Q12 , ” The h e a t t r a n s f e r i s ” )Scilab code Exa 9.13 Energy calculations in an insulated vessel12345678910111213141516171819202122x1 = 1; x2 = 0.8;// a t 0 .
2MPavg = 0.8857; v1 = vg ; hg = 2706.7; h1 = hg ;m1 = 5 ; V1 = m1 * v1 ;// a t 0 . 5MPam2 = 10;hf = 640.23; hfg = 2108.5vf = 0.001093; vfg = 0.3749;v2 = vf +( x2 * vfg ) ;V2 = m2 * v2 ;//Vm = V1 + V2 ;m = m1 + m2 ;vm = Vm / m ;u1 = h1 ;h2 = hf +( x2 * hfg ) ;u2 = h2 ;m3 = m ;h3 = (( m1 * u1 ) +( m2 * u2 ) ) / m3 ;u3 = h3 ;v3 = vm ;// From m o l l i e r d i a g r a m622324252627282930x3 = 0.870; p3 = 3.5; s3 = 6.29;s1 = 7.1271;sf = 1.8607; sfg = 4.9606;s2 = sf +( x2 * sfg ) ;E = m3 * s3 -(( m1 * s1 ) +( m2 * s2 ) ) ;disp ( ” b a r ” ,p3 , ” F i n a l p r e s s u r e i s ” )disp ( x3 , ” Steam q u a l i t y i s ” )disp ( ” kJ /K” ,E , ” Entropy c h a n g e d u r i n g t h e p r o c e s s i s ”)Scilab code Exa 9.14 Energy calculation on steam passing through turbine// At 6 MPa, 400 d e g r e eh1 = 3177.2; s1 = 6.5408;// At 20 d e g r e eh0 = 83.96; s0 = 0.2966;T0 = 293;f1 = ( h1 - h0 ) - T0 *( s1 - s0 ) ;// By i n t e r p o l a t i o nt2 = 273 + 393;s2 = 6.63;h2 = h1 ;f2 = ( h2 - h0 ) - T0 *( s2 - s0 ) ;df = f1 - f2 ;x3s = ( s2 -1.5301) /(7.1271 -1.5301) ;h3s = 504.7+( x3s *2201.9) ;eis = 0.82;h3 = h2 - eis *( h1 - h3s ) ;x3 = ( h3 -504.7) /2201.7;s3 = 1.5301+( x3 *5.597) ;f3 = ( h3 - h0 ) - T0 *( s3 - s0 ) ;disp ( ” kJ / kg ” ,f1 , ” The a v a i l a b i l i t y o f t h e steamb e f o r e the t h r o t t l e valve ”)21 disp ( ” kJ / kg ” ,f2 , ” The a v a i l a b i l i t y o f t h e steam a f t e r123456789101112131415161718192063the t h r o t t l e valve ”)22 disp ( ” kJ / kg ” ,f3 , ” The a v a i l a b i l i t y o f t h e steam a tthe t u r b i n e exhaust ”)23 disp ( ” kJ / kg ” ,h2 - h3 , ” The s p e c i f i c work o u t p u t fromthe t u r b i n e i s ”)Scilab code Exa 9.15 Energy calculation on a steam turbine123456789101112131415161718192021222324// At 25 bar , 350 d e g r e eh1 = 3125.87; s1 = 6.8481;// 30 d e g r e eh0 = 125.79; s0 = 0.4369;// At 3 bar , 200 d e g r e eh2 = 2865.5; s2 = 7.3115;// At 0 .
2 b a r 0 . 9 5 d r yhf = 251.4; hfg = 2358.3;sf = 0.8320; sg = 7.0765;h3 = hf +0.92* hfg ;s3 = sf +(0.92* sg ) ;// P a r t ( a )T0 = 303;f1 = ( h1 - h0 ) -( T0 *( s1 - s0 ) ) ;f2 = ( h2 - h0 ) -( T0 *( s2 - s0 ) ) ;f3 = ( h3 - h0 ) -( T0 *( s3 - s0 ) ) ;disp ( ” kJ / kg ” ,f1 , ” A v a i l a b i l i t y o fs t a t e 1”)disp ( ” kJ / kg ” ,f2 , ” A v a i l a b i l i t y o fs t a t e 2”)disp ( ” kJ / kg ” ,f3 , ” A v a i l a b i l i t y o fs t a t e 3”)// P a r t ( b )m2m1 = 0.25; m3m1 = 0.75;Wrev = f1 -( m2m1 * f2 ) -( m3m1 * f3 ) ;disp ( ” kJ / kg ” , Wrev , ”Maximum work// P a r t ( c )64steam e n t e r i n g a tsteam l e a v i n gatsteam l e a v i n gati s ”)25 w1 = 600; w2 = 150; w3 = 450;26 Q = -10*3600;// For 1 h o u r27 I = T0 *( w2 * s2 + w3 * s3 - w1 * s1 ) -Q ;28 disp ( ” kJ / h ” ,I , ” I r r e v e r s i b i l i t yi s ”)Scilab code Exa 9.16 Determination of energy of different phases of water123456789101112131415161718192021222324252627// At dead s t a t e o f 1 bar , 300Ku0 = 113.1; h0 = 113.2;v0 = 0.001005; s0 = 0.0395;T0 = 300; P0 = 100;K = h0 -( T0 * s0 ) ;// P a r t ( a )u = 376.9; h = 377;v = 0.001035; s = 1.193;m = 3;fi = m *( h -( T0 * s ) -K ) ; // As P = P0 = 1 b a rdisp ( ” kJ ” ,fi , ” Energy o f s y s t e m i n P a r t ( a ) i s ” )// P a r t ( b )u = 3099.8; h = 3446.3; v = 0.08637; s = 7.090; //At P = 4 Mpa , t = 500 d e g r e em = 0.2;fib = m *( u + P0 *v - T0 *s - K ) ;disp ( ” kJ ” ,fib , ” Energy o f s y s t e m i n P a r t ( b ) i s ” )// P a r t ( c )m = 0.4;x = 0.85; // Q u a l i t yu = 192+ x *2245;h = 192+ x *2392;s = 0.649+ x *7.499;v = 0.001010+ x *14.67;fic = m *( u + P0 *v - T0 *s - K ) ;disp ( ” kJ ” ,fic , ” Energy o f s y s t e m i n P a r t ( c ) i s ” )// P a r t ( d )m = 3;6528 h = -354.1; s = -1.298; // a t 1 0 0 0 kPa , −10 d e g r e e29 fid = m *(( h - h0 ) - T0 *( s - s0 ) ) ;30 disp ( ” kJ ” ,fid , ” Energy o f s y s t e m i n P a r t ( d ) i s ” )Scilab code Exa 9.17 Calculations on a heat exchanger1234567891011121314151617181920212223242526// Giventh1 = 90+273;tc1 = 25+273;tc2 = 50+273;mc = 1; T0 = 300;th2p = 60+273; // P a r a l l e lth2c = 35+273; // C o u n t e rmhp = ( tc2 - tc1 ) /( th1 - th2p ) ; // P a r a l l e lmhc = ( tc2 - tc1 ) /( th1 - th2c ) ; // C o u n t e rh0 = 113.2; s0 = 0.395; T0 = 300; // At 300 Kh1 = 376.92; s1 = 1.1925; // At 90 d e g r e eaf1 = mhp *(( h1 - h0 ) - T0 *( s1 - s0 ) ) ;// P a r a l l e l Flowh2 = 251.13; s2 =0.8312; // At 60 d e g r e eh3 = 104.89; s3 = 0.3674; // At 25 d e g r e eh4 = 209.33; s4 = 0.7038; // At 50 d e g r e eREG = mc *(( h4 - h3 ) - T0 *( s4 - s3 ) ) ; // Rate o f e n e r g ygainREL = mhp *(( h1 - h2 ) - T0 *( s1 - s2 ) ) ; // Rate o f e n e r g ylossIa = REL - REG ; // Energy d e s t r u c t i o nn2a = REG / REL ; // S e c o n d law e f f i c i e n c ydisp ( ” I n p a r a l l e l f l o w ” )disp ( ”kW” ,Ia , ” The r a t e o f i r r e v e r s i b i l i t y i s ” )disp ( ”%” , n2a *100 , ” The S e c o n d law e f f i c i e n c y i s ” )// C o u n t e r f l o wh2 = 146.68; s2 = 0.5053; // At 35 d e g r e eREG_b = REG ; // Rate o f e n e r g y g a i n by h o t w a t e r i ssame i n b o t h f l o w s6627 REL_b = mhc *(( h1 - h2 ) - T0 *( s1 - s2 ) ) ;28 Ib = REL_b - REG_b ; // Energy d e s t r u c t i o n29 n2b = REG_b / REL_b ; // S e c o n d law e f f i c i e n c y30 disp ( ” I n C o u n t e r f l o w ” )31 disp ( ”kW” ,Ib , ” The r a t e o f i r r e v e r s i b i l i t y i s ” )32 disp ( ”%” , n2b *100 , ” The S e c o n d law e f f i c i e n c y i s ” )Scilab code Exa 9.18 Estimation of max cooling rate of a system123456789101112131415m = 50 ; // i n kg / hTh = 23+273; // Home t e m p e r a t u r e// S t a t e 1T1 = 150+273;h1 = 2746.4;s1 = 6.8387;// S t a t e 2h2 = 419.0;s2 = 1.3071;T0 = 318;//b1 = h1 -( T0 * s1 ) ;b2 = h2 -( T0 * s2 ) ;Q_max = m *( b1 - b2 ) /( T0 / Th -1) ;disp ( ”kW” , Q_max /3600 , ” The maximum c o o l i n g r a t e i s ” )67Chapter 10Properties of gases and gasmixtureScilab code Exa 10.1 Finding the final temperature and heat transferredin a fluid123456789101112131415161718// P a r t ( a )P1 = 100; P2 = 50;T1 = 273+300;T2 = ( P2 / P1 ) * T1 ;R = 0.287; cv = 0.718;V1 = 0.8;m = ( P1 * V1 ) /( R * T1 ) ;Q = m * cv *( T2 - T1 ) ;disp ( ” I f t h e f l u i d i s i n t h e a i r ” )disp ( ”K” ,T2 , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ” kJ / kg ” ,Q , ” The h e a t t r a n s f e r r e d i s ” )// P a r t ( b )t2 = 273+81.33; vf = 0.00103; vg = 3.24;v1 = 2.6388; u1 = 2810.4;x2 = ( v1 - vf ) /( vg - vf ) ;u2 = 340.42+( x2 *2143.4) ;m_ = V1 / v1 ;Q_ = m_ *( u2 - u1 ) ;68192021disp ( ” I f t h e f l u i d i s i n t h e steam ” )disp ( ”K” ,t2 , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ” kJ / kg ” ,Q_ , ” The h e a t t r a n s f e r r e d i s ” )Scilab code Exa 10.2 Finding the final temperature and heat transferredin a fluid1 // P a r t ( a )2 R = 0.287; T1 = 273+150; v1 = 0.96; v2 = 1.55; Cp =3456789101112131415161718192021221.005;P = ( R * T1 ) / v1 ;W = P *( v2 - v1 ) ;T2 = ( v2 / v1 ) * T1 ;Q = Cp *( T2 - T1 ) ;disp ( ” I f t h e f l u i d i s i n t h e a i r ” )disp ( ”K” ,T2 , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ” kJ ” ,Q , ” The h e a t t r a n s f e r r e d i s ” )disp ( ” kJ ” ,W , ”Work done i s ” )// P a r t ( b )vg = 0.3928;P1 = 200 e03 ;P2 = P1 ;h1 = 2768.8;t2 = 273+400; h2 = 3276.5;Q_ = h2 - h1 ;W_ = P1 *( v2 - v1 ) ;disp ( ” I f t h e f l u i d i s i n t h e steam ” )disp ( ”K” ,t2 , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ” kJ ” ,Q_ , ” The h e a t t r a n s f e r r e d i s ” )disp ( ” J ” ,W_ , ”Work done i s ” )Scilab code Exa 10.3 Heat calculation on a fluid691234567891011121314151617181920212223// P a r t ( a )v = 16 ; // v = v1 / v2P1 = 300 e03 ;P2 = P1 * v ;R = 0.287; T1 = 300+273;W12 = R * T1 * log (1/ v ) ;disp ( ” I f t h e f l u i d i s i n t h e a i r ” )disp ( ”Pa” ,P2 , ” The f i n a l p r e s s u r e i s ” )disp ( ” kJ ” ,0 , ” The c h a n g e i n i n t e r n a l e n e r g y i s ” )disp ( ” kJ ” ,W12 , ”Work done i s ” )// P a r t ( b )v1 = 0.7664; u1 = 2728.7;v2 = v1 /16;x2 = ( v2 -0.00125) /(0.05013) ;s2 = 2.7927+( x2 *3.2802) ;u2 = 1080.37+( x2 *1522.0) ;du = u2 - u1 ;T = 250+273;Q12 = T *( s2 - s1 )disp ( ” I f t h e f l u i d i s i n t h e steam ” )disp ( ”K” ,T , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ” kJ / kg ” ,Q12 , ” The h e a t t r a n s f e r r e d i s ” )disp ( ” kJ / kg ” ,du , ” The c h a n g e i n i n t e r n a l e n e r g y i s ”)Scilab code Exa 10.4 Heat calculation for a reversible adiabatic process12345678// P a r t ( a )P1 = 10; P2 = 1;T1 = 273+300;g = 1.4;T2 = T1 *(( P2 / P1 ) ^(( g -1) / g ) ) ;R = 0.287;W12 = (( R * T1 ) /(1 - g ) ) *( T2 / T1 -1) ;v2 = ( R * T2 ) /(100* P2 ) ;7091011121314151617181920disp ( ” I f t h e f l u i d i s i n t h e a i r ” )disp ( ”m3/ kg ” ,v2 , ” The s p e c i f i c volume i s ” )disp ( ” kJ ” ,W12 , ” The work done p e r kg o f t h e f l u i d)// P a r t ( b )u1 = 2793.2; v1 = 0.2579; s1 = 7.1228;x2 = (7.1228 -1.3025) /6.0568;u2 = 417.33+( x2 *2088.7) ;v2 = 0.001043+(0.96*1.693) ;W12 = u1 - u2 ;disp ( ” I f t h e f l u i d i s i n t h e steam ” )disp ( ”m3/ kg ” ,v2 , ” The s p e c i f i c volume i s ” )disp ( ” kJ ” ,W12 , ” The work done p e r kg o f t h e f l u i d)is ”is ”Scilab code Exa 10.5 Heat calculations on a reversible polytropic process123456789101112131415161718// P a r t ( a )P1 = 10; P2 = 1;T1 = 273+200; n = 1.15; R = 0.287;v2 = (( R * T1 ) /( P1 *100) ) *(( P1 / P2 ) ^(1/1.15) ) ;v1 = (( R * T1 ) /( P1 *100) ) ;T2 = T1 *( P2 / P1 ) *( v2 / v1 ) ;cv = 0.716;Q = ( cv +( R /(1 - n ) ) ) *( T2 - T1 ) ;disp ( ” I f t h e f l u i d i s i n t h e a i r ” )disp ( ”m3/ kg ” ,v2 , ” The s p e c i f i c volume i s ” )disp ( ”K” ,T2 , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ” kJ ” ,Q , ” Heat t r a n s f e r r e d p e r kg i s ” )// P a r t ( b )v1 = 0.20596; u1 = 2621.9;v2 = v1 *( P1 / P2 ) ^(1/ n ) ;x2 = ( v2 -0.001043) /(1.694 -0.001043) ;t2 = 99.62+273;u2 = 417.33+( x2 *2088.7) ;7119 W = (( P1 *100* v1 ) -( P2 *100* v2 ) ) /( n -1) ;20 Q = u2 - u1 + W ;21 disp ( ” I f t h e f l u i d i s i n t h e steam ” )22 disp ( ”m3/ kg ” ,v2 , ” The s p e c i f i c volume i s ” )23 disp ( ”K” ,t2 , ” The f i n a l t e m p e r a t u r e i s ” )24 disp ( ” kJ ” ,Q , ” Heat t r a n s f e r r e d p e r kg i s ” )Scilab code Exa 10.6 Calculation on PV cycle of ideal monoatomic gas1234567891011121314151617181920212223242526P0 = 1000;T0 = 3;V0 = 0.001;R = 287;n = ( P0 * V0 ) /( R * T0 ) ; // Number o f m o l e s// P r o c e s s abWab = 0;cv = (3/2) * R ;Ta = T0 ; Tb = 300;Qab = n * cv *( Tb - Ta ) ;Ua = 0; // Given i n t e r n a l e n e r g yUb = Qab + Ua ;Uab = Ub - Ua ;// P r o c e s s bcQbc = 0; Uc = 0; Ubc = Uc - Ub ;Wbc = - Ubc ;// P r o c e s s c aTc = Ta ;g = 5/3; // gammaVcb = ( Tb / Tc ) ^(3/2) ; // Vc/VbWca = -n * R * Tc * log ( Vcb ) ;Qca = Wca ;Uca = 0;//disp ( ” J ” , Wab + Wbc + Wca , ”Work done i n t h e c y c l e i s ” )disp ( ” J ” , Uab + Ubc + Uca , ” I n t e r n a l e n e r g y c h a n g e i n t h e7227282930c y c l e i s ”)disp ( ” J ” , Qab + Qbc + Qca , ” Heat t r a n s f e r i n t h e c y c l e i s ”)// P a r t ( b )e = ( Qab + Qca ) / Qab ;disp ( ”%” ,e *100 , ” Thermal e f f i c i e n c y o f t h e s y s t e m i s ”)Scilab code Exa 10.7 Pressure calculation in a system of two vessels1234567891011121314151617181920212223Pa = 1.5; Ta = 273+50; ca = 0.5;Pb = 0.6; Tb = 20+273; mb = 2.5;R = 8.3143;Va = ( ca * R * Ta ) /( Pa *1 e03 ) ;ma = ca *28;Rn = R /28;Vb = ( mb * Rn * Tb ) /( Pb *1 e03 ) ;V = Va + Vb ;m = ma + mb ;Tf = 27+273;P = ( m * Rn * Tf ) / V ;g = 1.4;cv = Rn /( g -1) ;U1 = cv *( ma * Ta + mb * Tb ) ;U2 = m * cv * Tf ;Q = U2 - U1 ;disp ( ”KPa” ,P , ” The f i n a l e q u i l l i b r i u m p r e s s u r e i s ” )disp ( ” kJ ” ,Q , ” The amount o f h e a t t r a n s f e r r e d t o t h esurrounding i s ”)T_ = ( ma * Ta + mb * Tb ) / m ;P_ = ( m * Rn * T_ ) / V ;disp ( ” I f t h e v e s s e l e i s p e r f e c t l y i n s l u l a t e d ” )disp ( ”K” ,T_ , ” The f i n a l t e m p e r a t u r e i s ” )disp ( ”KPa” ,P_ , ” The f i n a l p r e s s u r e i s ” )73Scilab code Exa 10.8 Heat calculation on a gas in constant volume chamber1234567891011121314151617cp = 1.968; cv = 1.507;R_ = 8.314;V = 0.3; m = 2;T1 = 5+273; T2 = 100+273;R = cp - cv ;mu = R_ / R ;Q12 = m * cv *( T2 - T1 ) ;W12 = 0 ;U21 = Q12 ;H21 = m * cp *( T2 - T1 ) ;S21 = m * cv * log ( T2 / T1 ) ;disp ( ” kJ / kg K” ,R , ” kg / kg mol and ” ,mu , ” M o l e c u l a rw e i g h t and t h e g a s c o n s t a n t o f t h e g a s a r e ” )disp ( ” kJ ” ,0 , ”Work done ” )disp ( ” kJ ” ,Q12 , ” The h e a t t r a n s f e r r e d ” )disp ( ” kJ ” ,U21 , ” The c h a n g e i n i n t e r n a l e n e r g y ” )disp ( ” kJ ” ,S21 , ” e n t r o p y ” )disp ( ” kJ /K” ,H21 , ” e n t h a l p y ” )Scilab code Exa 10.9 Calculation of work done in expansion of a gas12345678m = 1.5;P1 = 5.6; V1 = 0.06;T2 = 273+240;a = 0.946; b = 0.662;k = 0.0001;// P a r t ( b )R = a-b;T1 = ( P1 *1 e03 * V1 ) /( m * R ) ;749 W12 = - integrate ( ’m∗ ( b+k ∗T) ’ , ’T ’ ,T1 , T2 ) ;10 disp ( ” kJ ” ,W12 , ” The work done i n t h e e x p a n s i o ni s ”)Scilab code Exa 10.11 Calculation of work and heat transfer on a path12345678910111213141516m = 0.5;P1 = 80 e03 ; T1 = 273+60;P2 = 0.4 e06 ;R = 0.287;V1 = ( m * R * T1 ) / P1 ;g = 1.4; // GammaT2 = T1 *( P2 / P1 ) ^(( g -1) / g ) ;W12 = ( m * R *( T1 - T2 ) ) /( g -1) ;V2 = V1 *(( P1 / P2 ) ^(1/ g ) ) ;W23 = P2 *( V1 - V2 ) ;W = W12 + W23 ;V3 = V1 ;T3 = T2 *( V3 / V2 ) ;cp = 1.005;Q = m * cp *( T3 - T2 ) ;disp ( ” kJ ” ,W , ” The work t r a n s f e r f o r t h e w h o l e p a t h i s”)17 disp ( ” kJ ” ,Q , ” The h e a t t r a n s f e r f o r t h e w h o l e p a t h ” )Scilab code Exa 10.12 Heat calculations over a cycle1234567P1 = 700 e03 ; T1 = 273+260; T3 = T1 ;V1 = 0.028; V2 = 0.084;R = 0.287;m = ( P1 * V1 ) /( R * T1 ) ;P2 = P1 ;T2 = T1 *(( P2 * V2 ) /( P1 * V1 ) ) ;n = 1.5;7589101112131415161718P3 = P2 *(( T3 / T2 ) ^( n /( n -1) ) ) ;cp = 1.005; cv = 0.718;Q12 = m * cp *( T2 - T1 ) ;Q23 = m * cv *( T3 - T2 ) + ( m * R *( T2 - T3 ) ) /( n -1) ;Q31 = m * R * T1 * log ( P3 / P1 ) ;Q1 = Q12 ;Q2 = -( Q23 + Q31 ) ;e = 1 -( Q2 / Q1 ) ;disp ( ” J ” ,Q1 , ” The h e a t r e c e i v e d i n t h e c y c l e i s ” )disp ( ” J ” ,Q2 , ” The h e a t r e j e c t e d i n t h e c y c l e ” )disp (e , ” The e f f i c i e n c y o f t h e c y c l e i s ” )Scilab code Exa 10.13 Heat calculations on an ideal gas12345678910111213P1 = 300 e03 ; V1 = 0.07;m = 0.25; T1 = 80+273;R = ( P1 * V1 ) /(1000* m * T1 ) ;P2 = P1 ;V2 = 0.1;T2 = ( P2 * V2 ) /(1000* m * R ) ;W = -25;cv = -W /( m *( T2 - T1 ) ) ;cp = R + cv ;S21 = m * cp * log ( V2 / V1 ) ; // S21 = S2−S1disp ( ” kJ / kg K” ,cv , ” cv o f t h e g a s i s ” )disp ( ” kJ / kg K” ,cp , ” cp o f t h e g a s i s ” )disp ( ” kJ / kg K” ,S21 , ” I n c r e a s e i n t h e e n t r o p y o f t h egas i s ”)Scilab code Exa 10.14 Calculations on internal combustion engine1 P1 = 1;2 P2 = 15;763456789101112131415161718V1 = 800 e -06;V2 = V1 /8;cv = 0.718; g = 1.4;n = ( log ( P2 / P1 ) ) /( log ( V1 / V2 ) )T1 = 348; R = 0.287;m = ( P1 *100* V1 ) /( R * T1 ) ;T2 = T1 *(( P2 * V2 ) /( P1 * V1 ) ) ;P3 = 50;T3 = T2 *( P3 / P2 ) ;S21 = m *( cv * log ( T2 / T1 ) + R * log ( V2 / V1 ) ) ;S32 = m * cv * log ( T3 / T2 ) ;Q = ( m * cv *( g - n ) *( T2 - T1 ) ) /(1 - n ) ;disp (n , ” The i n d e x o f c o m p r e s s i o n p r o c e s s i s ” )disp ( ” kJ /K” ,S21 , ” S2−S1 i s ” )disp ( ” kJ /K” ,S32 , ” S3−S2 i s ” )disp ( ” kJ ” ,Q , ” The h e a t e x c h a n g e i s ” )Scilab code Exa 10.15 Calculations on a mixture of ideal gasesmn = 3; // Mass o f n i t r o g e n i n kgmc = 5; // mass o f CO2 i n kgan = 28; // Atomic w e i g h t o f n i t r o g e nac = 44; // Atomic w e i g h t o f CO2// P a r t ( a )xn = ( mn / an ) /(( mn / an ) +( mc / ac ) ) ;xc = ( mc / ac ) /(( mn / an ) +( mc / ac ) ) ;disp ( xn , ” Mole f r a c t i o n o f N2 i s ” )disp ( xc , ” Mole f r a c t i o n o f CO2 i s ” )// P a r t ( b )M = xn * an + xc * ac ;disp ( ” kg ” ,M , ” E q u i v a l a n t m o l e c u l a r w e i g h t o f m i x t u r ei s ”)13 // P a r t ( c )14 R = 8.314;15 Req = (( mn * R / an ) +( mc * R / ac ) ) /( mn + mc ) ;1234567891011127716171819202122232425262728293031323334353637383940414243444546disp ( ” kJ / kg K” ,Req , ” The e q u i v a l e n t g a s c o n s t a n t o fthe mixture i s ”)// P a r t ( d )P = 300; // P r e s s u r e i n kPaT = 20+273;Pn = xn * P ; // P a r t i a l p r e s s u r e o f N i t r o g e nPc = xc * P ; // P a r t i a l p r e s s u r e o f CO2Vn = ( mn * R * T ) /( P * an ) ; // Volume o f n i t r o g e nVc = ( mc * R * T ) /( P * ac ) ; // Volume o f CO2disp ( ” kPa r e s p e c t i v e l y ” ,Pc , ” and ” ,Pn , ” P a r t i a lp r e s s u r e s o f n i t r o g e n and CO2 a r e ” )disp ( ”m3 r e s p e c t i v e l y ” ,Vc , ” and ” ,Vn , ” P a r t i a l volumeo f n i t r o g e n and CO2 a r e ” )// P a r t ( e )V = ( mn + mc ) * Req * T / P ; // T o t a l volumerho = ( mn + mc ) / V ;disp ( ”m3” ,V , ” Volume o f m i x t u r e i s ” )disp ( ” kg /m3” ,rho , ” D e n s i t y o f m i x t u r e i s ” )// P a r t ( f )gn = 1.4; // Gammagc = 1.286;cvn = R /(( gn -1) * an ) ; // cp and cv o f N2cpn = gn * cvn ;cvc = R /(( gc -1) * ac ) ; // cp and cv o f CO2cpc = gc * cvc ;cp = ( mn * cpn + mc * cpc ) /( mn + mc ) ; // o f m i x t u r ecv = ( mn * cvn + mc * cvc ) /( mn + mc ) ;disp ( ” kJ / kg K r e s p e c t i v e l y ” ,cv , ” and ” ,cp , ” cp and cvof mixture are ”)T1 = T ; T2 = 40+273;U21 = ( mn + mc ) * cv *( T2 - T1 ) ;H21 = ( mn + mc ) * cp *( T2 - T1 ) ;S21v = ( mn + mc ) * cv * log ( T2 / T1 ) ; // I f h e a t e d a tc o n s t a n t volumedisp ( ” kJ ” ,U21 , ” Change i n i n t e r n a l e n e r g y o f t h es y s t e m h e a t e d a t c o n s t a n t volume i s ” )disp ( ” kJ ” ,H21 , ” Change i n e n t h a l p y o f t h e s y s t e mh e a t e d a t c o n s t a n t volume i s ” )78disp ( ” kJ / kg K” , S21v , ” Change i n e n t r o p y o f t h e s y s t e mh e a t e d a t c o n s t a n t volume i s ” )48 S21p = ( mn + mc ) * cp * log ( T2 / T1 ) ; // I f h e a t e d a tconstant Pressure49 disp ( ” kJ ” , S21p , ” Change i n e n t r o p y o f t h e s y s t e mheated at constant Pressure i s ”)47Scilab code Exa 10.16 Finding the increase in entropy of gas12345678910mo = 2; mn = 6;muo = 32; mun = 28;o = mo / muo ;n = mn / mun ;xo = o /( n + o ) ;xn = n /( n + o ) ;R = 8.314;Ro = R / muo ; Rn = R / mun ;dS = - mo * Ro * log ( xo ) - mn * Rn * log ( xn ) ;disp ( ” kJ / kg K” ,dS , ” I n c r e a s e i n e n t r o p y i s ” )Scilab code Exa 10.17 Calculations os specific properties of neon1234567891011an = 20.183; // m o l e c u l a r w e i g h t o f neonPc = 2.73; // C r i t i c a l p r e s s u r eTc = 44.5;Vc = 0.0416;Pr = 2; // Reduced P r e s s u r eTr = 1.3;Z = 0.7;P = Pr * Pc ;T = Tr * Tc ;R = 8.314;v = ( Z * R * T ) /( P *1000* an ) ;7912 vr = ( v * an ) / Vc ;13 disp ( ”m3/ kg ” ,v , ” S p e c i f i c volume i s ” )14 disp ( ”K” ,T , ” S p e c i f i c t e m p e r a t u r e i s ” )15 disp ( ” kPa ” ,P , ” S p e c i f i c p r e s s u r e i s ” )16 disp ( vr , ” Reduced volume i s ” )80Chapter 11Thermodynamic relationsEquilibrium and stabilityScilab code Exa 11.3 Finding the vapour pressure of benzene12345Tb = 353;T = 303;R = 8.3143;P = 101.325* exp ((88/ R ) *(1 -( Tb / T ) ) ) ;disp ( ” kPa ” ,P , ” Vapour p r e s s u r e o f b e n z e n e i s ” )Scilab code Exa 11.4 Calculations on vapours of benzene12345678T = (3754 -3063) /(23.03 -19.49) ;P = exp (23.03 -(3754/195.2) ) ;R = 8.3143;Lsub = R *3754;Lvap = 3063* R ;Lfu = Lsub - Lvap ;disp ( ”K” ,T , ” T e m p e r a t u r e o f t r i p l e p o i n t i s ” )disp ( ”mm Hg” ,P , ” P r e s s u r e o f t r i p l e p o i n t i s ” )81disp ( ” kJ / kg mol ” , Lsub , ” L a t e n t h e a t o f s u b l i m a t i o n i s”)10 disp ( ” kJ / kg mol ” , Lvap , ” L a t e n t h e a t o f v a p o u r i z a t i o ni s ”)11 disp ( ” kJ / kg mol ” ,Lfu , ” L a t e n t h e a t o f f u s i o n i s ” )9Scilab code Exa 11.6 Thermodynamic calculation on a system of two simple systems1 R = 8.314;2 N1 = 0.5 e -03; N2 = 0.75 e -03; // Mole number o f3456789101112131415161718s y s t e m 1 and 2 i n kg / molT1 = 200; T2 = 300;V = 0.02;Tf = (( N1 * T1 ) +( N2 * T2 ) ) /( N1 + N2 ) ; // F i n a l t e m p e r a t u r eUf1 = (3/2) * R * N1 * Tf ;Uf2 = (3/2) * R * N2 * Tf ;Pf = ( R * Tf *( N1 + N2 ) ) / V ;Vf1 = ( R * N1 * Tf ) / Pf ;Vf2 = V - Vf1 ;disp ( ” System 1 ” )disp ( ”m3” ,Vf1 , ” Volume i s ” )disp ( ” kJ ” ,Uf1 , ” Energy i s ” )disp ( ” System 2 ” )disp ( ”m3” ,Vf2 , ” Volume i s ” )disp ( ” kJ ” ,Uf2 , ” Energy i s ” )disp ( ”K” ,Tf , ” F i n a l t e m p e r a t u r e i s ” )disp ( ” kPa ” ,Pf , ” F i n a l P r e s s u r e i s ” )82Chapter 12Vapour power cycleScilab code Exa 12.1 Calculation of work required for compression of steam1 // P a r t ( a )2 P1 = 1 e05 ;3 P2 = 10 e05 ;4 vf = 0.001043;5 Wrev = vf *( P1 - P2 ) ;6 disp ( ” kJ / kg ” , Wrev /1000 , ” The work r e q u i r e dins a t u r a t e d l i q u i d form i s ” )7 // P a r t ( b )8 h1 = 2675.5; s1 = 7.3594;9 s2 = s1 ;10 h2 = 3195.5;11 Wrev1 = h1 - h2 ;12 disp ( ” kJ / kg ” , Wrev1 , ” The work r e q u i r e din saturatedv a p o u r form i s ” )Scilab code Exa 12.2 Calculations on steam on a cycle1 h1 = 3159.3; s1 = 6.9917;832345678910111213141516171819202122232425h3 = 173.88; s3 = 0.5926; sfp2 = s3 ; hfp2 = h3 ;hfgp2 = 2403.1; sgp2 = 8.2287;vfp2 = 0.001008; sfgp2 = 7.6361;x2s = ( s1 - sfp2 ) /( sfgp2 ) ;h2s = hfp2 +( x2s * hfgp2 ) ;// P a r t ( a )P1 = 20 e02 ; P2 = 0.08 e02 ;h4s = vfp2 *( P1 - P2 ) + h3 ;Wp = h4s - h3 ;Wt = h1 - h2s ;Wnet = Wt - Wp ;Q1 = h1 - h4s ;n_cycle = Wnet / Q1 ;disp ( ” kJ / kg ” , Wnet , ” Net work p e r kg o f steam i s ” )disp ( n_cycle , ” C y c l e e f f i c i e n c y i s ” )// P a r t ( b )n_p = 0.8; n_t = 0.8;Wp_ = Wp / n_p ;Wt_ = Wt * n_t ;Wnet_ = Wt_ - Wp_ ;P = 100*(( Wnet - Wnet_ ) / Wnet ) ;n_cycle_ = Wnet_ / Q1 ;P_ = 100*(( n_cycle - n_cycle_ ) / n_cycle ) ;disp ( ”%” ,P , ” P e r c e n t a g e r e d u c t i o n i n n e t work p e r kgo f steam i s ” )26 disp ( ”%” ,P_ , ” P e r c e n t a g e r e d u c t i o n i n c y c l ee f f i c i e n c y i s ”)Scilab code Exa 12.3 Calculation on stem power plant12345P1 = 0.08; // i n b a rsf = 0.5926; x2s = 0.85; sg = 8.2287;s2s = sf +( x2s *( sg - sf ) ) ;s1 = s2s ;P2 = 16.832; // by steam t a b l e o p p o s i t e t o s 1 i n b a r84678910111213141516h1 = 3165.54;h2s = 173.88 + (0.85*2403.1) ;h3 = 173.88;vfp2 = 0.001;h4s = h3 + ( vfp2 *( P2 - P1 ) *100) ;Q1 = h1 - h4s ;Wt = h1 - h2s ;Wp = h4s - h3 ;n_cycle = 100*(( Wt - Wp ) / Q1 ) ;Tm = ( h1 - h4s ) /( s2s - sf ) ;disp ( ” b a r ” ,P2 , ” The g r e a t e s t a l l o w a b l e steam p r e s s u r eat the t u r b i n e i n l e t i s ”)17 disp ( ”%” , n_cycle , ” Rankine c y c l e e f f i c i e n c y i s ” )18 disp ( ”K” ,Tm , ”Mean t e m p e r a t u r e o f h e a t a d d i t i o n i s ” )Scilab code Exa 12.4 Calculations on steam power plant1234567891011121314h1 = 3465; h2s = 3065; h3 = 3565;h4s = 2300; x4s = 0.88; h5 = 191.83;v = 0.001;P = 150; // i n b a rWp = v * P *100;h6s = 206.83;Q1 = ( h1 - h6s ) +( h3 - h2s ) ;Wt = ( h1 - h2s ) +( h3 - h4s ) ;Wnet = Wt - Wp ;n_cycle = 100* Wnet / Q1 ;sr = 3600/ Wnet ;disp (0.88 , ” Q u a l i t y a t t u r b i n e e x h a u s t i s ” )disp ( ”%” , n_cycle , ” C y c l e e f f i c i e n c y i s ” )disp ( ” kg /kW h ” ,sr , ” steam r a t e i s ” )Scilab code Exa 12.5 Calculations on single heater regenerative cycle851234567891011121314151617181920212223h1 = 3230.9; s1 = 6.9212; s2 = s1 ; s3 = s1 ;h2 = 2796; sf = 0.6493; sfg = 7.5009;x3 = ( s3 - sf ) / sfg ;h3 = 191.83 + x3 *2392.8;h4 = 191.83; h5 = h4 ;h6 = 640.23; h7 = h6 ;m = ( h6 - h5 ) /( h2 - h5 ) ;Wt = ( h1 - h2 ) +(1 - m ) *( h2 - h3 ) ;Q1 = h1 - h6 ;n_cycle = 100* Wt / Q1 ;sr = 3600/ Wt ;s7 = 1.8607; s4 = 0.6493;Tm = ( h1 - h7 ) /( s1 - s7 ) ;Tm1 = ( h1 - h4 ) /( s1 - s4 ) ; // With o u t r e g e n e r a t i o ndT = Tm - Tm1 ;Wt_ = h1 - h3 ;sr_ = 3600/ Wt_ ;dsr = sr - sr_ ;n_cycle_ = 100*( h1 - h3 ) /( h1 - h4 ) ;dn = n_cycle - n_cycle_ ;disp ( ”%” , n_cycle , ” E f f i c i e n c y o f t h e c y c l e i s ” )disp ( ” kg /kW h ” ,sr , ” Steam r a t e o f t h e c y c l e i s ” )disp ( ” d e g r e e c e n t i g r a d e ” ,dT , ” I n c r e a s e i n t e m p e r a t u r edue t o r e g e n e r a t i o n i s ” )24 disp ( ” kg /kW h ” ,dsr , ” I n c r e a s e i n steam r a t e due t or e g e n e r a t i o n i s ”)25 disp ( ”%” ,dn , ” I n c r e a s e i n E f f i c i e n c y o f t h e c y c l e dueto r e g e n e r a t i o n i s ”)Scilab code Exa 12.6 Calculations on steam power plant1 h1 = 3023.5; s1 = 6.7664; s2 = s1 ; s3 = s1 ; s4 = s1 ;2 t_sat_20 = 212;3 t_sat_1 = 46;4 dt = t_sat_20 - t_sat_1 ;865678910111213141516171819202122232425262728293031323334n =3; // number o f h e a t e r st = dt / n ;t1 = t_sat_20 - t ;t2 = t1 - t ;// 0 .














