Class Separator
- All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, ProcessEquipmentInterface, SeparatorInterface, StateVectorProvider, SimulationInterface, NamedInterface
- Direct Known Subclasses:
GasScrubber, GasScrubberSimple, Hydrocyclone, Hydrocyclone, NeqGasScrubber, SimpleAbsorber, ThreePhaseSeparator, TwoPhaseSeparator
Separator class.
Capacity Utilization Calculations
To get meaningful capacity utilization results from getCapacityUtilization(), the
following parameters must be set on the separator:
- Internal diameter —
setInternalDiameter(double)[m]. Default: 1.0 m. Defines the cross-sectional area available for gas flow. - Separator length —
setSeparatorLength(double)[m]. Default: 5.0 m. Used for volume calculations. - Orientation —
setOrientation(String), either"horizontal"(default) or"vertical". Determines how gas cross-sectional area is computed. - Design gas load factor (K-factor) —
setDesignGasLoadFactor(double)[m/s]. Default: 0.11 m/s. This is the design K-factor from the Souders-Brown equation. Typical range: 0.07–0.15 m/s for horizontal separators, 0.04–0.10 m/s for vertical scrubbers. - Design liquid level fraction (vertical only) —
setDesignLiquidLevelFraction(double). Default: 0.8. The fraction of cross-sectional area occupied by liquid at design conditions.
Gas-only (dry gas) operation: If the feed contains no liquid phase, the utilization is
still computed using a default liquid density of 1000 kg/m³
(DEFAULT_LIQUID_DENSITY_FOR_SIZING). This ensures scrubbers and dry-gas separators still
report a meaningful gas velocity utilization.
Example usage:
Separator scrubber = new Separator("inlet scrubber", feedStream);
scrubber.setInternalDiameter(1.5); // 1.5 m ID
scrubber.setSeparatorLength(4.0); // 4.0 m length
scrubber.setOrientation("vertical");
scrubber.setDesignGasLoadFactor(0.08); // K = 0.08 m/s
scrubber.run();
double utilization = scrubber.getCapacityUtilization(); // e.g. 0.75 = 75%
- Version:
- $Id: $Id
- Author:
- Even Solbraa
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class for constructing Separator instances with a fluent API. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanFlag indicating if separator has been auto-sized.private Map<String, CapacityConstraint> Capacity constraints map for this separator.private static final doubleDefault design gas load factor (K-factor) [m/s].static final doubleDefault droplet cut size limit per Equinor TR3500 SR-50535 [m].static final doubleDefault inlet momentum flux limit per Equinor Revamp Limit [Pa].static final doubleDefault K-value limit per Equinor TR3500 SR-50535 [m/s].static final doubleDefault liquid density for sizing calculations when no liquid phase is present [kg/m³].static final doubleDefault minimum oil retention time per API 12J [minutes].static final doubleDefault minimum water retention time per API 12J [minutes].private doubleDesign gas load factor (K-factor) from mechanical design [m/s].private doubleLiquid level fraction (Fg) from mechanical design.private doubleprivate booleanWhether to enforce capacity limits during simulation.private doubleprivate doubleprivate String(package private) StreamInterface(package private) SystemInterface(package private) doubleprivate doubleprivate String(package private) Mixerprivate doubleInner diameter/height of separator volume.private double(package private) booleanprivate doubleprivate doubleprivate doubleprivate doubleprotected doubleLiquid level height in meters (default set to 50% of internal diameter).(package private) StreamInterface(package private) SystemInterface(package private) double(package private) static org.apache.logging.log4j.LoggerLogger object for class.private doubleMaximum gas volumetric flow rate from design [m3/s].private static final doubleMinimum default design volume flow in m3/hr for zero flow cases.private static final doubleprivate static final doubleintprivate doubleprivate Stringprivate StringOrientation of separator.private doubleprivate doubleLength of separator volume.(package private) SeparatorMechanicalDesign(package private) ArrayList<SeparatorSection> private doubleSeparator volume.private doubleSeparator cross sectional area.private static final longSerialization version UID.private booleanprivate String(package private) SystemInterface(package private) SystemInterface(package private) SystemInterfaceprivate doubleprivate String(package private) SystemInterfaceFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for Separator.Separator(String name, StreamInterface inletStream) Constructor for Separator. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCapacityConstraint(CapacityConstraint constraint) Adds a new capacity constraint to this equipment.voidaddSeparatorSection(String name, String type) addSeparatorSection.voidaddStream(StreamInterface newStream) addStream.voidautoSize()Automatically size using default safety factor (1.2 = 20% margin).voidautoSize(double safetyFactor) Automatically size the equipment based on connected stream conditions.voidAutomatically size using company-specific design standards.static Separator.BuilderCreates a new Builder for constructing a Separator with a fluent API.doublecalcDropletCutSize(double effectiveGasLength, double freeHeightAboveLiquid) Calculate the oil droplet cut size in the gas section above liquid level.doubleCalculate the oil droplet cut size at HLL using mechanical design parameters.doublecalcGasAreaAboveLevel(double liquidLevelHeight) Calculate the gas area above the specified liquid level for horizontal separator.doublecalcGasVelocityAboveLevel(double liquidLevelHeight) Calculate gas velocity above the specified liquid level.doubleCalculate the inlet momentum flux using mechanical design nozzle size.doublecalcInletMomentumFlux(double nozzleDiameter) Calculate the inlet nozzle momentum flux.doublecalcKValue(double liquidLevelHeight) Calculate the K-value (Souders-Brown factor) above the specified liquid level.doubleCalculate the K-value at the design HLL from mechanical design.doublecalculates liquid volume based on separator type.doubleCalculate oil retention time between NIL and NLL.static doublecalcSegmentArea(double diameter, double levelHeight) Calculate the liquid area (circular segment) at a given level height.doubleCalculate water retention time below NIL.private doubleclampLiquidHeight(double height) voidClears all capacity constraints from this equipment.booleandisableConstraint(String constraintName) Disable a specific constraint by name.voiddisableConstraints(String... constraintNames) Disable specific constraints by name.voiddisplayResult.voidenableConstraints(String... constraintNames) Enable specific constraints by name (additive - doesn't disable others).protected voidbooleanEvaluates fire exposure using the separator geometry and process conditions.evaluateFireExposure(SeparatorFireExposure.FireScenarioConfig config, Flare flare, double flareGroundDistanceM) Evaluates fire exposure using separator geometry and process conditions while accounting for flare radiation based on the real flaring heat duty.Gets the constraint with the highest utilization (the bottleneck).Gets all capacity constraints defined for this equipment.doublegetCapacityDuty.doublegetCapacityMax.doubleGets the capacity utilization as a fraction (current gas flow / max design gas flow).Get a summary of all constraint utilizations.doublegetDeRatedGasLoadFactor.doublegetDeRatedGasLoadFactor(int phaseNum) getDeRatedGasLoadFactor.doubleGets the design gas load factor (K-factor) that the separator is designed for.doubleGetter for the fielddesignLiquidLevelFraction.doubleGetter for the fieldefficiency.Get list of all enabled constraint names.doublegetEntropyProduction(String unit) getEntropyProduction.doublegetExergyChange(String unit) getExergyChange.doublegetExergyChange(String unit, double surroundingTemperature) Get exergy change production of the process equipment.getFeedStream.getGas()getGas.doubleGetter for the fieldgasCarryunderFraction.doublegetGasLoadFactor.doublegetGasLoadFactor(int phaseNumber) getGasLoadFactor.Getter for the fieldgasOutStream.doublegetGasSuperficialVelocity.doubleGet heat duty (alias for getHeatInput).doublegetHeatDuty(String unit) Get heat duty in specified unit.doubleGet heat input in watts.doublegetHeatInput(String unit) Get heat input in specified unit.doubleCalculates the total inner surface area of the separator, including shell and heads.doubleGetter for the fieldinternalDiameter.getLiquid.doubleGetter for the fieldliquidCarryoverFraction.doubleGetter for the fieldliquidLevelin percentage.Getter for the fieldliquidOutStream.doublegetMassBalance(String unit) getMassBalance.doubleCalculates the maximum allowable gas volumetric flow rate based on separator design.doubleCalculates the maximum allowable gas velocity based on the design K-factor.private doubledoubleGets the maximum utilization across all constraints.Get amechanicalDesignfor the equipment.private doubleGets the reason why equipment is outside its operating envelope.Getter for the fieldorientation.Get a summary of all performance parameters with limit checks.doubleGetter for the fieldpressure.doubleGetter for the fieldpressureDrop.String[][]getResultTable.doubleGetter for the fieldseparatorLength.getSeparatorSection(int i) Getter for the fieldseparatorSection.getSeparatorSection(String name) Getter for the fieldseparatorSection.getSeparatorSections.Gets validation errors for the current simulation state.Get a detailed sizing report after auto-sizing.Get sizing report as JSON for programmatic access.Get the current state as a standardized vector.getThermoSystem.doubleEstimates the unwetted (dry) area as the remaining inner area not in contact with liquid.doubleEstimates the wetted inner surface area based on current liquid level and orientation.inthashCode()voidInitializes separator dimensions from mechanical design calculations.protected voidInitializes default capacity constraints for this separator.voidInitializes separator for transient calculations.voidInitialize ainitMechanicalDesignfor the equipment.booleanCheck if equipment has been auto-sized.booleanChecks if any capacity constraint is violated (exceeds 100% utilization).booleanisConstraintEnabled(String constraintName) Check if a specific constraint is enabled.booleanCheck if droplet cut size is within the default limit (150 µm per TR3500).booleanisDropletCutSizeWithinLimit(double limitMicrons) Check if droplet cut size is within the specified limit.booleanGets whether capacity limits are enforced during simulation.booleanChecks if any HARD constraint limit is exceeded.booleanCheck if inlet momentum flux is within the default limit (16000 Pa).booleanisInletMomentumWithinLimit(double limitPa) Check if inlet momentum flux is within the specified limit.booleanCheck if K-value is within the default limit (0.15 m/s per TR3500).booleanisKValueWithinLimit(double limit) Check if K-value is within the specified limit.booleanCheck if oil retention time meets the default minimum (3 minutes).booleanisOilRetentionTimeAboveMinimum(double minMinutes) Check if oil retention time meets the minimum requirement.booleanChecks if the separator is overloaded (operating above design capacity).booleanCheck if heat input is set.booleanChecks if the current simulation result is physically valid.booleanChecks if the separator feed is single-phase (no separation required).booleanCheck if water retention time meets the default minimum (3 minutes).booleanisWaterRetentionTimeAboveMinimum(double minMinutes) Check if water retention time meets the minimum requirement.booleanCheck if all separator performance parameters are within limits.booleanChecks if the equipment is operating within its valid operating envelope.doublelevelFromVolume(double volumeTarget) Estimates liquid level based on volume for horizontal separators using bisection method.doubleliquidArea(double level) Calculates both gas and liquid fluid section areas for horizontal separators.private voidCustom deserialization to reinitialize transient fields.booleanremoveCapacityConstraint(String constraintName) Removes a capacity constraint by name.voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.voidrunTransient(double dt, UUID id) runTransientvoidsetDesignGasLoadFactor(double kFactor) Sets the design gas load factor (K-factor) for the separator.voidsetDesignLiquidLevelFraction(double designLiquidLevelFraction) Setter for the fielddesignLiquidLevelFraction.voidsetDropletCutSizeLimit(double limitMicrons) Set custom droplet cut size limit for the separator constraint.voidsetDuty(double heatDuty) Set heat duty (alias preserved for compatibility with energy-stream style naming).voidSet heat duty with unit (alias preserved for compatibility with energy-stream style naming).voidsetEfficiency(double efficiency) Setter for the fieldefficiency.voidsetEnforceCapacityLimits(boolean enforce) Sets whether to enforce capacity limits during simulation.voidsetEntrainment(double val, String specType, String specifiedStream, String phaseFrom, String phaseTo) setEntrainment.voidsetGasCarryunderFraction(double gasCarryunderFraction) Setter for the fieldgasCarryunderFraction.voidsetHeatDuty(double heatDuty) Set heat duty (alias for setHeatInput).voidsetHeatDuty(double heatDuty, String unit) Set heat duty with unit (alias for setHeatInput).voidsetHeatInput(double heatInput) Set heat input to the separator (e.g., from flare radiation, external heating).voidsetHeatInput(double heatInput, String unit) Set heat input to the separator with specified unit.voidsetInletMomentumLimit(double limitPa) Set custom inlet momentum limit for the separator constraint.voidsetInletStream(StreamInterface inletStream) setInletStream.voidsetInternalDiameter(double diameter) setInternalDiameter.voidsetKValueLimit(double limit) Set custom K-value limit for the separator constraint.voidsetLiquidCarryoverFraction(double liquidCarryoverFraction) Setter for the fieldliquidCarryoverFraction.voidsetLiquidLevel(double liquidlev) Setter for the fieldliquidLevel.voidsetMinOilRetentionTime(double minMinutes) Set custom minimum oil retention time for the separator constraint.voidsetMinWaterRetentionTime(double minMinutes) Set custom minimum water retention time for the separator constraint.voidsetOrientation(String orientation) Setter for the fieldorientation.voidsetPressureDrop(double pressureDrop) Setter for the fieldpressureDrop.voidsetSeparatorLength(double separatorLength) Setter for the fieldseparatorLength.voidsetTempPres(double temp, double pres) setTempPres.voidsizeFromFlow(double safetyFactor) Sizes the separator diameter based on the current flow conditions and design K-factor.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 voidKeeps cached gas/liquid holdup volumes aligned with current geometry and level.voidUse all available constraints.voidUse API 12J constraints (K-value, retention times).voiduseConstraints(String... constraintNames) Enable only the specified constraints by name.voidUse Equinor TR3500 constraints (K-value, droplet cut size, inlet momentum, retention times).voidUse gas capacity constraints (gas load factor, K-value, droplet cut size, inlet momentum).voidUse gas scrubber constraints (gas load factor and inlet momentum).voidUse liquid capacity constraints (retention times).Validate the process equipment before execution.Methods inherited from class ProcessEquipmentBaseClass
copy, getConditionAnalysisMessage, getController, getEffectiveCapacityFactor, getEnergyStream, getFailureMode, getMassBalance, getMinimumFlow, getPressure, getProperty, getReport_json, getSpecification, getTemperature, getTemperature, isActive, isActive, isCapacityAnalysisEnabled, isFailed, isSetEnergyStream, reportResults, restoreFromFailure, run_step, runConditionAnalysis, setCapacityAnalysisEnabled, setController, setEnergyStream, setEnergyStream, setFailureMode, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, simulateDegradedOperation, simulateTrip, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods 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, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getFluid, 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. -
thermoSystem
SystemInterface thermoSystem -
gasSystem
SystemInterface gasSystem -
waterSystem
SystemInterface waterSystem -
liquidSystem
SystemInterface liquidSystem -
thermoSystemCloned
SystemInterface thermoSystemCloned -
thermoSystem2
SystemInterface thermoSystem2 -
isInitTransient
boolean isInitTransient -
orientation
Orientation of separator. "horizontal" or "vertical" -
gasOutStream
StreamInterface gasOutStream -
liquidOutStream
StreamInterface liquidOutStream -
pressureDrop
private double pressureDrop -
numberOfInputStreams
public int numberOfInputStreams -
inletStreamMixer
Mixer inletStreamMixer -
efficiency
private double efficiency -
liquidCarryoverFraction
private double liquidCarryoverFraction -
gasCarryunderFraction
private double gasCarryunderFraction -
specifiedStream
-
oilInGas
private double oilInGas -
oilInGasSpec
-
waterInGas
private double waterInGas -
waterInGasSpec
-
gasInLiquid
private double gasInLiquid -
gasInLiquidSpec
-
separatorLength
private double separatorLengthLength of separator volume. -
internalDiameter
private double internalDiameterInner diameter/height of separator volume. -
internalRadius
private double internalRadius -
liquidLevel
protected double liquidLevelLiquid level height in meters (default set to 50% of internal diameter). -
MIN_HEADSPACE_FRACTION
private static final double MIN_HEADSPACE_FRACTION- See Also:
-
MIN_HEADSPACE_VOLUME
private static final double MIN_HEADSPACE_VOLUME- See Also:
-
DEFAULT_LIQUID_DENSITY_FOR_SIZING
public static final double DEFAULT_LIQUID_DENSITY_FOR_SIZINGDefault liquid density for sizing calculations when no liquid phase is present [kg/m³]. Assumes water density for conservative sizing.- See Also:
-
sepCrossArea
private double sepCrossAreaSeparator cross sectional area. -
separatorVolume
private double separatorVolumeSeparator volume. -
liquidVolume
double liquidVolume -
gasVolume
double gasVolume -
separatorSection
ArrayList<SeparatorSection> separatorSection -
separatorMechanicalDesign
SeparatorMechanicalDesign separatorMechanicalDesign -
lastEnthalpy
private double lastEnthalpy -
lastFlowRate
private double lastFlowRate -
lastPressure
private double lastPressure -
setHeatInput
private boolean setHeatInput -
heatInput
private double heatInput -
heatInputUnit
-
DEFAULT_DESIGN_GAS_LOAD_FACTOR
private static final double DEFAULT_DESIGN_GAS_LOAD_FACTORDefault design gas load factor (K-factor) [m/s]. Used to detect user overrides.- See Also:
-
designGasLoadFactor
private double designGasLoadFactorDesign gas load factor (K-factor) from mechanical design [m/s]. -
designLiquidLevelFraction
private double designLiquidLevelFractionLiquid level fraction (Fg) from mechanical design. -
maxDesignGasFlowRate
private double maxDesignGasFlowRateMaximum gas volumetric flow rate from design [m3/s]. -
enforceCapacityLimits
private boolean enforceCapacityLimitsWhether to enforce capacity limits during simulation. -
capacityConstraints
Capacity constraints map for this separator. -
autoSized
private boolean autoSizedFlag indicating if separator has been auto-sized. -
MIN_DEFAULT_VOLUME_FLOW
private static final double MIN_DEFAULT_VOLUME_FLOWMinimum default design volume flow in m3/hr for zero flow cases.- See Also:
-
DEFAULT_K_VALUE_LIMIT
public static final double DEFAULT_K_VALUE_LIMITDefault K-value limit per Equinor TR3500 SR-50535 [m/s]. K-value must be less than this limit related to HLL.- See Also:
-
DEFAULT_DROPLET_CUTSIZE_LIMIT
public static final double DEFAULT_DROPLET_CUTSIZE_LIMITDefault droplet cut size limit per Equinor TR3500 SR-50535 [m]. Droplet cut size must be less than 150 µm (150e-6 m).- See Also:
-
DEFAULT_INLET_MOMENTUM_LIMIT
public static final double DEFAULT_INLET_MOMENTUM_LIMITDefault inlet momentum flux limit per Equinor Revamp Limit [Pa].- See Also:
-
DEFAULT_MIN_OIL_RETENTION_TIME
public static final double DEFAULT_MIN_OIL_RETENTION_TIMEDefault minimum oil retention time per API 12J [minutes]. Typically 3-5 minutes for oil gravities above 35° API.- See Also:
-
DEFAULT_MIN_WATER_RETENTION_TIME
public static final double DEFAULT_MIN_WATER_RETENTION_TIMEDefault minimum water retention time per API 12J [minutes].- See Also:
-
-
Constructor Details
-
Separator
-
Separator
Constructor for Separator.- Parameters:
name- aStringobjectinletStream- aStreamInterfaceobject
-
-
Method Details
-
initializeTransientCalculation
public void initializeTransientCalculation()Initializes separator for transient calculations. -
getMechanicalDesign
Get a
mechanicalDesignfor the equipment.- Specified by:
getMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
getMechanicalDesignin classProcessEquipmentBaseClass- Returns:
- a
MechanicalDesignobject
-
initMechanicalDesign
public void initMechanicalDesign()Initialize a
initMechanicalDesignfor the equipment.- Specified by:
initMechanicalDesignin interfaceProcessEquipmentInterface- Overrides:
initMechanicalDesignin classProcessEquipmentBaseClass
-
setInletStream
setInletStream.
- Parameters:
inletStream- aStreamInterfaceobject
-
addStream
addStream.
- Parameters:
newStream- aStreamInterfaceobject
-
getLiquidOutStream
Getter for the field
liquidOutStream.- Returns:
- a
StreamInterfaceobject
-
getGasOutStream
Getter for the field
gasOutStream.- Returns:
- a
StreamInterfaceobject
-
getGas
-
getLiquid
-
getThermoSystem
getThermoSystem.
- Specified by:
getThermoSystemin interfaceProcessEquipmentInterface- Specified by:
getThermoSystemin interfaceSeparatorInterface- Overrides:
getThermoSystemin classProcessEquipmentBaseClass- Returns:
- a
SystemInterfaceobject
-
setEntrainment
public void setEntrainment(double val, String specType, String specifiedStream, String phaseFrom, String phaseTo) setEntrainment.
- Parameters:
val- a double specifying the entrainment amountspecType- aStringobject describing the specification unitspecifiedStream- aStringobject describing the reference streamphaseFrom- aStringobject describing the phase entrained fromphaseTo- aStringobject describing the phase entrained to
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Specified by:
runin interfaceSimulationInterface- Parameters:
id- UUID
-
displayResult
public void displayResult()displayResult.
- Specified by:
displayResultin interfaceProcessEquipmentInterface- Overrides:
displayResultin classProcessEquipmentBaseClass
-
getResultTable
getResultTable.
- Specified by:
getResultTablein interfaceProcessEquipmentInterface- Overrides:
getResultTablein classProcessEquipmentBaseClass- Returns:
- an array of
Stringobjects
-
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- Parameters:
dt- Delta time [s]id- Calculation identifier
-
setTempPres
public void setTempPres(double temp, double pres) setTempPres.
- Parameters:
temp- a doublepres- a double
-
getEfficiency
public double getEfficiency()Getter for the field
efficiency.- Returns:
- a double
-
setEfficiency
public void setEfficiency(double efficiency) Setter for the field
efficiency.- Parameters:
efficiency- a double
-
getLiquidCarryoverFraction
public double getLiquidCarryoverFraction()Getter for the field
liquidCarryoverFraction.- Returns:
- a double
-
setLiquidCarryoverFraction
public void setLiquidCarryoverFraction(double liquidCarryoverFraction) Setter for the field
liquidCarryoverFraction.- Parameters:
liquidCarryoverFraction- a double
-
getGasCarryunderFraction
public double getGasCarryunderFraction()Getter for the field
gasCarryunderFraction.- Returns:
- a double
-
setGasCarryunderFraction
public void setGasCarryunderFraction(double gasCarryunderFraction) Setter for the field
gasCarryunderFraction.- Parameters:
gasCarryunderFraction- a double
-
setLiquidLevel
public void setLiquidLevel(double liquidlev) Setter for the field
liquidLevel.- Specified by:
setLiquidLevelin interfaceSeparatorInterface- Parameters:
liquidlev- a double
-
getLiquidLevel
public double getLiquidLevel()Getter for the field
liquidLevelin percentage.- Returns:
- a double
-
getPressureDrop
public double getPressureDrop()Getter for the field
pressureDrop.- Returns:
- the pressureDrop
-
setPressureDrop
public void setPressureDrop(double pressureDrop) Setter for the field
pressureDrop.- Parameters:
pressureDrop- the pressureDrop to set
-
getInternalDiameter
public double getInternalDiameter()Getter for the field
internalDiameter.- Returns:
- the diameter
-
setInternalDiameter
public void setInternalDiameter(double diameter) setInternalDiameter.
- Specified by:
setInternalDiameterin interfaceSeparatorInterface- Parameters:
diameter- a double
-
getGasSuperficialVelocity
public double getGasSuperficialVelocity()getGasSuperficialVelocity.
- Returns:
- a double
-
getGasLoadFactor
public double getGasLoadFactor()getGasLoadFactor.
- Returns:
- a double
-
getGasLoadFactor
public double getGasLoadFactor(int phaseNumber) getGasLoadFactor.
- Parameters:
phaseNumber- a int- Returns:
- a double
-
getDeRatedGasLoadFactor
public double getDeRatedGasLoadFactor()getDeRatedGasLoadFactor.
- Returns:
- a double
-
getDeRatedGasLoadFactor
public double getDeRatedGasLoadFactor(int phaseNum) getDeRatedGasLoadFactor.
- Parameters:
phaseNum- a int- Returns:
- a double
-
getDesignGasLoadFactor
public double getDesignGasLoadFactor()Gets the design gas load factor (K-factor) that the separator is designed for.- Returns:
- design gas load factor [m/s]
-
setDesignGasLoadFactor
public void setDesignGasLoadFactor(double kFactor) Sets the design gas load factor (K-factor) for the separator. This is the key parameter for capacity utilization calculations via the Souders-Brown equation. Also updates the associated capacity constraint if one exists.Typical values:
- Horizontal separator: 0.07–0.15 m/s
- Vertical separator/scrubber: 0.04–0.10 m/s
- With mesh/vane demister: towards upper end of range
- Without internals: towards lower end of range
- Parameters:
kFactor- design gas load factor [m/s], typically 0.04–0.15 depending on type- See Also:
-
getMaxAllowableGasVelocity
public double getMaxAllowableGasVelocity()Calculates the maximum allowable gas velocity based on the design K-factor. Uses the Souders-Brown equation: V_max = K * sqrt((rho_liq - rho_gas) / rho_gas)If no liquid phase is present, a default liquid density of 1000 kg/m³ is assumed for sizing purposes.
- Returns:
- maximum allowable gas velocity [m/s]
-
getMaxAllowableGasFlowRate
public double getMaxAllowableGasFlowRate()Calculates the maximum allowable gas volumetric flow rate based on separator design. This combines the max allowable gas velocity (from the Souders-Brown equation) with the available gas flow area, which depends on the separator orientation, internal diameter, and liquid level.- Returns:
- maximum allowable gas flow rate [m3/s]
- See Also:
-
getCapacityUtilization
public double getCapacityUtilization()Gets the capacity utilization as a fraction (current gas flow / max design gas flow). A value greater than 1.0 indicates the separator is overloaded.For single-phase gas (no liquid), the utilization is still computed using a default liquid density of 1000 kg/m³ (
DEFAULT_LIQUID_DENSITY_FOR_SIZING). This is important for scrubbers that handle dry gas — the gas velocity capacity limit still applies.The calculation depends on the following parameters being set:
setInternalDiameter(double)— separator inner diameter [m]setSeparatorLength(double)— separator length [m]setDesignGasLoadFactor(double)— design K-factor [m/s]setOrientation(String)— "horizontal" or "vertical"setDesignLiquidLevelFraction(double)— for vertical separators
- Returns:
- capacity utilization fraction (0.0 to 1.0+ if overloaded), or 0.0 if liquid-only (no gas separation needed), or Double.NaN if calculation error
- See Also:
-
isSinglePhase
public boolean isSinglePhase()Checks if the separator feed is single-phase (no separation required).- Returns:
- true if the thermodynamic system has only one phase
-
isOverloaded
public boolean isOverloaded()Checks if the separator is overloaded (operating above design capacity).- Returns:
- true if capacity utilization is greater than 1.0
-
isSimulationValid
public boolean isSimulationValid()Checks if the current simulation result is physically valid.Returns false if calculated values are outside physically possible ranges. This method should be overridden by specific equipment types to perform equipment-specific validation. For example:
- Compressor: power must be positive, head must be positive
- Heat exchanger: duty direction must match temperature change
- Separator: phase fractions must sum to 1.0
Validates that the separator simulation produced physically reasonable results.
- Specified by:
isSimulationValidin interfaceProcessEquipmentInterface- Returns:
- true if simulation results are physically valid, false otherwise
-
getSimulationValidationErrors
Gets validation errors for the current simulation state.Returns a list of human-readable error messages describing why the simulation result is invalid. Returns an empty list if the simulation is valid.
- Specified by:
getSimulationValidationErrorsin interfaceProcessEquipmentInterface- Returns:
- list of validation error messages, empty if valid
-
isWithinOperatingEnvelope
public boolean isWithinOperatingEnvelope()Checks if the equipment is operating within its valid operating envelope.This is different from capacity utilization - it checks whether the equipment can physically operate at the current conditions, not whether it's operating efficiently. For example:
- Compressor: checks if between surge and stonewall
- Pump: checks if above minimum flow (no cavitation)
- Heat exchanger: checks if approach temperature is positive
Checks if the separator is operating within its valid envelope. For separators, this means not overloaded (gas velocity within design limits).
- Specified by:
isWithinOperatingEnvelopein interfaceProcessEquipmentInterface- Returns:
- true if operating within valid envelope
-
getOperatingEnvelopeViolation
Gets the reason why equipment is outside its operating envelope.- Specified by:
getOperatingEnvelopeViolationin interfaceProcessEquipmentInterface- Returns:
- description of envelope violation, or null if within envelope
-
isEnforceCapacityLimits
public boolean isEnforceCapacityLimits()Gets whether capacity limits are enforced during simulation.- Returns:
- true if capacity limits are enforced
-
setEnforceCapacityLimits
public void setEnforceCapacityLimits(boolean enforce) Sets whether to enforce capacity limits during simulation. When enabled, the simulation will check if flow exceeds separator design capacity.- Parameters:
enforce- true to enforce capacity limits
-
sizeFromFlow
public void sizeFromFlow(double safetyFactor) Sizes the separator diameter based on the current flow conditions and design K-factor. Uses the Souders-Brown equation to calculate the required diameter.If no liquid phase is present, a default liquid density of 1000 kg/m³ is assumed for sizing purposes.
- Parameters:
safetyFactor- design safety factor (typically 1.1-1.5)
-
autoSize
public void autoSize(double safetyFactor) Automatically size the equipment based on connected stream conditions.This method calculates dimensions and design parameters using the inlet stream properties and applies the specified safety factor. The equipment must have a valid inlet stream connected before calling this method.
- Specified by:
autoSizein interfaceAutoSizeable- Parameters:
safetyFactor- multiplier for design capacity, typically 1.1-1.3 (10-30% over design)
-
autoSize
public void autoSize()Automatically size using default safety factor (1.2 = 20% margin).- Specified by:
autoSizein interfaceAutoSizeable
-
autoSize
Automatically size using company-specific design standards.This method applies design rules from the specified company's technical requirements (TR) documents. The standards are loaded from the NeqSim design database.
- Specified by:
autoSizein interfaceAutoSizeable- Parameters:
company- company name (e.g., "Equinor", "Shell", "TotalEnergies")trDocument- TR document reference (e.g., "TR2000", "DEP-31.38.01.11")
-
isAutoSized
public boolean isAutoSized()Check if equipment has been auto-sized.- Specified by:
isAutoSizedin interfaceAutoSizeable- Returns:
- true if autoSize() has been called successfully
-
getSizingReport
Get a detailed sizing report after auto-sizing.The report includes:
- Design basis (flow rates, pressures, temperatures)
- Calculated dimensions
- Design parameters (K-factor, Cv, velocity, etc.)
- Safety margins
- Specified by:
getSizingReportin interfaceAutoSizeable- Returns:
- formatted sizing report string
-
getSizingReportJson
Get sizing report as JSON for programmatic access.- Specified by:
getSizingReportJsonin interfaceAutoSizeable- Returns:
- JSON string with sizing data
-
initDesignFromFlow
public void initDesignFromFlow()Initializes separator dimensions from mechanical design calculations. This uses the mechanical design module to size the separator based on flow. -
getOrientation
-
setOrientation
Setter for the field
orientation.- Parameters:
orientation- the orientation to set
-
liquidArea
public double liquidArea(double level) Calculates both gas and liquid fluid section areas for horizontal separators. Results can be used for volume calculation, gas superficial velocity, and settling time.
- Parameters:
level- current liquid level inside the separator [m]- Returns:
- separator liquid area.
-
calcLiquidVolume
public double calcLiquidVolume()calculates liquid volume based on separator type.
- Returns:
- liquid level in the separator
-
updateHoldupVolumes
private void updateHoldupVolumes()Keeps cached gas/liquid holdup volumes aligned with current geometry and level. -
enforceHeadspace
protected void enforceHeadspace() -
getMaxLiquidHeight
private double getMaxLiquidHeight() -
getMinGasVolume
private double getMinGasVolume() -
clampLiquidHeight
private double clampLiquidHeight(double height) -
getInnerSurfaceArea
public double getInnerSurfaceArea()Calculates the total inner surface area of the separator, including shell and heads.- Returns:
- inner surface area in square meters
-
getWettedArea
public double getWettedArea()Estimates the wetted inner surface area based on current liquid level and orientation.For horizontal separators, the wetted area uses the circular segment defined by the liquid level to apportion the cylindrical shell and head areas. For vertical separators, the wetted area is the side area up to the current level plus the bottom head.
- Returns:
- wetted area in square meters
-
getUnwettedArea
public double getUnwettedArea()Estimates the unwetted (dry) area as the remaining inner area not in contact with liquid.- Returns:
- unwetted area in square meters
-
evaluateFireExposure
public SeparatorFireExposure.FireExposureResult evaluateFireExposure(SeparatorFireExposure.FireScenarioConfig config) Evaluates fire exposure using the separator geometry and process conditions.- Parameters:
config- fire scenario configuration- Returns:
- aggregated fire exposure result
-
evaluateFireExposure
public SeparatorFireExposure.FireExposureResult evaluateFireExposure(SeparatorFireExposure.FireScenarioConfig config, Flare flare, double flareGroundDistanceM) Evaluates fire exposure using separator geometry and process conditions while accounting for flare radiation based on the real flaring heat duty.- Parameters:
config- fire scenario configurationflare- flare supplying heat duty and radiation parametersflareGroundDistanceM- horizontal distance from flare base to separator [m]- Returns:
- aggregated fire exposure result
-
levelFromVolume
public double levelFromVolume(double volumeTarget) Estimates liquid level based on volume for horizontal separators using bisection method. Vertical separators too. tol and maxIter are bisection loop parameters.
- Parameters:
volumeTarget- desired liquid volume to be held in the separator [m3]- Returns:
- liquid level in the separator
-
getSeparatorLength
public double getSeparatorLength()Getter for the field
separatorLength.- Returns:
- the separatorLength
-
setSeparatorLength
public void setSeparatorLength(double separatorLength) Setter for the field
separatorLength.- Parameters:
separatorLength- the separatorLength to set
-
getSeparatorSection
Getter for the field
separatorSection.- Parameters:
i- a int- Returns:
- a
SeparatorSectionobject
-
getSeparatorSection
Getter for the field
separatorSection.- Parameters:
name- aStringobject- Returns:
- a
SeparatorSectionobject
-
getSeparatorSections
getSeparatorSections.
- Returns:
- a
ArrayListobject
-
addSeparatorSection
-
getDesignLiquidLevelFraction
public double getDesignLiquidLevelFraction()Getter for the field
designLiquidLevelFraction.- Returns:
- the designGasLevelFraction
-
setDesignLiquidLevelFraction
public void setDesignLiquidLevelFraction(double designLiquidLevelFraction) Setter for the field
designLiquidLevelFraction.- Parameters:
designLiquidLevelFraction- a double
-
getPressure
public double getPressure()Getter for the field
pressure.- Specified by:
getPressurein interfaceProcessEquipmentInterface- Overrides:
getPressurein classProcessEquipmentBaseClass- Returns:
- Pressure in bara
-
getEntropyProduction
getEntropyProduction.
- Specified by:
getEntropyProductionin interfaceProcessEquipmentInterface- Overrides:
getEntropyProductionin classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getMassBalance
getMassBalance.
- Specified by:
getMassBalancein interfaceProcessEquipmentInterface- Overrides:
getMassBalancein classProcessEquipmentBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-
getExergyChange
Get exergy change production of the process equipment.- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Overrides:
getExergyChangein classProcessEquipmentBaseClass- Parameters:
unit- Supported units are J and kJsurroundingTemperature- The surrounding temperature in Kelvin- Returns:
- change in exergy in specified unit
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceProcessEquipmentInterface- Overrides:
hashCodein classProcessEquipmentBaseClass
-
equals
- Specified by:
equalsin interfaceProcessEquipmentInterface- Overrides:
equalsin classProcessEquipmentBaseClass
-
getFeedStream
-
toJson
Serializes the Process Equipment along with its state to a JSON string.
- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Returns:
- json string.
-
toJson
Serializes the Process Equipment with configurable level of detail.- Specified by:
toJsonin interfaceProcessEquipmentInterface- Overrides:
toJsonin classProcessEquipmentBaseClass- Parameters:
cfg- report configuration- Returns:
- json string
-
setHeatInput
public void setHeatInput(double heatInput) Set heat input to the separator (e.g., from flare radiation, external heating).- Specified by:
setHeatInputin interfaceSeparatorInterface- Parameters:
heatInput- heat duty in watts
-
setHeatInput
Set heat input to the separator with specified unit.- Specified by:
setHeatInputin interfaceSeparatorInterface- Parameters:
heatInput- heat duty valueunit- heat duty unit (W, kW, MW, J/s, etc.)
-
setHeatDuty
public void setHeatDuty(double heatDuty) Set heat duty (alias for setHeatInput).- Parameters:
heatDuty- heat duty in watts
-
setHeatDuty
Set heat duty with unit (alias for setHeatInput).- Parameters:
heatDuty- heat duty valueunit- heat duty unit
-
setDuty
public void setDuty(double heatDuty) Set heat duty (alias preserved for compatibility with energy-stream style naming).- Parameters:
heatDuty- heat duty in watts
-
setDuty
Set heat duty with unit (alias preserved for compatibility with energy-stream style naming).- Parameters:
heatDuty- heat duty valueunit- heat duty unit
-
getHeatInput
public double getHeatInput()Get heat input in watts.- Specified by:
getHeatInputin interfaceSeparatorInterface- Returns:
- heat input in watts
-
getHeatInput
Get heat input in specified unit.- Specified by:
getHeatInputin interfaceSeparatorInterface- Parameters:
unit- desired unit (W, kW, MW)- Returns:
- heat input in specified unit
-
getHeatDuty
public double getHeatDuty()Get heat duty (alias for getHeatInput).- Returns:
- heat duty in watts
-
getHeatDuty
Get heat duty in specified unit.- Parameters:
unit- desired unit- Returns:
- heat duty in specified unit
-
isSetHeatInput
public boolean isSetHeatInput()Check if heat input is set.- Specified by:
isSetHeatInputin interfaceSeparatorInterface- Returns:
- true if heat input is explicitly set
-
getExergyChange
getExergyChange.
- Specified by:
getExergyChangein interfaceProcessEquipmentInterface- Parameters:
unit- aStringobject- Returns:
- a double
-
getCapacityDuty
public double getCapacityDuty()getCapacityDuty.
For separators, capacity duty is defined as the gas outlet volumetric flow rate in m³/hr. This is used in conjunction with
getCapacityMax()for bottleneck analysis viaProcessSystem.getBottleneck().- Specified by:
getCapacityDutyin interfaceProcessEquipmentInterface- Returns:
- gas outlet flow rate in m³/hr
-
getCapacityMax
public double getCapacityMax()getCapacityMax.
For separators, maximum capacity is defined by the mechanical design's maximum gas volume flow in m³/hr. If not set, the value is derived from the gas load factor design:
designGasLoadFactor * crossSectionalArea * 3600.- Specified by:
getCapacityMaxin interfaceProcessEquipmentInterface- Returns:
- maximum design gas volume flow in m³/hr
- See Also:
-
getStateVector
Get the current state as a standardized vector.The state vector should include all observable variables relevant for control and monitoring. Values should be in physical units with appropriate bounds.
Returns state vector containing:
- pressure - Separator pressure [bar]
- temperature - Separator temperature [K]
- liquid_level - Liquid level fraction [0-1]
- gas_density - Gas phase density [kg/m³]
- liquid_density - Liquid phase density [kg/m³]
- gas_flow - Gas outlet flow [kg/s]
- liquid_flow - Liquid outlet flow [kg/s]
- gas_load_factor - Gas load factor [-]
- Specified by:
getStateVectorin interfaceStateVectorProvider- Returns:
- current state vector
-
validateSetup
Validate the process equipment before execution.Checks for common setup errors:
- Equipment has a valid name
- Input streams connected
- Operating parameters in valid ranges
Validates the separator setup before execution. Checks that:
- Equipment has a valid name
- At least one inlet stream is connected
- Separator dimensions are positive
- Liquid level is within valid range
- Specified by:
validateSetupin interfaceProcessEquipmentInterface- Returns:
- validation result with errors and warnings
-
initializeCapacityConstraints
protected void initializeCapacityConstraints()Initializes default capacity constraints for this separator.Creates constraints for gas load factor based on the separator's design parameters. Additional constraints like liquid residence time can be added after construction.
Note: All separator constraints (gas load factor, K-value, droplet cut size, inlet momentum, retention times) are disabled by default for backwards compatibility with the optimizer. Use
useEquinorConstraints(),useAPIConstraints(), oruseAllConstraints()to enable them explicitly for capacity analysis. -
setKValueLimit
public void setKValueLimit(double limit) Set custom K-value limit for the separator constraint.- Parameters:
limit- K-value limit in m/s (default 0.15 per TR3500)
-
setDropletCutSizeLimit
public void setDropletCutSizeLimit(double limitMicrons) Set custom droplet cut size limit for the separator constraint.- Parameters:
limitMicrons- droplet cut size limit in micrometers (default 150 µm per TR3500)
-
setInletMomentumLimit
public void setInletMomentumLimit(double limitPa) Set custom inlet momentum limit for the separator constraint.- Parameters:
limitPa- momentum flux limit in Pa (default 16000 Pa per Equinor Revamp)
-
setMinOilRetentionTime
public void setMinOilRetentionTime(double minMinutes) Set custom minimum oil retention time for the separator constraint.- Parameters:
minMinutes- minimum oil retention time in minutes (default 3 min per API 12J)
-
setMinWaterRetentionTime
public void setMinWaterRetentionTime(double minMinutes) Set custom minimum water retention time for the separator constraint.- Parameters:
minMinutes- minimum water retention time in minutes (default 3 min per API 12J)
-
getConstraintSummary
Get a summary of all constraint utilizations.- Returns:
- constraint summary as formatted string
-
getCapacityConstraints
Gets all capacity constraints defined for this equipment.The map keys are constraint names (e.g., "speed", "gasLoadFactor") and values are the corresponding CapacityConstraint objects containing design values, current values, and utilization calculations.
- Specified by:
getCapacityConstraintsin interfaceCapacityConstrainedEquipment- Returns:
- unmodifiable map of constraint name to CapacityConstraint
-
getBottleneckConstraint
Gets the constraint with the highest utilization (the bottleneck).This method identifies which constraint is closest to or exceeding its design limit. Use this to determine what is limiting equipment capacity.
- Specified by:
getBottleneckConstraintin interfaceCapacityConstrainedEquipment- Returns:
- the bottleneck constraint, or null if no constraints are defined
-
isCapacityExceeded
public boolean isCapacityExceeded()Checks if any capacity constraint is violated (exceeds 100% utilization).A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.
- Specified by:
isCapacityExceededin interfaceCapacityConstrainedEquipment- Returns:
- true if any constraint utilization exceeds 1.0 (100%)
-
isHardLimitExceeded
public boolean isHardLimitExceeded()Checks if any HARD constraint limit is exceeded.HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.
- Specified by:
isHardLimitExceededin interfaceCapacityConstrainedEquipment- Returns:
- true if any HARD constraint's max value is exceeded
-
getMaxUtilization
public double getMaxUtilization()Gets the maximum utilization across all constraints.This gives a single number representing how close the equipment is to its limiting constraint. Values above 1.0 indicate the equipment is over capacity.
- Specified by:
getMaxUtilizationin interfaceCapacityConstrainedEquipment- Returns:
- maximum utilization as fraction (1.0 = 100% of design capacity)
-
addCapacityConstraint
Adds a new capacity constraint to this equipment.This allows dynamic addition of constraints at runtime. Constraints can be added during equipment configuration or based on operating conditions.
- Specified by:
addCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraint- the constraint to add
-
removeCapacityConstraint
Removes a capacity constraint by name.- Specified by:
removeCapacityConstraintin interfaceCapacityConstrainedEquipment- Parameters:
constraintName- the name of the constraint to remove- Returns:
- true if the constraint was found and removed
-
clearCapacityConstraints
public void clearCapacityConstraints()Clears all capacity constraints from this equipment.- Specified by:
clearCapacityConstraintsin interfaceCapacityConstrainedEquipment
-
useConstraints
Enable only the specified constraints by name. All other constraints are removed.Available constraint names:
- "gasLoadFactor" - Gas load factor (K-factor)
- "kValue" - K-value (Souders-Brown) at HLL per TR3500
- "dropletCutSize" - Droplet cut size per TR3500
- "inletMomentum" - Inlet nozzle momentum flux
- "oilRetentionTime" - Oil retention time per API 12J
- "waterRetentionTime" - Water retention time per API 12J
- Parameters:
constraintNames- names of constraints to enable (all others will be disabled)
-
enableConstraints
Enable specific constraints by name (additive - doesn't disable others). Use this to add constraints to the existing set without clearing others.- Parameters:
constraintNames- names of constraints to enable
-
disableConstraints
Disable specific constraints by name.- Parameters:
constraintNames- names of constraints to disable
-
useEquinorConstraints
public void useEquinorConstraints()Use Equinor TR3500 constraints (K-value, droplet cut size, inlet momentum, retention times). Enables these constraints in addition to the default gas load factor. -
useAPIConstraints
public void useAPIConstraints()Use API 12J constraints (K-value, retention times). Enables these constraints in addition to the default gas load factor. -
useGasScrubberConstraints
public void useGasScrubberConstraints()Use gas scrubber constraints (gas load factor and inlet momentum). For gas scrubbers, the gas load factor (K-factor) is the primary performance metric as liquid retention is not relevant - the focus is on removing liquid droplets from gas. Inlet momentum is also checked to ensure the inlet nozzle velocity does not re-entrain separated liquid. -
useGasCapacityConstraints
public void useGasCapacityConstraints()Use gas capacity constraints (gas load factor, K-value, droplet cut size, inlet momentum). -
useLiquidCapacityConstraints
public void useLiquidCapacityConstraints()Use liquid capacity constraints (retention times). -
useAllConstraints
public void useAllConstraints()Use all available constraints. Enables all constraints including the new TR3500/API 12J constraints. -
disableConstraint
Disable a specific constraint by name.- Parameters:
constraintName- name of constraint to disable- Returns:
- true if constraint was found and disabled
-
isConstraintEnabled
Check if a specific constraint is enabled.- Parameters:
constraintName- name of constraint to check- Returns:
- true if constraint exists and is enabled
-
getEnabledConstraintNames
-
calcGasAreaAboveLevel
public double calcGasAreaAboveLevel(double liquidLevelHeight) Calculate the gas area above the specified liquid level for horizontal separator.- Parameters:
liquidLevelHeight- liquid level height in meters- Returns:
- gas area in m²
-
calcGasVelocityAboveLevel
public double calcGasVelocityAboveLevel(double liquidLevelHeight) Calculate gas velocity above the specified liquid level.- Parameters:
liquidLevelHeight- liquid level height in meters (e.g., HLL)- Returns:
- gas velocity in m/s
-
calcKValue
public double calcKValue(double liquidLevelHeight) Calculate the K-value (Souders-Brown factor) above the specified liquid level. K = v_gas * sqrt(ρ_gas / (ρ_liquid - ρ_gas))Per Equinor TR3500 SR-50535: K-value must be less than 0.15 m/s related to HLL.
- Parameters:
liquidLevelHeight- liquid level height in meters (typically HLL)- Returns:
- K-value in m/s
-
calcKValueAtHLL
public double calcKValueAtHLL()Calculate the K-value at the design HLL from mechanical design. Uses HLL fraction from SeparatorMechanicalDesign if available.- Returns:
- K-value in m/s at HLL
-
isKValueWithinLimit
public boolean isKValueWithinLimit(double limit) Check if K-value is within the specified limit.- Parameters:
limit- K-value limit in m/s (default 0.15 per TR3500)- Returns:
- true if K-value is below the limit
-
isKValueWithinLimit
public boolean isKValueWithinLimit()Check if K-value is within the default limit (0.15 m/s per TR3500).- Returns:
- true if K-value is below the default limit
-
calcDropletCutSize
public double calcDropletCutSize(double effectiveGasLength, double freeHeightAboveLiquid) Calculate the oil droplet cut size in the gas section above liquid level. Based on Stokes law for terminal settling velocity.Per Equinor TR3500 SR-50535: Droplet cut size must be less than 150 µm.
- Parameters:
effectiveGasLength- effective gas separation length in metersfreeHeightAboveLiquid- free height above liquid level in meters- Returns:
- droplet cut size in meters (multiply by 1e6 for µm)
-
calcDropletCutSizeAtHLL
public double calcDropletCutSizeAtHLL()Calculate the oil droplet cut size at HLL using mechanical design parameters.- Returns:
- droplet cut size in meters
-
isDropletCutSizeWithinLimit
public boolean isDropletCutSizeWithinLimit(double limitMicrons) Check if droplet cut size is within the specified limit.- Parameters:
limitMicrons- droplet cut size limit in micrometers (default 150 µm per TR3500)- Returns:
- true if droplet cut size is below the limit
-
isDropletCutSizeWithinLimit
public boolean isDropletCutSizeWithinLimit()Check if droplet cut size is within the default limit (150 µm per TR3500).- Returns:
- true if droplet cut size is below the default limit
-
calcInletMomentumFlux
public double calcInletMomentumFlux(double nozzleDiameter) Calculate the inlet nozzle momentum flux. M = ρ_mix * v_mix²Per Equinor Revamp Limit: Momentum flux should be less than 16000 Pa.
- Parameters:
nozzleDiameter- inlet nozzle internal diameter in meters- Returns:
- momentum flux in Pa
-
calcInletMomentumFlux
public double calcInletMomentumFlux()Calculate the inlet momentum flux using mechanical design nozzle size.- Returns:
- momentum flux in Pa
-
isInletMomentumWithinLimit
public boolean isInletMomentumWithinLimit(double limitPa) Check if inlet momentum flux is within the specified limit.- Parameters:
limitPa- momentum flux limit in Pa (default 16000 Pa for revamp)- Returns:
- true if momentum flux is below the limit
-
isInletMomentumWithinLimit
public boolean isInletMomentumWithinLimit()Check if inlet momentum flux is within the default limit (16000 Pa).- Returns:
- true if momentum flux is below the default limit
-
calcSegmentArea
public static double calcSegmentArea(double diameter, double levelHeight) Calculate the liquid area (circular segment) at a given level height.- Parameters:
diameter- vessel internal diameter in meterslevelHeight- liquid level height in meters- Returns:
- segment area in m²
-
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.- 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.- Returns:
- water retention time in minutes
-
isOilRetentionTimeAboveMinimum
public boolean isOilRetentionTimeAboveMinimum(double minMinutes) Check if oil retention time meets the minimum requirement.- Parameters:
minMinutes- minimum retention time in minutes (default 3 minutes per API 12J)- Returns:
- true if retention time is above the minimum
-
isOilRetentionTimeAboveMinimum
public boolean isOilRetentionTimeAboveMinimum()Check if oil retention time meets the default minimum (3 minutes).- Returns:
- true if retention time is above the default minimum
-
isWaterRetentionTimeAboveMinimum
public boolean isWaterRetentionTimeAboveMinimum(double minMinutes) Check if water retention time meets the minimum requirement.- Parameters:
minMinutes- minimum retention time in minutes (default 3 minutes per API 12J)- Returns:
- true if retention time is above the minimum
-
isWaterRetentionTimeAboveMinimum
public boolean isWaterRetentionTimeAboveMinimum()Check if water retention time meets the default minimum (3 minutes).- Returns:
- true if retention time is above the default minimum
-
isWithinAllLimits
public boolean isWithinAllLimits()Check if all separator performance parameters are within limits. Uses default limits from Equinor TR3500 and API 12J.- Returns:
- true if all parameters are within limits
-
getPerformanceSummary
Get a summary of all performance parameters with limit checks.- Returns:
- performance summary as formatted string
-
readObject
Custom deserialization to reinitialize transient fields.After deserialization, the capacity constraints need to be reinitialized because the valueSupplier lambdas are transient and cannot be serialized. This method clears any deserialized constraints and creates fresh ones with proper value suppliers bound to this separator instance.
- Parameters:
in- the ObjectInputStream to read from- Throws:
IOException- if an I/O error occursClassNotFoundException- if the class of a serialized object cannot be found
-
builder
Creates a new Builder for constructing a Separator with a fluent API.Example usage:
Separator sep = Separator.builder("V-100").inletStream(feed).orientation("horizontal") .length(5.0).diameter(2.0).liquidLevel(0.5).build();- Parameters:
name- the name of the separator- Returns:
- a new Builder instance
-