Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
WATER DETECTION FOR GEOSTEERING IN DIRECTIONAL DRILLING
Document Type and Number:
WIPO Patent Application WO/2021/240196
Kind Code:
A1
Abstract:
Systems and methods are provided for geosteering in directional drilling based on water detection. An exemplary method includes determining a signal-to-noise ratio (SNR) for an electromagnetic communication between devices on a bottom hole assembly, and determining a distance to water based, at least in part, on the SNR. Adjustments to geosteering vectors for the bottom hole assembly are determined based, at least in part, on the distance to water.

Inventors:
MARSALA ALBERTO (SA)
DONZIER ERIC (FR)
Application Number:
PCT/IB2020/000529
Publication Date:
December 02, 2021
Filing Date:
May 26, 2020
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
SAUDI ARABIAN OIL CO (SA)
OPENFIELD TECH (FR)
International Classes:
E21B47/026; E21B7/04; G01V3/30
Foreign References:
US20070256832A12007-11-08
US20160041296A12016-02-11
GB2563739A2018-12-26
US20120111561A12012-05-10
Attorney, Agent or Firm:
SANTARELLI (FR)
Download PDF:
Claims:
Claims

What is claimed is:

1. A method for geosteering in directional drilling, comprising: determining a signal-to-noise ratio (SNR) for an electromagnetic communication between devices on a bottom hole assembly; determining a distance to water based, at least in part, on the SNR; and determining adjustments to geosteering vectors for the bottom hole assembly based, at least in part, on the distance to water.

2. The method of claim 1, wherein the electromagnetic communication is performed between instrumented mandrels on the bottom hole assembly.

3. The method of claim 1, further comprising determining a trend in the distance to water.

4. The method of claim 3, further comprising determining the adjustments to the geosteering vectors for the bottom hole assembly based, at least in part, on the trend in the distance to water.

5. The method of claim 1, further comprising determining the adjustments to the geosteering vectors for the bottom hole assembly based, at least in part, on a geophysical model.

6. The method of claim 1, further comprising: communicating measurements from a first mandrel to a second mandrel; and logging the measurements in a data store in the second mandrel.

7. The method of claim 6, further comprising transmitting the measurements to a surface facility from the second mandrel.

8. The method of claim 1, further comprising drilling a wellbore in an underbalanced condition using a coiled tubing drilling apparatus.

9. The method of claim 1, further comprising making the adjustments to the geosteering vectors to change a trajectory of a wellbore.

10. The method of claim 9, further comprising making the adjustments to the geosteering vectors in a controller in the bottom hole assembly.

11. The method of claim 1, further comprising measuring temperature.

12. The method of claim 1, further comprising measuring a hydrocarbon content in a two phase stream.

13. The method of claim 1, further comprising measuring a gas content in a two-phase stream.

14. The method of claim 1, further comprising measuring flow velocity.

15. The method of claim 1, further comprising measuring pressure.

16. A system for geosteering in directional drilling, comprising a bottom hole assembly comprising: a coiled tubing drilling apparatus; at least two mandrels mounted on the coiled tubing drilling apparatus, wherein each mandrel comprises an electromagnetic communication device; a controller to determine a distance to a water layer based, at least in part, on electromagnetic communications between the at least two mandrels; and a drill bit.

17. The system of claim 16, wherein the controller determines the distance based on a reflection of the electromagnetic communications from a water layer.

18. The system of claim 16, wherein the controller determines the distance based on a reflection of the electromagnetic communications from a water layer.

19. The system of claim 16, further comprising a sealed surface system to allow the coiled tubing drilling apparatus to drill in an underbalanced configuration.

20. The system of claim 16, further comprising a pressure sensor.

21. The system of claim 16, further comprising a velocity sensor.

22. The system of claim 16, further comprising a temperature sensor.

23. The system of claim 16, further comprising a conductivity probe.

24. The system of claim 16, further comprising a mud pulse telemetry system.

25. The system of claim 16, further comprising a steering actuator to change a direction of the bottom hole assembly.

26. The system of claim 16, further comprising the controller, wherein the controller comprises: a processor; and a data store, wherein the data store comprises instructions that, when executed, direct the processor to: determine a signal-to-noise ratio (SNR) for an electromagnetic communication between devices on a bottom hole assembly; determine a distance to water based, at least in part, on the SNR; and determine adjustments to geosteering vectors for the bottom hole assembly based, at least in part, on the distance to water. 27. The system of claim 26, wherein the data store comprises instructions that, when executed, direct the processor to make adjustments to the geosteering vectors.

Description:
WATER DETECTION FOR GEOSTEERING IN DIRECTIONAL

DRILLING

Background [0001] The production of crude oil and other hydrocarbons starts with the drilling of a wellbore into a hydrocarbon reservoir. In many cases, the hydrocarbon reservoir is a narrow layer of material in the subterranean environment, making efficient targeting of the wellbore important for productivity. Accordingly, directional drilling is often used to direct a drill bit to form a wellbore in the reservoir layer. [0002] Drilling may be performed by a rotating drill string, which uses the rotation of the drill string to power a bit to cut through subterranean layers. Changing the orientation of the bit for directional drilling may be performed using a mud motor, for example, by stopping the rotation of the drill string and activating the mud motor to power the drill bit while the drill string is slid forward down the well, while a bent section of the bottom hole assembly orients the drill string in a new direction. Any number of other techniques have been developed to perform directional drilling.

[0003] More recent developments have been in the use of coiled tubing drilling for directional drilling. Directional drilling using coiled tubing may be performed by a mud motor used with hydraulic actuators to change the direction of the bit. [0004] Controlling the direction of the drill string in directional drilling, termed geosteering herein, may be done using any number of techniques. In early techniques, drilling was halted and downhole instrumentation, coupled to the surface by a wireline, was lowered into the wellbore. The wireline instrumentation was used to collect information on the inclination of the end of the wellbore and a magnetic azimuth of the end of the wellbore. This information was used in concert with the depth of the end of the wellbore, for example, measured by the length of the wireline or drill string, to determine the location of the end of the wellbore at a point in time, termed a survey. Collection of a number of surveys was needed to determine the changes needed in drilling operations for geosteering a wellbore to a reservoir layer.

Summary

[0005] An embodiment described herein provides a method for geosteering in directional drilling. The method includes determining a signal-to-noise ratio (SNR) for an electromagnetic communication between devices on a bottom hole assembly, and determining a distance to water based, at least in part, on the SNR. Adjustments to geosteering vectors for the bottom hole assembly are determined based, at least in part, on the distance to water.

[0006] Another embodiment described herein provides a system for geosteering in directional drilling, comprising a bottom hole assembly. The bottom hole assembly includes a coiled tubing drilling apparatus and at least two mandrels mounted on the coiled tubing drilling apparatus, wherein each mandrel comprises an electromagnetic communication device. A controller is included to determine a distance to a water layer based, at least in part, on electromagnetic communications between the at least two mandrels. The system includes a drill bit.

Brief Description of Drawings

[0007] Figure 1 is a schematic drawing of a method for geosteering a well during directional drilling using electromagnetic (EM) communication to determine proximity to a water layer.

[0008] Figure 2 is a drawing of an instrumented bottom hole assembly (BHA) that may be used for geo-steering in directional drilling in coiled tubing drilling (CTD) using gas parameter measurements.

[0009] Figure 3 is a schematic drawing of fluid flow through a sensor equipped mandrel.

[0010] Figure 4 is a schematic drawing of geosteering in a well.

[0011] Figure 5 is a process flow diagram of a method for using EM communication between mandrels for geosteering in coiled tubing drilling.

[0012] Figure 6 is a block diagram of a system that may be used for geosteering the BHA based, at least in part, on data from gas parameters measured by sensors deployed on the BHA.

Detailed Description

[0013] Production Logging (PLT) is one of the key technologies to measure fluid properties in the oil industry. If this is done while drilling, termed logging while drilling (LWD) herein, the measured data can be used in to support drilling operations. The data collected in the LWD may be retrieved from the well by pulling the coiled tubing from the well and removing memory chips that have stored the data. In other examples the data may be sent to the surface through but pulse telemetry, wireline connections, or other techniques. This is termed measurement while drilling (MWD) herein. Generally, LWD is used to describe both concepts herein.

[0014] The data may be used to geosteer the wells, e.g., direct the drilling trajectory using hydrocarbon production information. This may allow the well to be targeted inside the most prolific reservoir layers. In some applications, the log data from the LWD may be used to change the trajectory of the wells once it is analyzed. In other applications, the data collected in real time from the MWD may be used to either automate the trajectory control, or to provide information to an operator to change the trajectory if needed.

[0015] Coiled tubing may be used to drill wellbores in an underbalanced condition, in which the pressure in the formation is lower than the pressure in the wellbore. This may be performed by using a sealed surface system that allows the coiled tubing to pass through while sealing around it and diverting fluids flowing into the wellbore. Drilling in an underbalanced condition protects the reservoir from damage due to drilling fluids, leak off, and other conditions, as fluids, including gas are flowing into the wellbore during the drilling process. In drilling of gas wells in underbalanced conditions, gas from the formation is flowing in the annulus, i.e., the region in the wellbore between the coiled tubing and the rock formation. This allows the use of the LWD/MWD techniques described herein.

[0016] Provided herein are LWD/MWD techniques that allow the measurement and evaluation of the proximity of a bottom hole assembly to water, such as in a water layer below a reservoir. This is preformed using a tool that includes at least two mandrels that are in radio communication with each other. The presence of water may be detected by the determination of the effects of the water on the communication between the two mandrels. In an embodiment, one mandrel is operated as a RF EM emitter while the second mandrel is operated as a receiver. The RF EM wave is reflected at layer boundaries where conductivity and dielectric properties vary. For example, a water table plane is a strong reflector for the RF EM wave which is detected by the receiver antenna.

[0017] The detection may be either in the time domain, similar to a pulse echo or continuous wave radar principle, or in the amplitude domain, wherein the conductive plane attenuates the EM energy transfer between spaced mandrels. The straight line distance to the water table from the well bore is derived from acquired signals and known distance between mandrels.

[0018] As an example of an amplitude domain determination, as a mandrel moves closer to a water layer, the signal-to-noise ratio of the radio communication from that mandrel will decrease. The changes in the signal to noise ratio may be used to determine the proximity to the water layer. Other communication techniques may be used for directionality, such as multiple antennae placed around the mandrel, wherein the antennae are communicating at different frequencies. The different frequencies may change the susceptibility to water interference, allowing a determination of distance to the water layer.

[0019] The mandrels may also include other sensors for determining location by seismic and sound sensing, determining gas parameters, and determining hydrocarbon composition, among others. The data collected supports geosteering in more productive gas or oil layers of a reservoir. The techniques also relate to measurements of multiphasic flows in oil and gas wells at downhole conditions. Production Logging (PL), including LWD and MWD of oil and gas wells has numerous challenges related to the complexity of multiphasic flow conditions and severity of downhole environment.

[0020] In particular, gas, oil, water, mixtures flowing in wells, will present bubbles, droplets, mist, segregated wavy, slugs, and other structures depending on relative proportions of phases, their velocities, densities, viscosities, as well as pipe dimensions and well deviations. Accordingly, in order to achieve good understanding of individual phases a number of gas parameters must be measured, including, for example, flowrates, bubble contents, water content, and the like. Further, detection of the proximity to water, such as in a water layer below the reservoir, and a determination of the distance to the water layer is useful for understanding the well environment and adjusting the trajectory of the wellbore.

[0021] The wellbores provide an aggressive environment that may include high pressures, for example, up to 2000 bars, high temperature, for example, up to 200 °C, corrosivity from FLS and CO2, and high impacts. These environmental conditions place constraints on sensors and tool mechanics. Further, solids present in flowing streams, such as cuttings and produced sand, can damage equipment. In particular, sand entrained from reservoir rocks will erode parts facing flow. Solids precipitated from produced fluids due to pressure and temperature changes, such as asphalthenes, paraffins or scales, create deposits that can contaminate sensors or blocking moving parts, such as spinners. Cost is also an important parameter in order to provide an economically viable solution to well construction optimization.

[0022] Figure 1 is a schematic drawing of a method 100 for geosteering a well during directional drilling using electromagnetic (EM) communication to determine proximity to a water layer. In the method 100, a drilling rig 102 at the surface 104 is used to drill a wellbore 106 to a reservoir layer 108. In this illustration, the reservoir layer 108 is bounded by an upper layer 110, such as a layer of cap rock, and a lower layer 112, such as a layer containing water.

[0023] The drilling rig 102 is coupled to a roll of coiled tubing 114, which is used for the drilling. A control shack 116 may be coupled to the roll of coiled tubing 114 by a cable 118 that includes transducer power lines and other control lines. The cable 118 may pass through the coiled tubing 114, or alongside the coiled tubing 114, to the end 120 of the wellbore 106, where it couples to the BHA used for drilling the wellbore 106. In some embodiments described herein, a cable is not used as the sensor packages and controllers are powered by batteries and communicate with the surface through other techniques, such as mud pulse telemetry (MPT), through drilling mud or other incompressible fluids flowing through the wellbore.

[0024] In embodiments described herein, EM communicators on the mandrels allow communication of data from a first mandrel, closer to the drillbit at the end 120 of the wellbore, to pass data to a second mandrel farther from the drillbit. For example, the first mandrel emits EM signals 122 that may be received by the second mandrel. During communication, the second mandrel emits EM signals 124 that may be received by the first mandrel. The second mandrel may record the measurements in a local data store, relay the measurements to the surface, or both.

[0025] Further, a local controller, for example, located in the second mandrel, may calculate adjustments to the trajectory of the wellbore, and make the trajectory adjustments locally. Additional sensors may be used to measure the components and velocity of materials passing through the outer annulus of the wellbore 106, for example, measuring velocity, phases, and the like. The trend of these measurements may be used to determine whether the BHA is within a producing zone of the reservoir layer 108, has left the producing zone, or is approaching the lower layer 112. This information, along with the information on the structure of the layers 110 and 112, is used to adjust the vectors 126 to steer the wellbore 106 in the reservoir layer 108 back towards a product zone. For example, if the material flowing into the wellbore in the unbalanced wellbore is increasing in water or fluids, the BHA may be approaching the lower layer 112. Other sensors, such as EM sensors, may be used to confirm that. Accordingly, the vectors 126 may be adjusted to direct the BHA back towards a gas zone in the reservoir layer 108.

[0026] Figure 2 is a drawing of an instrumented bottom hole assembly (BHA) 200 that may be used for geo-steering in directional drilling in coiled tubing drilling (CTD) using gas parameter measurements. Like numbered items are as described with respect to Fig. 1. In this embodiment, the BHA 200 has two instrumented mandrels. A first mandrel 202 is located near a drillbit (not shown), and a second mandrel 204 is located further away from the drillbit, separated from the first mandrel 202 by a spacer pipe 206. Although two instrumented mandrels are shown in Fig. 2, more instrumented mandrel may be used.

[0027] The two mandrels 202 and 204 may communicate with each other, for example, through EM signals 122 and 124 linking EM antennae 208 on each of the mandrels 202 and 204. This enables the communication system with the surface to be installed in only one of the mandrels. For example, the second mandrel 204 may be located farther from the drillbit, and may handle communication with the surface, using a mud pulse telemetry system. The first mandrel 202 may be located closer to the drill bit, and send data to the second mandrel 204 to be sent to the surface. Thus, in addition to measurement trends, e.g., in time, the use of two mandrels allows determination of differences in location as the wellbore is being drilled.

[0028] Sensor packages 210 are mounted along each of the mandrels 202 and 204, for example, in embedded slots formed in the outer surface of the mandrels 202 and 204. The sensor packages 210 may include multiple sensors assembled into a strings, or packets, of sensors, which are mounted in recesses along the mandrels. The sensors may include micro electro mechanical systems (MEMS) pressure sensors, temperature sensors, optical sensors, ultrasonic sensors, conductivity sensors, and the like. The sensors are available from OpenField Technologies of Paris, France (https://www.openfield-technology.com/). [0029] Figure 3 is a schematic drawing 300 of fluid flow through a sensor equipped mandrel 302. Like numbered items are as described with respect to Fig. 2. In a schematic drawing 300, drilling fluid 306 from the surface flows through the coil tubing line 304 in the direction of the drill bit. A mixture 308 of drilling fluid 306 and produced fluids is returned to the surface through the annulus. The produced fluids may include gas, oil, and reservoir water.

[0030] The EM antennae 208 allow for communication with other mandrels, but also provide a detection system for determining the proximity of the mandrel 302 to a lower layer 112 containing water. The EM signals 122 are blocked from entering the conductive water of the lower layer 112, decreasing the signal to noise ratio of the communication. Locating multiple EM antennae 208 around the mandrel 302 may provide information on the distance to the water layer, as the antenna located on an opposite surface of the mandrel 302 from the lower layer 112 may not experience as large a decrease in signal to noise ratio.

[0031] Sensor packages 210 along the mandrel 302 may include an ultrasonic Doppler system to measure the velocity of fluid flow. For example, an ultrasonic transducer is oriented to emit an ultrasonic wave into the fluid flow, which is reflected off bubbles or particles in the fluid flow. An ultrasonic detector picks up the reflected sound, and can be used to calculate the velocity from the frequency shift as particles or bubbles approach the detector. The ultrasonic Doppler system can also provide the information to determine the gas content of the two-phase stream in the annulus of the wellbore, for example, by quantitating the bubbles of an internal phase, and determining their size. In some embodiments, a micro spinner is included to measure the flow velocity instead of, or in addition to, the Doppler measurement. The micro spinner may use an electrical coil or a magnet to detect spinning rate, which is proportional to the flow rate.

[0032] The sensor packages 210 may include a MEMS pressure transducer to measure pressure outside of the mandrel 202 or 204. A conductivity probe may be included to measure fluid conductivity at a high frequency, allowing a determination of hydrocarbon to water phase in a two-phase stream.

[0033] The information from the sensor packages 210 is combined with information from other geophysical measurements to assist in geosteering. For example, seismic measurements may be used to determine probable locations of boundary layers 110 and 112. As described herein, geophysical models may be generated and used with the data from the gas sensors.

[0034] Figure 4 is a schematic drawing of geosteering in a well. Like numbered items are as described with respect to Figs. 1-3. The separations of the sensors in the sensor packages 210 between the first mandrel 202 and the second mandrel 204 provide a separation of measurements in space, allowing targeting to be performed based on the differences in the measurements between the mandrels 202 and 204. For example, if the water measured in the mixture 308 at the first mandrel 202, closer to the drillbit 402, are higher than the water measured at the second mandrel 204, it may indicate that the drillbit 402 is leaving the reservoir layer 108. Accordingly, the trajectory of the well may be adjusted to bring the drillbit 402 back into the productive zone.

[0035] As described herein, the EM signals 406 that allow communication between the first mandrel 202 and the second mandrel 204 are used for the determination of proximity to water layers. As shown in Fig. 4, the EM signals 406 are blocked by the water in the lower layer 112. The determination of the proximity of the mandrels 202 and 204 to the lower layer 112 may be used as a sensor reading for geosteering the trajectory of the wellbore, as described herein. For example, if a mandrel 202 is determined to be too close to a water layer, the drillbit 402 may be steered away from the water layer.

[0036] Trends over time of sensor readings at the mandrels 202 and 204 may also be used for geosteering. For example, if the water measured at the first mandrel 202 increases, this may indicate that the drillbit 402 is nearing lower layer and the leaving the reservoir layer 108.

[0037] A telemetry package 404 may also be located directly behind the drillbit 402 to provide further information about the location of the drillbit 402. This may include seismic detectors and transducers that can locate the drillbit 402 in three- dimensional space. The telemetry data may be transferred back to the surface directly from the telemetry package 404, through mud pulse telemetry, fiber optical cables, or through other communications techniques. In one embodiment, the telemetry package 404 may communicate with the second mandrel 204 through electromagnetic waves and the second mandrel 204 may communicate the telemetry data to the surface, for example through mud pulse telemetry. [0038] Figure 5 is a process flow diagram of a method 500 for using EM communication between mandrels for geosteering in coiled tubing drilling. The method begins at block 502, with communication with another mandrel. As described herein, the communication may include the transfer of data relating to measurements of pressure, temperature, flow velocity, the amount of gas in the liquid fraction of the produced fluids, and the presence of conductive fluids, among others. The data may be transferred to a single mandrel for storage or to be transferred to the surface.

[0039] At block 504, the signal-to-noise ratio in the EM signals are determined. At block 506, the change in the signal-to-noise ratio is used to determine a distance to a water layer. In some embodiments, the distance to the water table is calculated by sending a signal from a first antenna, for example, on a first mandrel, and detecting reflections at a second antenna, for example, at a second mandrel. The reflections may allow the determination of the distance to a water layer.

[0040] At block 508, the trend in the signal-to-noise is determined. As the measurements of signal-to-noise are quantitative, the analysis of the data during the trajectory of the drilling of the wellbore provides the information that can be used to determine if the wellbore is being drilled in the targeted structural layer of the reservoir or is approaching a water layer.

[0041] In some embodiments, the signal-to-noise measurements and the trends in the signal-to-noise measurements are integrated with other measurements from sensors mounted along the mandrels and a priori information of the area, including, for example, geological structural models and dynamic models of the area. Other measurements that may be used along with the signal-to-noise measurements include acoustic measurements, measurements from cuttings, or flow measurements at the surface, to assess if the wellbore is still being drilled into an economically productive reservoir layer.

[0042] At block 510, adjustments to geosteering vectors are determined. The information obtained from the combination of the signal-to-noise measurements, and the parameters measured by other sensors, along with trends and modeling parameters, may be used to determine adjustments to the geosteering vectors. For example, the information may indicate that the wellbore needs to be steered to the right, left, up, or down. In coiled tubing drilling, a mud motor can be used to change the direction of the drillbit, thus changing the trajectory of the wellbore. The determination of the direction to steer the drillbit is based on the tool measurements and the knowledge of the geological setting. For example, if the signal-to-noise measurements of the EM communication indicate the presence of water around the tool, this indicates that the BHA is proximate to the lower layer 112, or water aquifer, and that steering the drillbit upward away from the water will increase the percentage of the hydrocarbon produced.

[0043] In some examples, the information may indicate that the wellbore has left the productive zone. In some embodiments, the coiled tubing is removed to allow a completely different direction to be drilled. In other embodiments, leaving the productive zone indicates that the drilling is completed and further well completion activities may be performed to begin production, such as fracturing the rock around the well environment, installing casing, cementing the casing in place, perforating the casing, or positioning of production tubing in the wellbore, and the like, depending on the application and well environment.

[0044] Figure 6 is a block diagram of a system 600 that may be used for geosteering the BHA based, at least in part, on data from EM communication devices and sensors deployed on the BHA. The system 600 includes a controller 602 and BHA sensors/actuators 604 that are coupled to the controller 602 through a number of sensor interfaces 606. In the embodiment shown in Fig. 6, the BHA sensors/actuators 604 include a pressure sensor 608, a velocity sensor 610, and a temperature sensor 612. As described herein, the pressure sensor 608 may be a MEMS sensor. The velocity sensor 610 may be an ultrasonic based Doppler sensor.

[0045] In addition, the BHA sensors/actuators 604 may include an electromagnetic (EM) communication device 614, for example, used to communicate between mandrels. The EM communication device 614 may also be used for sensing the presence of water proximate to the BHA, for example, by detecting a decrease in signal-to-noise ratio at the receiving mandrel from the broadcasting mandrel. Further, in some embodiments, multiple antennas may be spaced around the mandrels providing directional determination of the water proximate to the BHA.

[0046] A steering actuator 616 may be a mud motor, hydraulic actuator, or other device used to redirect the drillbit. A communicator 618 may be included in the BHA 604 to allow communication with the surface. The communicator 618 may be based on mud pulse telemetry. In some embodiments, the drilling fluid is compressed gas. In these embodiments, the communicator 618 may not be present as the compressibility of the drilling fluid prevents communication through mud pulse telemetry. In other embodiments, the communicator 618 is a digital interface to a wireline or optical line coupled to equipment at the surface through the coiled tubing line.

[0047] The BHA sensors/actuators 604 are coupled to the controller 602 through a number of different sensor interfaces 606. For example, a sensor interface and power bus 620 may couple the pressure sensor 608, the velocity sensor 610, and the temperature sensor 612 to the controller 602. Further, the sensor interfaces 606 generally provide power to the individual sensors, such as from a battery or a power line to the surface.

[0048] The sensor interfaces 606 may include an electromagnetic (EM) interface and power system 622 that provides power for the EM communication device 614.

The EM communication device 614 may be located in a last mandrel, e.g., farthest from the drillbit along the BHA, allowing the last mandrel to provide communication through the communicator 618 to the surface.

[0049] If present, the steering actuator 616 is powered by hydraulic lines or electric lines, for example, from the surface. In some embodiments, a steering control unit 624 provides the power or hydraulic actuation for the steering actuator 616. In other embodiments, the geo-steering is performed by other techniques, such as the inclusion of bent subs in the BHA. In yet other embodiments, the coiled tubing drilling apparatus is pulled from the wellbore to obtain log data from the controller 602, and determine the trajectory changes to make.

[0050] The controller 602 may be a separate unit mounted in the control shack 116 (Fig. 1), for example, as part of a programmable logic controller (PLC), a distributed control system (DCS), or another computer control unit used for controlling the drilling. In other embodiments, the controller 602 may be a virtual controller running on a processor in a DCS, on a virtual processor in a cloud server, or using other real or virtual processors. In one embodiment, the controller 602 is included in an instrument package attached to the BHA, for example, in a mandrel along with sensors. This embodiment may be used with gas as the drilling fluid, as communication to the surface may be limited. Further, embedding the controller 602 in the BHA may be used for LWD, in which the coiled tubing is pulled from the wellbore to retrieve the data. [0051] The controller 602 includes a processor 626. The processor 626 may be a microprocessor, a multi-core processor, a multithreaded processor, an ultra-low- voltage processor, an embedded processor, or a virtual processor. In some embodiments, the processor 626 may be part of a system-on-a-chip (SoC) in which the processor 626 and the other components of the controller 602 are formed into a single integrated electronics package. In various embodiments, the processor 626 may include processors from Intel® Corporation of Santa Clara, California, from Advanced Micro Devices, Inc. (AMD) of Sunnyvale, California, or from ARM Holdings, LTD., Of Cambridge, England. Any number of other processors from other suppliers may also be used.

[0052] The processor 626 may communicate with other components of the controller 602 over a bus 628. The bus 628 may include any number of technologies, such as industry standard architecture (ISA), extended ISA (EISA), peripheral component interconnect (PCI), peripheral component interconnect extended (PCIx), PCI express (PCIe), or any number of other technologies. The bus 628 may be a proprietary bus, for example, used in an SoC based system. Other bus technologies may be used, in addition to, or instead of, the technologies above. For example, the interface systems may include I 2 C buses, serial peripheral interface (SPI) buses, Fieldbus, and the like.

[0053] The bus 628 may couple the processor 626 to a memory 630, such as RAM, ROM, and the like. In some embodiments, such as in PLCs and other process control units, the memory 630 is integrated with a data store 632 used for long-term storage of programs and data. The memory 630 includes any number of volatile and nonvolatile memory devices, such as volatile random-access memory (RAM), static random- access memory (SRAM), flash memory, and the like. In smaller devices, such as PLCs, the memory 630 may include registers associated with the processor 626 itself. The data store 632 is used for the persistent storage of information, such as data, applications, operating systems, and so forth. The data store 632 may be a nonvolatile RAM, a solid-state disk drive, or a flash drive, among others. In some embodiments, the data store 632 will include a hard disk drive, such as a micro hard disk drive, a regular hard disk drive, or an array of hard disk drives, for example, associated with a DCS or a cloud server. [0054] The bus 628 couples the processor 626 to a sensor interface 634. The sensor interface 634 is a data interface that couples the controller 602 to the sensor interface and power bus 620. In some embodiments, the sensor interface 634 and the sensor interface and power bus 620 are combined into a single unit, such as in a universal serial bus (USB).

[0055] The bus 628 also couples the processor 626 to a controller interface 636. The controller interface 636 may be an interface to a plant bus, such as a Fieldbus, an I 2 C bus, an SPI bus, and the like. The controller interface 636 may provide the data interface to the electromagnetic interface and power system 622 and the steering control unit 624.

[0056] The bus 628 couples the processor 626 to a network interface controller (NIC) 638. The NIC 638 couples the controller 602 to the communicator 618, for example, if the controller 602 is located in the BHA 604.

[0057] The data store 632 includes a number of blocks of code that include instructions that, when executed, direct the processor to carry out the functions described herein. The data store 632 includes a code block 640 to instruct the processor to control communication, for example, between mandrels with the EM communication device 614, or between the controller and a surface device using the communication device 618.

[0058] The data store 632 includes a code block 642 to instruct the processor 626 to determine the signal-to-noise ratio of the communication received by the EM communication device. A code block 644 instructs the processor 626 to determine the distance to water proximate to the BHA. This may be performed by comparing the signal-to-noise ratio of communication performed over the EM communication device 614 to standards or trends. As described herein, at block 646, the trends in the distance to water are determined.

[0059] The data store 632 includes a code block 648 to instruct the processor 626 to determine adjustments to the steering vector based on the measurements, including the distance to water and other measurements, trends in the measurements, and geophysical data or models. A code block 650 may be included to direct the processor 626 to automatically make the adjustments to the steering vector, for example, if the drilling fluid is a gas that makes communication to the surface difficult by mud pulse telemetry. [0060] The code blocks described above may be in different combinations of code to implement the functions described herein. Further, the data store 632 may include other code blocks to add additional functionality. For example, a code block may be included to instruct the processor to measure sensor responses, for example, from the pressure sensor 608, the velocity sensor 610, and the temperature sensor 612. A code block may be included to instruct the processor 626 to determine gas parameters from the measurements. As described herein, the gas parameters may include hydrocarbon content of flowing fluids, gas content in flowing fluids, flow velocity, and the like. The determination is made for each mandrel and a difference between the measurements for the mandrels is calculated. A code block may be included to instruct the processor 626 to determine trends in the gas parameters.

[0061] An embodiment described herein provides a method for geosteering in directional drilling. The method includes determining a signal-to-noise ratio (SNR) for an electromagnetic communication between devices on a bottom hole assembly, and determining a distance to water based, at least in part, on the SNR. Adjustments to geosteering vectors for the bottom hole assembly are determined based, at least in part, on the distance to water.

[0062] In an aspect, the electromagnetic communication is performed between instrumented mandrels on the bottom hole assembly.

[0063] In an aspect, the method includes determining a trend in the distance to water. In an aspect, the method includes determining the adjustments to the geosteering vectors for the bottom hole assembly based, at least in part, on the trend in the distance to water.

[0064] In an aspect, the method includes determining the adjustments to the geosteering vectors for the bottom hole assembly based, at least in part, on a geophysical model.

[0065] In an aspect, the method includes communicating measurements from a first mandrel to a second mandrel and logging the measurements in a data store in the second mandrel. In an aspect, the method includes transmitting the measurements to a surface facility from the second mandrel.

[0066] In an aspect, the method includes drilling a wellbore in an underbalanced condition using a coiled tubing drilling apparatus. [0067] In an aspect, the method includes making the adjustments to the geosteering vectors to change a trajectory of a wellbore. In an aspect, the method includes making the adjustments to the geosteering vectors in a controller in the bottom hole assembly.

[0068] In an aspect, the method includes measuring temperature. In an aspect, the method includes measuring a hydrocarbon content in a two phase stream. In an aspect, the method includes measuring a gas content in a two-phase stream. In an aspect, the method includes measuring flow velocity. In an aspect, the method includes measuring pressure.

[0069] Another embodiment described herein provides a system for geosteering in directional drilling, comprising a bottom hole assembly. The bottom hole assembly includes a coiled tubing drilling apparatus and at least two mandrels mounted on the coiled tubing drilling apparatus, wherein each mandrel comprises an electromagnetic communication device. A controller is included to determine a distance to a water layer based, at least in part, on electromagnetic communications between the at least two mandrels. The system includes a drill bit.

[0070] In an aspect, the controller determines the distance based on a reflection of the electromagnetic communication from a water layer. In an aspect, the controller determines the distance based on a reflection of the electromagnetic communication from a water layer. In an aspect, the system includes a sealed surface system to allow the coiled tubing drilling apparatus to drill in an underbalanced configuration.

[0071] In an aspect, the system includes a pressure sensor. In an aspect, the system includes a velocity sensor. In an aspect, the system includes a temperature sensor. In an aspect, the system includes a conductivity probe. In an aspect, the system includes a mud pulse telemetry system.

[0072] In an aspect, the system includes a steering actuator to change a direction of the bottom hole assembly.

[0073] In an aspect, the controller includes a processor and a data store, wherein the data store comprises instructions that, when executed, direct the processor to determine a signal-to-noise ratio (SNR) for an electromagnetic communication between devices on a bottom hole assembly. The data store also comprises instructions that, when executed, direct the processor to determine a distance to water-based, at least in part, on the SNR, and determine adjustments to geosteering vectors for the bottom hole assembly based, at least in part, on the distance to water. In an aspect, the data store comprises instructions that, when executed, direct the processor to make adjustments to the geosteering vectors.

[0074] Other implementations are also within the scope of the following claims.