Well integrity toolbox
The TheTechIdea.OilGas.Integrity package. Settings: toolboxes.integrity in the environment.
Multi-finger caliper wall loss
MfcAnalysis.Analyze(model, caliperLogSet) interprets a multi-finger caliper (MFC) run - one radius curve per finger, numbered around
the tool (fingerCurves, e.g. R01 ... R40), in any length unit. Following KAPPA's Multifinger Caliper Interpretation and
Applications (N. Kotlar):
- the readings at each depth are first centred on a fitted eccentric circle (an eccentric tool otherwise reads as false penetration);
excludeFingersleaves the worst-fitting fingers - the ones in defects - out of the fit; - penetration = (2 x maximum radius - nominal ID) / (nominal OD - nominal ID) - twice the maximum radius, so a hole through the wall reads 100 % and not 50 %;
- reduction = (ID/2 - minimum radius) / (ID/2);
- ovality = (maximum - minimum opposite-finger diameter) / their average (standards define ovality differently - this is the one used);
- areal metal loss = sum(Si^2 - ID^2) / (n x (OD^2 - ID^2)), Si = twice finger i's radius - the cross-sectional loss, as GOWell interpretation reports state it;
- remaining wall at the deepest penetration = (OD - 2 x maximum radius) / 2 with the nominal OD - a caliper cannot see external corrosion.
The nominal pipe at each depth is the innermost casing or tubing string covering it (its OD and ID). Results come back as curves
(PENE, MLOSS, REDU, OVAL, IDMAX, IDMIN, RWALL, ECC) on the caliper's depths - shown with the usual log tracks - and per joint: maximum
penetration and its depth, maximum metal loss, minimum remaining wall, maximum ovality, minimum ID, and the damage class. Joints come
from a tally you pass in, or from the casing collar locator (cclMnemonic, cclThreshold - no default, it depends on the tool), with
connectionExclusion left out each side of a connection; without either, the statistics are per nominal pipe interval and the result
says so. Damage classes are your company's (damageClasses, by maximum penetration) - there is no industry-standard scale, so none is
built in. MfcAnalysis.JointsCsv exports the joint table.
Re-rating corroded joints
Rerating.Rerate(model, mfcResult, loads) re-rates each joint with the same API TR 5C3 formulas as the casing design check (burst,
collapse in its regime, pipe-body tension), at the joint's measured wall and the nominal OD, and shows each against the nominal rating.
Which wall is a decision about the corrosion, not a formula - KAPPA calls it interdisciplinary: isolated pits tend to leak rather than
weaken the pipe, uniform loss weakens it. integrity.wallBasis chooses:
minimumWall(default, conservative) - the wall left at the deepest penetration;averageWall- the uniform wall that leaves the same metal area as the joint's areal metal loss.
API's 0.875 wall-tolerance factor stays in the burst formula as API states it. Loads and design factors are those of the casing design
check: collapse with the casing evacuated at the joint's TVD, a surface test pressure, the buoyed weight of string below the joint,
against casingDesign.designFactors. A joint penetrated through is rated zero; a grade without a minimum yield is reported, not rated.
CorrosionTrack shows the joints beside the schematic (class colour, re-rated burst and collapse as a percentage of nominal, design
factors, failures in the Failed colour); Rerating.ToCsv exports them.
Annular casing pressure
Following API RP 90 (Annular Casing Pressure Management) as the US regulator applies it (BSEE NTL 2009-G01, 30 CFR 250 subpart E).
MAWOP - Mawop.For(model, annulus) gives the maximum allowable wellhead operating pressure of an annulus as the lesser of 50 % of
the minimum internal yield pressure (MIYP) of the casing being evaluated, 80 % of the MIYP of the next outer casing (for the outermost
casing: 30 % of its own MIYP instead) and 75 % of the collapse rating of the inner tubular. MIYP and collapse are the API 5C3 ratings
of the casing design check; the next outer casing is one that reaches the wellhead (a liner hung deeper does not bound the annulus). The
result names the governing term; a missing rating means no MAWOP, and a recorded MAWOP that differs is pointed out.
Diagnostic test - CasingPressureDiagnostic.Classify(test, mawop) reads a bleed-down / build-up test (the readings, when bleeding
started, when the valve was closed): a pressure above 100 psig needs the test; sustained casing pressure must bleed to 0 psig through a
1/2-inch needle valve within 24 hours; pressure that builds up again after the bleed-down is sustained; pressure above the MAWOP is a
departure. As RP 90 says, a departure is not by itself an unacceptable risk - it calls for a risk assessment.
Every number is a setting (toolboxes.integrity.casingPressure): the diagnostic threshold, bleed and build-up hours, the zero
tolerance and the four MAWOP fractions - for regimes that set them differently.
Well integrity status and the field board
IntegrityStatus.Assess(model, inputs) puts a well in the categories of Norwegian Oil and Gas / Offshore Norge guideline 117:
| Category | Principle |
|---|---|
| Red | One barrier failure and the other degraded / not verified, or leak to surface |
| Orange | One barrier failure and the other intact, or a single failure may lead to leak to surface |
| Yellow | One barrier degraded, the other intact |
| Green | Healthy well - no or minor integrity issue |
Green and yellow comply with the two-barrier principle; orange and red do not and call for diagnosis and a risk assessment. The barrier envelopes come from the well's latest as-built barrier set (an element's Impaired is the guideline's "degraded", Unverified its "not verified"); an element common to both envelopes means a single failure may lead to leak to surface. The other inputs: corroded joints that fail their design factors (7.2) degrade the barrier elements of their string; annulus diagnostics (7.3) - pressure that cannot be kept below the MAWOP is orange, a leak rate above its criteria (not bleeding to zero) is orange, or red when the pressure is above the MAWOP as well; an observed leak to surface is red. Every category comes with its reasons.
FieldIntegrity counts the wells per category and lists them worst first (ToCsv); IntegrityBoardView shows the field as tiles in
the category colours (toolboxes.integrity.categoryColors).
Exports follow the environment's units
MfcAnalysis.JointsCsv and Rerating.ToCsv write in the company's units, not the engines' inches and psi: depths in units.depthUnit, walls and
diameters in units.diameterUnit, pressures in units.pressureUnit and tension in units.forceUnit, each column named with its unit
(top_m, min_remaining_wall_mm, burst_kPa, tension_kN). Numbers are always in the invariant format.