P. K. Nag. Engineering Thermodynamics (776119), страница 4
Текст из файла (страница 4)
2 9 4 + 2 2 5 7 ∗w ’ ])41 w = stress (0.1 ,0.2 , p ) ;42 disp ( ”Kg/ h ” ,w *3600 , ” The amount o f h e a t t h a t s h o u l dbe s u p p l i e d i s ” )Scilab code Exa 5.5 Calculations across a heat exchanger12345678910t1 = 15; t2 = 800; t3 = 650; t4 = 500;v1 = 30; v2 = 30 ; v3 = 60;w = 2;cp = 1005;Q1_2 = w * cp *( t2 - t1 ) ;disp ( ”KJ/ s ” , Q1_2 /1000 , ” The r a t e o f h e a t t r a n s f e r t othe a i r in the heat exchanger i s ”)W_T = w *( (( v2 ^2 - v3 ^2) /2) + cp *( t2 - t3 ) ) ;disp ( ”KW” , W_T /1000 , ” The power o u t p u t from t h et u r b i n e a s s u m i n g no h e a t l o s s ” )v4 = sqrt ( ( v3 ^2) + (2* cp *( t3 - t4 ) ) ) ;disp ( ”m/ s ” ,v4 , ” The v e l o c i t y a t t h e e x i t o f t h en o z z l e i s ”)Scilab code Exa 5.6 Calculations on a gas turbine1 w = 5;2 h1 = 900 e03 ;303456789101112h2 = 400 e03 ;v1 = 50; v2 = 150;Q = -25*5; // Q = dQ/ d t f o r w = 5 kgW = w *( ( h1 - h2 ) + (( v1 ^2 - v2 ^2) /2) ) + Q ; // W = dW/dtdisp ( ”kW” ,W /1000 , ” The power o u t p u t o f t h e t u r b i n e i s”)R = 285; T1 = 300; P1 = 100 e03 ;V = ( w * R * T1 ) / P1 ; // V = dV/ d tA1 = V / v1 ;D1 = sqrt ((4* A1 ) / %pi ) ;disp ( ”m” ,D1 , ” The d i a m e t e r o f t h e i n l e t p i p e i s ” )Scilab code Exa 5.7 Calculation of velocity of exhaust jetha = 260; // E n t h a l p y o f a i rhg = 912; // E n t h a l p y o f g a sVa = 270; // V e l o c i t y o f a i rf = 0.0190; // F u e l t o a i r r a t i o wf /waEf = 44500; // C h e m i c a l e n e r g y o f f u e l i n kJ / kgQ = 21; // Heat l o s s from t h e e n g i n eEg = 0.05* f * Ef /(1+ f ) ; // As 5% o f c h e m i c a l e n e r g y i snot r e l e a s e d in r e a c t i o n8 Vg = sqrt (2000*((( ha +( Va ^2*0.001) /2+( f * Ef ) -Q ) /(1+ f ) )-hg - Eg ) ) ;9 disp ( ”m/ s ” ,Vg , ” V e l o c i t y o f e x h a u s t g a s i s ” )1234567Scilab code Exa 5.9 Thermodynamics calculations of air with given internal energy function1 u0 = 0.718*273*1 e03 ;2 t = poly (0 , ’ t ’ ) ;3 u = u0 +718* t ; // i n S I u n i t3145678hp = u + 285*( t +273) ; // ””h = horner ( hp ,150) ; // h = hp ( 1 5 0 )W = 100; // W = dW/ d tm = W/h;disp ( ” kg / h ” ,m *3600 , ” The r a t e a t which a i r f l o w s o u to f the tank ”)32Chapter 6Second law of thermodynamicsScilab code Exa 6.1 Calculation of least rate of heat rejection by a cyclicheat engine1234567T1 = 800;T2 = 30;e_max = 1 -(( T2 +273) /( T1 +273) ) ;Wnet = 1; // i n kWQ1 = Wnet / e_max ;Q2 = Q1 - Wnet ;disp ( ”KW” ,Q2 , ” L e a s t r a t e o f h e a t r e j e c t i o n i s ” )Scilab code Exa 6.2 Calculation of least power for a domestic food freezer123456T1 = -15+273;T2 = 30+273;Q2 = 1.75; // i n kJ / s e cQ1 = ( T1 / T2 ) * Q2 ;W = Q1 - Q2 ;disp ( ”kW” ,W , ” L e a s t Power n e c e s s a r y t o pump t h e h e a tout i s ”)3378// There i s a c a l c u l a t i o n m i s t a k e i n t h e bookScilab code Exa 6.4 Calculations on a carnot engine1234567Q1 = 200;T1 = 373.15;T2 = 273.16;Q2 = Q1 *( T2 / T1 ) ;W = Q1 - Q2 ;e = W / Q1 ;disp ( ” r e s p e c t i v e l y ” ,e , ” J ” ,W , ” J ” ,Q2 , ” The h e a tr e j e c t e d , t h e work done and t h e t h e r m a l e f f i e n c yof the engine i s ”)Scilab code Exa 6.5 Calculations on reversible heat engine1234567891011121314T1 = 873;T2 = 313;T3 = 253;Q1 = 2000 e03 ; // I n j o u l eW = 360 e03 ; // i n j o u l e// P a r t ( a )e_max = 1 -( T2 / T1 ) ;W1 = e_max * Q1 ;COP = T3 /( T2 - T3 ) ;W2 = W1 - W ;Q4 = COP * W2 ;Q3 = Q4 + W2 ;Q2 = Q1 - W1 ;disp ( ” J ” , Q2 + Q3 , ” The h e a t r e j e c t i o n t o t h e 40 d e g r e er e s e r v i o r i s ”)15 // P a r t ( b )341617181920212223e_max_ = 0.4* e_max ;W1_ = e_max_ * Q1 ;W2_ = W1_ - W ;COP_ = 0.4* COP ;Q4_ = COP_ * W2_ ;Q3_ = Q4_ + W2_ ;Q2_ = Q1 - W1_ ;disp ( ” J ” , Q2_ + Q3_ , ” The h e a t r e j e c t i o n t o t h e 40degree r e s e r v i o r i s ”)Scilab code Exa 6.7 Determination of heat multiplication factor12345T1 = 473;T2 = 293;T3 = 273;MF = ( T2 *( T1 - T3 ) ) /( T1 *( T2 - T3 ) ) ;disp ( MF , ” The m u l t i p l i c a t i o n f a c t o r i s ” )Scilab code Exa 6.8 Estimation of minimum collector area of solar area123456789T1 = 363;T2 = 293;W = 1; // Kj / se_max = 1 -( T2 / T1 ) ;Qmin = W / e_max ;Qmin_ = Qmin *3600;E = 1880; // i n kJ /m2 hAmin = Qmin_ / E ;disp ( ”m2” , Amin , ”Minimum a r e a r e q u i r e d f o r t h ec o l l e c t o r p l a t e ”)35Scilab code Exa 6.9 Determination of minimum solar panel area1 T1 = 1000;2 W = 1000; // i n W3 K = 5.67 e -08;4 Amin = (256* W ) /(27* K * T1 ^4) ;5 disp ( ”m2” , Amin , ” Area o f t h e p a n e l ” )36Chapter 7EntropyScilab code Exa 7.1 Calculation of entropy change of water123456T1 = 37+273;T2 = 35+273;m = 1 ;cv = 4.187;S = m * cv * log ( T2 / T1 ) ; // S = S2−S1disp ( ”KJ/K” ,S , ” Change i n t h e e n t r o p y o f t h e w a t e r i s”)Scilab code Exa 7.2 Entropy change calculations of a heat reservoir anduniverse1234567// P a r t ( a )T1 = 273;T2 = 373;m = 1 ;cv = 4.187;Ss = m * cv * log ( T2 / T1 ) ; // S = S2−S1Q = m * cv *( T2 - T1 ) ;378 Sr = -( Q / T2 ) ;9 S = Ss + Sr ;10 disp ( ” kJ /K” ,S , ” The e n t r o p y c h a n g e o f t h e u n i v e r s e11121314151617is”)// P a r t ( b )T3 = 323;Sw = m * cv *( log ( T3 / T1 ) + log ( T2 / T3 ) ) ;Sr1 = -m * cv *( T3 - T1 ) / T3 ;Sr2 = -m * cv *( T2 - T3 ) / T2 ;Su = Sw + Sr1 + Sr2 ;disp ( ” kJ /K” ,Su , ” The e n t r o p y c h a n g e o f t h e u n i v e r s ei s ”)Scilab code Exa 7.3 Entropy change calculations between ice and universe// P a r t ( a )m = 1;T1 = -5+273;T2 = 20+273;T0 = 0+273;cp = 2.093;cv = 4.187;lf = 333.3;Q = m * cp *( T0 - T1 ) +1*333.3+ m * cv *( T2 - T0 ) ;Sa = -Q / T2 ;Ss1 = m * cp * log ( T0 / T1 ) ;Ss2 = lf / T0 ;Ss3 = m * cv * log ( T2 / T0 ) ;St = Ss1 + Ss2 + Ss3 ;Su = St + Sa ;disp ( ” kJ /K” ,Su , ” The e n t r o p y c h a n g e o f t h e u n i v e r s ei s ”)17 // P a r t ( b )18 S = 1.5549; // S = S4−S119 Wmin = T2 *( S ) -Q ;123456789101112131415163820disp ( ” kJ ” , Wmin , ” The minimum r i s k r e q u i r e d i s ” )Scilab code Exa 7.5 Calculation of entropy change for a gas12345678Vo = 8.4;Vh = 14;n1 = Vo /22.4; n2 = Vh /22.4;R = 8.31;x1 = n1 /( n1 + n2 ) ;x2 = n2 /( n1 + n2 ) ;S = -R *( n1 * log ( x1 ) + n2 * log ( x2 ) ) ;disp ( ” J /K” ,S , ” Entropy c h a n g e f o r t h e p r o c e s s i s ” )Scilab code Exa 7.8 Calculation of highest temperature in three body system of constant heat capacity1 T = poly (0 , ’T ’ ) ; // T = Tf2 Tf_ = 700 -2* T ; // T f = Tf ’3 // B i s e c t i o n method t o s o l v e f o r t h e p o l y n o m i a l4 function [ x ] = Temperature (a ,b , f )5N = 100;6eps = 1e -5;7if (( f ( a ) * f ( b ) ) >0) then8error ( ’ no r o o t p o s s i b l e f ( a ) ∗ f ( b ) >0 ’ ) ;9abort ;10end ;11if ( abs ( f ( a ) ) < eps ) then12error ( ’ s o l u t i o n a t a ’ ) ;13abort ;14end15if ( abs ( f ( b ) ) < eps ) then16error ( ’ s o l u t i o n a t b ’ ) ;17abort ;3918end19while (N >0)20c = ( a + b ) /221if ( abs ( f ( c ) ) < eps ) then22x = c ;23x;24return ;25end ;26if (( f ( a ) * f ( c ) ) <0 ) then27b = c ;28else29a = c ;30end31N = N -1;32end33error ( ’ no c o n v e r g e n c e ’ ) ;34abort ;35 endfunction36 deff ( ’ [ y ]= p (T) ’ ,[ ’ y = 2∗Tˆ3 −700∗Tˆ2+9000000 ’ ])37 T = Temperature (100 ,200 , p ) ;3839 Tf_ = horner ( Tf_ , T ) ;40 disp ( ”K” ,Tf_ , ” The f i n a l t e m p e r a t u r e o f t h e body C i s”)Scilab code Exa 7.9 Calculation of mxaximum amount of work for a system with given heat capacity1234567T1 = 200;T2 = 100;A = 0.042;Q1 = integrate ( ’A∗Tˆ2 ’ , ’T ’ ,T1 , T2 ) ;S = integrate ( ’A∗Tˆ2/T ’ , ’T ’ ,T1 , T2 ) ;W = poly (0 , ’W’ ) ;Z = ( - Q1 - W ) / T2 + S ; // P o l y n o m i a l t o be s o l v e d f o r W408 // B i s e c t i o n method t o s o l v e f o r t h e Work9 function [ x ] = Work (a ,b , f )10N = 100;11eps = 1e -5;12if (( f ( a ) * f ( b ) ) >0) then13error ( ’ no r o o t p o s s i b l e f ( a ) ∗ f ( b ) >0 ’ ) ;14abort ;15end ;16if ( abs ( f ( a ) ) < eps ) then17error ( ’ s o l u t i o n a t a ’ ) ;18abort ;19end20if ( abs ( f ( b ) ) < eps ) then21error ( ’ s o l u t i o n a t b ’ ) ;22abort ;23end24while (N >0)25c = ( a + b ) /226if ( abs ( f ( c ) ) < eps ) then27x = c ;28x;29return ;30end ;31if (( f ( a ) * f ( c ) ) <0 ) then32b = c ;33else34a = c ;35end36N = N -1;37end38error ( ’ no c o n v e r g e n c e ’ ) ;39abort ;40 endfunction41 deff ( ’ [ y ]= p (W) ’ ,[ ’ y = 350 −0.01∗W ’ ])42 W = Work (34000 ,36000 , p ) ;4344 disp ( ” kJ ” ,W /1000 , ” The maximum work t h a t can ber e c o v e r e d i s ”)41Scilab code Exa 7.10 Heat calculation for a reversible adiabatic compression cycle12345678910111213P1 = 0.5 e06 ;V1 = 0.2; V2 = 0.05;n = 1.3P2 = P1 *( V1 / V2 ) ^ n ;function y = H ( p )y = (( P1 * V1 ^ n ) / p ) ^(1/ n ) ;endfunctionH = integrate ( ’H ’ , ’ p ’ ,P1 , P2 ) ; // H = H2−H1U = H -( P2 * V2 - P1 * V1 ) ;W12 = -U ;disp ( ” kJ ” ,H /1000 , ” Change i n e n t h a l p y i s ” )disp ( ” kJ ” ,U /1000 , ” Change i n i n t e r n a l e n e r g y i s ” )disp ( ” kJ ” ,0 , ” and ” ,0 , ” The c h a n g e i n e n t r o p y and h e a tt r a n s f e r are ”)14 disp ( ” kJ ” , W12 /1000 , ” The work t r a n s f e r d u r i n g t h ep r o c e s s i s ”)Scilab code Exa 7.11 Establishment of direction of flow in a insulatedduct1234PaTacpSs= 130 e03 ; Pb = 100 e03 ;= 50+273; Tb = 13+273;= 1.005;= integrate ( ’ cp /T ’ , ’T ’ ,Ta , Tb ) - integrate ( ’ 0 .
2 8 7 / p ’, ’ p ’ ,Pa , Pb ) ;5 Ssy = 0;6 Su = Ss + Ssy ;7 disp ( ” kJ /Kg K” ,Su , ” Change i n t h e e n t r o p y o f t h eu n i v e r s e i s ”)428disp ( ” As t h e c h a n g e i n e n t r o p y o f t h e u n i v e r s e i nt h e p r o c e s s A−B i s n e g a t i v e s o t h e f l o w must befrom B−A” )Scilab code Exa 7.12 Determination of possibility of a hypothetical devicethermodynamically1234567T1 = 300; T2 = 330; T3 = 270;P1 = 4; P2 =1 ; P3 =1 ;cp = 1.0005; R = 0.287;S21 = cp * log ( T2 / T1 ) -R * log ( P2 / P1 ) ; // S21 = S2−S1S31 = cp * log ( T3 / T1 ) -R * log ( P3 / P1 ) ; // S31 = S3−S1Sgen = 1* S21 + 1* S31 ;disp ( ”kW/K” , Sgen , ” The e n t r o p y g e n e r a t e d d u r i n g t h ep r o c e s s i s ”)8 disp ( ” As t h e e n t r o p y g e n e r a t e d i s p o s i t i v e s o s u c hd e v i c e i s p o s s i b l e ”)Scilab code Exa 7.13 Calculation of heat transfer through a room1234567891011A = 5*7;k = 0.71;L = 0.32;Ti = 21+273;To = 6+273;Q = k * A *( Ti - To ) / L ;disp ( ”W” ,Q , ” The r a t e o f h e a t t r a n s f e r t h r o u g h t h ewall i s ”)Sgen_wall = Q / To - Q / Ti ;disp ( ”W/K” , Sgen_wall , ” The r a t e o f e n t r o p y t h r o u g hthe wall i s ”)Tr = 27+273;Ts = 2+273;431213Sgen_total = Q / Ts - Q / Tr ;disp ( ”W/K” , Sgen_total , ” The r a t e o f t o t a l e n t r o p yg e n e r a t i o n with t h i s heat t r a n s f e r p r o c e s s i s ”)44Chapter 8Available energy Availabilityand irreversibilityScilab code Exa 8.1 Calculation of fraction of available energy in heattransfer123456T0 = 308;T1 = 693;T1_ = 523; // T1 = T1 ’T1_ = 523; // ””f = ( T0 *( T1 - T1_ ) ) /( T1_ *( T1 - T0 ) ) ;disp (f , ” The f r a c t i o n o f e n e r g y t h a t becomesu n a v a i l a b l e due t o i r r e v e r s i b l e h e a t t r a n s f e r i s ”)Scilab code Exa 8.2 Calculation of increase in available energy in a steamboiler1 lhw = 1858.5; // L a t e n t h e a t o f w a t e r2 Tew = 220+273;3 Sw = lhw / Tew ;45456789101112Tig = 1100; // I n i t i a l t e m p e r a t u r e o f t h e g a sTfg = 550; // F i n a l ””k = 1* lhw /( Tig - Tfg ) ; // k = mg dot ∗ cpgTg2 = 823; Tg1 = 1373Sg = integrate ( ’ k /T ’ , ’T ’ ,Tg1 , Tg2 )St = Sg + Sw ;disp ( ” kJ /K” ,St , ” T o t a l c h a n g e i n e n t r o p y i s ” )T0 = 303;disp ( ” kJ ” , T0 * St , ” I n c r e a s e i n u n a v a i l a b l e e n e r g y i s ” )Scilab code Exa 8.3 Calculation of available energy in water12345678910Tw = 75+273;Ts = 5+273; // Ts = T0m = 40;cp = 4.2;W = integrate ( ’m∗ cp ∗(1 −( Ts /T) ) ’ , ’T ’ ,Ts , Tw ) ;Q1 = m * cp *( Tw - Ts ) ;UE = Q1 - W ;disp ( ” kJ ” ,W , ” T o t a l work ” )disp ( ” kJ ” ,Q1 , ” Heat r e l e a s e d ” )disp ( ” kJ ” ,UE , ” I n t e r n a l e n e r g y c h a n g e ” )Scilab code Exa 8.4 Calculation of decrease in available energy in water12345678Ts = 273+15;Tw1 = 95+273;Tw2 = 35+273;m1 = 25; m2 = 35;cp = 4.2;AE25 = integrate ( ’m1∗ cp ∗(1 −( Ts /T) ) ’ , ’T ’ ,Ts , Tw1 ) ;AE35 = integrate ( ’m2∗ cp ∗(1 −( Ts /T) ) ’ , ’T ’ ,Ts , Tw2 ) ;AEt = AE25 + AE35 ;469 Tm = ( m1 * Tw1 + m2 * Tw2 ) /( m1 + m2 ) ; // T e m p e r a t u r e a f t e rmixing10 AE60 = integrate ( ’ (m1+m2) ∗ cp ∗(1 −( Ts /T) ) ’ , ’T ’ ,Ts , Tm ) ;11 AE = AEt - AE60 ;12 disp ( ” kJ ” ,AE , ” The d e c r e a s e i n t h e t o t l a e n e r g y i s ” )Scilab code Exa 8.5 Calculation of the final RPM of the flywheel12345678910111213N1 = 3000;w1 = (2* %pi * N1 ) /60;I = 0.54;Ei = 0.5* I * w1 ^2;ti = 15+273;m = 2;dt = Ei /(1000*2*4.187) ;tf = ti + dt ;AE = integrate ( ’m∗ 4 .














