# Chapter 3 : Second Law of Thermodynamics¶

## Example 3.1 Page No : 6¶

In :

# Variables :
Q2 = 1800.;			#KJ/hr
Q2 = Q2/3600;			#KJ/sec or KW
W = 0.35;			#KW

# Calculations
COP = Q2/W;

# Results
print "COP is : %.4f"%COP

COP is : 1.4286


## Example 3.2 Page No : 21¶

In :

# Variables :
Q2 = 1;			#KJ/sec or KW
W = 0.4;			#KW
T2 = -30+273;			#K

# Calculations and Results
COP = Q2/W;
print "COP of refrigerator is : ",COP

T1 = T2*(1+COP)/COP;			#K
print "Temperature at which heat is rejected in K :  ",T1

Q1 = Q2*(1+COP)/COP;			#KW
print "Heat rejected per KW of cooling(KW) :  ",Q1

COP of refrigerator is :  2.5
Temperature at which heat is rejected in K :   340.2
Heat rejected per KW of cooling(KW) :   1.4


## Example 3.3 Page No : 22¶

In :

# Variables :
Q2 = 100.;			#KJ/sec or KW
T2 = -20.+273;			#K
T1 = 35.+273;			#K

# Calculations and Results
COP = T2/(T1-T2);
print "COP  is : ",COP

W = Q2/COP;			#KW
print "Power input in KJ/s or KW : %.2f"%W

COPheatpump = T1/(T1-T2);			#
print "COP as heat pump : ",COPheatpump

Eta_engine = (1-T2/T1)*100;
print "Efficiency as an engine in : %.3f"%(Eta_engine)

COP  is :  4.6
Power input in KJ/s or KW : 21.74
COP as heat pump :  5.6
Efficiency as an engine in : 17.857


## Example 3.4 Page No : 22¶

In :

# Variables :
Q2dot = 12000.;			#KJ/hr
Wdot = 0.75;			#KW
Wdot = Wdot*3600.;			#KJ/hr

# Calculations and Results
COP = Q2dot/Wdot;
print "Coefficient of Performance  is : %.3f"%COP

Q1dot = Q2dot+Wdot;			#KJ/hr
print "Heat transfer rate in condenser in KJ/hr : %.0f"%Q1dot

Coefficient of Performance  is : 4.444
Heat transfer rate in condenser in KJ/hr : 14700


## Example 3.5 Page No : 23¶

In :
from numpy import *

# Variables :
Eta1 = 25./100;			#efficiency

# Calculations
#T2dash = T2-20;			#K
#T1dash = T1;			#K
deltaEta1 = 30./100;
Eta_dash = 30./100;			#efficiency
#Eta1/Eta_dash = (1-T2dash/T1dash)/(1-T2/T1)
#T1-T2 = 100;
#0.75*T1-T2 = 0;
A = array([[1, -1],[0.75, -1]])
B = array([100,0])
X = linalg.solve(A,B);
#Solution for T1 and T2 by matrix
T1 = X;			#K
T2 = X;			#K

# Results
print "Source temperature in K : %.0f"%T1
print "Sink temperature in K : %.0f"%T2

Source temperature in K : 400
Sink temperature in K : 300


## Example 3.6 Page No : 23¶

In :

# Variables :
T1 = 23.+273;			#K
COP_HP = 2.5;
HeatLost = 60000.;			#KJ/hr
HeatGenerated = 4000.;			#KJ/hr

# Calculations
Q1 = HeatLost-HeatGenerated;			#KJ/hr
W = Q1/COP_HP;			#KJ/hr
W = W/3600;			#KJ/s or KW

# Results
print "Power input in KW : %.3f"%W

Power input in KW : 6.222


## Example 3.7 Page No : 24¶

In :

# Variables :
T1 = 400.+273;			#K
T2 = 20.+273;			#K
T3 = 100.+273;			#K
T4 = T2;			#K
Q1 = 12000.;			#KW
Q3 = 25000.;			#KW

# Calculations and Results
Eta1 = 1-T2/T1;			#Efficiency
W1 = Eta1*Q1;			#KW
print "Power of Engine 1, W1 in KW : %.2f"%W1
Eta2 = 1-T4/T3;			#Efficiency
W2 = Eta2*Q3;			#KW
print "Power of Engine 2, W2 in KW : %.2f"%W2
print ("W1>W2, The engine 1 delivers more power.");

Power of Engine 1, W1 in KW : 6775.63
Power of Engine 2, W2 in KW : 5361.93
W1>W2, The engine 1 delivers more power.


## Example 3.8 Page No : 25¶

In :
from numpy import *

# Variables :
Wdot = 200.;			#W

# Calculations
#Q2dot = 20*(t1-t2);			#W
#COP = Q2dot/W2dot = T2/(T1-T2)
#(t1-t2)/(W2dot/20) = (t1+273)/(t1-t2)
#20*t1**2+20*t2**2-20*2*t1*t2-t1*Wdot-273*Wdot
#(t2+273)/(t1-t2) = (t1-t2)/(Wdot/20)
#t2**2-(2*t1+(Wdot/20))*t2-273*(Wdot/20)+t1**2
P = array([1, -(2*t1+(Wdot/20)), -273*(Wdot/20)+t1**2])
t2 = roots(P);
t2 = t2;			#degree C

# Results
#Taken only -ve value as t2 cant be greater than t1
print "Temperature of cold space(degree C) %.2f"%t2

Temperature of cold space(degree C) -11.17


## Example 3.10 Page No : 26¶

In :

# Variables :
m = 0.8;			#Kg
hi = 335.;			#KJ/Kg-water
T1 = 24.+273;			#K
T2 = 0.+273;			#K
Wdot = 400.;			#W
Wdot = Wdot/1000.;			#KW

# Calculations
Q2 = m*hi;			#KJ
ActualCOP = T2/(T1-T2)*30/100;
Q2dot = ActualCOP/Wdot;			#KJ/s
T = Q2/Q2dot;			#sec

# Results
print "Time required to freeze the water in sec : %.2f"%T

Time required to freeze the water in sec : 31.41


## Example 3.11 Page No : 26¶

In :

# Variables :
T1 = 727.+273;		           	#K
T2 = 27.+273;		        	#K
Wdot = 76.;			             #KW
FuelBurned = 4.;		    	#Kg/hr
FuelBurned = 4./3600;			#Kg/sec
FuelHeatingValue = 75000.;			#KJ/Kg

# Calculations and Results
Q1dot = FuelBurned*FuelHeatingValue;			#KJ/s or KW
Eta = Wdot/Q1dot*100;			#%
print "Actual Efficiency of Engine in % : ",Eta

Eta_c = (1-T2/T1)*100;			#%
print "Carnot Efficiency of Engine in % : ",Eta_c
print ("Claim of inventor is wrong as actual efficiency is greater than carnot efficiency.");

Actual Efficiency of Engine in % :  91.2
Carnot Efficiency of Engine in % :  70.0
Claim of inventor is wrong as actual efficiency is greater than carnot efficiency.


## Example 3.12 Page No : 27¶

In :

# Variables :
T1 = 24.+273;			#K
T2 = 10.+273;			#K
Q1 = 1500.;			#kJ/min
Q1 = Q1/60.;			#kW

# Calculations
COP_ideal = T1/(T1-T2);
ActualCOP = COP_ideal*30/100;
W = Q1/ActualCOP;			#kW

# Results
print "Power required in kW : %.3f"%W

#Answer is wrong in the book as calculation for Q1 is wrong.

Power required in kW : 3.928


## Example 3.13 Page No : 27¶

In :
# Variables :
T1 = 450.;			#K
T2 = 280.;			#K
Q1 = 1200.;			#KJ
W = 0.15;			#KWh
W = W*3600.;			#KJ

# Calculations and Results
Eta_a = W/Q1*100;			#%
print "Actual Efficiency of Engine in % : ",Eta_a

Eta_c = (1-T2/T1)*100;			#%
print "Carnot Efficiency of Engine in %% : %.1f"%(Eta_c)
print ("We would not issue a patent as actual efficiency is greater than carnot efficiency.");

Actual Efficiency of Engine in % :  45.0
Carnot Efficiency of Engine in % : 37.8
We would not issue a patent as actual efficiency is greater than carnot efficiency.


## Example 3.14 Page No : 28¶

In :

# Variables :
T1 = 1000.;			#K
T3 = 100.;			#K
Q1 = 1680.;			#KJ

#Eta_a = Eta_b : 1-T2/T1 = 1-T3/T2
T2 = math.sqrt(T1*T3);			#K
Eta_a = 1-T2/T1;
Eta_b = Eta_a;
W1 = Eta_a*Q1;			#KJ
Q2 = Q1-W1;			#KJ
Q3 = (1-Eta_b)*Q2;			#KJ
print "Heat rejected by engine B in KJ : ",Q3
print "Temperature at which heat is rejected by engine A in K :  %.2f"%T2
print "Workdone by engine A in KJ ; %.2f"%W1

W2 = Eta_b*Q2;			#KJ
print "Workdone by engine B in KJ ; %.2f"%W2

#If W1 = W2
#Q/T = constant
T2 = (T1+T3)/2;			#K
Eta_a = (1-T2/T1)*100;			#%
Eta_b = (1-T3/T2)*100;			#%
print ("If Engine A & B deliver equal work.")
print  "of Engine A in %% : %.2f"%Eta_a
print  "of Engine B in %% : %.2f"%Eta_b

Heat rejected by engine B in KJ :  168.0
Temperature at which heat is rejected by engine A in K :  316.23
Workdone by engine A in KJ ; 1148.74
Workdone by engine B in KJ ; 363.26
If Engine A & B deliver equal work.
of Engine A in % : 45.00
of Engine B in % : 81.82


## Example 3.15 Page No : 29¶

In :
# Variables :
T1 = 800.+273;			#K
T2 = 30.+273;			#K
T3 = 30.+273;			#K
T4 = -15.+273;			#K
Q1 = 1900.;			#KJ
W2 = 290.;			#KJ

# Calculations and Results
#Eta = 1-T2/T1 = W1/Q1
W1 = (1-T2/T1)*Q1;			#KJ
Q2 = Q1-W1;			#KJ
W3 = W1-W2;			#KJ

#COP = T4/(T3-T4) = Q4/W3
Q4 = T4/(T3-T4)*W3;			#KJ
print "Heat absorbed by refrigerant in KJ : %.2f"%Q4

Q3 = W3+Q4;			#KJ
TotalHeat = Q2+Q3;			#KJ
print "Total Heat transferred to reservoir at 30 degree centigrade in KJ : %.2f"%TotalHeat

Heat absorbed by refrigerant in KJ : 6154.54
Total Heat transferred to reservoir at 30 degree centigrade in KJ : 7764.54


## Example 3.16 Page No : 30¶

In :

# Variables :
T1 = 840.+273;			#K
T2 = 60.+273;			#K
T3 = 5.+273;			#K
W3 = 30.;			#KW
Q3 = 17.;			#KJ/s

# Calculations
#Q3/T3 = Q4/T4
T4 = T2;			#K
Q4 = Q3/T3*T4;			#KJ/s
W2 = Q4-Q3;			#KJ/s
W1 = W2+W3;			#KJ/s
Q1subQ2 = W1;			#KJ/s
#Q1/T1 = Q2/T2
Q1ByQ2 = T1/T2;
#Q1subQ2 = Q1subQ2*Q2-Q2
Q2 = Q1subQ2/(Q1ByQ2-1);			#KW
Q1 = Q1ByQ2*Q2;			#KW

# Results
print "Rate of heat supply from 800 degree C source in KW : %.1f"%Q1
print "Rate of heat rejection to sink in KW : %.3f"%(Q2+Q4)

Rate of heat supply from 800 degree C source in KW : 47.6
Rate of heat rejection to sink in KW : 34.607


## Example 3.17 Page No : 31¶

In :

# Variables :
T1 = 27.+273;			#K
T2 = -23.+273;			#K
W = 1.;			#KW
Q2 = 20000.;			#KJ/hr

# Calculations and Results
Q2 = Q2/3600;			#KJ/s
ActualCOP = Q2/W;
print  "COP of machine : %.3f"%ActualCOP

IdealCOP = T2/(T1-T2);
print "Ideal COP of machine : %.0f"%IdealCOP
print ("ActualCOP>IdealCOP, Inventor's claim is wrong.");

COP of machine : 5.556
Ideal COP of machine : 5
ActualCOP>IdealCOP, Inventor's claim is wrong.


## Example 3.18 Page No : 32¶

In :
from numpy import *

# Variables :
#Heat Pump in winter
Q1 = 2400.;			#KJ/hr/degree temperature difference
t1 = 20.;			#degreeC
t2 = 0.;			#degreeC

# Calculations and Results
Q1 = Q1*(t1-t2)/3600;			#KJ/s
T1 = t1+273;			#K
T2 = t2+273;			#K
COP = T1/(T1-T2);
W = Q1/COP;			#KW
print "Power required to drive heat pump in KW : %.2f"%W

#Refrigerating unit in summer
T4 = 20+273;			#K
#Q4 = 2400*(T3-T4)/3600;			#KJ/s
Q3subQ4 = W;			#KJ
#COP = Q4/(Q3subQ4) = T4/(T3-T4);
#T3**2-2*T3*T4+T4**2-T4*3600/2400*(Q3subQ4) = 0
P = array([1, -2*T4, T4**2-T4*3600./2400*(Q3subQ4)])
T3 = roots(P);
T3 = T3;			#K(Maximum outside temperature)
print "Maximum outside temperature in K : %.0f"%T3
print  "in degree C : %.0f"%(T3-273)

Power required to drive heat pump in KW : 0.91
Maximum outside temperature in K : 313
in degree C : 40


## Example 3.20 Page No : 34¶

In :

# Variables :
VcByVa = 14.;			#Overall expansion ratio
T1 = 257+273.;			#K
T2 = 27+273.;			#K
Gamma = 1.4;
Ta = T1;			#K
Tb = T1;			#K
Tc = T2;			#K
Td = T2;			#K

# Calculations and Results
VcByVb = (Tb/Tc)**(1/(Gamma-1));			#Expansion ratio for Adiabatic Process :
print  "ratio for adiabatic process : %.2f"%VcByVb

VbByVa = VcByVa/VcByVb;			#Expansion ratio for Isothermal Process :
print "Expansion ratio for Isothermal process : %.3f"%VbByVa
Eta = (1-T2/T1)*100;			#%
print "Thermal Efficiency of carnot cycle in %% : %.1f"%Eta

ratio for adiabatic process : 4.15
Expansion ratio for Isothermal process : 3.375
Thermal Efficiency of carnot cycle in % : 43.4


## Example 3.21 Page No : 34¶

In :

# Variables :
W = 10.;			#KW
#For flat plate collector
T1 = 90.+273;			#K
T2 = 27.+273;			#K
Tmax = T1;			#K
IE = 1.;			#KW/m**2 incident energy
EtaCollection = 60./100;

# Calculations and Results
#Eta = 1-T2/T1 = W/Q1
Q1 = W/(1-T2/T1);			#KJ/s
A1 = Q1/IE/EtaCollection;			#m**2
print "Solar Collector Area required in m**2 : %.3f"%A1

#For parabolic collector
T3 = 250.+273;			#K
T4 = 27.+273;			#K
Tmax = T3;			#K
IE = 1.;			#KW/m**2 incident energy
EtaCollection = 50./100;

#Eta = 1-T2/T1 = W/Q1
Q3 = W/(1-T4/T3);			#KJ/s
A2 = Q3/IE/EtaCollection;			#m**2
print "Parabolic Solar Collector Area required in m**2 : %.3f"%A2
#Answer of 2nd part is wrong in the book.

Solar Collector Area required in m**2 : 96.032
Parabolic Solar Collector Area required in m**2 : 46.906


## Example 3.24 Page No : 37¶

In :

# Variables :
T1 = 40.+273;			#K
T2 = 5.+273;			#K
T3 = 400.+273;			#K
T4 = T1;			#K
Q2 = 1500.;			#KJ/min

# Calculations and Results
COP_R = T2/(T1-T2);
print "COP of refrigerator is : %.3f"%COP_R

Q2dot = Q2/60;			#KJ/s
Wdot = Q2dot/COP_R;			#KW
print "Work Input to refrigerator in KW : %.4f"%Wdot

Eta = (1-T4/T3);			#%
Q3dot = Wdot/Eta;			#KW
OverallCOP = Q2dot/Q3dot;			#
print "Overall COP of refrigerator : %.4f"%OverallCOP

#Ans of overall COP is wrong in the book.

COP of refrigerator is : 7.943
Work Input to refrigerator in KW : 3.1475
Overall COP of refrigerator : 4.2488


## Example 3.25 Page No : 38¶

In :

# Variables :
T1 = 1500.;			#K
T2 = 450.;			#K
T3 = 150.;			#K
Q3 = 250.;			#KJ

# Calculations and Results
COP_CR = T3/(T2-T3);
print "COP of cold refrigerator is : %.1f"%COP_CR

COP_HR = T2/(T1-T2);
print "COP of hotter refrigerator is : %.4f"%COP_HR
COP = T3/(T1-T3);
print "COP of composite system is : %.3f"%COP

COP of cold refrigerator is : 0.5
COP of hotter refrigerator is : 0.4286
COP of composite system is : 0.111


## Example 3.26 Page No : 38¶

In :

# Variables :
T1 = 870.;			#K
T2 = 580.;			#K
T3 = 290.;			#K
Wdot = 85.;			#KW
Q3 = 3000.;			#KJmin
Q3 = Q3/60.;			#KJ/s
Q1plusQ2 = Wdot+Q3;			#KJ

#sigma(Q/T) = 0
#Q1/T1+Q2/T2 = Q3/T3
#Q1/T1+(Q1plusQ2-Q1)/T2-Q3/T3 = 0
Q1 = (-Q3*T1*T2/T3+Q1plusQ2*T1)/(T1-T2);			#KW
print "Heat Supplied by source1 in KW : %.0f"%Q1

Q2 = Q1plusQ2-Q1;			#KW
print "Heat Supplied by source2 in KW : %.0f"%Q2

Eta = Wdot/(Q1+Q2)*100;			#%
print "Efficiency of engine in %% : %.2f"%Eta

Heat Supplied by source1 in KW : 105
Heat Supplied by source2 in KW : 30
Efficiency of engine in % : 62.96