Class WellScheduler

java.lang.Object
neqsim.process.util.fielddevelopment.WellScheduler
All Implemented Interfaces:
Serializable

public class WellScheduler extends Object implements Serializable
Schedules well interventions, workovers, and tracks well availability.

This class provides comprehensive well scheduling capabilities including:

  • Well status and availability tracking
  • Intervention and workover scheduling
  • Production impact analysis
  • Schedule optimization to minimize deferred production
  • Rig/vessel constraint handling
  • Gantt chart generation for visualization

Well Status Model

Each well can be in one of several states that affect its contribution to total production:

Intervention Planning

Interventions are scheduled activities that temporarily take a well offline but may improve its performance afterward. The scheduler calculates:

  • Deferred production during intervention
  • Expected production gain after intervention
  • Net present value of the intervention
  • Optimal timing considering rig availability

Integration with Facility Model

When a ProcessSystem is provided, the scheduler accounts for facility bottlenecks. This ensures that:

  • Production is capped at facility capacity even when well potential exceeds it
  • Interventions on non-bottleneck wells may not increase total production
  • Optimal scheduling prioritizes interventions that relieve constraints

Example Usage

WellScheduler scheduler = new WellScheduler(reservoir, facility);

// Add wells with their current potential
scheduler.addWell("Well-A", 5000.0, "Sm3/day");
scheduler.addWell("Well-B", 4000.0, "Sm3/day");
scheduler.addWell("Well-C", 3000.0, "Sm3/day");

// Schedule interventions
scheduler
    .scheduleIntervention(Intervention.builder("Well-A").type(InterventionType.COILED_TUBING)
        .startDate(LocalDate.of(2024, 6, 15)).durationDays(5).expectedGain(0.15) // 15%
                                                                                 // improvement
        .cost(500000, "USD").build());

// Optimize the schedule
ScheduleResult result = scheduler.optimizeSchedule(LocalDate.of(2024, 1, 1), LocalDate.of(2024, 12, 31), 1); // max 1
                                                                                                             // concurrent
                                                                                                             // intervention

System.out.println("Total deferred: " + result.getTotalDeferredProduction());
System.out.println("Total gain: " + result.getTotalProductionGain());
System.out.println(result.toGanttMarkdown());
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • DAYS_PER_YEAR

      private static final double DAYS_PER_YEAR
      Days per year for calculations.
      See Also:
    • reservoir

      private final SimpleReservoir reservoir
      Reservoir model (may be null).
    • facility

      private final ProcessSystem facility
      Surface facility process system (may be null).
    • wells

      private final Map<String, WellScheduler.WellRecord> wells
      Map of well names to well records.
    • defaultRateUnit

      private String defaultRateUnit
      Default rate unit for wells.
  • Constructor Details

    • WellScheduler

      public WellScheduler()
      Creates a well scheduler without reservoir or facility models.
    • WellScheduler

      public WellScheduler(SimpleReservoir reservoir, ProcessSystem facility)
      Creates a well scheduler with reservoir and facility models.
      Parameters:
      reservoir - reservoir model for production tracking
      facility - surface facility for bottleneck analysis
  • Method Details

    • addWell

      public WellScheduler.WellRecord addWell(String name, double initialPotential, String rateUnit)
      Adds a well with initial production potential.
      Parameters:
      name - well name (unique identifier)
      initialPotential - unconstrained production rate
      rateUnit - rate unit (e.g., "Sm3/day")
      Returns:
      the created well record
    • getWell

      public WellScheduler.WellRecord getWell(String name)
      Gets a well record by name.
      Parameters:
      name - well name
      Returns:
      well record, or null if not found
    • getAllWells

      public Collection<WellScheduler.WellRecord> getAllWells()
      Gets all well records.
      Returns:
      unmodifiable collection of well records
    • scheduleIntervention

      public void scheduleIntervention(WellScheduler.Intervention intervention)
      Schedules an intervention for a well.
      Parameters:
      intervention - intervention to schedule
      Throws:
      IllegalArgumentException - if well doesn't exist
    • getAllInterventions

      public List<WellScheduler.Intervention> getAllInterventions()
      Gets all scheduled interventions across all wells.
      Returns:
      list of all interventions sorted by date
    • optimizeSchedule

      public WellScheduler.ScheduleResult optimizeSchedule(LocalDate startDate, LocalDate endDate, int maxConcurrentInterventions)
      Optimizes the intervention schedule to minimize deferred production.

      The optimization considers:

      • Intervention priority and dependencies
      • Rig/vessel availability (maxConcurrentInterventions)
      • Production potential of each well
      • Facility constraints (if facility is provided)
      Parameters:
      startDate - start of scheduling period
      endDate - end of scheduling period
      maxConcurrentInterventions - maximum number of simultaneous interventions
      Returns:
      optimized schedule result
    • countConcurrentOnDate

      private long countConcurrentOnDate(List<WellScheduler.Intervention> interventions, LocalDate date)
      Counts concurrent interventions on a specific date.
    • calculateSystemAvailability

      public double calculateSystemAvailability(LocalDate startDate, LocalDate endDate)
      Calculates system-wide availability over a period.
      Parameters:
      startDate - start of period
      endDate - end of period
      Returns:
      weighted average availability across all wells
    • getTotalPotentialOn

      public double getTotalPotentialOn(LocalDate date)
      Gets the total well potential on a specific date.
      Parameters:
      date - date to check
      Returns:
      sum of potentials for all producing wells
    • getReservoir

      public SimpleReservoir getReservoir()
      Gets the reservoir model.
      Returns:
      reservoir, or null if not configured
    • getFacility

      public ProcessSystem getFacility()
      Gets the facility process system.
      Returns:
      facility, or null if not configured
    • setDefaultRateUnit

      public void setDefaultRateUnit(String rateUnit)
      Sets the default rate unit for new wells.
      Parameters:
      rateUnit - rate unit string