Class ThreePhaseSeparator
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, ProcessEquipmentInterface, SeparatorInterface, StateVectorProvider, ProcessElementInterface, SimulationInterface, NamedInterface
ThreePhaseSeparator class.
- Version:
- $Id: $Id
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Separator
Separator.Builder -
Field Summary
FieldsModifier and TypeFieldDescription(package private) double(package private) String(package private) double(package private) String(package private) double(package private) String(package private) double(package private) Stringprivate doubleGas outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).private doubleprivate doubleprivate double(package private) static org.apache.logging.log4j.LoggerLogger object for class.(package private) double(package private) String(package private) double(package private) Stringprivate doubleOil level height in meters (bottom of separator to top of oil phase).private doubleOil outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).private static final longSerialization version UID.(package private) String(package private) booleanprivate doubleWater level height in meters (bottom of separator to water-oil interface).private doubleWater outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).(package private) StreamInterfaceFields inherited from class Separator
DEFAULT_DROPLET_CUTSIZE_LIMIT, DEFAULT_INLET_MOMENTUM_LIMIT, DEFAULT_K_VALUE_LIMIT, DEFAULT_LIQUID_DENSITY_FOR_SIZING, DEFAULT_MIN_OIL_RETENTION_TIME, DEFAULT_MIN_WATER_RETENTION_TIME, electricalDesign, gasOutStream, gasSystem, gasVolume, inletStreamMixer, instrumentDesign, isInitTransient, liquidLevel, liquidOutStream, liquidSystem, liquidVolume, numberOfInputStreams, separatorMechanicalDesign, separatorSection, thermoSystem, thermoSystem2, thermoSystemCloned, waterSystemFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionThreePhaseSeparator(String name) Constructor for ThreePhaseSeparator.ThreePhaseSeparator(String name, StreamInterface inletStream) Constructor for ThreePhaseSeparator. -
Method Summary
Modifier and TypeMethodDescriptiondoubleCalculate the oil-water interface settling time.doubleCalculate oil retention time between NIL and NLL.doubleCalculate water retention time below NIL.voiddisplayResult.doublegetEntropyProduction(String unit) getEntropyProduction.getEquipmentState(String temperatureUnit, String pressureUnit, String flowUnit) Returns a map of key equipment properties with values and units.doublegetExergyChange(String unit, double surroundingTemperature) Get exergy change production of the process equipment.doubleGet the gas outlet valve flow fraction.doublegetMassBalance(String unit) getMassBalance.doubleGet the oil level (height from bottom of separator to top of oil phase).doubleGet the oil outlet valve flow fraction.getOilOutStream.doubleGet the oil phase thickness (oil level minus water level).Returns all outlet streams produced by this equipment.Get a summary of all performance parameters with limit checks.doubleGet the water level (height from bottom of separator to water-oil interface).doubleGet the water outlet valve flow fraction.Getter for the fieldwaterOutStream.voidInitializes three-phase separator for transient calculations.booleanCheck if all separator performance parameters are within limits.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunTransient(double dt, UUID id) runTransientvoidsetEntrainment(double val, String specType, String specifiedStream, String phaseFrom, String phaseTo) setEntrainment.voidsetGasOutletFlowFraction(double fraction) Set the gas outlet valve flow fraction (simulates valve position).voidsetInletStream(StreamInterface inletStream) setInletStream.voidsetOilLevel(double level) Set the oil level (height from bottom of separator to top of oil phase).voidsetOilOutletFlowFraction(double fraction) Set the oil outlet valve flow fraction (simulates valve position).voidsetTempPres(double temp, double pres) setTempPres.voidsetWaterLevel(double level) Set the water level (height from bottom of separator to water-oil interface).voidsetWaterOutletFlowFraction(double fraction) Set the water outlet valve flow fraction (simulates valve position).toJson()Serializes the Process Equipment along with its state to a JSON string.toJson(ReportConfig cfg) Serializes the Process Equipment with configurable level of detail.private voidUpdates the parent class liquidLevel based on water and oil levels.private voidUpdates all six entrainment fractions from the detailed performance calculator for three-phase separation.private voidUpdates all six entrainment fractions from the performance calculator using the live vessel state.private voidUpdates water and oil levels from phase volumes in the thermodynamic system.Methods inherited from class Separator
addCapacityConstraint, addSeparatorSection, addStream, autoSize, autoSize, autoSize, builder, calcDropletCutSize, calcDropletCutSizeAtHLL, calcGasAreaAboveLevel, calcGasVelocityAboveLevel, calcInletMomentumFlux, calcInletMomentumFlux, calcKValue, calcKValueAtHLL, calcLiquidVolume, calcSegmentArea, clearCapacityConstraints, disableConstraint, disableConstraints, enableConstraints, enforceHeadspace, equals, evaluateFireExposure, evaluateFireExposure, getBootVolume, getBottleneckConstraint, getCapacityConstraints, getCapacityDuty, getCapacityMax, getCapacityUtilization, getConstraintSummary, getDeRatedGasLoadFactor, getDeRatedGasLoadFactor, getDesignGasLoadFactor, getDesignLiquidLevelFraction, getEfficiency, getElectricalDesign, getEnabledConstraintNames, getExergyChange, getFeedStream, getGas, getGasCarryunderFraction, getGasLoadFactor, getGasLoadFactor, getGasOutStream, getGasSuperficialVelocity, getHeatDuty, getHeatDuty, getHeatInput, getHeatInput, getInletFlowRegime, getInletStreams, getInnerSurfaceArea, getInstrumentDesign, getInternalDiameter, getKFactor, getKFactorUtilization, getLiquid, getLiquidCarryoverFraction, getLiquidLevel, getLiquidOutStream, getMaxAllowableGasFlowRate, getMaxAllowableGasVelocity, getMaxUtilization, getMechanicalDesign, getMistEliminatorDpCoeff, getMistEliminatorPressureDrop, getMistEliminatorThickness, getOperatingEnvelopeViolation, getOrientation, getPerformanceCalculator, getPressure, getPressureDrop, getResultTable, getSeparatorLength, getSeparatorSection, getSeparatorSection, getSeparatorSections, getSimulationValidationErrors, getSizingReport, getSizingReportJson, getStateVector, getThermoSystem, getUnwettedArea, getWeirHeight, getWeirLength, getWeirOverflowRate, getWettedArea, hasGeometry, hashCode, initDesignFromFlow, initElectricalDesign, initializeCapacityConstraints, initInstrumentDesign, initMechanicalDesign, isAutoSized, isCapacityExceeded, isConstraintEnabled, isDetailedEntrainmentCalculation, isDropletCutSizeWithinLimit, isDropletCutSizeWithinLimit, isEnforceCapacityLimits, isEnhancedEntrainmentCalculation, isHardLimitExceeded, isInletMomentumWithinLimit, isInletMomentumWithinLimit, isKValueWithinLimit, isKValueWithinLimit, isMistEliminatorFlooded, isOilRetentionTimeAboveMinimum, isOilRetentionTimeAboveMinimum, isOverloaded, isSetHeatInput, isSimulationValid, isSinglePhase, isWaterRetentionTimeAboveMinimum, isWaterRetentionTimeAboveMinimum, isWithinOperatingEnvelope, levelFromVolume, liquidArea, removeCapacityConstraint, setBootVolume, setDesignGasLoadFactor, setDesignLiquidLevelFraction, setDetailedEntrainmentCalculation, setDropletCutSizeLimit, setDuty, setDuty, setEfficiency, setEnforceCapacityLimits, setEnhancedEntrainmentCalculation, setGasCarryunderFraction, setGasLiquidSurfaceTension, setHeatDuty, setHeatDuty, setHeatInput, setHeatInput, setInletDeviceType, setInletMomentumLimit, setInletPipeDiameter, setInternalDiameter, setKValueLimit, setLiquidCarryoverFraction, setLiquidLevel, setMinOilRetentionTime, setMinWaterRetentionTime, setMistEliminatorDpCoeff, setMistEliminatorThickness, setOrientation, setPerformanceCalculator, setPressureDrop, setSeparatorLength, setWeirHeight, setWeirLength, sizeFromFlow, updateEntrainmentForTransient, updateEntrainmentFromPerformanceCalculator, useAllConstraints, useAPIConstraints, useConstraints, useEquinorConstraints, useGasCapacityConstraints, useGasScrubberConstraints, useLiquidCapacityConstraints, validateSetupMethods inherited from class ProcessEquipmentBaseClass
addController, copy, getAvailableMargin, getAvailableMarginPercent, getConditionAnalysisMessage, getConstraintEvaluationReport, getController, getController, getControllers, getEffectiveCapacityFactor, getEnergyStream, getFailureMode, getMassBalance, getMaxUtilizationPercent, getMinimumFlow, getPressure, getProperty, getReferenceDesignation, getReport_json, getSpecification, getTemperature, getTemperature, getUtilizationSummary, initializeDefaultConstraints, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isNearCapacityLimit, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setReferenceDesignation, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagNumber, setName, setTagNumberMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CapacityConstrainedEquipment
disableAllConstraints, enableAllConstraints, getAvailableMargin, getAvailableMarginPercent, getMaxUtilizationPercent, getUtilizationSummary, isCapacityAnalysisEnabled, isNearCapacityLimit, setCapacityAnalysisEnabledMethods inherited from interface NamedInterface
getName, getTagName, getTagNumber, setName, setTagName, setTagNumberMethods inherited from interface ProcessEquipmentInterface
getExergyDestruction, getExergyDestruction, getFluid, getOutletFlowRate, getOutletPressure, getOutletTemperature, getReferenceDesignationString, getRestCapacity, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface StateVectorProvider
getStateDimension, getStateNames
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
logger
static org.apache.logging.log4j.Logger loggerLogger object for class. -
waterOutStream
StreamInterface waterOutStream -
specifiedStream
String specifiedStream -
gasInAqueous
double gasInAqueous -
gasInAqueousSpec
String gasInAqueousSpec -
gasInOil
double gasInOil -
gasInOilSpec
String gasInOilSpec -
oilInGas
double oilInGas -
oilInGasSpec
String oilInGasSpec -
oilInAqueous
double oilInAqueous -
oilInAqueousSpec
String oilInAqueousSpec -
aqueousInGas
double aqueousInGas -
aqueousInGasSpec
String aqueousInGasSpec -
aqueousInOil
double aqueousInOil -
aqueousInOilSpec
String aqueousInOilSpec -
useTempMultiPhaseCheck
boolean useTempMultiPhaseCheck -
lastEnthalpy
private double lastEnthalpy -
lastFlowRate
private double lastFlowRate -
lastPressure
private double lastPressure -
waterLevel
private double waterLevelWater level height in meters (bottom of separator to water-oil interface). -
oilLevel
private double oilLevelOil level height in meters (bottom of separator to top of oil phase). -
gasOutletFlowFraction
private double gasOutletFlowFractionGas outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open). -
oilOutletFlowFraction
private double oilOutletFlowFractionOil outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open). -
waterOutletFlowFraction
private double waterOutletFlowFractionWater outlet valve flow fraction (0.0 = fully closed, 1.0 = fully open).
-
-
Constructor Details
-
ThreePhaseSeparator
Constructor for ThreePhaseSeparator.- Parameters:
name- name of separator
-
ThreePhaseSeparator
Constructor for ThreePhaseSeparator.
- Parameters:
name- aStringobjectinletStream- aStreamInterfaceobject
-
-
Method Details
-
setEntrainment
-
updateThreePhaseEntrainment
private void updateThreePhaseEntrainment()Updates all six entrainment fractions from the detailed performance calculator for three-phase separation. Called duringrun()when detailed entrainment is enabled. -
setInletStream
setInletStream.
- Overrides:
setInletStreamin classSeparator- Parameters:
inletStream- aStreamInterfaceobject
-
getWaterOutStream
Getter for the field
waterOutStream.- Returns:
- a
StreamInterfaceobject
-
getOilOutStream
-
getOutletStreams
Returns all outlet streams produced by this equipment. Subclasses override to report their specific outlets. Used by graph builders, DEXPI export, and auto-instrumentation to discover topology withoutinstanceofchecks.- Specified by:
getOutletStreamsin interfaceProcessEquipmentInterface- Overrides:
getOutletStreamsin classSeparator- Returns:
- unmodifiable list of outlet streams (empty by default)
-
getEquipmentState
public Map<String, Map<String,Object>> getEquipmentState(String temperatureUnit, String pressureUnit, String flowUnit) Returns a map of key equipment properties with values and units.Provides a unified way to access equipment state without knowing the specific equipment type. Each entry in the outer map has a property name (e.g. "temperature", "pressure"). Each inner map contains "value" (Double) and "unit" (String).
The default implementation uses
ProcessEquipmentInterface.getOutletStreams()to report outlet conditions. Subclasses override this to add equipment-specific properties (e.g., valve opening, compressor power, separator liquid levels).- Specified by:
getEquipmentStatein interfaceProcessEquipmentInterface- Overrides:
getEquipmentStatein classSeparator- Parameters:
temperatureUnit- temperature unit (e.g. "C")pressureUnit- pressure unit (e.g. "bara")flowUnit- flow unit (e.g. "kg/hr")- Returns:
- map of property name to value/unit maps
-
setWaterLevel
public void setWaterLevel(double level) Set the water level (height from bottom of separator to water-oil interface).- Parameters:
level- water level in meters
-
getWaterLevel
public double getWaterLevel()Get the water level (height from bottom of separator to water-oil interface).- Returns:
- water level in meters
-
setOilLevel
public void setOilLevel(double level) Set the oil level (height from bottom of separator to top of oil phase).- Parameters:
level- oil level in meters
-
getOilLevel
public double getOilLevel()Get the oil level (height from bottom of separator to top of oil phase).- Returns:
- oil level in meters
-
getOilThickness
public double getOilThickness()Get the oil phase thickness (oil level minus water level).- Returns:
- oil thickness in meters
-
setGasOutletFlowFraction
public void setGasOutletFlowFraction(double fraction) Set the gas outlet valve flow fraction (simulates valve position).- Parameters:
fraction- flow fraction (0.0 = fully closed, 1.0 = fully open)
-
getGasOutletFlowFraction
public double getGasOutletFlowFraction()Get the gas outlet valve flow fraction.- Returns:
- flow fraction (0.0 = fully closed, 1.0 = fully open)
-
setOilOutletFlowFraction
public void setOilOutletFlowFraction(double fraction) Set the oil outlet valve flow fraction (simulates valve position).- Parameters:
fraction- flow fraction (0.0 = fully closed, 1.0 = fully open)
-
getOilOutletFlowFraction
public double getOilOutletFlowFraction()Get the oil outlet valve flow fraction.- Returns:
- flow fraction (0.0 = fully closed, 1.0 = fully open)
-
setWaterOutletFlowFraction
public void setWaterOutletFlowFraction(double fraction) Set the water outlet valve flow fraction (simulates valve position).- Parameters:
fraction- flow fraction (0.0 = fully closed, 1.0 = fully open)
-
getWaterOutletFlowFraction
public double getWaterOutletFlowFraction()Get the water outlet valve flow fraction.- Returns:
- flow fraction (0.0 = fully closed, 1.0 = fully open)
-
updateLiquidLevelFromWaterAndOil
private void updateLiquidLevelFromWaterAndOil()Updates the parent class liquidLevel based on water and oil levels. -
updateWaterAndOilLevelsFromPhases
private void updateWaterAndOilLevelsFromPhases()Updates water and oil levels from phase volumes in the thermodynamic system. -
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Overrides:
runin classSeparator- Parameters:
id- UUID
-
initializeTransientCalculation
public void initializeTransientCalculation()Initializes three-phase separator for transient calculations.- Overrides:
initializeTransientCalculationin classSeparator
-
updateThreePhaseEntrainmentForTransient
private void updateThreePhaseEntrainmentForTransient()Updates all six entrainment fractions from the performance calculator using the live vessel state. This method is the transient counterpart ofupdateThreePhaseEntrainment()and reads fluid properties fromthermoSystem(post-VU-flash vessel inventory) instead of the steady-statethermoSystem2. Gas velocity is estimated from the gas outlet stream throughput. -
runTransient
runTransient
This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.- Specified by:
runTransientin interfaceSimulationInterface- Overrides:
runTransientin classSeparator- Parameters:
dt- Delta time [s]id- Calculation identifier
-
setTempPres
public void setTempPres(double temp, double pres) setTempPres.
- Overrides:
setTempPresin classSeparator- Parameters:
temp- a doublepres- a double
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classSeparator
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classSeparator- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classSeparator- Parameters:
unit- aStringobject- Returns:
- a double
-
getExergyChange
Get exergy change production of the process equipment.- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Overrides:
getExergyChangein classSeparator- Parameters:
unit- Supported units are J and kJsurroundingTemperature- The surrounding temperature in Kelvin- Returns:
- change in exergy in specified unit
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classSeparator- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classSeparator- Parameters:
cfg- report configuration- Returns:
- json string
-
calcOilRetentionTime
public double calcOilRetentionTime()Calculate oil retention time between NIL and NLL. Per API 12J and TR3500 SR-83381: Should be 3-5 minutes for light oils.For three-phase separator, oil retention time is calculated for the oil layer between the water-oil interface (NIL) and the oil surface (NLL).
- Overrides:
calcOilRetentionTimein classSeparator- Returns:
- oil retention time in minutes
-
calcWaterRetentionTime
public double calcWaterRetentionTime()Calculate water retention time below NIL. Per API 12J and TR3500 SR-83381: Should be 3-5 minutes for light oils.For three-phase separator, water retention time is calculated for the water layer below the water-oil interface (NIL).
- Overrides:
calcWaterRetentionTimein classSeparator- Returns:
- water retention time in minutes
-
calcInterfaceSettlingTime
public double calcInterfaceSettlingTime()Calculate the oil-water interface settling time. This is the time for oil droplets to rise through the water layer and water droplets to settle through the oil layer.- Returns:
- interface settling time in minutes
-
isWithinAllLimits
public boolean isWithinAllLimits()Check if all separator performance parameters are within limits. Uses default limits from Equinor TR3500 and API 12J.For three-phase separator, also checks interface settling time.
- Overrides:
isWithinAllLimitsin classSeparator- Returns:
- true if all parameters are within limits
-
getPerformanceSummary
Get a summary of all performance parameters with limit checks.For three-phase separator, includes interface settling information.
- Overrides:
getPerformanceSummaryin classSeparator- Returns:
- performance summary as formatted string
-