Class MultiCompartmentReservoir

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

public class MultiCompartmentReservoir extends ProcessEquipmentBaseClass
Multi-compartment reservoir model for tracking pressure evolution across connected zones.

Models multiple reservoir compartments connected by inter-zone transmissibilities. Each compartment has its own fluid (SystemInterface), pore volume, and pressure. Injectors and producers can be placed in specific compartments.

The material balance equation for each compartment per timestep is:

V_i * ct_i * dP_i/dt = q_inj,i - q_prod,i + SUM_j(T_ij * (P_j - P_i))

where ct_i is total compressibility, T_ij is the transmissibility between compartments i and j.

Usage Example

MultiCompartmentReservoir reservoir = new MultiCompartmentReservoir("Field");

// Add zones
reservoir.addCompartment("Target Sand", targetFluid, 1.0e7, 250.0);
reservoir.addCompartment("Thief Zone", thiefFluid, 5.0e6, 230.0);
reservoir.addCompartment("Aquifer", aquiferFluid, 1.0e9, 260.0);

// Set inter-zone transmissibilities
reservoir.setTransmissibility("Target Sand", "Thief Zone", 0.5);
reservoir.setTransmissibility("Target Sand", "Aquifer", 0.1);

// Add wells
reservoir.addInjectionRate("INJ-1", "Target Sand", 5000.0); // Sm3/day
reservoir.addProductionRate("PROD-1", "Target Sand", 3000.0);

// Time-step the reservoir
for (int step = 0; step < 365; step++) {
  reservoir.runTimeStep(86400.0); // 1 day
  double p = reservoir.getCompartmentPressure("Target Sand", "bara");
  double flow = reservoir.getInterZoneFlowRate("Target Sand", "Thief Zone", "Sm3/day");
}
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

  • Constructor Details

    • MultiCompartmentReservoir

      public MultiCompartmentReservoir(String name)
      Creates a multi-compartment reservoir model.
      Parameters:
      name - reservoir name
  • Method Details

    • addCompartment

      public void addCompartment(String name, SystemInterface fluid, double poreVolume, double pressure)
      Add a reservoir compartment.
      Parameters:
      name - compartment identifier
      fluid - NeqSim fluid system for this compartment
      poreVolume - pore volume (m³)
      pressure - initial pressure (bara)
    • setCompressibility

      public void setCompressibility(String compartmentName, double compressibility)
      Set total compressibility for a compartment.
      Parameters:
      compartmentName - compartment name
      compressibility - total compressibility (1/bar)
    • setTransmissibility

      public void setTransmissibility(String name1, String name2, double transmissibility)
      Set transmissibility between two compartments.
      Parameters:
      name1 - first compartment name
      name2 - second compartment name
      transmissibility - inter-zone transmissibility (Sm3/day/bar)
    • addInjectionRate

      public void addInjectionRate(String wellName, String compartmentName, double rateSm3day)
      Add injection rate to a compartment.
      Parameters:
      wellName - injector well name (for tracking)
      compartmentName - compartment receiving injection
      rateSm3day - injection rate (Sm3/day)
    • addProductionRate

      public void addProductionRate(String wellName, String compartmentName, double rateSm3day)
      Add production rate from a compartment.
      Parameters:
      wellName - producer well name (for tracking)
      compartmentName - compartment being produced
      rateSm3day - production rate (Sm3/day)
    • setInjectionRate

      public void setInjectionRate(String compartmentName, double rateSm3day)
      Set injection rate for a compartment (replaces any previous rate).
      Parameters:
      compartmentName - compartment name
      rateSm3day - injection rate (Sm3/day)
    • setProductionRate

      public void setProductionRate(String compartmentName, double rateSm3day)
      Set production rate for a compartment (replaces any previous rate).
      Parameters:
      compartmentName - compartment name
      rateSm3day - production rate (Sm3/day)
    • runTimeStep

      public void runTimeStep(double dtSeconds)
      Advance the reservoir state by one timestep using explicit Euler integration.

      For each compartment the pressure update is: dP_i = dt / (V_i * ct_i) * (q_inj,i - q_prod,i + SUM(T_ij * (P_j - P_i)))

      Parameters:
      dtSeconds - timestep size (seconds)
    • getCompartmentPressure

      public double getCompartmentPressure(String name, String unit)
      Get the current pressure of a compartment.
      Parameters:
      name - compartment name
      unit - pressure unit ("bara", "psia")
      Returns:
      current pressure
    • getInterZoneFlowRate

      public double getInterZoneFlowRate(String name1, String name2, String unit)
      Get the inter-zone flow rate between two compartments.
      Parameters:
      name1 - first compartment name
      name2 - second compartment name
      unit - flow rate unit ("Sm3/day")
      Returns:
      flow rate (positive = from name1 to name2)
    • getNumberOfCompartments

      public int getNumberOfCompartments()
      Get the number of compartments.
      Returns:
      number of compartments
    • getSimulationTime

      public double getSimulationTime(String unit)
      Get the cumulative simulation time.
      Parameters:
      unit - time unit ("s", "days", "years")
      Returns:
      cumulative simulation time
    • getCompartmentFluid

      public SystemInterface getCompartmentFluid(String name)
      Get the fluid in a compartment.
      Parameters:
      name - compartment name
      Returns:
      SystemInterface for the compartment, or null
    • getCompartment

      private MultiCompartmentReservoir.Compartment getCompartment(String name)
      Get a compartment by name.
      Parameters:
      name - compartment name
      Returns:
      Compartment or null if not found
    • reset

      public void reset()
      Reset all compartment pressures to initial values.
    • 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