Chapter 2 : The First Law and Other Basic Concepts

Example 2.1 page : 26

In [1]:
# Variables
H = 100.;			#height = 100m
M = 1.; 			#Mass of water = 1Kg
g = 9.8066;			#Acceleration due to gravity(m/s**2)


# Calculations and Results
#(a)
PE1 = M*H*g;			#[j]
print '(a)Potential energy of Water at the Top',PE1,'J'

#(b)
del_U = 0;
KE1 = 0;
PE2 = 0;
KE2 = PE1;			#[j]
print '(b)Kinetic energy of Water',KE2,'J'

#(c)
del_U = KE2;
print '(c)Change in Internal energy when 1kg Water added',del_U,'J'
(a)Potential energy of Water at the Top 980.66 J
(b)Kinetic energy of Water 980.66 J
(c)Change in Internal energy when 1kg Water added 980.66 J

Example 2.3 page : 27

In [2]:
# Variables
P_atm = 101.3;			#Atm Pressure = 101.3KPa
V1 = 0.1;			#Volume1 = 0.1m**3
V2 = 0.2;			#Volume2 = 0.2m**3

# Calculations
del_V = V2-V1;
W_by = P_atm*del_V;
W_on = -W_by;
Q = 0;
del_Energy = Q+W_on;			#KJ

# Results
print 'Energy Change',del_Energy,'KJ'
Energy Change -10.13 KJ

Example 2.4 page : 28

In [4]:
# Variables
W_acb = 40;			#J
Q_acb = 100;			#J
W_aeb = 20;			#J
W_bda = 30;			#J

# Calculations and Results
del_U_ab = Q_acb-W_acb;

#(a)
Q_aeb = del_U_ab-W_aeb;			#J
print '(a)Heat Flow in acb',Q_aeb,'J'

#(b)
del_U_ba = -del_U_ab;			#J
Q_bda = del_U_ba-W_bda;
print '(b)Heat Flow in bda',Q_bda,'J'
(a)Heat Flow in acb 40 J
(b)Heat Flow in bda -90 J

Example 2.5 page : 30

In [5]:
# Variables
#(a)-Liquid Water in equllibrium with its vapour.
N = 1;
pi = 2;

# Calculations and Results
F = 2-pi+N;
print '(a)Degree Of freedom is',F

#(b)-Liquid Water in equllibrium with a mixture of vapour and nitrogen.
N = 2;
pi = 2;
F = 2-pi+N;
print '(b)Degree Of freedom is',F

#(c)-A liquid Soln of alcohol in water in equillibrium with its vapour
N = 2;
pi = 2;
F = 2-pi+N;
print '(c)Degree Of freedom is',F
(a)Degree Of freedom is 1
(b)Degree Of freedom is 2
(c)Degree Of freedom is 2

Example 2.6 page no : 31

In [1]:
from scipy.integrate import quad 

# Variables
P = 14.;			#Pressure = 14bar
V1 = 0.03;			#Initial volume = 0.03m**3
V2 = 0.06;			#Final Volume

#Process is isothermal
#(a)-To find the work done by gas in moving the External force
#(b)-To find the work done by gas if external force is suddenly reduced to half its initial value

# Calculations and Results
#(a)
K = P*V1*(10**5);			#J

def f3(V): 
    return 1./V

W1 = round(-K* quad(f3,0.03,0.06)[0],2)

P2 = K/V2;			#Final Pressure(Pa)
P2 = P2/(10**5);			#bar
print '(a)The work done by gas in moving the External Force is',W1,'J'

#(b)
def f4(V): 
    return 1

W2 = -P2*(10**5)* quad(f4,0.03,0.06)[0]

n = round((W2/W1)*100,1);			#Efficiency
print '(b)The work done by gas if external force is reduced to half is',W2,'J'
print 'Hence the efficiency is',n,'%'
(a)The work done by gas in moving the External Force is -29112.18 J
(b)The work done by gas if external force is reduced to half is -21000.0 J
Hence the efficiency is 72.1 %

Example 2.7 page no : 32

In [2]:
# Variables
P = 7;			#pressure = 7bar
m = 45;			#Mass of cube
mt = 23;			#mass of piston,piston rod,pan
x = 0.5;			#Dismath.tance moved = 0.5m
g = 9.8;			#Acceleration Due to gravity(m/s**2)

# Calculations
#Acc to Eqn del_U_sys+del_U_surr+del_PE_surr = 0
del_PE_surr = (m+mt)*g*x;
#ans = del_U_sys+del_U_surr

# Results
print 'Energy Changes in the Process',-del_PE_surr,'J'
Energy Changes in the Process -333.2 J

Example 2.8 pageno : 34

In [3]:
# Variables
m = 1.;     			#1kg of water
T = 373.15;	    		#Temp = 373.15K(100`C)
P = 101.325;			#Pressure = 101.325KPa
V2 = 1.673;		    	#Final Volume[m**3]
V1 = 0.00104;			#Initial Volume[m**3]
Sv_liqiud = 0.00104;	#Specific Volume of Liqiud
Sv_vapour = 1.673;		#Specific Volume of Vapour
del_H = 2256.9;			#Heat Added(KJ)

# Calculations
Q = del_H;
del_V = V2-V1;
W = P*del_V;			#KJ
del_U = round(del_H-(P*del_V),1);

# Results
print 'Change in Enthalpy',del_H,'KJ'
print 'Change in Internal energy',del_U,'KJ'
Change in Enthalpy 2256.9 KJ
Change in Internal energy 2087.5 KJ

Example 2.9 page no : 35

In [4]:
# Variables
P1 = 1.;    			#Pressure = 1bar
T1 = 298.15;			#Temp = 298.15K(25`C)
V1 = 0.02479;			#Molar Volume = 0.02479m**3/mol
#Final
P2 = 5. 			#Pressure = 5bar
Cv = 20.78;			#J/mol/K
Cp = 29.10;			#J/mol/K

# Calculations and Results
#to Find del_U,del_H by two processes
V2 = V1*(P1/P2);			#m**3(1 mol)
print 'Final Volume',V2,'m**3'


#(a)-Cooling at const pressure followed by heating at const Volume
T2 = T1*(V2/V1);			#K
print 'Final Temperature',T2,'K'

del_H = round(Cp*(T2-T1));			#J
Q1 = del_H;			#J
del_U1 = round(del_H-(P1*(10**5)*(V2-V1)));			#J

#Second Step
del_U2 = round(Cv*(T1-T2));			#J
Q2 = del_U2;
Q = Q1+Q2;
del_U = 0;
W = del_U-Q;			#J
del_H = 0;			#const Temperature

print ('(a) Cooling at const Pressure Followed by Heating at const Volume')
print 'Heat Required',Q,'J'
print 'Work Required',W,'J'
print 'Change in enthalpy',del_H,'J'
print 'Change in Energy',del_U,'J'

#(b)-heating at Const Volume Followed by cooling at const Pressure
T2 = T1*(P2/P1);			#K
del_U1 = round(Cv*(T2-T1));			#J
Q1 = del_U1;
del_H = round(Cp*(T1-T2));			#J
Q2 = del_H;
del_U2 = round(del_H-(P2*(10**5)*(V2-V1)));			#J
Q = Q1+Q2;
del_U = 0;
W = del_U-Q;			#J
del_H = 0;			#const Temperature
print '(b) Heating at const Volume Followed by Cooling at const Pressure'
print 'Heat Required',Q,'J'
print 'Work Required',W,'J'
print 'Change in enthalpy',del_H,'J'
print 'Change in Energy',del_U,'J'


#Note
print ('Note : The Answer varies From That in the book because in Book 4956.44 has been rounded to \
 4958 which is absurd')
Final Volume 0.004958 m**3
Final Temperature 59.63 K
(a) Cooling at const Pressure Followed by Heating at const Volume
Heat Required -1985.0 J
Work Required 1985.0 J
Change in enthalpy 0 J
Change in Energy 0 J
(b) Heating at const Volume Followed by Cooling at const Pressure
Heat Required -9923.0 J
Work Required 9923.0 J
Change in enthalpy 0 J
Change in Energy 0 J
Note : The Answer varies From That in the book because in Book 4956.44 has been rounded to  4958 which is absurd

Example 2.10 page no : 36

In [5]:
# Variables
T1 = 277.;			#Temp = 277K
P1 = 10.;			#Pressure = 10bar
V1 = 2.28;			#molar Volume = 2.28m**3/Kmol

T2 = 333.;			#Temp = 333K
P2 = 1. 			#Pressure = 1atm

Cv = 21.;			#KJ/Kmol/K
Cp = 29.3;			#KJ/Kmol/K

# Calculations
#(a)-Cooled at const Vol to the final pressure
#(b)-Heated at const Pressure to final temperature
T_ = T1*(1./10);			#Intermediate temperature
del_Ta = T_-T1;
del_Tb = T2-T_;
del_Ua = Cv*del_Ta;			#KJ/Kmol
del_Ha = del_Ua+(V1*(P2-P1)*(10**5)/(10**3));			#KJ/Kmol
V2 = (V1*P1*T2)/(P2*T1);			#m**3/kmol
del_Hb = Cp*del_Tb;
del_Ub = del_Hb-(P2*(V2-V1)*(10**5)/(10**3));			#KJ/Kmol

del_U = round(del_Ua+del_Ub,0);
del_H = round(del_Ha+del_Hb,0);

# Results
print 'Change In Internal Energy',del_U,'KJ/Kmol'
print 'Change In Enthalpy',del_H,'KJ/Kmol'
Change In Internal Energy 1197.0 KJ/Kmol
Change In Enthalpy 1658.0 KJ/Kmol

Example 2.13 page no : 37

In [6]:
import math 

# Variables
M = 190.;			#Mass = 190Kg
T0 = 333.15;			#Temperature = 333.15K(60`C)
m = 0.2;			#Steady rate of mass(Kg/s)
T = 308.15;			#Temperature = 308.15K(35`C)
T1 = 283.15;			#Temperature = 283.15K(10`C)

# Calculations and Results
#Using the Eqn (2.29)
t = round(-(M/m)*math.log((T-T1)/(T0-T1)),1);			#s
print 'Time Taken for temperature of water to drop from 333.15K to 308.15K',t,'s'
t = round(t/60);			#min
print 'Time Taken for temperature of water to drop from 333.15K to 308.15K',t,'min'
Time Taken for temperature of water to drop from 333.15K to 308.15K 658.5 s
Time Taken for temperature of water to drop from 333.15K to 308.15K 11.0 min

Example 2.14 page no : 38

In [13]:
# Variables
rQ = 4.15;			#[g/s]  flow rate
rQ2 = 12740.;			#Rate of Heat addition from resismath.tance heater

# Calculations
#del_z and del_u*2 are negligible  if Ws and H1 = 0..then H2 = Q
H2 = round(rQ2/rQ);			#[J/g]

# Results
print 'Enthalpy of Steam',H2,'J/g'
Enthalpy of Steam 3070.0 J/g

Example 2.15 page no : 39

In [14]:
# Variables
V = 600.;           			#[m/s]
W_compression = 240.;			#[KJ/Kg]

# Calculations
#Umath.sing Eqn(2.32a)
Q = (1./2*(V*V)/1000.)-W_compression;

# Results
print 'Thus Heat Removed from each KG of air compressed is',-Q,'KJ/kg'
Thus Heat Removed from each KG of air compressed is 60.0 KJ/kg

Example 2.16 page no : 41

In [7]:
# Variables
R = 3.15*10**-3;			#[m**3/s]  Rate of pumping
rH = -700.;			#[KW]  Rate of Heat lost  
h = 15.;			#[m]  Height
rW = 1.5;			#[KW]
rho = 958.;			#[Kg/m**3]  at 366.65K
g = 9.805;
gc = 1000.;
del_z = h;

# Calculations and Results
rm = round(R*rho,3);			#[Kg/s]  Mass flow rate
Q = round(rH/rm,1);			#[KJ/Kg]
W = round(rW/rm,3);			#[KJ/Kg]  Shaft Work
K = round(g/gc*del_z,3);

#using Eqn(2.32b)
del_H = Q+W-K;

#From Steam tables for water at 366.65K
H1 = 391.6;			#[KJ/Kg]
H2 = del_H+H1;
print 'Enthalpy',H2,'KJ/Kg'

#From Steam Tables temp at this enthalpy is
T = 311.35;			#[K]
print 'Temperature in the Second tank',T,'K'
Enthalpy 160.05 KJ/Kg
Temperature in the Second tank 311.35 K