Class SafetyEnvelope
java.lang.Object
neqsim.process.safety.envelope.SafetyEnvelope
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of safety envelopes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate double[]private final Stringprivate double[]private doubleprivate doubleprivate double[]private final SafetyEnvelope.EnvelopeType -
Constructor Summary
ConstructorsConstructorDescriptionSafetyEnvelope(String name, SafetyEnvelope.EnvelopeType type, int numPoints) Creates a new safety envelope. -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateMarginToLimit(double pressureBara, double temperatureK) Calculates the margin to the safety limit at given conditions.voidexportToCSV(String filename) Exports envelope to CSV format for DCS/SCADA import.voidexportToJSON(String filename) Exports envelope to JSON format.voidexportToPIFormat(String tagPrefix, String filename) Exports to OSIsoft PI-compatible format.voidexportToSeeq(String filename) Exports to Seeq-compatible format.double[]getName()intdouble[]doubledoubledoublegetSafeTemperatureAtPressure(double pressureBara) Gets the temperature limit with safety margin applied.double[]doublegetTemperatureAtPressure(double pressureBara) Gets the temperature limit at a given pressure.getType()booleanisOperatingPointSafe(double pressureBara, double temperatureK) Checks if an operating point is within the safe envelope.(package private) voidsetDataPoint(int index, double p, double t) (package private) voidsetDataPoint(int index, double p, double t, double safetyMargin) (package private) voidsetFluidDescription(String description) (package private) voidsetReferenceWaterContent(double waterContent) (package private) voidsetReferenceWaxContent(double waxContent) toString()
-
Field Details
-
name
-
type
-
pressure
private double[] pressure -
temperature
private double[] temperature -
margin
private double[] margin -
fluidDescription
-
referenceWaterContent
private double referenceWaterContent -
referenceWaxContent
private double referenceWaxContent
-
-
Constructor Details
-
SafetyEnvelope
Creates a new safety envelope.- Parameters:
name- envelope identifiertype- type of safety limitnumPoints- 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
-
setReferenceWaterContent
void setReferenceWaterContent(double waterContent) -
setReferenceWaxContent
void setReferenceWaxContent(double waxContent) -
getName
-
getType
-
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 baratemperatureK- 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 baratemperatureK- operating temperature in Kelvin- Returns:
- margin in Kelvin (positive = safe, negative = unsafe)
-
exportToCSV
Exports envelope to CSV format for DCS/SCADA import.- Parameters:
filename- output file path
-
exportToJSON
Exports envelope to JSON format.- Parameters:
filename- output file path
-
exportToPIFormat
-
exportToSeeq
Exports to Seeq-compatible format.- Parameters:
filename- output file path
-
toString
-