Patent application title:

COMPUTER-IMPLEMENTED METHOD FOR IDENTIFYING THE POSITION OF A HOLE OR A CRACK IN A DRILL STRING AND COMPUTER-READABLE STORAGE MATERIAL

Publication number:

US20260009326A1

Publication date:
Application number:

19/252,210

Filed date:

2025-06-27

Smart Summary: A method has been developed to find holes or cracks in a drill string. It starts by detecting a drop in pressure or a decrease in the rotation of a drilling tool. Next, it measures the head losses in the drilling equipment. After that, the method calibrates these head losses within the drill string. Finally, it calculates how far the hole or crack is from the drilling equipment. 🚀 TL;DR

Abstract:

The present invention relates to a computer-implemented method for identifying the position of a hole or a crack in a drill string, comprising the steps of identifying a pressure drop in the standpipe and/or a drop in the rotation of the turbine of the continuous logging instrument; obtaining the head losses in the bottom-hole assembly; calibrating the head losses inside the drill string; and calculating the distance from the hole or crack to the bottom-hole assembly.

Inventors:

Applicant:

Interested in similar patents?

Get notified when new applications in this technology area are published.

Classification:

E21B47/117 »  CPC main

Survey of boreholes or wells; Locating fluid leaks, intrusions or movements Detecting leaks, e.g. from tubing, by pressure testing

E21B44/00 »  CPC further

Automatic control, surveying or testing

E21B44/00 »  CPC further

Automatic control systems specially adapted for drilling operations, i.e. self-operating systems which function to carry out or modify a drilling operation without intervention of a human operator, e.g. computer-controlled drilling systems ; Systems specially adapted for monitoring a plurality of drilling variables or conditions

E21B2200/20 »  CPC further

Special features related to earth drilling for obtaining oil, gas or water Computer models or simulations, e.g. for reservoirs under production, drill bits

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of priority of application Ser. No. 1020240137949, filed in Brazil on Jul. 4, 2024; the disclosure of which is incorporated herein by reference.

FIELD OF THE INVENTION

The present invention pertains to the technical field of identifying leaks in pipes. In particular, the present invention relates to a computer-implemented method for identifying the position of a hole or a crack in a drill string, in particular during well drilling and completion operations.

BACKGROUND OF THE INVENTION

Specifically, a drill string consists of several connected steel pipes and has essential functions during operations involving the construction of oil wells.

Thus, an opening that occurs unintentionally in the drill string, such as a hole or a crack, represents failures that can generate serious operational consequences when drilling a well, such as stopping the drilling rig due to its rupture and, in more extreme cases, the need to abandon the well.

Generally, a hole or a crack is detected by variations in operational parameters during the drilling, for example, a drop in pressure in the standpipe (a cane-shaped pipe installed vertically, which receives the drill fluid from the mud pump and conducts it to the injection head through the Kelly hose) accompanied by a drop in the rotation of the downhole sensor turbine.

In this sense, one of the main challenges is identifying the position of the leak in the drill string, since it consists of a large extension of pipes that connect the bottom-hole to the offshore drilling rig.

Currently, when variations in operating parameters are found that are consistent with a leak in the drill string, it is necessary to identify which pipe is showing the anomaly. The identification of the pipe with a hole or crack is performed visually by the operational team, and it is necessary to remove the drill string to assess the integrity of each pipe, as the drill string is removed from the well.

Therefore, a solution is needed to identify the position of holes or cracks to prevent fluid leakage in a drilling system. More specifically, a solution is needed to provide, in real time, the position of a hole or crack in the drill string, reducing the time spent by the operational team to identify this problem and, therefore, reducing operating costs and increasing the safety of the drilling and completion operations.

STATE OF THE ART

In the state of the art, there can be found documents aimed at identifying the position of a hole or crack in related applications. In particular, there are highlighted the following documents listed below.

Document WO03046503A discloses a method for detecting leaks in pipelines during their operation, applied to the transportation of oil and derivatives. Said method is based on the fact that, in the case of a rapid leak, a characteristic pressure drop occurs at the leak site, which propagates at the speed of sound both upstream and downstream of said leak location and which is recorded at the pressure measurement point, which are located along the pipeline line. The method of the document in question makes use of four algorithms for the logical connection of pressure drops recorded at adjacent pressure measurement stations (they represent the actual invention), which allow determining whether the pressure drop recorded at a station was caused by a leak in the station itself or by a leak in both sections of the line to adjacent stations or was triggered by variations in operating pressure. The operating pressure drops can then be detected along the entire pipeline and filtered, so that, on the one hand, precise and reliable leak detection is possible and, on the other hand, a very low number of false alarms can be guaranteed.

U.S. Pat. No. 4,452,306A discloses a method of detecting and correcting breaks in a drill pipe above and below the drilling drive to prevent the loss of drill fluid, comprising running a seating support in the drill string at the top of the drilling drive and subsequently placing a flushing locator tool in the drill pipe until the tool seats in the seating support. The drill string is pressurized above the seated tool to a predetermined pressure. The predetermined pressure is monitored to verify whether or not the predetermined pressure holds without bleeding, indicating that there is no noticeable leak in the drill string between the tool and the surface, or does not hold and bleeds, indicating that there is a leak. If the pressure holds without bleeding, the shear pins are cut into the tool to establish circulation and the stern of the bit is pulled dry, and the downhole assembly below the drill collar is checked. When the pressure is not maintained, the drill string is pulled to detect and correct any ruptures that cause a decrease in the predetermined pressure.

Document U.S. Pat. No. 4,131,216A discloses a system and a method for detecting leaks in an underground pipeline network that supplies liquid petroleum products pumped from an underground storage tank to an above-ground dispenser outlet. A highly sensitive flow detector located in a parallel circuit bypass arrangement is selectively operated to determine whether or not a leak exists in the pipeline. After a sufficient period of non-dispensing time to allow the temperature of the pipeline network to stabilize, the detector is activated in a controlled sequence of advance and non-advance steps that culminate in verifying whether or not a leak exists in the pipeline while eliminating any false indication caused by the detector malfunction.

The documents of the state of the art do not present teachings aimed at means of identifying the position of a hole or a crack in a drill string.

Accordingly, the features and advantages of the present invention compared to the state of the art will clearly emerge from the detailed description below and with reference to the attached drawings, which are provided as a preferred, non-limiting embodiment. Furthermore, it is noted that the aforementioned documents of the state of the art are more concerned with identifying a leak rather than precisely locating the position of the opening (hole or crack) where the unintentional leak occurs.

BRIEF DESCRIPTION OF THE INVENTION

The present invention discloses a method for inferring the position of a hole or crack in a drill string, characterized in that it comprises the steps of:

    • identifying a pressure drop in the standpipe and/or a drop in the rotation of the turbine of the bottom-hole assembly of the continuous logging instrument;
    • obtaining the head losses in the bottom-hole assembly;
    • calibrating the head losses inside the drill string;
    • calculating the distance from the hole or crack to the bottom-hole, by using the equation:

Δ ⁢ P fric SP → Pint = [ Δ ⁢ P DP Q ⁢ 1 m * 
 ( L pwd - L bha ) ] - [ Δ ⁢ P DP Q ⁢ 1 m * ( L x ) ] + [ Δ ⁢ P DP Q ⁢ 2 m * ( L x ) ] + [ Δ ⁢ P bha Q ⁢ 2 ]

    • where:
    • ΔPfricSP→Pint: Head loss inside the drill string, between the standpipe pressure sensor and the PWD (Pressure While Drilling) sensor using flow rate before a leak (Q1);

Δ ⁢ P DP Q ⁢ 1 m :

    •  Head loss per meter inside the string using flow rate before the leak (Q1);

Δ ⁢ P DP Q ⁢ 2 m :

    •  Head loss per meter inside the string using flow rate after the leak section (Q2);
    • ΔPbhaQ2: Head loss through the BHA using flow rate after the leak section (Q2);
    • Lbha: Distance between the start of the bottom-hole assembly and the pressure sensor;
    • Lpwd: Distance between the standpipe and the bottom-hole assembly.

The step of obtaining the head losses in the bottom-hole assembly is performed through the Shallow Test and comprises:

    • collecting or estimating a plurality of data, comprising:
      • data on solids density;
      • data on the fluid flow rate when passing through the drill string before identifying the hole or crack (Q1);
      • data on the head loss in the drill bit after identifying the hole or crack;
      • data on the total head loss during the Shallow Test (DP_ShalT);
      • data on the head loss of the BHA completely inside the well;
      • data on the head loss of the BHA partially inside the well;
      • data on the head loss of the BHA along a portion of the drill string inside the well.

The step of calibrating the head losses inside the drill string comprises:

    • collecting samples of pressure and flow rate points at each end of the drill string; wherein each sample comprises:
      • drill fluid flow;
      • pressure in the standpipe;
      • pressure inside the bottom-hole assembly;
      • drill depth;
      • equivalent static density; and
      • annular pressure;
    • adjusting the inlet flow rate efficiency;
    • comparing the actual and calculated values of head losses in the drill string, correcting the same by using a correction factor.

The head loss inside the drill string is obtained by the difference between the pressure read in the standpipe and the pressure inside the bottom-hole, discounting the effects of hydrostatics and fluid compressibility.

The correction factor is obtained by using the least squares method applied to the pressure and flow rate points at each end of the drill string where samples are collected.

Further, according to another preferred embodiment of the present invention, a computer-readable storage media is defined comprising, stored in itself, a set of computer-readable instructions, which when executed by a computer, executes the computer-implemented method to identify the position of a hole or a crack in a drill string of the present invention.

BRIEF DESCRIPTION OF THE FIGURES

In order to complement the present description and obtain a better understanding of the features of the present invention, and in accordance with a preferred embodiment thereof, a set of figures is presented in the attachment, where its preferred embodiment is represented in an exemplary, although not limitative, manner.

FIG. 1 presents a flowchart of the computer-implemented method for identifying the position of a hole or a crack in a drill string.

FIG. 2 presents the position for collecting head losses through the Shallow Test.

FIG. 3 presents the position for obtaining the portion of the friction loss between the pressure in the standpipe and the pressure inside the bottom-hole assembly, through the sensor readings.

FIG. 4 presents a graph showing the pressure drop in the standpipe and the drop in the rotation of the turbine of the continuous logging instrument.

FIG. 5 presents an example of a table containing some of the data collected in the Shallow Test, in an exemplary application of the method of the present invention.

FIG. 6 presents a hole identified, through the method of the invention, in the bottom-hole assembly.

DETAILED DESCRIPTION OF THE INVENTION

The method for identifying the position of a hole or a crack in a drill string of the present invention efficiently solves the problem of locating leaks in the bottom-hole assembly.

As observed in FIG. 1, which presents a flowchart of the computer-implemented method for identifying the position of a hole or a crack in a drill string of the present invention, said method comprises the steps of:

    • identifying a pressure drop in the standpipe and/or a drop in the rotation of the turbine of the continuous logging instrument (1);
    • obtaining the head losses in the bottom-hole assembly (BHA) (2);
    • calibrating the head losses inside the drill string (3);
    • calculating the distance Lx from the hole or crack to the bottom-hole assembly (4), from equation 1:

Δ ⁢ P fric SP → Pint = [ Δ ⁢ P DP Q ⁢ 1 m * ( L pwd - L bha ) ] - 
 [ Δ ⁢ P DP Q ⁢ 1 m * ( L x ) ] + [ Δ ⁢ P DP Q ⁢ 2 m * ( L x ) ] + [ Δ ⁢ P bha Q ⁢ 2 ] ( equation ⁢ 1 )

    • where:
    • ΔPfricSP→Pint: Head loss inside the drill string, between the pressure sensor of the standpipe and the PWD (Pressure While Drilling) sensor using flow rate before the leak Q1; it is obtained by the difference between the pressure read in the standpipe (Pstandpipe) and the pressure inside the bottom-hole assembly (Pinternal), discounting the effects of hydrostatics and fluid compressibility;

Δ ⁢ P DP Q ⁢ 1 m :

    •  Head loss per meter inside the string using flow rate before the leak (Q1);

Δ ⁢ P DP Q ⁢ 2 m :

    •  Head loss per meter inside the string using flow rate after the leak section (Q2);
    • ΔPbhaQ2: Head loss through the BHA using flow rate after the leak section (Q2);
    • Lbha: Distance between the start of the bottom-hole assembly and the pressure sensor;
    • Lpwd: Distance between the standpipe and the bottom-hole assembly.

Specially, a hole or a crack, within the scope of the method of the present invention, is defined as any opening where a leak may occur unintentionally.

In particular, the identification of any indicator of a leak in the drill string is performed through the computer program or set of instructions that performs the method for monitoring the well drilling operations, which operates 24 hours a day. It is necessary to recognize the start of the leak event to trigger the start of the computer-implemented method for identifying the position of a hole or a crack in a drill string of the present invention.

In this way, when there is any type of unintentional leak in the drill string, a drop in pressure in the standpipe and/or a drop in rotation of the turbine of the continuous logging instrument 1 are identified and, consequently, changes in these parameters are identified. From this, the computer-implemented method for identifying the position of a hole or a crack in a drill string of the present invention is initiated. Consequently, the position where the leak occurs and the distance from the hole or crack to the bottom-hole assembly (Lx) can also be obtained.

Specifically, the step of obtaining the head losses in the bottom-hole assembly 2 involves performing a test before starting the drilling operations in the well, known as the Shallow Test.

More specifically, the Shallow Test is performed in all well drilling operations with the aim of obtaining the head losses in the bottom-hole assembly.

The head losses obtained in the Shallow Test are corrected by taking into account the fluid defined at the time of the point collections, during the calibration.

FIG. 3 presents the position of collection of the head losses through the Shallow Test, showing:

    • ΔPbit: Head loss in the bit calculated based on the flow rate, total flow area (TFA) and fluid;
    • ΔPBHA_annulus: Head loss in the annulus, in the BHA section, which is disregarded because it is irrelevant compared to the other head losses in the well;
    • Pstandpipe: Head loss obtained in the Shallow Test, discounting the head loss in the bit ΔPbit and the head loss in the annulus region of the bottom-hole assembly ΔPBHA_annulus.

More specifically, the step of obtaining the head losses in the bottom-hole assembly is carried out through the Shallow Test, and includes collecting or estimating a plurality of data comprising:

    • data on the density of the solids (rho_ShT);
    • data on the flow rate of the fluid as it passes through the drill string before identifying the hole or crack Q1;
    • data on the head loss in the drill bit (DP_pwd, ΔPbit) after identifying the hole or crack, that is, the head loss due to the passage of the fluid through the jet holes of the bit;
    • data on the total head loss obtained during the Shallow Test (DP_ShalT), being the sum of the previous head losses;
    • data on the head loss inside the bottom-hole assembly (DP_BHA), which comprises:
      • data on the head loss of the BHA completely inside the well;
      • data on the head loss of the BHA partially inside the well;
      • data on the head loss of the BHA along with a portion of the drill string inside the well.

Depending on the situation, the Shallow Test can be performed with the BHA completely inside the well, with the BHA partially inside the well and with the BHA along with a portion of the drill string inside the well. For the BHA inside the well, all the head loss obtained in the Shallow Test is applied to the BHA. In turn, for the BHA partially inside the well, a concept of excess BHA is defined, that is, the section covered by the test will have its head loss defined, and the remainder will be calibrated together with the drill string. For the BHA along with a portion of the drill string inside the well, the BHA and part of the drill string have their head losses defined by the Shallow Test.

After performing the Shallow Test, the only section that remains without a defined head loss is the drill string.

More specifically, the step of calibrating the head losses inside the drill string 3 is performed during drilling, and includes collecting samples from pressure and flow rate points, by using sensors, at each end of the drill string.

Regarding sample collection, at the time of sampling, continuous parameters are collected for drill fluid flow Q; pressure in the standpipe SPP; pressure inside the bottom-hole assembly Pinternal; drill bit depth; equivalent static density ESD; and pressure in the annulus Pannulus.

Therefore, after the step of collecting samples of pressure and flow rate points at each end of the drill string, the step of calibrating the head losses inside the drill string 3 additionally comprises adjusting the efficiency of the inlet flow (Q1) in order to minimize, for all samples, the error obtained between the pressure differential PWD and the calculated head loss in the drill bit.

Still in relation to the step of calibrating the head losses inside the drill string 3, this additionally comprises comparing the actual and calculated head losses in the drill string, correcting them through a correction factor alpha.

Furthermore, the flow rate passing through the drill bit in the period prior to the occurrence of the hole or crack Q1 and the flow rate passing through the drill bit after the appearance of the leak Q must be obtained. In this way, the predicted pressure differential in the drill bit must resemble the measured pressure differential.

As to the sample collection, one of the data collected corresponds to the friction portion (ΔPfric) between the pressure in the standpipe (Pstandpipe, SPP) and the pressure inside the bottom-hole assembly (Pinternal). In other words, the friction portion (ΔPfric) is the difference between the pressure read in the standpipe (Pstandpipe, SPP) and the internal pressure of the bottom-hole assembly (Pinternal), the hydrostatic pressure and the outlet pressure, which is atmospheric pressure. Thus, the friction portion (ΔPfric) can be determined through equation 2:

Δ ⁢ P P standpipe → P internal = P standpipe - { P internal - [ ( 0.1704 * ESD Calc No ⁢ Solids * TVD PWD ) - P outlet ] } ( equation ⁢ 2 )

    • where:
    • Pstandpipe: Pressure in the standpipe;
    • Pinternal: Pressure in the bottom-hole assembly sensor;
    • ESDCalcNo Solids: Static equivalent density;
    • TVDPWD: Vertical depth of the PWD sensor;
    • Poutlet: Outlet pressure.

Regarding the friction portion (ΔPfric), it can still be defined by separating the same into head loss by equipment, so that:

Δ ⁢ P P standpipe → P internal = Δ ⁢ P drill ⁢ pipe + Δ ⁢ P BHA ( equation ⁢ 3 ) P standpipe ShallowTest - Δ ⁢ P bit = Δ ⁢ P BHA + Δ ⁢ P Annulus BHA ( equation ⁢ 4 ) Δ ⁢ P drill ⁢ pipe = Δ ⁢ P P standpipe → P internal - ( P SP ShallowTest - Δ ⁢ P bit ) ( equation ⁢ 5 ) Δ ⁢ P drill ⁢ pipe Calibrated = Δ ⁢ P drill ⁢ pipe Original * Alpha ( equation ⁢ 6 )

    • where:
    • ΔPPstandpipe→Pinternal Head loss in the region between the drill pipe and the internal pressure in the bottom-hole assembly;
    • ΔPdrilling pipe: Head loss in the drill pipe or drill string;
    • ΔPBHA: Head loss in the bottom-hole assembly;
    • PSPShallowTest: Pressure in the drill pipe during the Shallow Test;
    • ΔPbit: Head loss in the drill bit;
    • ΔPAnnulusBHA: Head loss in the annular region of the bottom-hole assembly;
    • PSPShallowTest: Pressure in the standpipe during the Shallow Test;
    • ΔPdrill pipeCalibrated: Head loss in the drill pipe or drill string after calibration;
    • ΔPdrill pipeOriginal: Head loss in the uncalibrated drill pipe or drill string;
    • Alpha: Calibration factor for the head loss in the drill pipe or drill string.

In particular, the pressure in the standpipe during the Shallow Test (PSPShallowTest, PstandpipeShallowTest) is obtained from the linear regression performed with the points collected during the Shallow Test.

Furthermore, the alpha correction factor is obtained by using the least squares method applied to the points collected in the calibration table, that is, applied to the pressure and flow rate points at each end of the drill string where samples are collected, in the step of calibrating the head losses inside the drill string 3.

In particular, in order to calculate the distance Lx from the hole or crack to the bottom-hole assembly 4, once the Shallow Test data has been obtained, the calibration data has been collected, the inlet flow rate efficiency (Q1) has been adjusted and the calibration has been performed obtaining the alpha correction factor, it is possible to calculate the position of the leak from equation 1, described above:

Δ ⁢ P fric SP → Pint = [ Δ ⁢ P DP Q ⁢ 1 m * ( L pwd - L bha ) ] - 
 [ Δ ⁢ P DP Q ⁢ 1 m * ( L x ) ] + [ Δ ⁢ P DP Q ⁢ 2 m * ( L x ) ] + [ Δ ⁢ P bha Q ⁢ 2 ] . ( equation ⁢ 1 )

In this way, it is possible to quickly find the distance Lx from the hole to the bottom-hole assembly and thus reduce the rig's downtime.

In a complementary way, the present invention relates to a computer-readable storage media, which comprises, stored in itself, a set of computer-readable instructions, in which, when the set of computer-readable instructions is executed by one or more processors, the one or more processors implement the computer-implemented method for identifying the position of a hole or a crack in a drill string of the present invention, as described above.

In particular, the computer-readable storage media may be a memory, in which the memory may be a non-volatile type, such as a hard disk drive (HDD) or a solid-state drive (SSD), or it may be a volatile memory, such as a random access memory (RAM). Further, the readable storage media may be any other medium or media that can transport or store or record the expected program code in the form of an instruction or a data structure or a set of instructions, and can be accessed by one or more computers or one or more processors, but is not limited to the same. The readable storage media may alternatively be a circuit or any other device or medium that can implement a storage or transport or recording function, such as a signal or a carrier.

Specifically, the set of computer-readable instructions represents the algorithm or the computer program code or a data structure, which performs the computer-implemented method for identifying the position of a hole or a crack in a drill string of the present invention, as described above.

The processor may be a general purpose processor, which may be a microprocessor or any conventional processor or the like.

Results and Application of the Invention

An example of application of the method to identify the position of a hole or a crack in a drill string is carried out by identifying the pressure drop in the standpipe (represented by the first dashed oval marking) and the drop in rotation of the turbine of the continuous logging instrument (represented by the third dashed oval marking), as exemplified in FIG. 4.

The Shallow Test was performed before starting drilling operations in the well. Thus, as observed in FIG. 5, data are collected on the density of the solids (rho_ShT); head loss in the drill bit (DP_pwd); the head loss inside the bottom-hole assembly (DP_BHA); the total head loss obtained during the test (DP_ShalT), being the sum of the previous head losses; data at different flow rate points along the drill string (Q); data on the pressure in the annular region of the bottom-hole assembly (P_annulus); the pressure in the bottom-hole assembly sensor (P_internal); data on the pressure drop of the internal hydraulic pressure (DP_SP-Pint); and head loss of the internal pressure of the friction portion (DP_SP-Pint_fric).

With this, the distance between the hole and the bottom-hole assembly (Lx) is calculated. Then, it was found that Lx=−305.541 meters.

In this way, after investigating the operation, it was proven that the hole in the drill string was-300 meters from the bottom-hole assembly, as illustrated in FIG. 6. Thus, the error was only 1.8% between the value calculated by using the method of the present invention and the actual position of the hole.

The computer-implemented method for identifying the position of a hole or a crack in a drill string provides faster responses and improves the correction and control capacity during the well drilling operations, making it possible to identify the distance of the leak in real time.

Furthermore, the computer-implemented method for identifying the position of a hole or crack in a drill string allows the operators to be removed from hazardous environments, which reduces exposure to hazards and reduces the labor costs, such as those related to hazards.

Finally, the application of the computer-implemented method for identifying the position of a hole or crack in a drill string of the present invention provides a significant acceleration of the response time. This allows the well to operate under ideal conditions for longer, reducing the duration of major corrective actions and improving the operational efficiency. In this way, a faster response time also reduces the waste of corrective materials and reduces the environmental impact associated with well drilling. The time saved is associated with the depth of the hole or crack, being more significant for occurrences closer to the bottom-hole.

Those skilled in the art will appreciate the knowledge presented herein and will be able to reproduce the invention in the presented embodiments and in other variants, encompassed by the scope of the attached claims.

Claims

1. A computer-implemented method for identifying the position of a hole or a crack in a drill string, the computer-implemented method comprising:

identifying a pressure drop in a standpipe and/or a drop in a rotation of a turbine of a continuous logging instrument;

obtaining head losses in a bottom-hole assembly (BHA);

calibrating the head losses inside the drill string; and

calculating a distance (Lx) from the hole or the crack in the drill string to the BHA, from the equation:

Δ ⁢ P fric SP → Pint = [ Δ ⁢ P DP Q ⁢ 1 m * 
 ( L pwd - L bha ) ] - [ Δ ⁢ P DP Q ⁢ 1 m * ( L x ) ] + [ Δ ⁢ P DP Q ⁢ 2 m * ( L x ) ] + [ Δ ⁢ P bha Q ⁢ 2 ]

wherein:

ΔPfricSP→Pint is head loss inside the drill string between a standpipe pressure sensor and a pressure while drilling (PWD) sensor using flow rate before a leak (Q1);

Δ ⁢ P DP Q ⁢ 1 m

 is head loss per meter inside the drill string using the flow rate before the leak (Q1):

Δ ⁢ P DP Q ⁢ 2 m

 is head loss per meter inside the drill string using flow rate after a leak section (Q2);

ΔPbhaQ2 is head loss through the BHA using the flow rate after the leak section (Q2);

Lbha is distance between a start of the BHA and the standpipe pressure sensor; and

Lpwd is distance between the standpipe and the BHA.

2. The computer-implemented method of claim 1, wherein the head losses in the BHA are obtained through a shallow test comprising:

collecting or estimating a plurality of data, the plurality of data comprising:

data on solids density (rho_ShT);

data on the fluid flow rate when passing through the drill string before identifying the hole or crack (Q1);

data on a head loss in a drill bit (DP_pwd, ΔPbit) after identifying the hole or the crack;

data on a total pressure drop during the shallow test (DP_ShalT);

data on the head loss of the BHA completely inside a well;

data on the head loss of the BHA partially inside the well; and

data on the head loss of the BHA along a portion of the drill string inside the well.

3. The computer-implemented method of claim 1, wherein the calibrating step comprises:

collecting samples of pressure and flow rate points at each end of the drill string, wherein each of the samples comprises:

flow rate of a drill fluid (Q);

pressure in the standpipe (SPP);

pressure inside the BHA (Pinternal);

depth of a drill bit;

equivalent static density (ESD); and

pressure in an annulus (Pannulus);

adjusting an efficiency of an inlet flow (Q1);

comparing actual and calculated values of the head losses in the drill string; and

correcting the actual and calculated values by using a correction factor.

4. The computer-implemented method of claim 1, wherein the head loss inside the drill string is obtained from a difference between a pressure read in the standpipe (Pstandpipe) and a pressure inside the BHA (Pinternal), discounting effects of hydrostatics and fluid compressibility.

5. The computer-implemented method of claim 3, wherein the correction factor is obtained by applying the least squares method to the pressure and flow rate points at each end of the drill string where the samples are collected.

6. A computer-readable storage media comprising a set of computer-readable instructions stored therein, wherein the set of computer-readable instructions are configured to be executed by a computer to perform the computer-implemented method of claim 1.