Class WellRoutingEstimationExample

java.lang.Object
neqsim.process.calibration.WellRoutingEstimationExample

public class WellRoutingEstimationExample extends Object
Complete example demonstrating multi-well heat transfer coefficient estimation using the EnKFParameterEstimator with dynamic routing for improved observability.

Problem Description

A production network consists of 8 subsea wells connected via pipelines to 2 manifolds (HP and LP). Each pipeline has an unknown heat transfer coefficient that affects the temperature drop along the pipe. The goal is to estimate all 8 heat transfer coefficients using only 2 temperature measurements (one at each manifold outlet).

Observability Challenge

With 8 unknowns and only 2 measurements, the system is severely underdetermined in any single configuration. However, by dynamically changing which wells route to which manifold, we accumulate different measurement equations over time, eventually making all parameters observable.

Solution Approach

The example demonstrates:

  • Building a production network with ProcessSystem
  • Configuring EnKFParameterEstimator with tunable parameters and measurements
  • Pre-deployment validation using EstimationTestHarness
  • Dynamic routing schedule to maximize observability
  • Live estimation loop with result analysis
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

    • NUM_WELLS

      private static final int NUM_WELLS
      See Also:
    • SEA_TEMPERATURE

      private static final double SEA_TEMPERATURE
      See Also:
    • WELL_TEMPERATURE

      private static final double WELL_TEMPERATURE
      See Also:
    • MEASUREMENT_NOISE_STD

      private static final double MEASUREMENT_NOISE_STD
      See Also:
    • ENSEMBLE_SIZE

      private static final int ENSEMBLE_SIZE
      See Also:
    • PROCESS_NOISE

      private static final double PROCESS_NOISE
      See Also:
    • MAX_CHANGE_PER_UPDATE

      private static final double MAX_CHANGE_PER_UPDATE
      See Also:
    • TRUE_HEAT_TRANSFER_COEFFS

      private static final double[] TRUE_HEAT_TRANSFER_COEFFS
    • WELL_CONFIGS

      private static final double[][] WELL_CONFIGS
    • process

      private ProcessSystem process
    • wellStreams

      private Stream[] wellStreams
    • pipes

      private PipeBeggsAndBrills[] pipes
    • splitters

      private Splitter[] splitters
    • hpManifold

      private Mixer hpManifold
    • lpManifold

      private Mixer lpManifold
    • currentRouting

      private int[] currentRouting
    • noiseRng

      private Random noiseRng
  • Constructor Details

    • WellRoutingEstimationExample

      public WellRoutingEstimationExample()
  • Method Details

    • createWellFluid

      private SystemInterface createWellFluid(double temperature, double pressure)
      Creates a typical well fluid.
      Parameters:
      temperature - wellhead temperature in °C
      pressure - wellhead pressure in bar-a
      Returns:
      configured fluid system
    • buildNetwork

      public void buildNetwork()
      Builds the complete production network.

      Network topology:

      Well1 ─── Pipe1 ─── Splitter1 ──┬── HP Manifold ─── HP Outlet
      Well2 ─── Pipe2 ─── Splitter2 ──┤                     
      Well3 ─── Pipe3 ─── Splitter3 ──┤                     
      Well4 ─── Pipe4 ─── Splitter4 ──┤                     
      Well5 ─── Pipe5 ─── Splitter5 ──┤                     
      Well6 ─── Pipe6 ─── Splitter6 ──┤                     
      Well7 ─── Pipe7 ─── Splitter7 ──┤                     
      Well8 ─── Pipe8 ─── Splitter8 ──┴── LP Manifold ─── LP Outlet
      
    • setRouting

      public void setRouting(int[] routing)
      Sets the well routing configuration.
      Parameters:
      routing - array of routing decisions (0 = HP, 1 = LP) for each well
    • getMeasurementsWithNoise

      public Map<String,Double> getMeasurementsWithNoise()
      Gets simulated measurements with noise.
      Returns:
      map of measurement path to noisy value
    • createEstimator

      public EnKFParameterEstimator createEstimator()
      Creates and configures the EnKF estimator.
      Returns:
      configured estimator
    • createTestHarness

      public EstimationTestHarness createTestHarness()
      Creates and configures the test harness.
      Returns:
      configured test harness
    • getRoutingSchedule

      public int[][] getRoutingSchedule()
      Gets the routing schedule designed for maximum observability.

      The schedule includes:

      • Block patterns: groups of wells at each manifold
      • Alternating patterns: interleaved routing
      • Single-well isolation: most informative for individual estimates
      Returns:
      array of routing configurations
    • runValidation

      public boolean runValidation(EnKFParameterEstimator estimator, EstimationTestHarness harness)
      Runs pre-deployment validation tests.
      Parameters:
      estimator - the estimator to validate
      harness - the test harness
      Returns:
      true if validation passes
    • runLiveEstimation

      public void runLiveEstimation(EnKFParameterEstimator estimator)
      Runs the live estimation loop.
      Parameters:
      estimator - the estimator to use
    • printEstimates

      private void printEstimates(double[] estimates, double[] uncertainties, String prefix)
      Prints current estimates.
      Parameters:
      estimates - the current parameter estimates
      uncertainties - the uncertainties for each parameter
      prefix - the prefix to print before estimates
    • printFinalSummary

      private void printFinalSummary(EnKFParameterEstimator estimator)
      Prints final summary comparing estimates to true values.
      Parameters:
      estimator - the EnKF parameter estimator with results
    • createSeparator

      private String createSeparator(int length)
      Creates a separator string.
      Parameters:
      length - the length of the separator
      Returns:
      a string of dashes of the specified length
    • main

      public static void main(String[] args)
      Main entry point.
      Parameters:
      args - command line arguments (not used)