6.9 Entropy generation: Polytropic compression of Air#

Air is compressed in a polytropic process with \(n=1.3\) from \(P_1=10\:kPa\) and room temperature \(T_1=25^{\circ} C\) to \(P_2=100\:kPa\). Assuming ideal gas application for air, calculate:

a) final temperature of air

b) work associated with the process

c) heat associated with the process

d) changes in entropy during this process

e) entropy generation for the process given the heat is exchanged with ambient at a constant temperature \(T_{amb}=25^{\circ} C\)

Solution Approach for a)#

for a polytropic process

\(Pv^n=constant\)

combined with ideal gas correlation for temperature,

\(T_2/T_1=(P_2/P_1)^{(n-1)/n}\)

#define variables
n = 1.3   #polytropic constant
P_1 = 10E+3   #initial pressure in Pa
T_1 = 25 + 273.15   #initial temperature in K
P_2 = 100E+3   #final pressure in Pa

T_2 = T_1 * (P_2/P_1) ** ((n-1)/n)
print('The final temperature of air is:', f"{T_2-273.15:.1f}", 'C')
The final temperature of air is: 234.1 C

Solution Approach for b)#

for a polytropic process

\(w=(P_2v_2-P_1v_1)/(1-n)\)

applying ideal gas law

\(w=R(T_2-T_1)/(1-n)\)

#define variables
R = 0.287   #air gas constant in kJ/kg.K
C_v = 0.718   #air specific heat in constant colume kJ/kg.K
C_p = 1.005   #air specific heat in constant pressure kJ/kg.K

w = R * (T_2 - T_1) / (1 - n)

print('The specific work associated with the process is:', f"{w:.1f}", 'kJ/kg')
The specific work associated with the process is: -200.0 kJ/kg

Solution Approach for c)#

from the first law

\(q=\Delta u+w\)

and the change in internal energy for ideal gases

\(\Delta u=C_v\Delta T\)

du = C_v * (T_2 - T_1)   #change in internal energy kJ/kg
q = du + w   #heat for the process in kJ/kg

print('The specific heat associated with the process is:', f"{q:.1f}", 'kJ/kg')
The specific heat associated with the process is: -49.9 kJ/kg

Solution Approach for d)#

the change in entropy for a polytropic process in an ideal gas is

\(s_2-s_1=C_pln(T_2/T_1)-Rln(P_2/P_1)\)

# import the libraries we'll need
import numpy as np

ds = C_p * np.log(T_2/T_1) - R * np.log(P_2/P_1)
print('The specific changes in entropy is:', f"{ds:.3f}", 'kJ/kg.K')
The specific changes in entropy is: -0.127 kJ/kg.K

Solution Approach for e)#

\(\Delta s=q/T + s_{gen}\)

therefore

\(s_{gen}=\Delta s-q/T\)

#define ambient variable
T_amb = 25 + 273.15   #ambient temperature in K
s_gen = ds - q / T_amb   #entropy generation in kJ/kg.K

print('The specific entropy generation is:', f"{s_gen:.3f}", 'kJ/kg.K')
The specific entropy generation is: 0.041 kJ/kg.K