# Chapter 2 : Basic Concepts Of Thermodynamicsm¶

### Example 2.1 Page no : 41¶

In [3]:
# Variables
rho_Hg = 13596.; 			#kg/m**3
g = 9.806; 			#m/s**2
h = 0.76; 			#m

# Calculations and Results
P = rho_Hg*g*h/1000; 			#kPa

h1 = 0.80; 			#m
P1 = h1/h*P;
print "(i) Pressure of 80 cm of Hg %.3f kPa"%P1

print ("(ii) 30 cm Hg vacuum")
H2 = 0.30; 			#cm Hg vacuum
h2 = h-H2; 			#cm of Hg absolute

P2 = h2/h*P;
print "Pressure due to 46 cm of Hg %.3f kPa"%P2

rho_H2O = 1000; 			#kg/m**3
h3 = 1.35; 			#m
P3 = rho_H2O*g*h3/1000;
print "(iii) Pressure due to 1.35 m H2O gauge %.3f kPa"%(P3)

P4 = 4.2*10**2;
print "(iv) 4.2 bar %.3f kPa"%(P4),

(i) Pressure of 80 cm of Hg 106.658 kPa
(ii) 30 cm Hg vacuum
Pressure due to 46 cm of Hg 61.328 kPa
(iii) Pressure due to 1.35 m H2O gauge 13.238 kPa
(iv) 4.2 bar 420.000 kPa


### Example 2.2 page no : 42¶

In [4]:
import math

# Variables
d = 0.1; 			#m
F = 1000.; 			#N

# Calculations
A = math.pi/4*d**2; 			#m**2
P = F/A/10**3;

# Results
print "Pressure on the piston = %.3f kN/m**2"%(P),

Pressure on the piston = 127.324 kN/m**2


### Example 2.3 page no : 42¶

In [5]:
# Variables
SG = 0.9;
h = 1.2; 			#m
g = 9.81; 			#m/s**2
rho_w = 1000.; 			#kg/m**3

# Calculations
rho = SG*rho_w; 			#kg/m**3
P = rho*g*h/10**3;

# Results
print "Gauge pressure P = %.3f kN/m**2"%(P)

Gauge pressure P = 10.595 kN/m**2


### Example 2.4 page no : 43¶

In [6]:
# Variables
Vacuum_recorded = 740.; 			#mm of Hg
Barometric_reading = 760.; 			#mm of Hg

# Calculations

# Results
print "Absolute pressure in the condenser = %.3f Pa"%(Absolute_pressure),

Absolute pressure in the condenser = 2668.000 Pa


### Example 2.5 page no : 43¶

In [8]:
import math

# Variables
d = 0.5; 			#m
h = 0.75; 			#m
m = 4.; 			#kg
Manometer_reading = 620.; 			#mm of Hg above atmosphere
Barometer_reading = 760.; 			#mm of Hg
V = math.pi/4*d**2*h; 			#m**3
print ("(i) Total pressure in the vessel")

# Calculations and Results
print "P = %.3f bar"%(P)

print ("(ii) Specific volume and density")
SV = V/m;
print "Specific volume = %.3f m**3/kg"%(SV)

D = m/V;
print "Density = %.3f kg/m**3"%(D),

(i) Total pressure in the vessel
P = 1.841 bar
(ii) Specific volume and density
Specific volume = 0.037 m**3/kg
Density = 27.162 kg/m**3


### Example 2.6 page no : 43¶

In [9]:
# Variables
h0 = .761; 			#m
h = .55; 			#m
g = 9.79; 			#m/s**2
rho = 13640.; 			#kg/m**3

# Calculations
P = rho*g*(h0+h); 			#N/m**2

# Results
print "Gas pressure = %.3f bar"%(P/10**5),

Gas pressure = 1.751 bar


### Example 2.7 page no : 44¶

In [10]:
# Variables
h_H2O = 34.; 			#mm of Hg
g = 9.81; 			#m/s**2
rho = 13600.; 			#kg/m**3
P_Hg = 97.5; 			#mm of Hg
P_atm = 760.; 			#mm of Hg

# Calculations
P_H2O = h_H2O/13.6; 			#mm of Hg
Pabs = rho*g*(P_Hg+P_atm-P_H2O)/10**8; 			#bar

# Results
print "absolute pressure  = %.3f bar"%(Pabs)

absolute pressure  = 1.141 bar


### Example 2.8 page no : 44¶

In [11]:
# Variables
SG = 0.8;
rho_H2O = 1000.; 			#kg/m**3
g = 9.81; 			#ms**2
h = 0.17; 			#m
Patm = 1.01325; 			#bar

# Calculations
rho = SG*rho_H2O; 			#kg/m**3
P_liq = rho*g*h/10**5; 			#bar
P_gas = Patm - P_liq;

# Results
print "gas pressure =  %.3f bar"%(P_gas),

gas pressure =  1.000 bar


### Example 2.9 page no : 45¶

In [12]:
import math

# Variables
d = 0.2; 			#m
g = 9.81; 			#m/s**2
h = 0.117; 			#m
rho = 13600.; 			#kg/m**3

# Calculations
p = rho*g*h;
m = (p*math.pi/4*d**2)/g;

# Results
print "mass = %.3f kg"%(m),

mass = 49.989 kg


### Example 2.10 page no : 49¶

In [13]:
# Variables
v = 800.; 			#m/s
g = 9.; 			#m/s**2
F = 3600.; 			#N

# Calculations
m = F/g;
KE = 1./2*m*v**2./10**6;

# Results
print "Kinetic Energy = %.3f MJ"%(KE),

Kinetic Energy = 128.000 MJ


### Example 2.11 page no : 49¶

In [15]:
import math

# Variables
m = 6.; 			#kg
T1 = 25.; 			#0C
T2 = 125.; 			#0C

print ("(i) Heat transferred")

# Calculations and Results
def f18(T):
return m*(0.4+0.004*T)

print "heat tranferred = %.3f kJ"%(Q)

print ("(ii) Mean specific heat of the gas")
c_n = Q/m/(T2-T1);
print "Mean specific heat = %.3f kJ/kg.0C"%(c_n),

(i) Heat transferred
heat tranferred = 420.000 kJ
(ii) Mean specific heat of the gas
Mean specific heat = 0.700 kJ/kg.0C


### Example 2.12 page no : 50¶

In [7]:
import math
from numpy import *
# Variables
Ice_point = 0.;
Steam_point = 100.;

# Calculations
P = [[math.log(1.5),1],[math.log(7.5),1]];
Q = [0,100];
X = linalg.inv(P)*Q;

a = X[0,1];
b = X[1,1];
p = 3.5;
t = a*math.log(p)+b;

# Results
print ("The value of temperature is given by %.3f")%(t),("°C")

The value of temperature is given by 52.646 °C


### Example 2.13 page no : 50¶

In [18]:
def func(t):
return 0.20*t-5*10**(-4)*t**2
# Variables # Calculations
t1 = 0; 			#0C
e1 = func(t1);
t2 = 100; 			#0C
e2 = func(t2);
t3 = 70; 			#0C
e3 = func(t3);
t = e3*(t2-t1)/e2-e1;

# Results

thermocouple will read 77.0 °C


### Example 2.15 page no : 51¶

In [19]:
# Variables
p = 101.325; 		#kPa
V2 = 0.6; 			#m**3
V1 = 0; 			#m**3

# Calculations
W = p*(V2-V1);

# Results
print ("work done by atmosphere = "),(-W),"kJ"

work done by atmosphere =  -60.795 kJ


### Example 2.16 page no : 52¶

In [4]:
from scipy import integrate

# Variables
#p = 1.013*10**5; 	#N/m**2
p = lambda x: 1.013*10**5
V1 = 1.5; 			#m**3
V2 = 0; 			#m**3

# Calculations

# Results
print ("W = "),(integ/10**3),"kJ"

W =  -151.95 kJ


### Example 2.17 page no : 53¶

In [21]:
import math

# Variables
T = 1.25; 			#N.m
N = 9500.;
p = 101.3; 			#kPa
d = 0.65; 			#m
L = 0.6; 			#m

# Calculations
W1 = 2*math.pi*N*T/1000; 	#kJ
A = math.pi/4*d**2; #m**2
W2 = p*A*L; 		#kJ
Wnet = (-W1)+W2;

# Results
print "The net work transfer for the system = %.3f"%(Wnet),"kJ"

The net work transfer for the system = -54.444 kJ


### Example 2.18 page no : 53¶

In [22]:
# Variables
A = 45.*10**(-4); 	  #m**2
P = 0.9*10**5; 		  #N/m**2
Patm = 1.013*10**5;   #N/m**2
L = 0.05; 			  #m

# Calculations
dV = 300.*10**(-6); 			#m**3
W = P*A*L-Patm*dV;

# Results
print ("net work done  = "),(W),"J"

net work done  =  -10.14 J


### Example 2.19 page no : 54¶

In [23]:
import math

# Variables
p1 = 1.5; 			#bar
p2 = 7.5; 			#bar
V1 = 3/p1;
V2 = 3/p2;

# Calculations
def f19( V):
return 3./V*10**2

# Results
print "Work done = %.3f"%(W),"kJ"

Work done = -482.831 kJ


### Example 2.20 page no : 55¶

In [13]:
import math

# Variables
W = 150; 			#kJ
V1 = 0.6; 			#m**3

# Calculations and Results
V2 = (8-math.sqrt(64-4*2*2.58))/4; 			#m**3
print ("Final volume  = %.3f")%V2,"m**3"

p2 = 8-4*V2;
print "Final pressure  = %.2f"%p2,"bar"

Final volume  = 0.354 m**3
Final pressure  = 6.58 bar


### Example 2.21 page no : 56¶

In [20]:
import math

# Variables
p1 = 3.*10**5; 			#Pa
v1 = 0.18; 			#m**3/kg
p2 = 0.6*10**5; 			#Pa

# Calculations
C = p1*v1**2;
v2 = math.sqrt(C/p2);

def f17( v):
return C/v**2

# Results
print ("Work done = %d")%(W),("Nm/kg")

# Note : output would be differ as rounding error is there. v2 has rounding off error.

Work done = 29850 Nm/kg


### Example 2.22 page no : 57¶

In [26]:
import math

# Variables
m = 1.; 			#kg
p1 = 20.*10**5; 	#Pa
V1 = 0.05; 			#m**3

# Calculations
V2 = 2*V1;
p2 = p1*(V1/V2)**2;
C = p1*V1**2;
V3 = V1;

def f20( V):
return C/V**2


Net work done  =   25000.0 Nm