5.7. Cover Gas Flow and Pressure Calculations

5.7.1. Introduction

After the hydraulics calculations for the liquid flows and pressures have been completed for a time step, then the liquid temperatures are calculated, and, after they have been completed, the cover gas flows and pressures are computed. The cover gas treatment is a fully implicit calculation, ignoring the inertial effects of the gas, and modeling the flow as quasi-static and isothermal. It may be thought of as a modification of the liquid flow treatment in which the left side of Eq. (5.2-1) is set to zero and θ1 and θ2 set to zero and one, respectively, in Eq. (5.2-18).

The gas process may be thought of in the following way. Only compressible volumes containing cover gas are considered. Some may also contain liquid and some only gas. For those containing liquid, the liquid level has risen or dropped, as determined by the hydraulics calculations earlier in the time step, and the cover gas has been compressed or expanded by this action. The compression or expansion is assumed to be adiabatic, and new equilibrium conditions are calculated. Next, heat transfer between the gas and the liquid is computed, assuming that the gas temperature approaches that of the liquid without affecting the liquid temperature. Finally, taking all compressible volumes with cover gas, the gas flow between compressible volumes through connecting pipes is computed, and the temperatures, pressures, and masses of the gases in the compressible volumes are adjusted appropriately.

5.7.2. Basic Equations

In the compressible volumes with cover gas and liquid, the hydraulics routines provide the rise or fall in the liquid level during the time step, thereby giving the change in the cover gas volume during the time step. Let V03 be the volume of the cover gas before the liquid level change and V3 after the level change. The process is assumed to be adiabatic, and the pressure p03 after the change in terms of the pressure p03 before is given by

(5.7-1)p03=p03(V03V3)γ

and the accompanying new gas temperature Tg is given by the ideal gas law as:

(5.7-2)Tg=p03V3m3R

where

γ = the ratio of the specific heat at constant pressure to that at constant volume for the gas

m3 = the cover gas mass at the beginning of the time step

R = the universal gas constant

Heat transfer between the cover gas and the liquid is also accounted for. Since the heat capacity of the gas is much less than that of the liquid, it is assumed that the gas temperature approaches the liquid temperature with a time constant τ without affecting the liquid temperature. The time constant τ is a user-supplied input quantity. The adjusted gas temperature T3 is taken as

(5.7-3)T3=Tgττ+Δt+T1Δtτ+Δt

where

Tl = the temperature of the liquid

Δt = the time step

The new gas temperature means a new gas pressure p3, which is computed again by the ideal gas law as

(5.7-4)p3=m3RT3V3

With p3, V3, T3, and m3 now known for compressible volumes with or without liquid present, we turn to the gas flow through the pipes between compressible volumes. The difference in pressure between two connected compressible volumes causes gas flow from one to the other, and the amount of gas delivered to or withdrawn from a compressible volume in turn modifies the gas pressure in it. As a result, the pressure changes in all of the compressible volumes are solved for simultaneously.

The gas mass flow rate, Fij, from compressible volume i to compressible volume j is approximated at the end of the time step as

(5.7-5)Fij=Foij+F1ijΔp(j)+F2ijΔp(i)

Here Foij is the gas mass flow rate at the beginning of the time step from compressible volume i to compressible volume j. This flow rate is modified by the pressure changes in the compressible volumes i and j as a result of the flow during the time step. The coefficients of the pressure changes are taken as

(5.7-6)F1ij=Foij[p(i)p(j)]
(5.7-7)F2ij=Foij[p(i)p(j)]

where p(i)p(j) is the pressure difference between compressible volumes i and j at the beginning of the time step. Also

(5.7-8)Δp(i)=p4(i)p3(i)

where

p3(i) = the gas pressure in compressible volume i at the beginning of the time step

p4(i) = the gas pressure in compressible volume i at the end of the time step

The flow equation for isothermal unchoked flow of an ideal gas is given by Shapiro [5-3] as:

(5.7-9)fLDh=1[p(i)p(j)]2γM2ln[p(i)p(j)]2

where

f = the Moody friction factor

L = the length of the pipe

Dh = the hydraulic diameter of the pipe

p(i) = the inlet pressure

p(j) = the outlet pressure

γ = the ratio of the specific heat at constant pressure to that at constant volume for the gas

M = the Mach number

The Moody [5-2] friction factor is given by:

(5.7-10)f=0.0055[1+(20000εD+106Re)1/3]

where

ε = the pipe roughness

D = the pipe diameter

Re = the Reynolds number

In addition the Reynolds number can be written as

(5.7-11)Re=FoijADμ

where

A = the pipe area

μ = the viscosity of the gas

and the Mach number is related to the gas mass flow rate Foij by

(5.7-12)γM2=(FoijA)2RTγ

For turbulent flow, the gas mass flow rate is determined by an iterative process. With an initial built-in guessed value for f, Eq. (5.7-9) and Eq. (5.7-12) determine a value for Foij, which is used in Eq. (5.7-10) to calculate a new value for f, and the iteration is continued until consistency is achieved. For laminar flow, Foij is determined from Eq. (5.7-9) and Eq. (5.7-12) using the laminar flow value for f of

(5.7-13)f=64Re

5.7.3. Solution

The results of the gas flow between compressible volumes, where a compressible volume may be connected by gas segments to several other compressible volumes, can be written as:

(5.7-14)p4(i)=p3(i)(1+εi)
(5.7-15)m4(i)=m3(i)+δmi
(5.7-16)T4(i)=p4(i)V4(i)m4(i)R

where

(5.7-17)εi=γm3(i)T3(i)jTjiΔmji
(5.7-18)δmi=m4(i)m3(i)=jΔmji
(5.7-19)Δmi=Δt[Foji+F1jiΔp(i)+F2jiΔp(j)]

and Tji is the temperature of the gas flowing from compressible volume j to compressible volume i. Combining Eq. (5.7-14), Eq. (5.7-8), Eq. (5.7-17), and Eq. (5.7-19) yields a matrix equation of the form

(5.7-20)(c11c12......c21c22..........................................)(Δp(1)Δp(2)............)= (d1d2............)

where

(5.7-21)cij=δij[1p3(i)γΔtm3(i)T3(i)kTkiF1ki]p3(i)γΔtm3(i)T3(i)TjiF2ji

and

(5.7-22)di=p3(i)γΔtm3(i)T3(i)jTjiFoji

Here δij is the Kronecker delta.

The matrix equation 5.7-20 is solved by Gaussian elimination for the Δp(i). These are added to the pressures at the beginning of the time step to obtain the corresponding pressures at the end of the time step. The cover gas mass at the end of the time step m4(i) in each compressible volume is computed using Eq. (5.7-18) and Eq. (5.4-31), and finally the gas temperatures at the end of the time step T4(i) are computed for each compressible volume using the equation

(5.7-23)T4(i)=p4(i)V4(i)m4(i)R

All of the final values are then stored in COMMON blocks.

A solution algorithm for the entire cover gas treatment is given in Section 5.16.3.