Class AnnularLeakagePath

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, ProcessElementInterface, SimulationInterface, NamedInterface

public class AnnularLeakagePath extends ProcessEquipmentBaseClass
Models fluid leakage through compromised well cement or micro-annulus between zones.

This class calculates leakage flow through two mechanisms:

  • Channel flow (cubic law): Flow through a narrow gap between casing and formation, applicable when debonding creates a micro-annulus. The volumetric flow rate follows: q = w * delta^3 / (12 * mu) * dP/L
  • Porous cement (Darcy flow): Flow through degraded or poorly-placed cement with non-zero permeability: q = k * A / (mu * L) * dP

The class can be wired into a ProcessSystem as a parallel flow path alongside the main wellbore to quantify the behind-casing contribution to out-of-zone injection.

Usage Example

AnnularLeakagePath leakage = new AnnularLeakagePath("cement leak");
leakage.setPathGeometry(1500.0, 1600.0, 0.10, 0.001); // 100m path, 0.1m wide, 1mm gap
leakage.setFluid(reservoirFluid.clone());
leakage.calculate(350.0, 250.0); // 350 bara source, 250 bara sink

System.out.println("Channel leak rate: " + leakage.getChannelLeakageRate("m3/day") + " m3/day");
System.out.println("Cement leak rate: " + leakage.getCementLeakageRate("m3/day") + " m3/day");
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • logger

      private static final org.apache.logging.log4j.Logger logger
    • mechanism

    • depthTop

      private double depthTop
    • depthBottom

      private double depthBottom
    • pathLength

      private double pathLength
    • channelWidth

      private double channelWidth
    • channelGap

      private double channelGap
    • cementPermeability

      private double cementPermeability
    • cementCrossSectionArea

      private double cementCrossSectionArea
    • fluidViscosity

      private double fluidViscosity
    • fluidDensity

      private double fluidDensity
    • sourcePressure

      private double sourcePressure
    • sinkPressure

      private double sinkPressure
    • channelLeakageRate

      private double channelLeakageRate
    • cementLeakageRate

      private double cementLeakageRate
    • totalLeakageRate

      private double totalLeakageRate
    • fluid

      private SystemInterface fluid
    • casingBurstRating

      private double casingBurstRating
      Casing burst rating at surface in bara.
    • tubingCollapseRating

      private double tubingCollapseRating
      Tubing collapse rating in bara.
    • shoeDepth

      private double shoeDepth
      Shoe depth in m TVD.
    • fracPressureAtShoe

      private double fracPressureAtShoe
      Fracture pressure at shoe in bara.
    • annularFluidGradient

      private double annularFluidGradient
      Annular fluid gradient in bar/m.
    • maaspBurstSafetyFactor

      private double maaspBurstSafetyFactor
      Safety factor for burst MAASP per API RP 90.
    • maaspCollapseSafetyFactor

      private double maaspCollapseSafetyFactor
      Safety factor for collapse MAASP per API RP 90.
    • maasp

      private double maasp
      Computed MAASP in bara.
    • maaspLimitingCriterion

      private String maaspLimitingCriterion
      MAASP limiting criterion.
  • Constructor Details

    • AnnularLeakagePath

      public AnnularLeakagePath(String name)
      Create an annular leakage path model.
      Parameters:
      name - equipment name
  • Method Details

    • setPathGeometry

      public void setPathGeometry(double depthTop, double depthBottom, double width, double gap)
      Set the leakage path geometry.
      Parameters:
      depthTop - top depth of leakage path (m TVD)
      depthBottom - bottom depth of leakage path (m TVD)
      width - circumferential width of channel (m), typically 0.01 - 0.3
      gap - radial aperture of micro-annulus (m), typically 0.0001 - 0.005
    • setCementPermeability

      public void setCementPermeability(double permeability, String unit)
      Set cement permeability for the porous flow model.
      Parameters:
      permeability - cement permeability value
      unit - permeability unit ("mD", "D", "m2")
    • setCementCrossSectionArea

      public void setCementCrossSectionArea(double area)
      Set the cement annulus cross-section area for Darcy flow.
      Parameters:
      area - cross-section area (m²)
    • setFluid

      public void setFluid(SystemInterface fluid)
      Set the fluid for viscosity calculation.
      Parameters:
      fluid - NeqSim fluid system
    • setFluidViscosity

      public void setFluidViscosity(double viscosity)
      Set fluid viscosity directly (used when no SystemInterface is available).
      Parameters:
      viscosity - dynamic viscosity (cP)
    • setFluidDensity

      public void setFluidDensity(double density)
      Set fluid density directly.
      Parameters:
      density - density (kg/m³)
    • setLeakageMechanism

      public void setLeakageMechanism(AnnularLeakagePath.LeakageMechanism mechanism)
      Set the leakage mechanism to use.
      Parameters:
      mechanism - leakage mechanism
    • calculate

      public void calculate(double sourcePressureBara, double sinkPressureBara)
      Calculate leakage flow rates between source and sink pressures.
      Parameters:
      sourcePressureBara - source zone pressure (bara)
      sinkPressureBara - sink zone pressure (bara)
    • getEffectiveViscosity

      private double getEffectiveViscosity()
      Get effective viscosity from NeqSim fluid or fallback value.
      Returns:
      viscosity in cP
    • getChannelLeakageRate

      public double getChannelLeakageRate(String unit)
      Get channel (micro-annulus) leakage rate.
      Parameters:
      unit - flow rate unit ("m3/s", "m3/day", "l/min")
      Returns:
      channel leakage rate
    • getCementLeakageRate

      public double getCementLeakageRate(String unit)
      Get cement porous-flow leakage rate.
      Parameters:
      unit - flow rate unit ("m3/s", "m3/day", "l/min")
      Returns:
      cement leakage rate
    • getTotalLeakageRate

      public double getTotalLeakageRate(String unit)
      Get total leakage rate (channel + cement).
      Parameters:
      unit - flow rate unit ("m3/s", "m3/day", "l/min")
      Returns:
      total leakage rate
    • getDominantMechanism

      public String getDominantMechanism()
      Get the dominant leakage mechanism based on calculated rates.
      Returns:
      dominant mechanism description
    • getPathLength

      public double getPathLength()
      Get the path length.
      Returns:
      path length (m)
    • convertFlowRate

      private double convertFlowRate(double rateM3s, String unit)
      Convert flow rate from m³/s to the requested unit.
      Parameters:
      rateM3s - rate in m³/s
      unit - target unit
      Returns:
      converted rate
    • setMAASPParameters

      public void setMAASPParameters(double casingBurstRating, double tubingCollapseRating, double shoeDepth, double fracPressureAtShoe, double annularFluidGradient)
      Set parameters for MAASP (Maximum Allowable Annular Surface Pressure) calculation.

      MAASP is calculated per API RP 90 and NORSOK D-010 Section 9 as the minimum of:

      • Casing burst rating / safety factor
      • Tubing collapse rating / safety factor
      • Fracture pressure at shoe minus hydrostatic head of annular fluid
      Parameters:
      casingBurstRating - casing burst rating at surface (bara)
      tubingCollapseRating - tubing collapse rating (bara)
      shoeDepth - shoe depth (m TVD)
      fracPressureAtShoe - fracture pressure at shoe (bara)
      annularFluidGradient - annular fluid pressure gradient (bar/m), default ~0.098 for water
    • setMAASPSafetyFactors

      public void setMAASPSafetyFactors(double burstSF, double collapseSF)
      Set MAASP safety factors from standards (typically loaded from API RP 90 CSV data).
      Parameters:
      burstSF - burst safety factor (default 1.10 per API RP 90)
      collapseSF - collapse safety factor (default 1.00 per API RP 90)
    • calculateMAASP

      public double calculateMAASP()
      Calculate MAASP (Maximum Allowable Annular Surface Pressure) per API RP 90.

      MAASP = min(P_burst/SF_burst, P_collapse_tubing/SF_collapse, P_frac_shoe - rho*g*h_shoe)

      Returns:
      MAASP in bara
    • getMAASP

      public double getMAASP()
      Get the calculated MAASP value.
      Returns:
      MAASP in bara
    • getMAASPLimitingCriterion

      public String getMAASPLimitingCriterion()
      Get the criterion that limits the MAASP.
      Returns:
      limiting criterion description
    • isAnnularPressureExceeded

      public boolean isAnnularPressureExceeded(double annularPressureBara)
      Check if annular pressure exceeds MAASP.
      Parameters:
      annularPressureBara - current annular pressure (bara)
      Returns:
      true if pressure exceeds MAASP
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Parameters:
      id - UUID