Numerical Modeling of Foam Drilling Hydraulics

The use of foam as a drilling fluid was developed to meet a special set of conditions under which other common drilling fluids had failed. Foam drilling is defined as the process of making boreholes by utilizing foam as the circulating fluid. When compared with conventional drilling, underbalanced or foam drilling has several advantages. These advantages include: avoidance of lost circulation problems, minimizing damage to pay zones, higher penetration rates and bit life. Foams are usually characterized by the quality, the ratio of the volume of gas, and the total foam volume. Obtaining dependable pressure profiles for aerated (gasified) fluids and foam is more difficult than for single phase fluids, since in the former ones the drilling mud contains a gas phase that is entrained within the fluid system. The primary goal of this study is to expand the knowledge-base of the hydrodynamic phenomena that occur in a foam drilling operation. In order to gain a better understanding of foam drilling operations, a hydrodynamic model is developed and run at different operating conditions. For this purpose, the flow of foam through the drilling system is modeled by invoking the basic principles of continuum mechanics and thermodynamics. The model was designed to allow gas and liquid flow at desired volumetric flow rates through the drillstring and annulus. Parametric studies are conducted in order to identify the most influential variables in the hydrodynamic modeling of foam flow.

= right-hand side vector of the hydrodynamic formulation The Journal of Engineering Research Vol. 4, No.1 (2007)  = Vector containing the main unknowns of the hydrodynamic formulation

Introduction
The conventional method of drilling is to use either water-based or oil-based muds.However, the use of these drilling muds may result in increased formation damage or a significant reduced rate of penetration.Compared to conventional drilling, underbalanced or foam drilling has several advantages.These advantages include: avoidance of lost circulation problems, minimizing damage to pay zones, higher penetration rates and bit life.While air or mist drilling depends on high volumetric flow rate, foam drilling relies on bubble strength to remove the cuttings.There are also potential disadvantages to the use of foam for drilling.These include: corrosion, downhole fires, waste water disposal, and cost of consumables.Foam is composed of a continuous liquid phase that surrounds and traps the gaseous phase and the most common way to categorize foams is with respect to their qualities.Foam quality is the ratio of the gas volume to the total volume and is expressed as: (1) Raza and Marsden (1967) performed an empirical study of foam flow through tubes.They concluded that foams behave like a pseudoplastic fluid.David and Marsden (1969) took into consideration the fluid slippage at the tube wall and the compressibility of foam.They described the rheology of foam in terms of these two factors and described foam as a pseudoplastic fluid with low gel strength.In terms of foam rheology, one of the earliest studies was presented by Millhone, et al. (1972).They used a mathematical model to predict trends such as optimum gas and liquid flow rates, pressures, circulation time and solids-lifting capability of the drilling foam.In terms of investigating foam rheology, they plotted viscosity of foam versus quality of foam which indicates that the viscosity increases as the quality increases.Mitchell (1970) studied the viscosity of foam by performing experiments using capillary tubes.According to him, foam behaves similarly to a Bingham plastic fluid.His observations led him to ignore the wall slippage effect during foam flow.Beyer, et al. (1972) study was one of the first studies which included a mathematical model to describe the flow of foam in vertical pipes and annuli.The model was a 1-D, steady-state model that uses a Bingham Plastic model for all rheological calculations.Using the real gas law, Lord (1981) derived an equation of state for foams.He presented an equation of state that accounted for the presence of solids such as propants (utilized in hydraulic fracturing) or cuttings (in drilling operation).Sanghani and Ikoku (1982) used concentric annular pipe viscometer in their experiments performed to investigate the rheology of the foam.According to them, flowing foam behaves as a pseudoplastic fluid without a yield value for shear rates in the range 150 sec -1 to 1000 sec -1 and that when the quality is kept constant, effective viscosity becomes propor-tional to shear rate.Okpobiri and Ikoku (1986) proposed a semi-empirical method for predicting frictional pressure losses for the contiguous flow of foam and cuttings.A model that predicts the pressure drop across the bit nozzles for foams was also presented.Additionally, they came up with a technique to predict minimum volumetric requirements for foam and mist drilling operations.Ozbayoglu, et al. (2000) not only conducted experiments on foam rheology but also compared six different rheological models with the data obtained from their experiments.They observed that foam behaves like a Power Law fluid at lower qualities and behaves like a Bingham Plastic fluid for qualities above 90%.Ozbayoglu, et al. (2003) analyzed cutting transport phenomena with foam in horizontal and highly-inclined wells.They performed experiments to verify the results they obtained from the computer model.They developed a one-dimensional, three-layer model and calculated the fluid properties and pressure profile along the wellbore using the principles of mass and momentum balance equations for steady, isothermal conditions.Kuru, et al. (2004) proposed a new methodology for hydraulic optimization of foam drilling for maximizing drilling rate.The procedure includes the determination of optimum combination of gas/liquid ratio, back pressure and total flow area.They adopted Okpobiri and Ikoku's approach for bit pressure drop calculations.They proposed a linear relationship between the optimum back pressure and the depth of the well.Lourenço, et al. (2004) carried out an empiricallybased study which explored the effects of foam quality, foam texture, pressure, temperature, and geometry of the conduit on the rheology of the foam.They concluded that texture of the foams also has a significant influence on viscosity.The authors also stated that wall slippage is another important parameter in characterizing foam flow.They developed empirical correlations for the slippage coefficient that are independent of foam quality.Ozbayoglu, et al. (2005) investigated the effect of bubble size and texture of the foam on its rheological properties.According to the authors, even if foam qualities and flow conditions are kept constant, the rheological properties also change with changes in surfactant.Li and Kuru (2005) recently presented a 1-D, unsteady-state, twophase mechanistic model of cuttings transport with foam in vertical wells.The model predicts optimum foam flow rate and rheological properties to maximize the cuttings transport efficiency.

Description of the Model
A single-phase, one-dimensional, steady-state hydraulic model is developed to describe the flow of foam inside the drillstring and annuli.Foam flow is considered to be that of a pseudo-single phase (homogeneous model) and it is assumed that the flow can be fully characterized by solving the equations of conservation simultaneously.The continuity and momentum equations that describe the system of one-dimensional, area-averaged governing equa- tions written in their non-conservative forms, written for the foam mixture, are given below: Continuity: (2) Momentum Balance: (3) These two equations are used in the proposed hydraulic model expressed in customary field units.For simplicity, the effect of temperature is superimposed in the model by implementing prescribed temperature gradients.As a consequence of this, an energy balance equation was not required since it is assumed that the wellbore temperature gradient is known and can be inputted.The assumption here is that injection of foam has little impact on the wellbore temperature, which is dominated by the thermal condition of the surroundings (ie.geothermal gradients that are particular to the region).Once the temperature gradient is known, the following equation is used to calculate the temperature at each pipe increment: (4)

Closure Relationships
The closure relationships that define the various parameters of the mass and momentum balance equations are presented and discussed below.These parameters are the wall shear force (F w ) the gravitational force (F g ), equation of state, and rheological model.Field units, as incorporated in the hydraulic model, are used throughout this section.
Wall Shear Force (F w ): Wall shear force per unit volume (lb f /ft 3 ) between the wall and the fluid is calculated a function of the Fanning friction factor: (5) where the wetted area per unit volume (A w ) is defined as: (6) Inside the drillpipe, which is a single pipe system, the wetted area becomes: (7) Inside the annulus, where the flow occurs between two pipes, the wetted area becomes: where R 1 and R 2 are the radii of the outer and inner pipe in the annulus respectively and the "d" represents the diameter of the corresponding pipe.
The Fanning friction factor (f w ) is calculated as a function of Reynolds number (Re).Reynolds number is a dimensionless factor that incorporates fluid's density, velocity, effective viscosity and hydraulic diameter (d h ) and it is expressed as: For circular tubes, the hydraulic diameter is calculated as the wetted equivalent diameter, which is computed as shown below: (10) For a single circular tube, this definition becomes: (11) while for two concentric tubes, one writes: Once the Reynolds number and the equivalent diameter are calculated, the friction factor can be estimated.To determine the friction factor, the flow must be determined to be either laminar or turbulent.By convention, when the Reynolds number is less than 2100, laminar flow is present.The analytical expression from the Moody chart can then be used: (13) For turbulent flow, an explicit form of the Colebrook correlation derived by Chen (1979) is used in this study.This correlation is written in terms of Reynolds Number and pipe roughness (ε) takes the form: is the temperature gradient (°F/ft) defined by the user and Äx (ft) is the incremental segment length.
With the use of wetted area and friction factor, the wall shear force (F w ) can be determined after calculation of density and velocity.Density is obtained from the thermodynamic model which is based on the equations of state for liquids and gases presented below.Velocity is obtained by solving the mass and momentum balance equations.
Gravitational Force (F g ): The gravitational force term takes into consideration the density change with depth and the inclination of the well.For a homogeneous fluid, the gravitational force (F g ) can be expressed as: (15) Equation of State: Foam is composed of a gas and a liquid phase.In this study, the thermodynamic properties of these two phases are computed using the Peng-Robinson (1976) equation of state and the slightly compressible model for the gas and liquid phases, respectively.The equation of state for the liquid phase is written as: where the cubic polynomial form of the Peng-Robinson EOS is solved for the Z factor using Newton-Raphson technique.The equation of state for the foam is written in terms of quality, as shown below: (18) Foam Viscosity: Sanghani and Ikoku (1982) studied foam rheology and correlated the power law index (n) and consistency index (K) in terms of foam quality.Li and Kuru (2005) modified these indices by performing regressional analysis on the data generated in Sanghani and Ikoku's work and proposed the following equations: For 0.915 < Γ < 0.98: For Γ < 0.915: Once the K and n indices are obtained, the effective viscosity of the foam is calculated from the equation devel-oped by Sanghani and Ikoku (1982).For flow within the drillpipe, the effective foam viscosity is calculated as: (20a) and for flow through the annulus, 4. Pressure Drop Across the Bit Okpobiri and Ikoku (1982) proposed the following implicit model for estimating bit pressure drop (∆P b ) for foam flow: (21a) where:

Handling Cuttings
Based on the values of rate of penetration (ROP), porosity, densities of the formation fluids and formation rock at bottomhole conditions, and the saturation distribution of the formation fluids, the proposed model calculates actual mixture density values within the annulus by taking the weighted average of the foam and cuttings densities in terms of mass flow rate.Cuttings are introduced to the system after the bit, and they are composed of solids, water, oil, and gas coming out of formation.The mass flow rate of cuttings is calculated as:

T T P P
where â is the volumetric thermal expansivity and ê is the isothermal compressibility.The equation of state for the gas phase is written in terms of the compressibility factor as follows: where: The subscripts "w", "o", and "g" stand for formation water, oil, and gas, respectively.The mixture density calculation that includes the effect of both cuttings and foam is: where the subscript "f" stands for the value of cuttingsfree foam density obtained through Eq. ( 18).Mixture density (ρ m ) replaces cuttings-free foam density during hydraulic calculations (Eqs. 2 and 3) taking place within the annulus.

Numerical Procedure
Equations ( 2) and (3) represent a system of first-order ordinary differential equations (ODEs) that describe the hydrodynamics of foam flow.Pressure and velocity are the two principal unknowns of the system, while temperature is defined by the geothermal gradient, as described by Eq. ( 4).In order to solve the set of ordinary differential equations simultaneously, the Runge-Kutta method is used in this study.This study implements the method proposed in the hydrodynamic model of Ayala and Adewumi (2003), based on the Cash & Karp Embedded Runge-Kutta procedure, described by Press et al. (1994).In this method, the differential equations are written in a matrix form as follows: (24) where [A] is a 2x2 square matrix and [B] is a 2x1 column matrix.The derivative matrix [U] is called the solution vector, which includes both pressure and velocity values.One must write Eq. ( 24) explicitly in terms of the derivative matrix [U] in order to make it suitable for Runge-Kutta procedure as shown below: Therefore, the two differential equations that compose the model (Eqs. 2 and 3) can thus be written in a form analogous, in field units, as shown below: (28) Runge-Kutta method calculates the solution vector U(x + ∆x) as a function of U o .As stated in the above section, U(x) contains pressure and velocity of the fluid for this study.The method gives the fifth estimate as: (29) (30) (31)

Results and Discussion
The influence of different input parameters on foam flow can be evaluated separately.The parameters that are considered to be influential on foam flow calculations through a drillstring are: geometry of the system (ie.pipe diameters), geothermal gradient of the field, quality of the foam at the surface, total flow rate at standard conditions, and rate of penetration (ROP).A base case was constructed so that the effect of each parameter is analyzed with respect to a certain reference point.For the base case, foam consists of nitrogen and water with flow rates of 2 MSCF/min and 5 gal/min respectively at 5,000 psia and 65°F.Table 1 summarizes these conditions, where it is assumed that the hole is cased for most of the total depth and that the influence of the openhole section on the hydrodynamics of the flow is minimal.In the subsequent sections, this case will be used as the base-line for comparison purposes.
where F i a values are constant coefficients proposed by Cash & Karp (1990).
F i F values are obtained by using the [R] matrix calculated from Eq. ( 26) as: Then the final solution fo r U(x+Äx) can be calculated by expanding Eq. ( 29) as: ( ) Figure 1 shows the pressure and temperature profiles in the drillstring and annulus.Pressure increases as depth increases towards the bottom of the well and starts to decrease as the flow goes through the annulus.This is an indication that the gravitational force is dominant as compared to frictional force.The steeper slope in the annulus section reflects the fact that both the gravitational and frictional forces are formed in the opposite direction of the flow.Figure 2 demonstrates that, although there is a significant change in pressure throughout the wellbore, the velocity of the foam does not change significantly except for the sections where the geometry of the system changes.The two sharp changes in velocity indicate the presence of a diameter change.The reason for the small slope in the velocity profile in Fig. 2 (drillstring and annulus) can be explained by Fig. 3, which shows the density profiles.As it is seen from Fig. 3, foam density changes slightly except for the section where the transition from the drillstring to the annulus takes place.That section is the place where the cuttings enter the foam and make it heavier mostly because of the more dense rock particles.Since the velocity calculations are mostly driven by the density, for the case of drillstring and annulus, no dramatic change is seen in the velocity distribution.
In Fig. 4, a different slope in the quality profiles of the drillstring and annulus can be easily recognized.As given in Eq. ( 1), foam quality depends on both gas and liquid volumes.However, since the liquid is assumed to be slightly compressible and there is no condensation of gas, the change in the volume of the liquid phase is negligible.Therefore, there is an increase in foam quality inside the drillstring because of the increase in gas volume (decrease in gas density).The decrease in density is the result of the fact that rather than pressure effect, temperature effect dominates the gas density calculations.Throughout the annulus, pressure and temperature work together to make the gas density decrease with steeper slope and that makes the quality more affected.

Effect of Quality
The quality of foam at the surface can be changed either by changing the gas and liquid injection flow rates specified at standard conditions or by altering injection conditions (P i , T i ).The effect of different values of initial quality on the hydrodynamics of the system is investigated by changing injection rate specification at standard conditions.To understand the effect of quality, the program was tested with a constant gas flow rate of 2-MSCF/min and with three different liquid flow rates of 12.5, 8.85, and 2.64-gal/min forming a foam with qualities of 80%, 85% and 95%. Figure 5 shows the pressure profiles for different quality values at surface injection conditions.In this plot, one can see that as the quality at the surface decreases, the slope of the pressure profile increases because of the higher density of low quality foams.The opposite effect on velocity profile is demonstrated in Fig. 6.Lower qualities imply higher density values because of the higher liquid fraction.This fact is seen in Fig. 7. Changes in surface quality become unimportant after the bit because of the contribution of the higher density rock particles to foam density.The surface quality affects only the magnitudes of quality profiles.The trends are all the same for four different surface qualities (Fig. 8).

Effect of Temperature Gradient vs. Isothermal Assumption
Injection pressure, psia 5,000 Injection temperature, °F 65 Total Depth, ft 10,000 q g at the injection point, MSCF/min 2 q l at the injection point, gal/min 5 Quality at the injection point, Ã 90.9% Two different temperature gradients other than the base case were tested using the proposed model.One of them is a quite large value (0.03 °F/ft) whereas the other one is taken as 0 °F/ft which represents isothermal conditions.The effect of temperature gradient can be clearly seen from all of the plots given in Figs. 9 to 12. Figure 9 shows that as the temperature increases more rapidly, the slope of the pressure profile decreases.This is because of the direct influence of temperature gradient on the pressure derivative calculations in Eq. ( 28).One can easily see that the temperature gradient has a positive contribution to  The main reason for most of the changes in the hydrodynamics of the system lies on Fig. 11 which shows the foam density profiles with changing temperature gradients.Since the gas density is highly dependent on temperature, when there is a change in temperature, it is reflected first in the density, then in the quality, and finally in pressure and velocity.There is a clear difference in foam density trends in Fig. 11.In fact the density profile changes its trend from a negative slope to a positive slope.This result can be explained by real gas law.Since temperature is inversely proportional to gas density, when the geothermal gradient changes, an effect in density trend is expected.The gradient selected for the base case makes the density profile almost flat.That is why when the gradient is changed; the slope changes its sign.As a consequence of this, quality trends are similar to the ones in the density profiles (Fig. 12).

Effect of Total Flow Rate
In a foam system, the quality can be kept constant even when the flow rates of gas and liquid phases are changed if the properties between gas and liquid phases are maintained.Therefore one can increase or decrease the total flow rate while keeping the surface quality constant.In this section, the analysis of the total flow rate was done by using three different combinations of gas and liquid rate.Table 2 summarizes these combinations.
As it can be seen from Figs. 13 through 15, the effect of total flow rate is not significant in the drillstring.In fact, it only changes the initial velocity of the foam which makes the velocity profiles different from each other (Fig. 14).Since the model uses the ratio of the gas and liquid flow rates rather than the total flow rate as a parameter used in the calculations, changing only the total flow rate without a change in quality does not play an important role.The real effect can be seen after the bit where the new density of the system is calculated using the total mass flow rate which is calculated from the initial gas and liquid flow rates.Since the rate of penetration was kept constant for this analysis, the mass flow rate after the bit is directly proportional to the initial flow rates.This fact is reflected in all profiles.As the total flow rate increases the slope of the pressure (Fig. 13) and quality profiles (Fig. 15) also increase.This is mostly because of the change in gravitational force.

Effect of Wellbore Dimensions
This section discusses the effect of the wellbore geometry which consists of the inner and outer diameters of drillpipes, drillcollars, and inner diameter of the casing.Bit diameter and casing setting depth were kept constant since the changes in diameters of pipes are considered to be sufficient to see the effect of the geometry.The diameters of different pipes are shown in Table 3.
Most standard drillpipe, drillcollar, and casing sizes are bounded by the minimum and maximum reference values indicated in Table 3.In this section, the effect of broad changes in the dimensions of casing, drill pipe, and drill collars on the hydrodynamic profiles is demonstrated.For instance, the effect of smaller diameter can be easily recognized in Figs.16 to 18.The effect of larger diameter is not significant because its cross-sectional area is relatively close to the one of the base case.On the other hand, the cross-sectional area of the 2.5-in diameter pipe is almost one of tenth of the pipe with 7.5 in diameter.Since the area directly affects the velocity, there is significant difference of the velocity profiles inside the drillpipe (Fig. 17).The difference in velocity profiles affects the frictional force calculations, although the gravitational force is not affected at all.The influence of this difference can be clearly seen in the pressure and quality profiles clearly (Figs.16 and 18).

Effect of Rate of Penetration (ROP)
Cuttings mass flow rate is controlled by the rate of penetration and the bit diameter.However, if the bit diameter is changed to analyze the effect of cuttings, then other pipe diameters should also be changed in order to maintain reasonable results.That would cause a change in well geometry whose effect is discussed separately.Therefore, changing the ROP is used to analyze the effect of cuttings entering the fluid system.Four different ROP values were considered: 0 ft/min (no penetration, only circulation), 0.25 ft/min, 0.5 ft/min (base case) and 1 ft/min.As with the nozzle size effect and since the cuttings are introduced into the system after the bit, only the plots in the annulus were included.mostly affects the density of the fluid after the bit which is in a direct relationship with gravitational force values inside the annulus.As a consequence, the pressure profiles are very different from each other.The change in density also triggers differences in quality and velocity profiles since they are both directly dependent on density.

Conclusions
This study has presented and developed a one-dimensional, steady-state hydraulic model of underbalanced drilling operations using foam.The model was tested for various injection conditions, well depths, foam qualities, bit and wellbore sizes, and temperature gradients to gain a better understanding of their influence on the overall drilling operation.Conclusions derived from this work are described below: • The quality of foam or the volume fraction of gas is directly affected by the density of the gas, which is impacted by variations in system pressure and temperature.Moreover, when the change in temperature is larger or smaller than the change in pressure, a change in density and a corresponding change in the quality of foam occurs.• The assumption of isothermal conditions is not a reasonable assumption for the system under consideration given the impact of temperature on gas density and the corresponding impact of gas density on the quality of foam.• The quality of foam as realized at the wellhead can be predetermined by varying the volumetric flow rate of the gas and liquid, which in turn changes the mixture's density at the surface.The changes in foam quality at the surface impact the pressure trends and velocity profiles with depth in the wellbore.These effects become negligible after the cuttings are mixed into the foam fluid because the change in fluid density is negligible compared to that of the cuttings density.• If the proportion of gas and liquid is kept constant, variations in total volumetric flow rate do not change the quality of the foam.The impact is seen however in the difference in total mass flow rate.The change in total mass flow rate does not affect the other variables in drillstring except for the velocity.
• The gravitational force is almost always dominant when compared to that of the frictional force, and results in an increase in pressure when moving downhole.For the upward flow in the annulus, a decrease in pressure is experienced given that both the gravitational and frictional forces act together against fluid pressure.• The magnitude of velocity of the fluid flowing inside a wellbore is highly dependent on the density of the fluid.When the density is kept constant, it is seen that the change in velocity profile is negligible.However, if the density change is large enough, a significant change in velocity is observed.
contribution to dx dP .This fact reflects itself in Fig. 10 by affecting the velocity profile trend.The velocity profile changes its trend into the opposite

Table 2 . Combination of gas and liquid flow rates (Effect of total flow rate) ID dp, in OD dp, in ID dc, in OD dc, in
Figures 19 to 21 indicate that the ROP

Table 3 . Pipe diameters used in wellbore geometry analysis direction
as the temperature gradient increases inside the drillstring.For the base case, the effects of pressure change and temperatur e gradients were compensating each other so that the change in velocity was gradual.Since pressure and temperature changes have an opposite effect on fluid density, accounting for both effects is critical in hydrodynamic studies.