Class SafetyEnvelope

java.lang.Object
neqsim.process.safety.envelope.SafetyEnvelope

public class SafetyEnvelope extends Object
Container for safety envelope data points.

Stores P-T curves for various safety limits including hydrate formation, wax appearance, CO2 freezing, and minimum design metal temperature (MDMT). Provides export capabilities for DCS/SCADA integration.

Author:
NeqSim team
  • Field Details

    • name

      private final String name
    • type

      private final SafetyEnvelope.EnvelopeType type
    • pressure

      private double[] pressure
    • temperature

      private double[] temperature
    • margin

      private double[] margin
    • fluidDescription

      private String fluidDescription
    • referenceWaterContent

      private double referenceWaterContent
    • referenceWaxContent

      private double referenceWaxContent
  • Constructor Details

    • SafetyEnvelope

      public SafetyEnvelope(String name, SafetyEnvelope.EnvelopeType type, int numPoints)
      Creates a new safety envelope.
      Parameters:
      name - envelope identifier
      type - type of safety limit
      numPoints - number of data points
  • Method Details

    • setDataPoint

      void setDataPoint(int index, double p, double t)
    • setDataPoint

      void setDataPoint(int index, double p, double t, double safetyMargin)
    • setFluidDescription

      void setFluidDescription(String description)
    • setReferenceWaterContent

      void setReferenceWaterContent(double waterContent)
    • setReferenceWaxContent

      void setReferenceWaxContent(double waxContent)
    • getName

      public String getName()
    • getType

      public SafetyEnvelope.EnvelopeType getType()
    • getFluidDescription

      public String getFluidDescription()
    • getNumberOfPoints

      public int getNumberOfPoints()
    • getPressure

      public double[] getPressure()
    • getTemperature

      public double[] getTemperature()
    • getMargin

      public double[] getMargin()
    • getReferenceWaterContent

      public double getReferenceWaterContent()
    • getReferenceWaxContent

      public double getReferenceWaxContent()
    • getTemperatureAtPressure

      public double getTemperatureAtPressure(double pressureBara)
      Gets the temperature limit at a given pressure.

      Interpolates between data points if necessary.

      Parameters:
      pressureBara - pressure in bara
      Returns:
      temperature limit in Kelvin, or NaN if outside range
    • getSafeTemperatureAtPressure

      public double getSafeTemperatureAtPressure(double pressureBara)
      Gets the temperature limit with safety margin applied.
      Parameters:
      pressureBara - pressure in bara
      Returns:
      temperature limit minus margin in Kelvin
    • isOperatingPointSafe

      public boolean isOperatingPointSafe(double pressureBara, double temperatureK)
      Checks if an operating point is within the safe envelope.
      Parameters:
      pressureBara - operating pressure in bara
      temperatureK - operating temperature in Kelvin
      Returns:
      true if safe (above hydrate/WAT/MDMT curves, below phase envelope upper limit)
    • calculateMarginToLimit

      public double calculateMarginToLimit(double pressureBara, double temperatureK)
      Calculates the margin to the safety limit at given conditions.
      Parameters:
      pressureBara - operating pressure in bara
      temperatureK - operating temperature in Kelvin
      Returns:
      margin in Kelvin (positive = safe, negative = unsafe)
    • exportToCSV

      public void exportToCSV(String filename)
      Exports envelope to CSV format for DCS/SCADA import.
      Parameters:
      filename - output file path
    • exportToJSON

      public void exportToJSON(String filename)
      Exports envelope to JSON format.
      Parameters:
      filename - output file path
    • exportToPIFormat

      public void exportToPIFormat(String tagPrefix, String filename)
      Exports to OSIsoft PI-compatible format.
      Parameters:
      tagPrefix - PI tag prefix for the data
      filename - output file path
    • exportToSeeq

      public void exportToSeeq(String filename)
      Exports to Seeq-compatible format.
      Parameters:
      filename - output file path
    • toString

      public String toString()
      Overrides:
      toString in class Object