Class ProductionAllocator

java.lang.Object
neqsim.process.fielddevelopment.evaluation.ProductionAllocator
All Implemented Interfaces:
Serializable

public class ProductionAllocator extends Object implements Serializable
Production allocation and metering calculations.

Handles production allocation when multiple wells or sources are commingled, accounting for measurement uncertainty. Key tool for fiscal metering, production reporting, and revenue allocation.

Metering Technologies Supported

  • Ultrasonic - ±0.5% (fiscal gas)
  • Coriolis - ±0.1% (fiscal liquid)
  • Differential Pressure - ±1.0% (process)
  • Multiphase - ±2-5% (wellhead)
  • Venturi/Orifice - ±1.5% (gas)

Example Usage


ProductionAllocator allocator = new ProductionAllocator();
allocator.addSource("Well-A", wellAStream, MeteringType.MULTIPHASE);
allocator.addSource("Well-B", wellBStream, MeteringType.MULTIPHASE);
allocator.setExportMeter("Export", exportStream, MeteringType.ULTRASONIC);

Map<String, Double> allocation = allocator.allocateByOil();

Version:
1.0
Author:
ESOL
See Also:
  • Field Details

  • Constructor Details

    • ProductionAllocator

      public ProductionAllocator()
  • Method Details

    • addSource

      public ProductionAllocator addSource(String name, StreamInterface stream, ProductionAllocator.MeteringType meterType)
      Adds a production source for allocation.
      Parameters:
      name - source identifier (e.g., well name)
      stream - production stream
      meterType - metering technology
      Returns:
      this for chaining
    • addSource

      public ProductionAllocator addSource(String name, StreamInterface stream)
      Adds a production source with multiphase meter (default).
      Parameters:
      name - source name
      stream - production stream
      Returns:
      this for chaining
    • setExportMeter

      public ProductionAllocator setExportMeter(String name, StreamInterface stream, ProductionAllocator.MeteringType meterType)
      Sets the export/sales meter reference.
      Parameters:
      name - meter name
      stream - export stream
      meterType - metering technology
      Returns:
      this for chaining
    • allocateByOil

      public Map<String,Double> allocateByOil()
      Allocates production by oil contribution.

      Oil-based allocation is common for commingled oil production. Each source is allocated a fraction of the export based on its oil flow rate contribution.

      Returns:
      map of source name to allocation fraction
    • allocateByGas

      public Map<String,Double> allocateByGas()
      Allocates production by gas contribution.
      Returns:
      map of source name to allocation fraction
    • allocateByMass

      public Map<String,Double> allocateByMass()
      Allocates production by total mass.
      Returns:
      map of source name to allocation fraction
    • allocateByEnergy

      public Map<String,Double> allocateByEnergy()
      Allocates production by energy content (hydrocarbon heating value).
      Returns:
      map of source name to allocation fraction
    • getAllocatedOilVolumes

      public Map<String,Double> getAllocatedOilVolumes(double exportOilSm3d)
      Gets allocated oil volume for each source.
      Parameters:
      exportOilSm3d - export oil volume in Sm³/d
      Returns:
      map of source name to allocated volume
    • getAllocatedGasVolumes

      public Map<String,Double> getAllocatedGasVolumes(double exportGasSm3d)
      Gets allocated gas volume for each source.
      Parameters:
      exportGasSm3d - export gas volume in Sm³/d
      Returns:
      map of source name to allocated volume
    • getOverallUncertainty

      public double getOverallUncertainty()
      Calculates overall allocation uncertainty.

      Uses root-sum-square method to combine uncertainties from individual meters.

      Returns:
      overall uncertainty as fraction
    • getSourceUncertainty

      public double getSourceUncertainty(String sourceName)
      Gets uncertainty for a specific source's allocation.
      Parameters:
      sourceName - source name
      Returns:
      uncertainty as fraction
    • getAllocatedWithUncertainty

      public double[] getAllocatedWithUncertainty(String sourceName, double exportVolume)
      Gets allocated volume with uncertainty bounds.
      Parameters:
      sourceName - source name
      exportVolume - total export volume
      Returns:
      array [allocated, low, high]
    • getMassImbalance

      public double getMassImbalance()
      Calculates mass balance imbalance.
      Returns:
      imbalance as fraction of export
    • isBalanceAcceptable

      public boolean isBalanceAcceptable(double toleranceFraction)
      Checks if imbalance exceeds acceptable tolerance.
      Parameters:
      toleranceFraction - acceptable tolerance (e.g., 0.02 for 2%)
      Returns:
      true if imbalance is acceptable
    • generateReport

      public String generateReport()
      Generates an allocation report.
      Returns:
      markdown formatted report
    • getOilFlowRate

      private double getOilFlowRate(StreamInterface stream)
      Gets oil flow rate from a stream.
    • getGasFlowRate

      private double getGasFlowRate(StreamInterface stream)
      Gets gas flow rate from a stream.
    • getEnergyRate

      private double getEnergyRate(StreamInterface stream)
      Gets energy rate (heating value * flow).