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 \(\theta_{1}\) and \(\theta_{2}\) set to zero and one, respectively, in Eq. 5.2-17.

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 \(V_{03}\) be the volume of the cover gas before the liquid level change and \(V_3\) after the level change. The process is assumed to be adiabatic, and the pressure \({p'}_{03}\) after the change in terms of the pressure \(p_{03}\) before is given by

(5.7‑1)

\[{p'}_{03} = p_{03} \left( \frac{V_{03}}{V_{3}} \right)^{\gamma}\]

and the accompanying new gas temperature \(T_{\text{g}}\) is given by the ideal gas law as:

(5.7‑2)

\[T_{\text{g}} = {p'}_{03} \frac{V_{3}}{m_{3} R}\]

where

\(\gamma\) = the ratio of the specific heat at constant pressure to that at constant volume for the gas

\(m_3\) = 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 \(\tau\) without affecting the liquid temperature. The time constant \(\tau\) is a user-supplied input quantity. The adjusted gas temperature \(T_{3}\) is taken as

(5.7‑3)

\[T_{3} = T_{\text{g}} \frac{\tau}{\tau + \Delta t} + T_{1} \frac{\Delta t}{\tau + \Delta t}\]

where

\(T_{\text{l}}\) = the temperature of the liquid

\(\Delta t\) = the time step

The new gas temperature means a new gas pressure \(p_{3}\), which is computed again by the ideal gas law as

(5.7‑4)

\[p_{3} = m_{3} \frac{RT_{3}}{V_{3}}\]

With \(p_{3}\), \(V_3\), \(T_{3}\), and \(m_{3}\) 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, \(F_{\text{ij}}\), from compressible volume \(i\) to compressible volume \(j\) is approximated at the end of the time step as

(5.7‑5)

\[F_{\text{ij}} = F_{\text{oij}} + F_{1\text{ij}} \Delta p\left( j \right) + F_{2\text{ij}} \Delta p\left( i \right)\]

Here \(F_{\text{oij}}\) 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)

\[F_{1\text{ij}} = \frac{- F_{\text{oij}}}{\left\lbrack p\left( i \right) - p\left( j \right) \right\rbrack}\]

(5.7‑7)

\[F_{2\text{ij}} = \frac{F_{\text{oij}}}{\left\lbrack p\left( i \right) - p\left( j \right) \right\rbrack}\]

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

(5.7‑8)

\[\Delta p\left( i \right) = p_{4}\left( i \right) - p_{3}\left( i \right)\]

where

\(p_{3} \left( i \right)\) = the gas pressure in compressible volume \(i\) at the beginning of the time step

\(p_{4} \left( i \right)\) = 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)

\[f \frac{L}{D_{\text{h}}} = \frac{1 - \left\lbrack \frac{p \left( i \right)}{p\left( j \right)} \right\rbrack^{2}}{\gamma M^{2}} \ln{\left\lbrack \frac{p \left( i \right)}{p\left( j \right)} \right\rbrack}^{2}\]

where

\(f\) = the Moody friction factor

\(L\) = the length of the pipe

\(D_{\text{h}}\) = the hydraulic diameter of the pipe

\(p \left( i \right)\) = the inlet pressure

\(p \left( j \right)\) = the outlet pressure

\(\gamma\) = 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 \left\lbrack 1 + \left( 20000 \frac{\varepsilon}{D} + \frac{10^{6}}{\text{Re}} \right)^{1/3} \right\rbrack\]

where

\(\varepsilon\) = the pipe roughness

\(D\) = the pipe diameter

\(\text{Re}\) = the Reynolds number

In addition the Reynolds number can be written as

(5.7‑11)

\[\text{Re} = \frac{F_{\text{oij}}}{A} \frac{D}{\mu}\]

where

\(A\) = the pipe area

\(\mu\) = the viscosity of the gas

and the Mach number is related to the gas mass flow rate \(F_{\text{oij}}\) by

(5.7‑12)

\[\gamma M^{2} = \left( \frac{F_{\text{oij}}}{A} \right)^{2} \frac{RT}{\gamma}\]

For turbulent flow, the gas mass flow rate is determined by an iterative process. With an initial built-in guessed value for \(f\), Eqs. 5.7-9 and 5.7-12 determine a value for \(F_{\text{oij}}\), 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, \(F_{\text{oij}}\) is determined from Eqs. 5.7-9 and 5.7-12 using the laminar flow value for \(f\) of

(5.7‑13)

\[f = \frac{64}{\text{Re}}\]

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)

\[p_{4}\left( i \right) = p_{3}\left( i \right) \left( 1 + \varepsilon_{\text{i}} \right)\]

(5.7‑15)

\[m_{4} \left( i \right) = m_{3}\left( i \right) + \delta m_{\text{i}}\]

(5.7‑16)

\[T_{4}\left( i \right) = \frac{p_{4} \left( i \right) V_{4} \left( i \right)}{m_{4} \left( i \right) R}\]

where

(5.7‑17)

\[\varepsilon_{\text{i}} = \frac{\gamma}{m_{3} \left( i \right) T_{3}\left( i \right)} \sum_{\text{j}}{T_{\text{ji}} \Delta m_{\text{ji}}}\]

(5.7‑18)

\[\delta m_{\text{i}} = m_{4} \left( i \right) - m_{3} \left( i \right) = \sum_{\text{j}}{\Delta m_{\text{ji}}}\]

(5.7‑19)

\[\Delta m_{\text{i}} = \Delta t \left\lbrack F_{\text{oji}} + F_{1\text{ji}} \Delta p \left( i \right) + F_{2\text{ji}} \Delta p\left( j \right) \right\rbrack\]

and \(T_{\text{ji}}\) is the temperature of the gas flowing from compressible volume \(j\) to compressible volume \(i\). Combining Eqs. 5.7-14, 5.7-8, 5.7-17, and 5.7-19 yields a matrix equation of the form

(5.7‑20)

\[\begin{split} \begin{pmatrix} c_{11} & c_{12} & \text{......} \\ c_{21} & c_{22} & \text{......} \\ \text{......} & \text{......} & \text{......} \\ \text{......} & \text{......} & \text{......} \\ \end{pmatrix} \begin{pmatrix} \Delta p\left( 1 \right) \\ \Delta p\left( 2 \right) \\ \text{......} \\ \text{......} \\ \end{pmatrix} = \ \begin{pmatrix} d_{1} \\ d_{2} \\ \text{......} \\ \text{......} \\ \end{pmatrix}\end{split}\]

where

(5.7‑21)

\[c_{\text{ij}} = \delta_{\text{ij}} \left\lbrack 1 - \frac{p_{3} \left( i \right) \gamma \Delta t}{m_{3} \left( i \right) T_{3} \left( i \right)} \sum_{\text{k}}{T_{\text{ki}} F_{1\text{ki}}} \right\rbrack - \frac{p_{3} \left( i \right) \gamma \Delta t}{m_{3} \left( i \right) T_{3} \left( i \right)} T_{\text{ji}} F_{2\text{ji}}\]

and

(5.7‑22)

\[d_{\text{i}} = \frac{p_{3} \left( i \right) \gamma \Delta t}{m_{3} \left( i \right) T_{3} \left( i \right)} \sum_{\text{j}}{T_{\text{ji}} F_{\text{oji}}}\]

Here \(\delta_{\text{ij}}\) is the Kronecker delta.

The matrix equation 5.7-20 is solved by Gaussian elimination for the \(\Delta p \left( i \right)\). 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 \(m_4 \left( i \right)\) in each compressible volume is computed using Eqs. 5.7-18 and Eq. (5.4-31), and finally the gas temperatures at the end of the time step \(T_{4} \left( i \right)\) are computed for each compressible volume using the equation

(5.7‑23)

\[T_{4}\left( i \right) = \frac{p_{4} \left( i \right) V_{4} \left( i \right)}{m_{4} \left( i \right) 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.