You are on page 1of 20

A COMPUTATIONAL STUDY OF

GAS TANK DICHARGING

Author: Marian Nedelcu


Freelance researcher
Email:
ned_marian@yahoo.com

ABSTRACT
This paper aims to investigate the theoretical problem of discharging of a pressurized
tank. A quasi one dimensional flow is considered in both supersonic and subsonic regimes.
Using Matlab time changes in parameters of flow during subsonic and supersonic flow
is studied.
INTRODUCTION
Pressurization and depressurization of gas vessels occur in numerous industrial
processes and gas storage applications and are also of fundamental interest.
The objectives of the analysis are to predict the pressure, temperature, and density of
the gas in the tank and the mass flow rate out of the tank as functions of time during the
discharge process.
DEVELOPEMENT OF PHENOMENOLOGICAL MODEL
A model for the charging or discharging process of a vessel filled with air is applied to
the control volumes depicted in Fig. 1. The air is assumed to behave as an ideal gas, and the
flow through the thoat (exit, in the case of discharging tank) will be approximated as
isentropic. However, because of the possibility of heat transfer to or from the surroundings,
the air inside the tank is assumed to undergo a more general polytropic process, as shown in
Eqn. (1). The model will also allow for the polytropic constant n to vary with time, as will be
considered later in this work. Allowing for a general, time-varying polytropic exponent n
precludes a closed-form solution; therefore a numerical solution is developed.

Figure 1. Gas tank discharging model


The model of gas tank comprises the two main element: an enough large reservoir that
allow to assume contant density, pressure and temperature in the entire volume, and a

convergent-divergent nozzle through which the gas is released to the athmosphere. For
evolution of parameters of state three important layers are considered. Layer 1 is a section
through the gas tank where the gas is considered in stagnation state (velocity is very small and
is considere zero). Layer 2 is the a vertical to the throat (the smallest section of the nozzle)
where the gas can reaches the speed of under specifric conditions. Layer 3 is the exist
section of the nozzle.
Processes are sometime modeled as an idealized type of process called a
quasiequilibrium (or quasistatic) process. A quasiequilibrium process is one in which the
departure from thermodynamic equilibrium is at most infinitesimal. All states through which
the system passes in a quasiequilibrium process may be considered equilibrium states.
ASSUMPTIONS
To accomplish these objectives the control volume shown in Fig. 1, which lies just inside the
vessel walls, is used. In addition, the following assumptions are made:
1. Properties of the gas in the tank are spatially uniform at any instant of time (i.e.,
quasi-steady or uniform state assumption);
2. Average velocity of the gas in the tank is zero;
3. Opening modeled as an ideal converging or converging-diverging nozzle with
isentropic flow to the nozzle throat;
4. One-dimensional flow and properties in the nozzle;
5. Neglect gravitational potential energy;
6. No shear or shaft work for the control volume;
7. Gas is thermally and calorically perfect;
8. Thermodynamic process is politropic.
If we choose the adiabatic process this would be expected to be a good model for very
rapid discharge processes in which case there would be little time for significant heat transfer
between the tank walls and the gas. On the other hand, the isothermal process is expected to
be appropriate for slow vessel discharge processes whereby there is sufficient time for heat
transfer to maintain the temperature of the gas in the vessel constant.

IDEAL GAS RELATIONSHIPS


Before developing the compresibble flow equations, the ideal gas properties are
evaluated. The equation of state is for an ideal gas is:

p RT

(1)

where p, , and T are pressure, density and pressure of gas, and R is the ideal gas
constant.
In thermodynamic analysis various form of energy is considered that make up the total
energy of a system. The sum of all the microscopic forms of energy is called the internal
energy and is denoted by u.
For an ideal gas, the internal energy is directly proportional to temperature, and can be
expressed as:
(
du cv dT

(2)

where cv is the specific heat at constant colume.


The fluid property entalpy of a gas is defines as:

( p
hu

(3)

The entalpy as internal energy is a function of temperature and can be expressed as:

dh c p dT

(4)

where cv, and cp are specific heats at constant volume and pressure. Having definitions
of internal energy and entalpy and equation of state (6) the following relationship can be
derived:

c p cv R

(5)

If the specific heat ration , is defined as

cp
cv

then combining equations (8) and (9) leads to;

(6)

cp

R
1

(7)

cv

1
R
1

(8)

Another extensive property of a thermodynamic system is entropy, as a measure of


dosprder. According to the second law of thermodynamics the entropy of an isolated system
never decreases.
The change in entropy (S) of a system was originally defined as:

dQ
T

(9)

For any pure substance include ideal gases, the first Tds equationis [1]

1
(
Tds du pd

(10)

and the second Tds equation is

Tds dh

dp

(11)

The second law of thermodynamics requires that the adiabatic and frictionless flow of
any fluid results ds=0. Constant entropy flow is called isentropic flow.
For an isentropic flow the most useful relationship is:

p
const.

(12)

The polytropic procees was coined to describe any reversible process or any open or
closed system of gas which involves bothe heat and work transfer.

A polytropic process is a quasiequilibrium process described by [1]

p
const.
n

(13)

An alternate derivation is to evaluateb equation (1) between two states 1 and 2 to


obain:

p2 2

p1 1

(14)

Mach number is defined as the ratio of the value of the local flow velocity, u,, to the
local speed of sound c.

u
c

(15)

For an isentropic flow the speed of sound can be calculated using:

dp
d

(16)

c RT

(17)

c
or

INTEGRAL FORM OF CONSEERVATION LAWS OVER A CONTROL VOLUME


Any fluid flow is guverning by the general equations of mass, momentum and enery
equations.
For finite control volume the mass conservation law states that the time rate of mass
change in the system must be equal the rate of max influx into control volume.

dV CS V ndA 0
t CV

(18)

The Newtons seond law equation for a control volume of fluid provide the
relationship between the time rate of change of the linear momentum of the system and sum
of external forces acting on the system [2]:

of
V dV CS V V ndA Fthecontents
t CV
control volume

(19)

The first law of thermodynamics state that the time rate of increase of total stored
energy of the system is equal with the sum of the net time rate of heat and work tranfered into
system [2].

&
e dV e V ndA Q&net W&
net

t CV
in CV
in
CS

(20)

Where:

V2
eu
gz
2

is the total energy per unit of mass and is ralated to the internal energy
per unit of mass u, the kinetic energy per unit of mass V2/2, and the potential energy
per unit of mass, gz;
Q&net
in

&
W&
net
in

is the net rate of heat transfer into system;


is the net work rate transfer into the system;

In many cases the work is tranfered across the control surface by moving a shaft and
the power transfered is related to the shaft toques T and angular velocity, shaft,
W&shaft T shaft
. In the case of liniar motion of the shat the power transfered is related to
W&shaft Fvshaft
the tranlational force F, and the speed of the shaft,vshaft,(
.
Work transfer can also occur at the control surface when a force associated with fluid
normal stress acts over a distance.For our study, the fluid normal stress, , is simply equal
with the negative pressure. The power transfer due to normal stress is:

W&normal
stress

pV ndV

(21)

SV

Using information developed about the power then the first law of thermodynamics for
a control volume can be written as:

p V2

e dV u
gz V ndA Q&net W&shaft

t CV
2
in CV
in

CS

(22)

DIFFERENTIAL FORM OF CONSEERVATION LAWS


If we take the control volume very small, as a cubical element, then the integral form
of mass conservation, given be equations (1), (2) and (5), become [2]:

u v w

0
t
x
y
z

(23)

In the same way the linear momentum law can be written in differential form as [2]:

u
u
u
u v w g x xx yx zx
x
y
z
x
y
z
t

(24)

xy yy zy
u
v
v
v
u v w gy

x
y
z
x
y
z
t

(25)

w
w
w

u
v
w g z xz yz zz
x
y
z
x
y
z
t

(26)

where:

detones the normal stresses, and the tangential stresses;


u,v, and w are the components of velocity vector V, in a orthogonal system of axis
(x,y,z);

The shearing stresses are developed in a fluid because of viscousity of the fluid. For
some common fluid as air or water the viscousity is small, and therefore it seems
resonable to asume under some circumstance the effect of viscousity as neglijable (and
thus the shearing forces). For fluids that in which there are no shearing forces the normal
stress is independent of direction and :

xx yy zz p

(27)

For an insviscid flow equation of momentum conservation are referred as Eulers


equation of motion and are reduced to:

u
u
u
u
p
u v w gx
x
y
z
x
t

(28)

u
v
v
v
p
u v w gy
x
y
z
y
t

(29)

u
w
w
w
p
u
v
w gz
x
y
z
z
t

(30)

Having an infinetisimal control volume the energy equation of an inviscid fluid can be
written in differential form as:

e u v w &

Qnet
t
x
y
z
in

(31)

where
, and
into the control volume .

W&shaft 0
in

because there can be no infinitesimal shaft protruding

ONE DIMENSIONAL FLOW


In one dimensional flow there are not a special interest in studing the variation of
parameters in cross section, but their variation along flow axis. The parameters are considered
constant on cross section and they are taken as averaged.
Integrating the differential equations of conservation over a cross section yields:

A uA

0
t
x

(32)

u
p
u
u
x
x
t

(33)

Ae
p u2
uA u gz Q&net
t
x
2
in

(34)

Under first assumption made above the mass conservation equation for a steady one
dimenasional flow can be written as:

dm0
x u x A x
dt

(35)

where m0 is mass inside the tank volume V, which can be expressed as V, Au and , u
and A denote the density, velocity and cross section area of a layer of nozzle, with coordinate
x.
For a steady-state inviscid flow momentum equation of momentum conservation can
be written in differential form as:

udu

dp
0

(36)

If we consider that the flow occurs with no heat and work exchanges with sorounding,
ate steady state, then the equation of energy conservation has differential form as follow:

dh udu 0

(37)

The above differential equations of conservation can be derived in a discrete form


when we write parameters between two layer of flow.
For an isentropic process the equations of momentum and energy conservation
becomes similar.
QUASI ONE DIMENSIONAL FLOW IN DISCRETE FORM
If we apply the energy equation (37) betwenn the layers of study yealds:

RT0
RT1 u12
RT2 u22
1
1
1

(38)

Rearaging the therms and using the Mach number in above relationships yelds

T0
1 2
1
M
T
2

(39)

Using the politropic process relationship followings formulas can be derived [2]
1

(40)

(41)

0
1 2 n 1
1
M

2

p0
1 2 n 1
1
M
p
2

Parameters having substript 0 are known as stagnation parameters, because


characterize the fluid where its velocity is zero.
If we consider the mass conservation equation we can put it in the following
differential form:

d du dA

u
A

(42)

udu

dp
0

Combining above relationship with momentum equation


and definition
2
dp c d
of spped of sound
we obtain the following relationship between velocity change
and area change in isentropic duct flow.

(43)

du dA 1
dp

2
2
u
A M 1
u

Inspection of this equation, without actually solving it, reveals a fascinating aspect of
compressible flow: Property changes are of opposite sign for subsonic and supersonic flow
because of the term M2 - 1.
In order to calculate the mass flow we have to consider the energy as:

u 2 2c pT T0 T 1

(44)

If we substitute the velocity from above relationship and politropic relationships

T T0 p p0

n 1

and

0 p p0

1n

p RT0 p p0

2 p
m& p0 A

RT0 1 p0

2n

p
1
p0

1n

n 1

as:

(45)

The maximum mass flux is reached when ratio between ambient pressure (back

pressure) and stagnation pressure is


n 1.4 pb p0 0.528

2
pb p0

. For and adiabatic process of air

Substituting the relationship (41) of pressure ratio in mass flux equation (43) yields
m& p0 A

RT0

(46)

1 2
M
2

1
2 1

The maximum flux flow coccurs at the section of minimum flow area when M=1.

If we analyse the mass flux for two different layers and make their ration then the ratio
of areas as a function of Mach numbers is obtained:

A2 M 1

A1 M 2

(47)

1 2 2 1
1
M 2
2
1 2
1
M1
2

An relation that relates flow area with Mach number can be obtained from Equation
(45) as [3]:

M 2 1 dM

dA

A 1 1 M 2 M
2

We observe that at the throat

dA dx 0 dM M 0

(48)

unless M=1.

NUMERICAL SIMULATION
A matlab program was developed (Appendix 2) to analize time variation fo parameters in
different layers. The tank properties, gas properties and ambient pressure were set as inputs
for program (Appendix 1).
The flow is chocked, and Mach number in the throat is 1, during 67.4 seconds (Figure
1.), then becomes subsonic. During the chocked phase 70.82% of gas mass is discharged and
the pressure drops with 99.99%. The tank looses gas almost exponnentially in time.
Pressures in each layer decrease asimptotically to ambient pressure (Figure 2).

Figure 2 Time Variation of Mach Number

Figure 2. Time Variation of Pressures

Figure 4 Time Variation of Temperatures

Figure 5 Time Variation of Velocities

Exit temperature dropped linear during the chocked flow, then remains
aproximativelly constant to 278 K (50C). The inside temperature and the temperature in the
throat has close values and go down to the exit temperature.
Velocity of the gas at the throat decrease and tend to be equal with velocity at exit
section.

Figure 6 Time Variation of Mass Loss

CONCLUSION
The flow regime is determined by the ratio between ambient pressure and pressure in
the tank.
The pressure drops drastically during the supersonic flow, and tank loses a major
portion of gas.

APPENDIX 1
Table 1 INPUT VALUES OF NUMERICAL SIMULATION
Symbol

R
V
dcr
de
patm
p0
T0

Parameter
Unit of measure
Specific heat ratio
Dimensionless
Gas constant
J/(KgK)
Volume of the tank
m3
Dimeter of the throat
m
Diameter of exit section
m
of nozzle
Atmospheric pressure
Pa
Initial pressure in the
Pa
tank
Initial temperature in
K
the tank

Value
1.4
287.058
1
0.01
0.015
101325
1013250
500

APPENDIX 2 MATLAB SCRIPT


% ------------------------------------------------------------------------% GAS TANK DISCHARGING
% QUASI ONE DIMENSIONAL FLOW
% ------------------------------------------------------------------------% Author: Marian Nedelcu
% Data: September 13, 2015
% ------------------------------------------------------------------------clear all;
clc;
n=1.35;
% politropic coefficient
gama=1.4;
% specific heat ratio
cp=gama/(gama-1);
% specific heat at constant pressure
R=287.058;
% gas constant [286 J/KgK] at standard condition
V=1;
% the volume of tank [m^3]
dcr=0.01;
% diameter of throat section [m]
de=0.015;
% diameter of exit section [m] - divergent
if dcr<de
Acr=pi()*dcr^2/4;
% area of the critical section [m^2]
Ae=pi()*de^2/4;
% area of exit section [m^2]
patm=100000;
% ambient pressure [Pa]
p0=10*patm;
% pressure inside the tank [Pa]
T0=500;
% temperature inside the tank [K}
rho0=p0/(R*T0);
pc=patm*((gama+1)/2)^(gama/(gama-1)); % critical pressure
dt=0.1;
% the time step
nn=1000;
% the number of time steps
t=zeros();
% time vector
rho=zeros();
% density inside the tank politropic
process
p=zeros();
% pressure inside the tank politropic
process
p_a=zeros();
% pressure inside the tank adiabatic
process
T=zeros();
% temperature inside the tank
politropic process
T_a=zeros();
% pressure inside the tank adiabatic
process
ucr=zeros();
% velocity at the throat
Tcr=zeros();
% temperature in critical section
Mcr=zeros();
% mach number in crtitical section
pcr=zeros();
% pressure in critical section
rhocr=zeros();
% density in critical section
Me=zeros();
% mach number at exit
ue=zeros();
% velocity exit
pe=zeros();
% pressure exit
rhoe=zeros();
% density exist
Te=zeros();
% temperature exit
i=1;
t(i)=0;
Ti=T0;
% initial pressure;
pi=p0;
% initial temperature
rhoi=pi/(R*Ti);
% initial density;
mi=rhoi*V;
% initial mass of gas
p0_a=p0;
%
T0_a=T0;
while p0>patm && i<=nn
% process lasts till internal pressure
becomes equal with ambient pressure
% FLOW IN CONVERGENT PART OF NOZZLE

rho(i)=rho0;
% density inside the tank [Kg/m^3]
p(i)=p0/10^5;
% pressure inside the tank [bar]
politropic process
p_a(i)=p0_a/10^5;
% pressure inside the tank [bar]
adiabatic process
T(i)=T0;
% temperature inside the tank [K]
politropic process
T_a(i)=T0_a;
% temperature inside the tank [k]
adiabatic process
if p0>pc
M1=1;
% Mach number is 1 for chocked flow
else
M1=sqrt(2/(gama-1)*((p0/patm)^((gama-1)/gama)-1)); % unchocked
flow
end
T1=T0/(1+M1^2*(gama-1)/2);
% energy conservatiom
rho1=rho0*(T1/T0)^(1/(gama-1)); % politropic transform
p1=rho1*R*T1;
% state equation in critical section
u1=M1*sqrt(gama*R*T1);
% isentropic flow
Tcr(i)=T1;
% temperature in critical section [K]
rhocr(i)=rho1;
% density in critical section
pcr(i)=p1/10^5;
% pressure in critical section [bar]
ucr(i)=u1;
% velocity in critical section [m/s]
Mcr(i)=M1;
% mach number in critical section
% EXPANSION IN DIVERGENT PART OF NOZZLE
f=@(m)(Ae/Acr-M1/m*((1+(gama-1)/2*m^2)/(1+(gama1)/2*M1^2))^((gama+1)/2/(gama-1)));
M2=fzero(f,0.2);
T2=T0/(1+(gama-1)/2*M2^2);
u2=M2*sqrt(gama*R*T2);
p2=p0*(T2/T0)^(gama/(gama-1));
rho2=rho0*(T2/T0)^(1/(gama-1));
dm1=rho1*u1*Acr;
dm2=rho2*u2*Ae;
Me(i)=M2;
ue(i)=u2;
pe(i)=p2/10^5;
Te(i)=T2;
% PARAMETERS AT NEXT MOMENT OF TIME
rho0=rho0-rho1*u1*Acr/V*dt;
% stagnation density at next time
p0=p0*(rho0/rho(i))^n;
% politropic transform
p0_a=p0_a*(rho0/rho(i))^gama;
% adiabatic process
T0=p0/(R*rho0);
% state equation
T0_a=p0_a/(R*rho0);
% state equation
t(i+1)=t(i)+dt;
i=i+1;
end
t=t(1:end-1);
MM=Mcr(1);
i=1;
while MM==1
i=i+1;
MM=Mcr(i);
end
if i==1
str1='The flow is only subsonic - unchoked';
disp(str1);
else
disp('SUPERSONIC REGIME');
str1=strcat('Period of time:',num2str(t(i-1)),'seconds');
disp(str1);

dm=(rhoi-rho(i-1))/rhoi*100;
dp=(pi-p(i-1))/pi*100;
dT=(Ti-T(i-1))/Ti*100;
str2=strcat('Mass loss:',num2str(dm),'%');
str3=strcat('Pressure drop:',num2str(dp),'%');
disp (str2);
disp(str3);
end
dmm=(rhoi-rho)/rhoi*100;
figure(1);
clf;
plot(t,p,t,pcr,t,pe);
title ('Pressure vs time');
xlabel('time [s]');
ylabel('pressure [bar]');
grid on;
legend('stagnation','critical','exit');
figure(2);
clf;
plot(t,T,t,Tcr,t,Te);
title ('Temperature vs time');
xlabel('time [s]');
ylabel('temperature [K]');
grid on;
legend('stagnation','critical','exit');
figure(3);
clf;
plot(t,ucr,t,ue);
title ('Velocity vs time');
xlabel('time [s]');
ylabel('velocity [m/s]');
legend('crtical','exit');
grid on;
figure(4);
clf;
plot(t,Mcr,t,Me);
title ('Mach number');
xlabel('time [s]');
ylabel('mach number');
legend('crtical','exit');
grid on;
figure(5);
clf;
plot(t,T,t,T_a);
title ('Temperaure poliropic vs adiabatic process');
xlabel('time [s]');
ylabel('[K]');
legend('politropic','adiabatic');
grid on;
figure(6);
clf;
plot(t,dmm);
title ('Mass Loss vs Time');
xlabel('time');
ylabel('percent');
grid on;
else
disp('The throat must have the smallest diameter');
disp('Choose the exit diamater higher the critical diameter')
end

References
[1 M. J. Michael, S. N. Howard, B. D. Daisie and B. B. Margaret, Fundamentals of
] Engineering Thermodynamics, 7th ed., Wiley, 2011.
[2 B. R. Muson, T. H. Okiishi, W. W. Huebsch and A. P. Rothmayer, Fundamentals
] of fluid Mechanics, Seventh ed., Wiley, 2013.
[3 M. A. Saad , Compressible Fluid Flow, New Jersey: Prentice-Hall, 1985.
]
[4 F. P. Incropera and P. D. Dewitt, Fundamentals of Heat and Mass Transfer,
] Seventh ed., John Wiley & Sons, Inc, 2011.

You might also like