chapter 1:Fundemental concepts and definitions

example 1.1;page no:22

In [1]:
#cal of pressure difference
#intiation of all variables
# Chapter 1
print"Example 1.1, Page:22  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 1"
h=30*10**-2;#manometer deflection of mercury in m
g=9.78;#acceleration due to gravity in m/s^2
rho=13550;#density of mercury at room temperature in kg/m^3
print"pressure difference(p)in pa"
p=rho*g*h
print"p=",round(p,2)
Example 1.1, Page:22  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 1
pressure difference(p)in pa
p= 39755.7

example 1.2;page no:22

In [2]:
#cal of effort required for lifting the lid
#intiation of all variables
# Chapter 1
print"Example 1.2, Page:22  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 2"
d=30*10**-2;#diameter of cylindrical vessel in m
h=76*10**-2;#atmospheric pressure in m of mercury
g=9.78;#acceleration due to gravity in m/s^2
rho=13550;#density of mercury at room temperature in kg/m^3
print"effort required for lifting the lid(E)in N"
E=(rho*g*h)*(3.14*d**2)/4
print"E=",round(E,2)
Example 1.2, Page:22  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 2
effort required for lifting the lid(E)in N
E= 7115.48

example 1.3;page no:22

In [3]:
#cal of actual pressure of the air
#intiation of all variables
# Chapter 1
print"Example 1.3, Page:22  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 3"
h=30*10**-2;# pressure of compressed air in m of mercury
Patm=101*10**3;#atmospheric pressure in pa
g=9.78;#acceleration due to gravity in m/s^2
rho=13550;#density of mercury at room temperature in kg/m^3
print"pressure measured by manometer is gauge pressure(Pg)in kpa"
print"Pg=rho*g*h/10^3"
Pg=rho*g*h/10**3
print"actual pressure of the air(P)in kpa"
P=Pg+Patm/10**3
print"P=",round(P,2)
Example 1.3, Page:22  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 3
pressure measured by manometer is gauge pressure(Pg)in kpa
Pg=rho*g*h/10^3
actual pressure of the air(P)in kpa
P= 140.76

example 1.4;page no:22

In [4]:
#cal of gauge pressure
#intiation of all variables
# Chapter 1
print"Example 1.4, Page:22  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 4"
h=1;#depth of oil tank in m
sg=0.8;#specific gravity of oil
RHOw=1000;#density of water in kg/m^3
g=9.81;#acceleration due to gravity in m/s^2
print"density of oil(RHOoil)in kg/m^3"
print"RHOoil=sg*RHOw"
RHOoil=sg*RHOw
print"gauge pressure(Pg)in kpa"
Pg=RHOoil*g*h/10**3
print"Pg=",round(Pg,3)
Example 1.4, Page:22  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 4
density of oil(RHOoil)in kg/m^3
RHOoil=sg*RHOw
gauge pressure(Pg)in kpa
Pg= 7.848

example 1.5;page no:22

In [5]:
#cal of pressure exerted by gas
#intiation of all variables
# Chapter 1
print"Example 1.5, Page:22 \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 5"
rho=13.6*10**3;#density of mercury in kg/m^3
g=9.81;#acceleration due to gravity in m/s^2
h1=40*10**-2;#difference of height in mercury column in m as shown in figure
h2=76*10**-2;#barometer reading of mercury in m
print"atmospheric pressure(Patm)in kpa"
print"Patm=rho*g*h2/10^3"
Patm=rho*g*h2/10**3
print"pressure due to mercury column at AB(Pab)in kpa"
print"Pab=rho*g*h1/10^3"
Pab=rho*g*h1/10**3
print"pressure exerted by gas(Pgas)in kpa"
Pgas=Patm+Pab
print"Pgas=",round(Pgas,2)
Example 1.5, Page:22 
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 5
atmospheric pressure(Patm)in kpa
Patm=rho*g*h2/10^3
pressure due to mercury column at AB(Pab)in kpa
Pab=rho*g*h1/10^3
pressure exerted by gas(Pgas)in kpa
Pgas= 154.76

example 1.6;page no:23

In [6]:
#cal of change in temperature of water
#intiation of all variables
# Chapter 1
print"Example 1.6, Page:23  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 6"
m=1;#mass of water in kg
h=1000;#height from which water fall in m
Cp=1;#specific heat of water in kcal/kg k
g=9.81;#acceleration due to gravity in m/s^2
print"by law of conservation of energy"
print"potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule"
print"so m*g*h = m*Cp*deltaT*4.18*1000"
print"change in temperature of water(deltaT) in degree celcius"
deltaT=(g*h)/(4.18*1000*Cp)
print"deltaT=",round(deltaT,2)
Example 1.6, Page:23  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 6
by law of conservation of energy
potential energy(m*g*h)in joule = heat required for heating water(m*Cp*deltaT*1000*4.18)in joule
so m*g*h = m*Cp*deltaT*4.18*1000
change in temperature of water(deltaT) in degree celcius
deltaT= 2.35

example 1.7;page no:23

In [7]:
#cal of spring balance reading
#intiation of all variables
# Chapter 1
print"Example 1.7, Page:23  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 7"
w1=100;#weight of object at standard gravitational acceleration in N
g1=9.81;#acceleration due to gravity in m/s^2
g2=8.5;#gravitational acceleration at some location
print"mass of object(m)in kg"
print"m=w1/g1"
m=w1/g1
print"spring balance reading=gravitational force in mass(F)in N"
F=m*g2
print"F=",round(F,2)
Example 1.7, Page:23  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 7
mass of object(m)in kg
m=w1/g1
spring balance reading=gravitational force in mass(F)in N
F= 86.65

example 1.8;page no:24

In [8]:
#cal of mass of piston
#intiation of all variables
# Chapter 1
import math
print"Example 1.8, Page:24  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8"
d=15*10**-2;#diameter of cylinder in m
h=12*10**-2;#manometer height difference in m of mercury
rho=13.6*10**3;#density of mercury in kg/m^3
g=9.81;#acceleration due to gravity in m/s^2
print"pressure measured by manometer(P) in pa"
print"p=rho*g*h"
p=rho*g*h
print"now weight of piston(m*g) = upward thrust by gas(p*math.pi*d^2/4)"
print"mass of piston(m)in kg"
m=(p*math.pi*d**2)/(4*g)
print"so m=",round(m,2)
Example 1.8, Page:24  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 8
pressure measured by manometer(P) in pa
p=rho*g*h
now weight of piston(m*g) = upward thrust by gas(p*math.pi*d^2/4)
mass of piston(m)in kg
so m= 28.84

example 1.9;page no:24

In [9]:
#cal of pressure due to atmosphere,water,mercury,steam
#intiation of all variables
# Chapter 1
print"Example 1.9, Page:24  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 9")
RHOm=13.6*10**3;#density of mercury in kg/m^3
RHOw=1000;#density of water in kg/m^3
h1=76*10**-2;#barometer reading in m of mercury
h2=2*10**-2;#height raised by water in manometer tube in m 
h3=10*10**-2;#height raised by mercury in manometer tube in m 
g=9.81;#acceleration due to gravity in m/s^2
print("balancing pressure at plane BC in figure we get")
print("Psteam+Pwater=Patm+Pmercury")
print("now 1.atmospheric pressure(Patm)in pa")
Patm=RHOm*g*h1
print("Patm="),round(Patm,2)
print("2.pressure due to water(Pwater)in pa")
Pwater=RHOw*g*h2
print("Pwater="),round(Pwater,2)
print("3.pressure due to mercury(Pmercury)in pa")
Pmercury=RHOm*g*h3
print("Pmercury=RHOm*g*h3"),round(Pmercury,2)
print("using balancing equation")
print("Psteam=Patm+Pmercury-Pwater")
print("so pressure of steam(Psteam)in kpa")
Psteam=(Patm+Pmercury-Pwater)/1000
print("Psteam="),round(Psteam,2)
Example 1.9, Page:24  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 9
balancing pressure at plane BC in figure we get
Psteam+Pwater=Patm+Pmercury
now 1.atmospheric pressure(Patm)in pa
Patm= 101396.16
2.pressure due to water(Pwater)in pa
Pwater= 196.2
3.pressure due to mercury(Pmercury)in pa
Pmercury=RHOm*g*h3 13341.6
using balancing equation
Psteam=Patm+Pmercury-Pwater
so pressure of steam(Psteam)in kpa
Psteam= 114.54

example 1.10;page no:24

In [10]:
#cal of "absolute temperature in compartment A,B
#intiation of all variables
# Chapter 1
print"Example 1.10, Page:24  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 10")
h=720*10**-3;#barometer reading in m of Hg
Pga=400;#gauge pressure in compartment A in kpa
Pgb=150;#gauge pressure in compartment B in kpa
rho=13.6*10**3;#density of mercury in kg/m^3
g=9.81;#acceleration due to gravity in m/s^2
print("atmospheric pressure(Patm)in kpa")
Patm=(rho*g*h)/1000
print("absolute temperature in compartment A(Pa) in kpa")
Pa=Pga+Patm
print"Pa=",round(Pa,2)
print"absolute temperature in compartment B(Pb) in kpa"
Pb=Pgb+Patm
print"Pb=",round(Pb,2)
print"absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa"
Example 1.10, Page:24  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 10
atmospheric pressure(Patm)in kpa
absolute temperature in compartment A(Pa) in kpa
Pa= 496.06
absolute temperature in compartment B(Pb) in kpa
Pb= 246.06
absolute pressure in compartments in A & B=496.06 kpa & 246.06 kpa

example 1.11;page no:25

In [11]:
#cal of air pressure
#intiation of all variables
# Chapter 1
print"Example 1.11, Page:25  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 11")
Patm=90*10**3;#atmospheric pressure in pa
RHOw=1000;#density of water in kg/m^3
RHOm=13600;#density of mercury in kg/m^3
RHOo=850;#density of oil in kg/m^3
g=9.81;#acceleration due to ggravity in m/s^2
h1=.15;#height difference between water column in m
h2=.25;#height difference between oil column in m
h3=.4;#height difference between mercury column in m
print"the pressure of air in air tank can be obtained by equalising pressures at some reference line"
print"P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3"
print"so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2"
P1=(Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2)/1000
print"air pressure(P1)in kpa",round(P1,2)
Example 1.11, Page:25  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 11
the pressure of air in air tank can be obtained by equalising pressures at some reference line
P1+RHOw*g*h1+RHOo*g*h2 = Patm+RHOm*g*h3
so P1 = Patm+RHOm*g*h3-RHOw*g*h1-RHOo*g*h2
air pressure(P1)in kpa 139.81

example 1.12;page no:26

In [12]:
#cal of kinetic energy
#intiation of all variables
# Chapter 1
print"Example 1.12, Page:26  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 12"
v=750;#relative velocity of object with respect to earth in m/sec
F=4000;#gravitational force in N
g=8;#acceleration due to gravity in m/s^2
print"mass of object(m)in kg"
print"m=F/g"
m=F/g
print"kinetic energy(E)in J is given by"
E=m*v**2/2
print"E=",round(E)
Example 1.12, Page:26  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 12
mass of object(m)in kg
m=F/g
kinetic energy(E)in J is given by
E= 140625000.0

example 1.13;page no:26

In [13]:
#cal of molecular weight of gas
#intiation of all variables
# Chapter 1
print"Example 1.13, Page:26  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 13"
Cp=2.286;#specific heat at constant pressure in kJ/kg k
Cv=1.786;#specific heat at constant volume in kJ/kg k
R1=8.3143;#universal gas constant in kJ/kg k
print"characteristics gas constant(R2)in kJ/kg k"
R2=Cp-Cv
m=R1/R2
print"molecular weight of gas(m)in kg/kg mol=",round(m,2)
print"NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary."
Example 1.13, Page:26  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 13
characteristics gas constant(R2)in kJ/kg k
molecular weight of gas(m)in kg/kg mol= 16.63
NOTE=>Their is some calculation mistake while calaulating gas constant in book,which is corrected above hence answer may vary.

example 1.14;page no:26

In [14]:
#cal of final temperature of gas
#intiation of all variables
# Chapter 1
print"Example 1.14, Page:26  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 14"
P1=750*10**3;#initial pressure of gas in pa
V1=0.2;#initial volume of gas in m^3
T1=600;#initial temperature of gas in k
P2=2*10**5;#final pressure of gas i pa
V2=0.5;#final volume of gas in m^3
print"using perfect gas equation"
print"P1*V1/T1 = P2*V2/T2"
print"=>T2=(P2*V2*T1)/(P1*V1)"
print"so final temperature of gas(T2)in k"
T2=(P2*V2*T1)/(P1*V1)
T2=T2-273
print"or final temperature of gas(T2)in degree celcius=",round(T2,2)
Example 1.14, Page:26  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 14
using perfect gas equation
P1*V1/T1 = P2*V2/T2
=>T2=(P2*V2*T1)/(P1*V1)
so final temperature of gas(T2)in k
or final temperature of gas(T2)in degree celcius= 127.0

example 1.15;page no:27

In [15]:
#cal of volume of this mass of air(V) at initial states
#intiation of all variables
# Chapter 1
print"Example 1.15, Page:27  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 15"
P1=100*10**3;#initial pressure of air in pa
V1=5.;#initial volume of air in m^3
T1=300.;#initial temperature of gas in k
P2=50*10**3;#final pressure of air in pa
V2=5.;#final volume of air in m^3
T2=(280.);#final temperature of air in K
R=287.;#gas constant on J/kg k
print"from perfect gas equation we get"
print"initial mass of air(m1 in kg)=(P1*V1)/(R*T1)"
m1=(P1*V1)/(R*T1)
print("m1="),round(m1,3)
print"final mass of air(m2 in kg)=(P2*V2)/(R*T2)"
m2=(P2*V2)/(R*T2)
print("m2="),round(m2,3)
m=m1-m2
print"mass of air removed(m)in kg",round(m,3)
V=m*R*T1/P1
print"volume of this mass of air(V) at initial states in m^3=",round(V,2)
Example 1.15, Page:27  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 15
from perfect gas equation we get
initial mass of air(m1 in kg)=(P1*V1)/(R*T1)
m1= 5.807
final mass of air(m2 in kg)=(P2*V2)/(R*T2)
m2= 3.111
mass of air removed(m)in kg 2.696
volume of this mass of air(V) at initial states in m^3= 2.32

example 1.16;page no:27

In [16]:
#cal of heat supplied
#intiation of all variables
# Chapter 1
import math
print"Example 1.16, Page:27  \n \n"
print"Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 16"
d=1;#diameter of cylinder in m
l=4;#length of cylinder in m
P1=100*10**3;#initial pressureof hydrogen gas in pa
T1=(27+273);#initial temperature of hydrogen gas in k
P2=125*10**3;#final pressureof hydrogen gas in pa
Cp=14.307;#specific heat at constant pressure in KJ/kg k
Cv=10.183;#specific heat at constant volume in KJ/kg k
print"here V1=V2"
print"so P1/T1=P2/T2"
print"final temperature of hydrogen gas(T2)in k"
print"=>T2=P2*T1/P1"
T2=P2*T1/P1
print"now R=(Cp-Cv) in KJ/kg k"
R=Cp-Cv
print"And volume of cylinder(V1)in m^3"
print"V1=(math.pi*d^2*l)/4"
V1=(math.pi*d**2*l)/4
print"mass of hydrogen gas(m)in kg"
m=(P1*V1)/(1000*R*T1)
print"m=",round(m,3)
print"now heat supplied(Q)in KJ"
Q=m*Cv*(T2-T1)
print"Q=",round(Q,2)
Example 1.16, Page:27  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 16
here V1=V2
so P1/T1=P2/T2
final temperature of hydrogen gas(T2)in k
=>T2=P2*T1/P1
now R=(Cp-Cv) in KJ/kg k
And volume of cylinder(V1)in m^3
V1=(math.pi*d^2*l)/4
mass of hydrogen gas(m)in kg
m= 0.254
now heat supplied(Q)in KJ
Q= 193.93

example 1.17;page no:28

In [17]:
#cal of final pressure
#intiation of all variables
# Chapter 1
print"Example 1.17, Page:28  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 17")
V1=2.;#volume of first cylinder in m^3
V2=2.;#volume of second cylinder in m^3
T=(27+273);#temperature of system in k
m1=20.;#mass of air in first vessel in kg
m2=4.;#mass of air in second vessel in kg
R=287.;#gas constant J/kg k
print("final total volume(V)in m^3")
print("V=V1*V2")
V=V1*V2
print("total mass of air(m)in kg")
print("m=m1+m2")
m=m1+m2
print("final pressure of air(P)in kpa")
print("using perfect gas equation")
P=(m*R*T)/(1000*V)
print"P=",round(P,2)
Example 1.17, Page:28  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 17
final total volume(V)in m^3
V=V1*V2
total mass of air(m)in kg
m=m1+m2
final pressure of air(P)in kpa
using perfect gas equation
P= 516.6

example 1.18;page no:28

In [18]:
#cal of pressure of CO2 as perfect,real gas
#intiation of all variables
# Chapter 1
print"Example 1.18, Page:28  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 18")
m=5;#mass of CO2 in kg
V=2;#volume of vesssel in m^3
T=(27+273);#temperature of vessel in k
R=8.314*10**3;#universal gas constant in J/kg k
M=44.01;#molecular weight of CO2 
print("1.By considering it as a PERFECT GAS")
print("gas constant for CO2(Rco2)")
Rco2=R/M
print("Rco2=(J/Kg.k)"),round(Rco2,1)
print("Also P*V=M*Rco2*T")
print("pressure of CO2 as perfect gas(P)in N/m^2")
P=(m*Rco2*T)/V
print("P=(m*Rco2*T)/V "),round(P,2)
print("2.By considering as a REAL GAS")
print("values of vanderwaal constants a,b can be seen from the table which are")
a=3628.5*10**2#vanderwall constant in N m^4/(kg mol)^2
b=3.14*10**-2# vanderwall constant in m^3/kg mol
print("a=(N m^4/(kg mol)^2) "),round(a,2)
print("b=(m^3/kg mol)"),round(b,2)
print("now specific volume(v)in m^3/kg mol")
v=V*M/m
print("v="),round(v,3)
print("now substituting the value of all variables in vanderwaal equation")
print("(P+(a/v^2))*(v-b)=R*T")
print("pressure of CO2 as real gas(P)in N/m^2")
P=((R*T)/(v-b))-(a/v**2)
print("P="),round(P,2)
Example 1.18, Page:28  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 18
1.By considering it as a PERFECT GAS
gas constant for CO2(Rco2)
Rco2=(J/Kg.k) 188.9
Also P*V=M*Rco2*T
pressure of CO2 as perfect gas(P)in N/m^2
P=(m*Rco2*T)/V  141683.71
2.By considering as a REAL GAS
values of vanderwaal constants a,b can be seen from the table which are
a=(N m^4/(kg mol)^2)  362850.0
b=(m^3/kg mol) 0.03
now specific volume(v)in m^3/kg mol
v= 17.604
now substituting the value of all variables in vanderwaal equation
(P+(a/v^2))*(v-b)=R*T
pressure of CO2 as real gas(P)in N/m^2
P= 140766.02

example 1.19;page no:29

In [19]:
#cal of specific volume of steam
#intiation of all variables
# Chapter 1
print"Example 1.19, Page:29  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 19")
P=17672;#pressure of steam on kpa
T=712;#temperature of steam in k
Pc=22.09;#critical pressure of steam in Mpa
Tc=647.3;#critical temperature of steam in k
R=0.4615;#gas constant for steam in KJ/kg k
print("1.considering as perfect gas")
print("specific volume(V)in m^3/kg")
V=R*T/P
print("V="),round(V,4)
print("2.considering compressibility effects")
print("reduced pressure(P)in pa")
p=P/(Pc*1000)
print("p="),round(p,2)
print("reduced temperature(t)in k")
t=T/Tc
print("t="),round(t,2)
print("from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1")
print("we get Z=0.785")
Z=0.785;#compressibility factor
print("now actual specific volume(v)in m^3/kg")
v=Z*V
print("v="),round(v,4)
Example 1.19, Page:29  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 19
1.considering as perfect gas
specific volume(V)in m^3/kg
V= 0.0186
2.considering compressibility effects
reduced pressure(P)in pa
p= 0.8
reduced temperature(t)in k
t= 1.1
from generalised compressibility chart,compressibility factor(Z)can be seen for reduced pressure and reduced temperatures of 0.8 and 1.1
we get Z=0.785
now actual specific volume(v)in m^3/kg
v= 0.0146

example 1.20;page no:30

In [20]:
#estimation of maximum load that can be lifted 
#intiation of all variables
# Chapter 1
import math
print"Example 1.20, Page:30  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 20")
d=5.;#diameter of ballon in m
T1=(27.+273.);#temperature of hydrogen in k
P=1.013*10**5;#atmospheric pressure in pa
T2=(17.+273.);#temperature of surrounding air in k
R=8.314*10**3;#gas constant in J/kg k
print("volume of ballon(V1)in m^3")
V1=(4./3.)*math.pi*((d/2)**3)
print("V1="),round(V1,2)
print("molecular mass of hydrogen(M)")
print("M=2")
M=2;#molecular mass of hydrogen
print("gas constant for H2(R1)in J/kg k")
R1=R/M
print("R1="),round(R1,2)
print("mass of H2 in ballon(m1)in kg")
m1=(P*V1)/(R1*T1)
print("m1="),round(m1,3)
print("volume of air printlaced(V2)=volume of ballon(V1)")
print("mass of air printlaced(m2)in kg")
R2=0.287*1000;#gas constant for air in J/kg k
m2=(P*V1)/(R2*T2)
print("m2="),round(m2,2)
print("gas constant for air(R2)=0.287 KJ/kg k")
print("load lifting capacity due to buoyant force(m)in kg")
m=m2-m1
print("m="),round(m,3)
Example 1.20, Page:30  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 20
volume of ballon(V1)in m^3
V1= 65.45
molecular mass of hydrogen(M)
M=2
gas constant for H2(R1)in J/kg k
R1= 4157.0
mass of H2 in ballon(m1)in kg
m1= 5.316
volume of air printlaced(V2)=volume of ballon(V1)
mass of air printlaced(m2)in kg
m2= 79.66
gas constant for air(R2)=0.287 KJ/kg k
load lifting capacity due to buoyant force(m)in kg
m= 74.343

example 1.21;page no:31

In [21]:
#cal of time required
#intiation of all variables
# Chapter 1
import math
print"Example 1.21, Page:31  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 21")
v=0.25;#volume sucking rate of pump in m^3/min
V=20.;#volume of air vessel in m^3
p1=1.;#initial receiver pressure in pa
print("let initial receiver pressure(p1)=1 in pa")
p2=p1/4.
print("so final receiver pressure(p2)=in pa"),round(p2,2)
print("perfect gas equation,p*V*m=m*R*T")
print("differentiating and then integrating equation w.r.t to time(t) ")
print("we get t=-(V/v)*log(p2/p1)")
t=-(V/v)*math.log(p2/p1)
print("so time(t)in min"),round(t,2)
Example 1.21, Page:31  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 21
let initial receiver pressure(p1)=1 in pa
so final receiver pressure(p2)=in pa 0.25
perfect gas equation,p*V*m=m*R*T
differentiating and then integrating equation w.r.t to time(t) 
we get t=-(V/v)*log(p2/p1)
so time(t)in min 110.9

example 1.22;page no:32

In [22]:
#cal of specific heat at constant pressure for constituent gases 
#intiation of all variables
# Chapter 1
print"Example 1.22, Page:32  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 22")
m=5;#mass of mixture of gas in kg
P=1.013*10**5;#pressure of mixture in pa
T=300;#temperature of mixture in k
M1=28.;#molecular weight of nitrogen(N2)
M2=32.;#molecular weight of oxygen(O2)
M3=44.;#molecular weight of carbon dioxide(CO2)
f1=0.80;#fraction of N2 in mixture
f2=0.18;#fraction of O2 in mixture
f3=0.02;#fraction of CO2 in mixture
k1=1.4;#ratio of specific heat capacities for N2
k2=1.4;#ratio of specific heat capacities for O2
k3=1.3;#ratio of specific heat capacities for CO2
R=8314;#universal gas constant in J/kg k
print("first calculate gas constants for different gases in j/kg k")
R1=R/M1
print("for nitrogen,R1="),round(R1,1)
R2=R/M2
print("for oxygen,R2="),round(R2,1)
R3=R/M3
print("for carbon dioxide,R3="),round(R3,2)
print("so the gas constant for mixture(Rm)in j/kg k")
Rm=f1*R1+f2*R2+f3*R3
print("Rm="),round(Rm,2)
print("now the specific heat at constant pressure for constituent gases in KJ/kg k")
Cp1=((k1/(k1-1))*R1)/1000
print("for nitrogen,Cp1="),round(Cp1,3)
Cp2=((k2/(k2-1))*R2)/1000
print("for oxygen,Cp2="),round(Cp2,3)
Cp3=((k3/(k3-1))*R3)/1000
print("for carbon dioxide,Cp3="),round(Cp3,3)
print("so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k")
Cpm=f1*Cp1+f2*Cp2+f3*Cp3
print("Cpm="),round(Cpm,4)
print("now no. of moles of constituents gases")
m1=f1*m
n1=m1/M1
print("for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg"),round(n1,3)
m2=f2*m
n2=m2/M2
print("for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg"),round(n2,3)
m3=f3*m
n3=m3/M3
print("for carbon dioxide,n3=m3/M3 in mol,where m3=f3*m in kg"),round(n3,4)
print("total no. of moles in mixture in mol")
n=n1+n2+n3
print("n="),round(n,4)
print("now mole fraction of constituent gases")
x1=n1/n
print("for nitrogen,x1="),round(x1,3)
x2=n2/n
print("for oxygen,x2="),round(x2,3)
x3=n3/n
print("for carbon dioxide,x3="),round(x3,4)
print("now the molecular weight of mixture(Mm)in kg/kmol")
Mm=M1*x1+M2*x2+M3*x3
print("Mm="),round(Mm,2)
Example 1.22, Page:32  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 22
first calculate gas constants for different gases in j/kg k
for nitrogen,R1= 296.9
for oxygen,R2= 259.8
for carbon dioxide,R3= 188.95
so the gas constant for mixture(Rm)in j/kg k
Rm= 288.09
now the specific heat at constant pressure for constituent gases in KJ/kg k
for nitrogen,Cp1= 1.039
for oxygen,Cp2= 0.909
for carbon dioxide,Cp3= 0.819
so the specific heat at constant pressure for mixture(Cpm)in KJ/kg k
Cpm= 1.0115
now no. of moles of constituents gases
for nitrogen,n1=m1/M1 in mol,where m1=f1*m in kg 0.143
for oxygen,n2=m2/M2 in mol,where m2=f2*m in kg 0.028
for carbon dioxide,n3=m3/M3 in mol,where m3=f3*m in kg 0.0023
total no. of moles in mixture in mol
n= 0.1733
now mole fraction of constituent gases
for nitrogen,x1= 0.825
for oxygen,x2= 0.162
for carbon dioxide,x3= 0.0131
now the molecular weight of mixture(Mm)in kg/kmol
Mm= 28.86

example 1.23;page no:33

In [23]:
#cal of pressure difference
#intiation of all variables
# Chapter 1
print"Example 1.23, Page:33  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 23")
V1=0.18;#volume fraction of O2 in m^3
V2=0.75;#volume fraction of N2 in m^3
V3=0.07;#volume fraction of CO2 in m^3
P=0.5;#pressure of mixture in Mpa
T=(107+273);#temperature of mixture in k
M1=32;#molar mass of O2
M2=28;#molar mass of N2
M3=44;#molar mass of CO2
print("mole fraction of constituent gases")
print("x=(ni/n)=(Vi/V)")
V=1;# volume of mixture in m^3
print("take volume of mixture(V)=1 m^3")
print("mole fraction of O2(x1)")
x1=V1/V
print("x1="),round(x1,2)
print("mole fraction of N2(x2)")
x2=V2/V
print("x2="),round(x2,2)
print("mole fraction of CO2(x3)")
x3=V3/V
print("x3="),round(x3,2)
print("now molecular weight of mixture = molar mass(m)")
m=x1*M1+x2*M2+x3*M3
print("m="),round(m,2)
print("now gravimetric analysis refers to the mass fraction analysis")
print("mass fraction of constituents")
print("y=xi*Mi/m")
print("mole fraction of O2")
y1=x1*M1/m
print("y1="),round(y1,3)
print("mole fraction of N2")
y2=x2*M2/m
print("y2="),round(y2,3)
print("mole fraction of CO2")
y3=x3*M3/m
print("y3="),round(y3,3)
print("now partial pressure of constituents = volume fraction * pressure of mixture")
print("Pi=xi*P")
print("partial pressure of O2(P1)in Mpa")
p1=x1*P
print("P1="),round(p1,2)
print("partial pressure of N2(P2)in Mpa")
P2=x2*P
print("P2="),round(P2,3)
P3=x3*P
print("partial pressure of CO2(P3)in Mpa")
print("P3="),round(P3,2)
print("NOTE=>Their is some calculation mistake for partial pressure of CO2(i.e 0.35Mpa)which is given wrong in book so it is corrected above hence answers may vary.")
Example 1.23, Page:33  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 23
mole fraction of constituent gases
x=(ni/n)=(Vi/V)
take volume of mixture(V)=1 m^3
mole fraction of O2(x1)
x1= 0.18
mole fraction of N2(x2)
x2= 0.75
mole fraction of CO2(x3)
x3= 0.07
now molecular weight of mixture = molar mass(m)
m= 29.84
now gravimetric analysis refers to the mass fraction analysis
mass fraction of constituents
y=xi*Mi/m
mole fraction of O2
y1= 0.193
mole fraction of N2
y2= 0.704
mole fraction of CO2
y3= 0.103
now partial pressure of constituents = volume fraction * pressure of mixture
Pi=xi*P
partial pressure of O2(P1)in Mpa
P1= 0.09
partial pressure of N2(P2)in Mpa
P2= 0.375
partial pressure of CO2(P3)in Mpa
P3= 0.04
NOTE=>Their is some calculation mistake for partial pressure of CO2(i.e 0.35Mpa)which is given wrong in book so it is corrected above hence answers may vary.

example 1.24;page no:34

In [24]:
#cal of equilibrium temperature,pressure of mixture
#intiation of all variables
# Chapter 1
print"Example 1.24, Page:34  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 24")
V=6;#volume of tank in m^3
P1=800*10**3;#pressure of N2 gas tank in pa
T1=480.;#temperature of N2 gas tank in k
P2=400*10**3;#pressure of CO2 gas tank in pa
T2=390.;#temperature of CO2 gas tank in k
k1=1.4;#ratio of specific heat capacity for N2
k2=1.3;#ratio of specific heat capacity for CO2
R=8314.;#universal gas constant in J/kg k
M1=28.;#molecular weight of N2
M2=44.;#molecular weight of CO2
V1=V/2
print("volume of tank of N2(V1) in m^3="),round(V1,2)
V2=V/2
print("volume of tank of CO2(V2) in m^3="),round(V2,2)
print("taking the adiabatic condition")
print("no. of moles of N2(n1)")
n1=(P1*V1)/(R*T1)
print("n1="),round(n1,2)
print("no. of moles of CO2(n2)")
n2=(P2*V2)/(R*T2)
print("n2="),round(n2,2)
print("total no. of moles of mixture(n)in mol")
n=n1+n2
print("n="),round(n,2)
print("gas constant for N2(R1)in J/kg k")
R1=R/M1
print("R1="),round(R1,2)
print("gas constant for CO2(R2)in J/kg k")
R2=R/M2
print("R2=R/M2"),round(R2,2)
print("specific heat of N2 at constant volume (Cv1) in J/kg k")
Cv1=R1/(k1-1)
print("Cv1="),round(Cv1,2)
print("specific heat of CO2 at constant volume (Cv2) in J/kg k")
Cv2=R2/(k2-1)
print("Cv2="),round(Cv2,2)
print("mass of N2(m1)in kg")
m1=n1*M1
print("m1="),round(m1,2)
print("mass of CO2(m2)in kg")
m2=n2*M2
print("m2="),round(m2,2)
print("let us consider the equilibrium temperature of mixture after adiabatic mixing at T")
print("applying energy conservation principle")
print("m1*Cv1*(T-T1) = m2*Cv2*(T-T2)")
print("equlibrium temperature(T)in k")
T=((m1*Cv1*T1)+(m2*Cv2*T2))/((m1*Cv1)+(m2*Cv2))
print("=>T="),round(T,2)
print("so the equlibrium pressure(P)in kpa")
P=(n*R*T)/(1000*V)
print("P="),round(P,2)
Example 1.24, Page:34  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 24
volume of tank of N2(V1) in m^3= 3.0
volume of tank of CO2(V2) in m^3= 3.0
taking the adiabatic condition
no. of moles of N2(n1)
n1= 0.6
no. of moles of CO2(n2)
n2= 0.37
total no. of moles of mixture(n)in mol
n= 0.97
gas constant for N2(R1)in J/kg k
R1= 296.93
gas constant for CO2(R2)in J/kg k
R2=R/M2 188.95
specific heat of N2 at constant volume (Cv1) in J/kg k
Cv1= 742.32
specific heat of CO2 at constant volume (Cv2) in J/kg k
Cv2= 629.85
mass of N2(m1)in kg
m1= 16.84
mass of CO2(m2)in kg
m2= 16.28
let us consider the equilibrium temperature of mixture after adiabatic mixing at T
applying energy conservation principle
m1*Cv1*(T-T1) = m2*Cv2*(T-T2)
equlibrium temperature(T)in k
=>T= 439.44
so the equlibrium pressure(P)in kpa
P= 591.55

example 1.25;page no:35

In [25]:
#cal of specific heat of final mixture
#intiation of all variables
# Chapter 1
print"Example 1.25, Page:35  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 25")
m1=2;#mass of H2 in kg
m2=3;#mass of He in kg
T=100;#temperature of container in k
Cp1=11.23;#specific heat at constant pressure for H2 in KJ/kg k
Cp2=5.193;#specific heat at constant pressure for He in KJ/kg k
print("since two gases are non reacting therefore specific heat of final mixture(Cp)in KJ/kg k can be obtained by following for adiabatic mixing")
print("so the specific heat at constant pressure(Cp)in KJ/kg k")
Cp=((Cp1*m1)+Cp2*m2)/(m1+m2)
print("Cp="),round(Cp,3)
Example 1.25, Page:35  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 25
since two gases are non reacting therefore specific heat of final mixture(Cp)in KJ/kg k can be obtained by following for adiabatic mixing
so the specific heat at constant pressure(Cp)in KJ/kg k
Cp= 7.608

example 1.26;page no:35

In [26]:
#cal of capacity and pressure in the vessel
#intiation of all variables
# Chapter 1
print"Example 1.26, Page:35  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 26")
m1=18.;#mass of hydrogen(H2) in kg
m2=10.;#mass of nitrogen(N2) in kg
m3=2.;#mass of carbon dioxide(CO2) in kg
R=8.314;#universal gas constant in KJ/kg k
Pi=101.325;#atmospheric pressure in kpa
T=(27+273.15);#ambient temperature in k
M1=2;#molar mass of H2
M2=28;#molar mass of N2
M3=44;#molar mass of CO2
print("gas constant for H2(R1)in KJ/kg k")
R1=R/M1
print("R1="),round(R1,3)
print("gas constant for N2(R2)in KJ/kg k")
R2=R/M2
print("R2="),round(R2,3)
print("gas constant for CO2(R3)in KJ/kg k")
R3=R/M3
print("R3="),round(R3,3)
print("so now gas constant for mixture(Rm)in KJ/kg k")
Rm=(m1*R1+m2*R2+m3*R3)/(m1+m2+m3)
print("Rm="),round(Rm,3)
print("considering gas to be perfect gas")
print("total mass of mixture(m)in kg")
m=m1+m2+m3
print("m="),round(m,2)
print("capacity of vessel(V)in m^3")
V=(m*Rm*T)/Pi
print("V="),round(V,2)
print("now final temperature(Tf) is twice of initial temperature(Ti)")
k=2;#ratio of initial to final temperature
print("so take k=Tf/Ti=2") 
print("for constant volume heating,final pressure(Pf)in kpa shall be")
Pf=Pi*k
print("Pf="),round(Pf,2)
Example 1.26, Page:35  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 26
gas constant for H2(R1)in KJ/kg k
R1= 4.157
gas constant for N2(R2)in KJ/kg k
R2= 0.297
gas constant for CO2(R3)in KJ/kg k
R3= 0.189
so now gas constant for mixture(Rm)in KJ/kg k
Rm= 2.606
considering gas to be perfect gas
total mass of mixture(m)in kg
m= 30.0
capacity of vessel(V)in m^3
V= 231.57
now final temperature(Tf) is twice of initial temperature(Ti)
so take k=Tf/Ti=2
for constant volume heating,final pressure(Pf)in kpa shall be
Pf= 202.65

example 1.27;page no:36

In [27]:
#cal of exit to inlet diameter ratio
#intiation of all variables
# Chapter 1
import math
print"Example 1.27, Page:36  \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 27")
T1=(27.+273.);#initial temperature of air in k
T2=500.;#final temperature of air in k
print("let inlet state be 1 and exit state be 2")
print("by charles law volume and temperature can be related as")
print("(V1/T1)=(V2/T2)")
print("(V2/V1)=(T2/T1)")
print("or (((math.pi*D2^2)/4)*V2)/(((math.pi*D1^2)/4)*V1)=T2/T1")
print("since change in K.E=0")
print("so (D2^2/D1^2)=T2/T1")
print("D2/D1=sqrt(T2/T1)")
print("say(D2/D1)=k")
k=math.sqrt(T2/T1)
print("so exit to inlet diameter ratio(k)"),round(k,2)
Example 1.27, Page:36  
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 27
let inlet state be 1 and exit state be 2
by charles law volume and temperature can be related as
(V1/T1)=(V2/T2)
(V2/V1)=(T2/T1)
or (((math.pi*D2^2)/4)*V2)/(((math.pi*D1^2)/4)*V1)=T2/T1
since change in K.E=0
so (D2^2/D1^2)=T2/T1
D2/D1=sqrt(T2/T1)
say(D2/D1)=k
so exit to inlet diameter ratio(k) 1.29

example 1.28;page no:37

In [28]:
#cal of final pressure
#intiation of all variables
# Chapter 1
print"Example 1.28, Page:37 \n \n"
print("Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 28")
V=2;#volume of vessel in m^3
P1=76;#initial pressure or atmospheric pressure in cm of Hg
T=(27+273.15);#temperature of vessel in k
p=70;#final pressure in cm of Hg vaccum
R=8.314;#universal gas constant in KJ/kg k
M=2;#molecular weight of H2
print("gas constant for H2(R1)in KJ/kg k")
R1=R/M
print("R1="),round(R1,3)
print("say initial and final ststes are given by 1 and 2")
print("mass of hydrogen pumped out shall be difference of initial and final mass inside vessel")
print("final pressure of hydrogen(P2)in cm of Hg")
P2=P1-p
print("P2="),round(P2,2)
print("therefore pressure difference(P)in kpa")
P=((P1-P2)*101.325)/76
print("P="),round(P,2)
print("mass pumped out(m)in kg")
print("m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))")
print("here V1=V2=V and T1=T2=T")
m=(V*P)/(R1*T)
print("so m="),round(m,2)
print("now during cooling upto 10 degree celcius,the process may be consider as constant volume process")
print("say state before and after cooling are denoted by suffix 2 and 3")
T3=(10+273.15);#final temperature after cooling in k
print("final pressure after cooling(P3)in kpa")
P3=(T3/T)*P2*(101.325/76)
print("P3="),round(P3,3)
Example 1.28, Page:37 
 

Engineering Thermodynamics by Onkar Singh,Chapter 1,Example 28
gas constant for H2(R1)in KJ/kg k
R1= 4.157
say initial and final ststes are given by 1 and 2
mass of hydrogen pumped out shall be difference of initial and final mass inside vessel
final pressure of hydrogen(P2)in cm of Hg
P2= 6.0
therefore pressure difference(P)in kpa
P= 93.33
mass pumped out(m)in kg
m=((P1*V1)/(R1*T1))-((P2*V2)/(R1*T2))
here V1=V2=V and T1=T2=T
so m= 0.15
now during cooling upto 10 degree celcius,the process may be consider as constant volume process
say state before and after cooling are denoted by suffix 2 and 3
final pressure after cooling(P3)in kpa
P3= 7.546