blob: b2a2191094cc151ed06d48fd47e8c8bd2fa3bd84 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
//Chapter-4,Example 13,Page 112
//Title:Final temperature and amount of gas entering the tank
//================================================================================================================
clear
clc
//INPUT
V=1;//volume of tank in m^3
T0=300;//initial temperature of ideal gas in K
P0=0.1;//initial pressure of ideal gas in MPa
T=500;//temperature of ideal gas in the pipeline in K
P=3;//pressure of ideal gas in the pipeline in MPa
R=8.314;//universal gas constant in J/molK
gaamma=1.4;//ratio of the molar heat capacities at constant pressure and constant volume for ideal gas (no unit)
//CALCULATION
Pf=3;//final pressure reached in the tank in MPa
//calculation of final temperature of the gas in the tank in K using Eq.(4.44) (and applying u=Cv*T, h=Cp*T and N=P*V/R*T as the gas is taken to be ideal)
Tf=(Pf*10^6)/((((Pf*10^6)-(P0*10^6))/(gaamma*T))+((P0*10^6)/T0));
//calculation of the moles of ideal gas entering into the tank using Eq.(4.44) (and applying u=Cv*T, h=Cp*T and N=P*V/R*T as the gas is taken to be ideal)
N=(V/R)*(((Pf*10^6)/Tf)-((P0*10^6)/T0));
//OUTPUT
mprintf('\n The final temperature= %0.1f K\n',Tf);
mprintf('\n The amount of gas that has entered the tank= %0.2f mol\n',N);
//===============================================END OF PROGRAM===================================================
|