Introduction

Unconventional oil and gas resources such as shale oil and gas, tight oil and gas, oil shale, heavy oil, and natural gas hydrate have the basic characteristics of "high quantity, low quality, and difficult to develop ", and are a strategic alternative energy source on a global scale. Twin parallel horizontal wells or cluster horizontal wells are typically needed to effectively exploit these oil and gas resources. Currently, the drilling technology of twin parallel horizontal wells combined with steam-assisted gravity drainage (SAGD) has been extensively used in the development of heavy oils and bitumen resources (Ameli and Mohammadi 2018; Butler and Stephens 1981; Kamari et al. 2015). For example, in the field tests of heavy oil development in the Liaohe oilfield and Xinjiang Fengcheng oilfield, the technology has also been shown to have significant application results (He et al. 2015; Liu and Dong 2022). Twin parallel horizontal wells, with the top horizontal well serving as the production well and the bottom horizontal well serving as the injection well, and a vertical separation of three to five meters, may also be used to mine natural hydrate successfully (Sasaki et al. 2009; Yamakawa et al. 2010). China possesses a sizable quantity of oil shale geologic resources as well, although the reservoirs are generally thin. To increase oil production from on-site conversion and decrease the cost of on-site oil shale conversion, small-spaced cluster horizontal well technology must be used (Allix et al. 2010; Sun et al. 2021). For instance, Fig. 1 depicts a well pattern for shale oil production during in-situ conversion. The minimum horizontal well spacing in this arrangement is just 3.25 m, and there are 10 heater wells and 2 producer wells (Jin et al. 2023). The spacing of horizontal wells in the development of these oil and gas resources has a large impact on the production of oil and gas. For this reason, it is necessary to strictly control the trajectory of the wellbore being drilled and to ensure that the spacing between it and other boreholes meets the design requirements (He et al. 2013).

Fig. 1
figure 1

Schematic diagram of the electric heating well pattern for shale oil

Drilling engineering frequently uses the technique of measuring the inclination angle, azimuth angle, and trace length to determine the position of the borehole (Jamieson 2017). Sadly, the hole location inaccuracy acquired using this method will rise as measured depth increases, making it challenging to satisfy the needs of twin parallel horizontal wells and small-spacing cluster horizontal wells. Fortunately, magnetic ranging tools were invented. However, early magnetic ranging tools (such as the Wellspot Tool and Passive Magnetic Ranging) were developed to steer relief well drilling rather than to guide a horizontal well along another horizontal well (Kuckes 1982; Robinson and Vogiatzis 1973). A few years later, the Single Wire Guidance system was also developed for wellbore interception and collision prevention (Kuckes 1991). The first magnetic ranging tool for SAGD double horizontal wells in heavy oil, known as Magnetic Guidance Tool (MGT), wasn't created until the early 1990s (Kuckes 1996a; Kuckes et al. 1996). Subsequently, Rotating Magnet Ranging System (RMRS), a system to calculate the adjacent well distance between twin parallel horizontal wells using a rotating magnetic field, was developed to realize the near-bit magnetic ranging of twin parallel horizontal wells (Diao and Gao 2015; Grills 2002; Kuckes 1996b; Nekut et al. 2001). Additionally, it is also important to note that the detection of underground pipelines shares many characteristics with the measurement of the relative position between adjacent wells. Techniques for detecting underground pipelines include electromagnetic sensing, mining radar, direct current, sound wave, and seismic wave methods, among others (Chen et al. 2019; Ge et al. 2021; El-Qady et al. 2014). Therefore, in recent years, several new methods have been proposed to measure the distance based on underground pipe detection. However, MGT and RMRS are still the most popular tools used to date in SAGD well engineering. The field application practice demonstrates that starting magnetic ranging from the build-up section can improve the control effect of the horizontal section spacing of two adjacent wells; each magnetic ranging requires the bit to move approximately twice the distance of the well spacing, and the position recording error of the RMRS magnetic sub and MGT probe will directly affect the magnetic ranging calculation accuracy.

The horizontal sections of the wells in the cluster horizontal well project illustrated in Fig. 1 are planned to be parallel to each other, and the closest distance from the producer well to the heater well is just 3.75 m. As a result, a more accurate ranging technique is required. To improve the ranging accuracy and save the measuring time, the authors proposed the Two Sensor Packages-Rotating Magnet Ranging System (TSP-RMRS), which uses two three-axis fluxgate magnetometers separated by a certain distance to detect the magnetic field generated by the magnetic sub synchronously, and established the parallel section ranging (PSR) algorithm for steerable drilling in parallel sections, and the build-up section ranging (BUSR) algorithm for steerable drilling in build-up sections (Diao and Gao 2013; Diao et al. 2021). We can measure the inclination and azimuth of each well at the drilling site, but measuring the convergence and non-coplanar angles of two adjacent wells is difficult. As a result, the relative inclination and azimuth of two adjacent wells are used to characterize the degree of non-parallelism between the two wells, and the influence of relative inclination and azimuth is more practical to consider during the ranging calculation process.

Description and operation of TSP-RMRS

TSP-RMRS is mainly composed of a magnetic sub, a probe, an interface box, and a computer. The computer is equipped with signal acquisition software and ranging calculation software. The magnetic sub is placed at the end of the bit. An alternating magnetic field is produced around the magnetic sub when it rotates by the drilling instrument. A three-axis accelerometer and two three-axis fluxgate magnetometers are installed inside the probe. The three-axis accelerometer's Z-axis and the two high-precision three-axis fluxgate magnetometers' X-axes are on the same plane and parallel to one another, and the three sensors' Y-axes are similar. The two three-axis fluxgate magnetometers are separated from one another by a certain amount. When it is essential to control the distance between the well being drilled and multiple surrounding wells, as shown in Fig. 2, a probe tube can be put in each well, and multiple probes can sense the magnetic field produced by the magnetic sub at the same time. The distance measurement software installed in the computer is used to calculate the radial distance R from the drill bit to the existing well and the angle Ahr from the high side of the drill bit to the r direction based on the uploaded detection data, the drilled survey data, and the wellhead positions (Fig. 3). The directional drilling engineers must regulate the distance between the well being drilled and neighboring wells in accordance with the findings of magnetic ranging in addition to referring to the observed values of inclination and azimuth angles.

Fig. 2
figure 2

Operational diagram of TSP-RMRS

Fig. 3
figure 3

The relative position model of the well being drilled and the existing well

Models and methods

Geometric model

The relative position of the magnetic sub and the two three-axis fluxgates when using TSP-RMRS to determine the distance is displayed in Fig. 4. Point O denotes the center of the magnetic sub, while prints A and B denote the centers of the three-axis fluxgate magnetometers I and II in the probe, respectively. The two sensors' centers are separated by a distance of d. The g-axis points in the direction of the plumb line of point A, and the projections of points A and B on the w-axis are points M and N. The well's high side orientation at points O, M, and N is represented by the h-axis, h1-axis, and h2-axis. Parallel lines MN and AM are traced through points A and N, respectively, and meet at point C, resulting in segment AC being perpendicular to segment BC. Draw a line parallel to the h2-axis through point C and a line perpendicular to the line through point B, intersecting at point D. Connect points A and D with a straight line so that the segment AD is perpendicular to the segment BD. Point G is the g-axis projection of point D. Finally, draw a straight line connecting points B and G.

Fig. 4
figure 4

Schematic diagram of the relative position of magnetic sub and two three-axis fluxgate magnetometers

Since the plane ABD and the plane ACD are perpendicular to each other, the angles θ, α and β have the following relation:

$$ \cos \theta = \cos \alpha \cos \beta $$
(1)

Both the segment AG and the segment BD are perpendicular to the planes BGD and AGD, respectively. The following results can be obtained:

$$ \tan \eta = \tan I_{p} \cos \delta ,\quad I_{p} \ne \frac{\pi }{2} $$
(2)
$$ \eta = \frac{\pi }{2},\quad I_{p} = \frac{\pi }{2} $$
(3)
$$ \cos \beta = \cos I_{p} \sec \eta ,\quad I_{p} \ne \frac{\pi }{2} $$
(4)
$$ \beta = A_{i} - A_{p} ,\quad I_{p} = \frac{\pi }{2} $$
(5)

Additionally, Fig. 4 can be used to derive the following geometry relationship:

$$ \alpha = \eta - I_{i} $$
(6)
$$ \delta = A_{i} - A_{p} $$
(7)
$$ W_{2} - W_{1} = d\cos \theta $$
(8)
$$ d^{2} \sin^{2} \theta = R_{1}^{2} + R_{2}^{2} - 2R_{1} R_{2} \cos (A_{{hr_{2} }} - A_{{hr_{1} }} ) $$
(9)

From the Eqs. (17), the cosine of the angle θ can be calculated as follows:

$$ \cos \theta = \left\{ {\begin{array}{*{20}l} {\cos \left\{ {\arctan \left[ {\tan I_{p} \cos \left( {A_{i} - A_{p} } \right)} \right] - I_{i} } \right\}\cos I_{p} \sec \left\{ {\arctan \left[ {\tan I_{p} \cos \left( {A_{i} - A_{p} } \right)} \right]} \right\}I_{p} \ne \frac{\pi }{2}} \hfill \\ {\sin I_{i} \cos \left( {A_{i} - A_{p} } \right)I_{p} = \frac{\pi }{2}} \hfill \\ \end{array} } \right. $$
(10)

Therefore, by changing the observed values of Ii, Ip, Ai, and Ap into Eq. (10), the value of the angle θ can be determined.

Magnetic ranging model

Define the quantities:

$$ k_{1} = \frac{{R_{1} }}{{W_{1} }} $$
(11)
$$ k_{2} = \frac{{R_{2} }}{{W_{2} }} $$
(12)

As shown in Fig. 4, the r1q1w rectangular coordinate system is established by taking the center of the magnetic sub as the origin, the radial direction from the magnetic sub to the magnetometer I as the r1-axis, the borehole direction ads the w-axis, and by taking the q1-axis orthogonal to both r1-axis and w-axis. Similarly, the r2q2w rectangular coordinate system is established. In the r1q1w coordinate system, the three-axis magnetic induction components (Br1, Bq1, and Bw1) at point A can be expressed as (Diao and Gao 2013):

$$ B_{{r_{1} }} = \frac{\mu m}{{4\pi W_{1}^{3} }}\frac{{2k_{1}^{2} - 1}}{{\left( {k_{1}^{2} + 1} \right)^{5/2} }}\cos \left( {A_{{mr_{1} }} } \right) $$
(13)
$$ B_{q1} = \frac{\mu m}{{4\pi W_{1}^{3} }}\frac{1}{{\left( {k_{1}^{2} + 1} \right)^{3/2} }}\sin \left( {A_{{mr_{1} }} } \right) $$
(14)
$$ B_{w1} = \frac{\mu m}{{4\pi W_{1}^{3} }}\frac{{3k_{1}^{{}} }}{{\left( {k_{1}^{2} + 1} \right)^{5/2} }}\cos \left( {A_{{mr_{1} }} } \right) $$
(15)

As shown in Fig. 5, the l1-axis is orthogonal to both the h1-axis and the w1-axis at the same time, the rules of vector projection give:

$$ B_{{h_{1} }} = B_{{r_{1} }} \cos (A_{{hr_{1} }} ) - B_{{q_{1} }} \sin (A_{{hr_{1} }} ) $$
(16)
$$ B_{{l_{1} }} = B_{{r_{1} }} \sin (A_{{hr_{1} }} ) + B_{{q_{1} }} \cos (A_{{hr_{1} }} ) $$
(17)
Fig. 5
figure 5

The relative position of the magnetic sub and the sensor at the upper end of the probe

Inserting Eqs. (16) and (17) into Eqs. (13) and (14), the following results can be obtained:

$$ \left| {B_{h1} } \right| = \frac{\mu m}{{4\pi \left| {W_{1} } \right|^{3} \left( {k_{1}^{2} + 1} \right)^{3/2} }}\sqrt {\left( {\frac{{2k_{1}^{2} - 1}}{{k_{1}^{2} + 1}}} \right)^{2} \cos^{2} (A_{hr1} ) + \sin^{2} (A_{hr1} )} $$
(18)
$$ \left| {B_{l1} } \right| = \frac{\mu m}{{4\pi \left| {W_{1} } \right|^{3} \left( {k_{1}^{2} + 1} \right)^{3/2} }}\sqrt {\left( {\frac{{2k_{1}^{2} - 1}}{{k_{1}^{2} + 1}}} \right)^{2} \sin^{2} (A_{hr1} ) + \cos^{2} (A_{hr1} )} $$
(19)

By Eqs. (18) and (19), the cosine of 2Ahr1 can be obtained:

$$ \cos (2A_{hr1} ) = \frac{{(2k_{1}^{2} - 1)^{2} + (k_{1}^{2} + 1)^{2} }}{{(2k_{1}^{2} - 1)^{2} - (k_{1}^{2} + 1)^{2} }}\frac{{\left| {B_{h1} } \right|^{2} - \left| {B_{l1} } \right|^{2} }}{{\left| {B_{h1} } \right|^{2} + \left| {B_{l1} } \right|^{2} }} $$
(20)

So similarly, the cosine of 2Ahr2 can be obtained:

$$ \cos (2A_{hr2} ) = \frac{{(2k_{2}^{2} - 1)^{2} + (k_{2}^{2} + 1)^{2} }}{{(2k_{2}^{2} - 1)^{2} - (k_{2}^{2} + 1)^{2} }}\frac{{\left| {B_{h2} } \right|^{2} - \left| {B_{l2} } \right|^{2} }}{{\left| {B_{h2} } \right|^{2} + \left| {B_{l2} } \right|^{2} }} $$
(21)

At the positions of the three-axis fluxgate magnetometers I and II, the magnetic induction intensity component (Bh1, Bl1, Bw1, Bh2, Bl2, and Bw2)of the magnetic field generated by the magnetic sub can be expressed as (Diao and Gao 2013):

$$ \left( {\begin{array}{*{20}c} {B_{h1} } & {B_{l1} } & {B_{w1} } \\ \end{array} } \right) = \left( {\begin{array}{*{20}c} {B_{x1} } & {B_{y1} } & {B_{z1} } \\ \end{array} } \right)\left\{ \omega \right\}\left\{ {A_{d} } \right\}\left\{ {I_{d} } \right\} $$
(22)
$$ \left( {\begin{array}{*{20}c} {B_{h2} } & {B_{l2} } & {B_{w2} } \\ \end{array} } \right) = \left( {\begin{array}{*{20}c} {B_{x2} } & {B_{y2} } & {B_{z2} } \\ \end{array} } \right)\left\{ \omega \right\}\left\{ {A_{d} } \right\}\left\{ {I_{d} } \right\} $$
(23)

with

$$ \left\{ \omega \right\} = \left[ {\begin{array}{*{20}l} {\cos \omega } \hfill & {\sin \omega } \hfill & 0 \hfill \\ { - \sin \omega } \hfill & {\cos \omega } \hfill & 0 \hfill \\ 0 \hfill & 0 \hfill & 1 \hfill \\ \end{array} } \right] $$
$$ \left\{ {I_{d} } \right\} = \left[ {\begin{array}{*{20}l} {\cos (I_{p} - I_{i} )} \hfill & 0 \hfill & { - \sin (I_{p} - I_{i} )} \hfill \\ 0 \hfill & 1 \hfill & 0 \hfill \\ {\sin (I_{p} - I_{i} )} \hfill & 0 \hfill & {\cos (I_{p} - I_{i} )} \hfill \\ \end{array} } \right] $$
$$ \left\{ {A_{d} } \right\} = \left[ {\begin{array}{*{20}l} 1 \hfill & 0 \hfill & 0 \hfill \\ 0 \hfill & {\cos (A_{p} - A_{i} )} \hfill & {\sin (A_{p} - A_{i} )} \hfill \\ 0 \hfill & { - \sin (A_{p} - A_{i} )} \hfill & {\cos (A_{p} - A_{i} )} \hfill \\ \end{array} } \right] $$

The magnitude of Br1 and Bw1 can be obtained from Eqs. (13) and (15):

$$ \left| {B_{r1} } \right| = \left| {\frac{\mu m}{{4\pi W_{1}^{3} }}\frac{{2k_{1}^{2} - 1}}{{\left( {k_{1}^{2} + 1} \right)^{5/2} }}} \right| $$
(24)
$$ \left| {B_{w1} } \right| = \left| {\frac{\mu m}{{4\pi W_{1}^{3} }}\frac{{3k_{1}^{{}} }}{{\left( {k_{1}^{2} + 1} \right)^{5/2} }}} \right| $$
(25)

The following results can be obtained from Eqs. (24) and (25):

$$ k_{1} = \left\{ {\begin{array}{*{20}c} {\frac{1}{4}\left[ { - 3\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right) + \sqrt {9\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right)^{2} + 8} } \right],\quad W_{1} > \sqrt 2 R_{1} } \\ {\frac{1}{4}\left[ {3\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right) + \sqrt {9\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right)^{2} + 8} } \right],\quad 0 \le W_{1} \le \sqrt 2 R_{1} } \\ {\frac{1}{4}\left[ {3\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right) - \sqrt {9\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right)^{2} + 8} } \right],\quad - \sqrt 2 R_{1} \le W_{1} < 0} \\ {\frac{1}{4}\left[ { - 3\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right) - \sqrt {9\left( {\frac{{\left| {B_{r1} } \right|}}{{\left| {B_{w1} } \right|}}} \right)^{2} + 8} } \right],\quad W_{1} < - \sqrt 2 R_{1} } \\ \end{array} } \right. $$
(26)

Similarly, the following results also can be obtained:

$$ k_{2} = \left\{ {\begin{array}{*{20}c} {\frac{1}{4}\left[ { - 3\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right) + \sqrt {9\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right)^{2} + 8} } \right],\quad W_{2} > \sqrt 2 R_{2} } \\ {\frac{1}{4}\left[ {3\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right) + \sqrt {9\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right)^{2} + 8} } \right],\quad 0 \le W_{2} \le \sqrt 2 R_{2} } \\ {\frac{1}{4}\left[ {3\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right) - \sqrt {9\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right)^{2} + 8} } \right],\quad - \sqrt 2 R_{2} \le W_{2} < 0} \\ {\frac{1}{4}\left[ { - 3\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right) - \sqrt {9\left( {\frac{{\left| {B_{r2} } \right|}}{{\left| {B_{w2} } \right|}}} \right)^{2} + 8} } \right],\quad W_{2} < - \sqrt 2 R_{2} } \\ \end{array} } \right. $$
(27)

These equations may be used to derive |Br1|, |Bw1|, |Br2|, and |Bw2| from Bh1, Bl1, Bw1, Bh2, Bl2, and Bw2. Consequently, by combining Eqs. (2223) and Eqs. (2627), the values of k1 and k2 may be determined from the measured values of ω, Ii, Ip, Ai, Ap, Bx1, By1, Bz1, Bx2, By2, and Bz2. Two sets of triaxial magnetic induction intensity components were identified by the two three-axis fluxgate magnetometers inside the probe, and they are Bx1, By1, Bz1, Bx2, By2, and Bz2. The values of Ahr1 and Ahr2 can then be derived by entering the computed values of k1 and k2 into Eqs. (20) and (21).

Moreover, by combining Eqs. (8, 9, 22, and 23), the following equation may be found:

$$ \begin{gathered} \left[ {k_{1}^{2} + k_{2}^{2} - 2k_{1} k_{2} \cos \left( {A_{hr2} - A_{hr1} } \right)} \right]W_{1}^{2} + \left[ {2k_{2}^{2} d\cos \theta - 2k_{1} k_{2} d\cos \theta \cos \left( {A_{hr2} - A_{hr1} } \right)} \right]W_{1} \hfill \\ + k_{2}^{2} d^{2} \cos^{2} \theta - d^{2} \sin^{2} \theta = 0 \hfill \\ \end{gathered} $$
(28)

The value of W1 may be obtained by solving the above equation using the calculated values of k1, k2, Ahr1, and Ahr2. Finally, by combining Eqs. (8, 11, and 12), the values of W2, R1, and R2 may be determined.

Offset well relative position model

As shown in Fig. 6, the distance and direction of the drill bit to the existing well are different from the distance and direction of the magnetic sub to the existing well, when the existing well is not parallel to the well being drilled. The drill bit's center is represented by point T. The r-axis is radial from the drill bit to the existing well, and the orientation of the h3-axis represents the direction of the high side of the borehole at the bit's center. The segment FT is parallel to the r1-axis and perpendicular to the segment AC. Figure 6 reveals the geometry relationship shown below:

$$ l_{TN} = W_{2} - L $$
(29)
$$ l_{AN}^{2} = \left( {W_{2} - W_{1} } \right)^{2} + R_{1}^{2} $$
(30)
$$ \cos \gamma = \frac{{d^{2} + R_{2}^{2} - l_{AN}^{2} }}{{2dR_{2} }} $$
(31)
$$ l_{BE} = l_{TN} \sec \theta $$
(32)
$$ l_{EN}^{2} = l_{BE}^{2} + R_{2}^{2} - 2R_{2} l_{BE} \cos \gamma $$
(33)
$$ R^{2} = l_{EN}^{2} - l_{TN}^{2} $$
(34)
$$ l_{EF} = l_{AF} \tan \theta $$
(35)
$$ l_{AF} = L - W_{1} $$
(36)
$$ \cos \varphi = \frac{{R^{2} + R_{1}^{2} - l_{EF}^{2} }}{{2RR_{1} }} $$
(37)
$$ A_{hr} = \left\{ {\begin{array}{*{20}c} {A_{hr1} + \varphi A_{hr2} > A_{hr1} } \\ {A_{hr1} - \varphi A_{hr2} < A_{hr1} } \\ \end{array} } \right. $$
(38)
Fig. 6
figure 6

Schematic diagram of the relative position relationship between the drill bit and the existing well

According to Eqs. (2934), the radial distance R from the drill bit to the existing well can be expressed as:

$$ R = \left[ {\left( {W_{2} - L} \right)^{2} \tan^{2} \theta + R_{2}^{2} - \frac{{\left( {W_{2} - L} \right)\sec \theta }}{d}\left( {d^{2} \sin^{2} \theta + R_{2}^{2} - R_{1}^{2} } \right)} \right]^{\frac{1}{2}} $$
(39)

And, according to Eqs. (3538), the angle Ahr from the h-axis to the r-axis can be expressed as:

$$ A_{hr} = \left\{ {\begin{array}{*{20}c} {A_{hr1} + \arccos \left[ {\frac{{R^{2} + R_{1}^{2} - \left( {L - W_{1} } \right)^{2} \tan^{2} \theta }}{{2RR_{1} }}} \right],\quad A_{hr2} > A_{hr1} } \\ {A_{hr1} - \arccos \left[ {\frac{{R^{2} + R_{1}^{2} - \left( {L - W_{1} } \right)^{2} \tan^{2} \theta }}{{2RR_{1} }}} \right],\quad A_{hr2} < A_{hr1} } \\ \end{array} } \right. $$
(40)

Thus, the size of R and Ahr can be obtained by substituting the calculated values of W2, R1, and R2 and the measured values of L into Eqs. (39) and (40). The relative spatial relationship between the well being drilled and the adjacent existing well is also determined.

The magnetic signal detected is influenced by not only the relative position of the holes but also the magnetic conductivity and temperature of the formation surrounding the magnetic sub and the speed of rotation of the drill bit. To accurately detect the magnetic signal, magnetic steel with good temperature resistance under underground conditions must be selected as the internal components of the magnetic sub. Along with using a 100 Hz fluxgate sensor inside the probe, it is crucial to regulate the bit's speed between 60 and 200 rpm. The magnetic sub's magnetic conductivity around it might affect the detected magnetic signals, however, this impact stands eliminated in the ranging model. Therefore, considering downhole temperatures for selecting the appropriate materials for constructing reliable magnetic subs, and halting drilling operations on detection of a valid magnetic signal while maintaining speeds between 60 and 200 rpm, would enable effective utilization of our proposed ranging calculation model.

Influence of Magnetic Sub

It is assumed that the distance between the center of the magnetic sub and the bit's bottom is 0.5 m, that the distance radially between the sub and the existing well is 4.33 m, that the angle between the high side direction and the radial direction is 120°, and that the inclination and azimuth angles of the existing well are 89° and 80° respectively. The distances from the bit to the existing well under various azimuth and inclination angles of the well being drilled are shown in Fig. 7. As the inclination and azimuth angles decrease, so do the distances. In other words, the length of the magnetic sub affects the distance from the bit to the existing well more strongly as the inclination and azimuth variances between the existing well and the well being drilled rise. Also, given the parameters described in this study, the calculation error of the distance from the bit to the existing well will be 2.8% if we do not take the influence into consideration. The sizes of the angle Ahr for various inclination and azimuth angles of the well being drilled are shown in Fig. 8. The sizes of angle Ahr decrease as the azimuth angle increases and the inclination angle decreases. The results demonstrated that the computation error of angle Ahr will be less than 1° if the distance between the bit and the magnetic sub is not taken into account. The inclination and azimuth changes between the existing well and the well being drilled do not necessarily cause this mistake to rise. Consequently, while using magnetic ranging, the distance between the bit and the magnetic sub should not be disregarded.

Fig. 7
figure 7

Distances under different inclinations and azimuth angles of the well being drilled

Fig. 8
figure 8

Angles under different inclinations and azimuth angles of the well being drilled

Simulation results and analysis

Magnetic ranging technology has been used extensively in guided drilling projects such as relief wells, twin parallel horizontal wells, connected wells, and cluster wells after decades of development. As there is no other way to more precisely determine the relative position between two wells, a lot of magnetic ranging field data can be collected, but its accuracy cannot be verified. Only ground simulation experiments can confirm the precision of magnetic ranging. Fortunately, it is simple to do magnetic ranging simulations on the ground. It is challenging to replicate the underground formation, temperature, pressure, vibration, and other characteristics in a ground experiment when compared to the actual underground situation. The magnetic conductivity of the general formation is equivalent to that of air, with the exception of the formation containing metal deposits. The probe and other equipment only need to be sealed because of the downhole pressure. While downhole temperature and vibration impair magnetic signals, they may be reduced via signal processing and other techniques. Hence, magnetic ranging simulation tests simply need to be performed in the surrounding environments without ferromagnetic influence.

The primary components of the simulation experiment apparatus, as seen in Fig. 9, are the simulated magnetic sub, test cart, non-magnetic support, probe, interface box, mobile power supply, and computer with signal processing and acquisition software. The test cart and the simulated magnetic sub are set up on the non-magnetic support, and the test cart has the capacity to rotate the simulated magnetic sub. The inclination and azimuth angles of the magnetic sub are determined by the attitude of the non-magnetic support. Within the probe, there are two three-axis fluxgate sensors spaced apart by 3.3 m. Also, when the non-magnetic support is positioned horizontally, 2.12 m separate the center of the magnetic sub from the ground plane. The probe's inclination angle was altered during the experiment by varying the height of one end. By measuring the inclination and azimuth angles of the non-magnetic support, one may determine the values of Ii and Ai. Reading the probe's inclination and azimuth angles will give the values of Ip and Ap. The simulated magnetic sub rotates at a fixed position on the non-magnetic support throughout each measurement, and the angular velocity of rotation is likewise constant. And, when the non-magnetic support is placed horizontally, the distance from the center of the magnetic sub to the ground plane is 2.12 m. During the experiment, by adjusting the height of one end of the probe, the inclination angle of the probe was changed. The values of Ii and Ai can be obtained by measuring the inclination and azimuth angles of the non-magnetic support. The values of Ip and Ap can be obtained by reading the inclination and azimuth angles of the probe. During each measurement, the simulated magnetic sub rotates at a fixed position on the non-magnetic support, and the angular velocity of rotation also is fixed. The distance from the magnetic sub to the end of the non-magnetic support increases by 0.5 m after each measurement.

Fig. 9
figure 9

Device for simulation experiment

The magnetic sub rotates at a fixed location for one measurement, and the acquired three-axis magnetic induction strength fluctuates periodically, but the amplitude remained constant. As a result, the magnetic ranging calculation model must be combined to determine the distance and direction from the well being drilled to the neighboring existing well. After fixing the non-magnetic support, the values of Ii and Ai are measured at 90.7° and 78.7° respectively. When Ip = 94.4° and Ap = 88.7°, the distances and directions from the magnetic sub to the probe are shown in Figs. 10 and 11 with the variation of s. Change the probe’s attitude to IP = 98,0° and Ai = 78,7°. Under these conditions, the distances and directions from the magnetic sub to the probe are illustrated in Figs. 12 and 13 with the variation of s. Since the axis of the magnetic sub is not parallel to the axis of the probe, the calculated values of Ahr by the PSR algorithm are complex numbers, so they are not shown in Figs. 11 and 13. Figures 10 and 12 indicate that the calculation error of R obtained by the algorithm in this paper is less than 3%, but the calculation error of R obtained by the PSR algorithm is larger than the requirement of drilling engineering. By comparing the calculated and measured values of Ahr, we can also determine that the calculation error of Ahr is less than ± 3°. Therefore, the distance and direction from the drill bit to the existing well obtained by the algorithm in this paper can be used to guide the well to directional drilling along the existing well trajectory according to the designed spacing.

Fig. 10
figure 10

Comparison of calculated values and measured values of R when Ip = 94.4° and Ap = 88.7°

Fig. 11
figure 11

Comparison of calculated values and measured values of Ahr when Ip = 94.4° and Ap = 88.7°

Fig. 12
figure 12

Comparison of calculated values and measured values of R when Ip = 98.0° and Ap = 98.7°

Fig. 13
figure 13

Comparison of calculated values and measured values of Ahr when Ip = 98.0° and Ap = 98.7°

Conclusions

This research aimed at increasing the accuracy of magnetic ranging during the drilling of parallel horizontal wells by establishing a novel ranging algorithm for the Two Sensor Packages—Rotating Magnet Ranging System (TSP-RMRS). The followings are concluded based on the study.

  1. 1.

    The calculation model takes the inclination and azimuth of the two wells and the distance from the bottom of the well being drilled to the center of the magnetic sub as input parameters to reduce the influence of the degree of non-parallelism and the length of the magnetic sub on the magnetic ranging results. The experimental findings demonstrate that when both the inclination and azimuth of the existing well are different from those of the well being drilled, the accuracy of the distance between the drill bit and the existing well determined by the algorithm in this paper may reach more than 97%.

  2. 2.

    During each ranging, the magnetic sub rotates at a fixed position, so the measurement error of the magnetic sub position will not affect the result of the magnetic ranging algorithm. However, when the Rotating Magnet Ranging System (RMRS) is used for magnetic ranging, it is impossible to avoid the influence of the magnetic sub position measurement error.

  3. 3.

    Measurements of the inclination and azimuth angles, as well as the intensity of the magnetic field around the magnetic sub, are all required for the ranging computation procedure. As a result, improvements in permanent magnet materials, fluxgate sensors, and digital signal processing can increase the precision with which these parameters are measured as well as lower the inaccuracies in the range results.