Class AntiSurge
java.lang.Object
neqsim.process.equipment.compressor.AntiSurge
- All Implemented Interfaces:
Serializable
AntiSurge class for compressor surge protection in dynamic simulations.
This class models anti-surge control systems including recycle valve control, surge detection, and various control strategies used to protect centrifugal compressors from surge.
- Version:
- $Id: $Id
- Author:
- asmund
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum for anti-surge control strategies. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AntiSurge.ControlStrategyprivate doubleprivate doubleprivate booleanprivate booleanprivate doubleprivate doubleprivate intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate static final longSerialization version UID.private doubleprivate doubleprivate doubleprivate doubleprivate intprivate doubleprivate doubleprivate doubleprivate doubleprivate doubleprivate booleanprivate doubleprivate doubleprivate double -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AntiSurge(AntiSurge.ControlStrategy strategy) Constructor with control strategy. -
Method Summary
Modifier and TypeMethodDescriptionprivate doublecalculateDualLoopControl(double surgeMargin, double timeStep) Calculate dual-loop control output.private doublecalculateOnOffControl(double surgeMargin) Calculate on/off control output.private doublecalculatePIDControl(double surgeMargin, double timeStep) Calculate PID control output.private doublecalculatePredictiveControl(double surgeMargin, double timeStep) Calculate predictive control output.private doublecalculateProportionalControl(double surgeMargin) Calculate proportional control output.booleanGet the control strategy.doubleGet the current surge fraction.doubleGet hot gas bypass flow.doubleGet the maximum recycle flow.doubleGet the minimum recycle flow.doubleGet the predictive horizon.doublegetRecycleFlow(double maxFlow) Get the recycle flow rate based on valve position.Generate a summary of the anti-surge controller state.doubleGet the surge approach rate.doubleGet the surge control factor.doubleGet the surge control line offset.intGet the number of surge cycles.doubleGet the surge warning margin.doubleGet the target valve position.doubleGet the current valve position.doubleGet the valve rate limit.doubleGet the valve response time.inthashCode()booleanisActive()Check if anti-surge is active.booleanisSurge()Check if compressor is in surge.booleanCheck if hot gas bypass is enabled.voidresetPID()Reset the PID controller state.voidReset the surge cycle counter.voidsetActive(boolean isActive) Set anti-surge active state.voidsetControlStrategy(AntiSurge.ControlStrategy strategy) Set the control strategy.voidsetCurrentSurgeFraction(double currentSurgeFraction) Set the current surge fraction.voidsetHotGasBypassFlow(double flow) Set hot gas bypass flow.voidsetMaximumRecycleFlow(double flow) Set the maximum recycle flow.voidsetMaxSurgeCyclesBeforeTrip(int maxCycles) Set the maximum surge cycles before trip.voidsetMinimumRecycleFlow(double flow) Set the minimum recycle flow.voidsetPIDParameters(double kp, double ki, double kd) Set PID controller parameters.voidsetPIDSetpoint(double setpoint) Set PID setpoint.voidsetPredictiveHorizon(double horizon) Set the predictive horizon.voidsetSurge(boolean isSurge) Set surge state.voidsetSurgeControlFactor(double antiSurgeSafetyFactor) Set the surge control factor.voidsetSurgeControlLineOffset(double offset) Set the surge control line offset.voidsetSurgeWarningMargin(double margin) Set the surge warning margin.voidsetTargetValvePosition(double position) Set the target valve position.voidsetUseHotGasBypass(boolean use) Enable or disable hot gas bypass.voidsetValvePosition(double position) Set the valve position directly.voidsetValveRateLimit(double rateLimit) Set the valve rate limit.voidsetValveResponseTime(double time) Set the valve response time.booleanCheck if the compressor should trip due to repeated surge cycles.doubleupdateController(double surgeMargin, double timeStep) Update the anti-surge controller.private voidupdateValvePosition(double timeStep) Update valve position with rate limiting and response time.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
isActive
private boolean isActive -
isSurge
private boolean isSurge -
surgeControlFactor
private double surgeControlFactor -
currentSurgeFraction
private double currentSurgeFraction -
controlStrategy
-
minimumRecycleFlow
private double minimumRecycleFlow -
maximumRecycleFlow
private double maximumRecycleFlow -
valvePosition
private double valvePosition -
valveResponseTime
private double valveResponseTime -
valveRateLimit
private double valveRateLimit -
targetValvePosition
private double targetValvePosition -
pidKp
private double pidKp -
pidKi
private double pidKi -
pidKd
private double pidKd -
pidIntegral
private double pidIntegral -
pidLastError
private double pidLastError -
pidSetpoint
private double pidSetpoint -
surgeApproachRate
private double surgeApproachRate -
lastSurgeFraction
private double lastSurgeFraction -
predictiveHorizon
private double predictiveHorizon -
predictionGain
private double predictionGain -
surgeControlLineOffset
private double surgeControlLineOffset -
surgeControlLineSlope
private double surgeControlLineSlope -
surgeWarningMargin
private double surgeWarningMargin -
surgeTripMargin
private double surgeTripMargin -
surgeCycleCount
private int surgeCycleCount -
maxSurgeCyclesBeforeTrip
private int maxSurgeCyclesBeforeTrip -
surgeCycleResetTime
private double surgeCycleResetTime -
timeSinceLastSurge
private double timeSinceLastSurge -
useHotGasBypass
private boolean useHotGasBypass -
hotGasBypassFlow
private double hotGasBypassFlow
-
-
Constructor Details
-
AntiSurge
public AntiSurge()Default constructor. -
AntiSurge
Constructor with control strategy.- Parameters:
strategy- the control strategy to use
-
-
Method Details
-
isActive
public boolean isActive()Check if anti-surge is active.- Returns:
- true if active
-
setActive
public void setActive(boolean isActive) Set anti-surge active state.- Parameters:
isActive- true to activate
-
isSurge
public boolean isSurge()Check if compressor is in surge.- Returns:
- true if in surge
-
setSurge
public void setSurge(boolean isSurge) Set surge state.- Parameters:
isSurge- true if in surge
-
getSurgeControlFactor
public double getSurgeControlFactor()Get the surge control factor.- Returns:
- the surge control factor
-
setSurgeControlFactor
public void setSurgeControlFactor(double antiSurgeSafetyFactor) Set the surge control factor.- Parameters:
antiSurgeSafetyFactor- the safety factor
-
getCurrentSurgeFraction
public double getCurrentSurgeFraction()Get the current surge fraction.- Returns:
- the surge fraction
-
setCurrentSurgeFraction
public void setCurrentSurgeFraction(double currentSurgeFraction) Set the current surge fraction.- Parameters:
currentSurgeFraction- the surge fraction
-
getControlStrategy
Get the control strategy.- Returns:
- the control strategy
-
setControlStrategy
Set the control strategy.- Parameters:
strategy- the control strategy
-
getMinimumRecycleFlow
public double getMinimumRecycleFlow()Get the minimum recycle flow.- Returns:
- minimum flow in m³/hr
-
setMinimumRecycleFlow
public void setMinimumRecycleFlow(double flow) Set the minimum recycle flow.- Parameters:
flow- minimum flow in m³/hr
-
getMaximumRecycleFlow
public double getMaximumRecycleFlow()Get the maximum recycle flow.- Returns:
- maximum flow in m³/hr
-
setMaximumRecycleFlow
public void setMaximumRecycleFlow(double flow) Set the maximum recycle flow.- Parameters:
flow- maximum flow in m³/hr
-
getValvePosition
public double getValvePosition()Get the current valve position.- Returns:
- valve position (0-1)
-
setValvePosition
public void setValvePosition(double position) Set the valve position directly.- Parameters:
position- valve position (0-1)
-
getValveResponseTime
public double getValveResponseTime()Get the valve response time.- Returns:
- response time in seconds
-
setValveResponseTime
public void setValveResponseTime(double time) Set the valve response time.- Parameters:
time- response time in seconds
-
getValveRateLimit
public double getValveRateLimit()Get the valve rate limit.- Returns:
- rate limit per second
-
setValveRateLimit
public void setValveRateLimit(double rateLimit) Set the valve rate limit.- Parameters:
rateLimit- rate limit per second
-
getTargetValvePosition
public double getTargetValvePosition()Get the target valve position.- Returns:
- target position (0-1)
-
setTargetValvePosition
public void setTargetValvePosition(double position) Set the target valve position.- Parameters:
position- target position (0-1)
-
updateController
public double updateController(double surgeMargin, double timeStep) Update the anti-surge controller.- Parameters:
surgeMargin- current distance to surgetimeStep- time step in seconds- Returns:
- the calculated valve position
-
calculateOnOffControl
private double calculateOnOffControl(double surgeMargin) Calculate on/off control output.- Parameters:
surgeMargin- current surge margin- Returns:
- valve position (0 or 1)
-
calculateProportionalControl
private double calculateProportionalControl(double surgeMargin) Calculate proportional control output.- Parameters:
surgeMargin- current surge margin- Returns:
- valve position (0-1)
-
calculatePIDControl
private double calculatePIDControl(double surgeMargin, double timeStep) Calculate PID control output.- Parameters:
surgeMargin- current surge margintimeStep- time step in seconds- Returns:
- valve position (0-1)
-
calculatePredictiveControl
private double calculatePredictiveControl(double surgeMargin, double timeStep) Calculate predictive control output.- Parameters:
surgeMargin- current surge margintimeStep- time step in seconds- Returns:
- valve position (0-1)
-
calculateDualLoopControl
private double calculateDualLoopControl(double surgeMargin, double timeStep) Calculate dual-loop control output.- Parameters:
surgeMargin- current surge margintimeStep- time step in seconds- Returns:
- valve position (0-1)
-
updateValvePosition
private void updateValvePosition(double timeStep) Update valve position with rate limiting and response time.- Parameters:
timeStep- time step in seconds
-
getRecycleFlow
public double getRecycleFlow(double maxFlow) Get the recycle flow rate based on valve position.- Parameters:
maxFlow- maximum possible recycle flow- Returns:
- calculated recycle flow
-
shouldTrip
public boolean shouldTrip()Check if the compressor should trip due to repeated surge cycles.- Returns:
- true if trip is required
-
getSurgeCycleCount
public int getSurgeCycleCount()Get the number of surge cycles.- Returns:
- surge cycle count
-
resetSurgeCycleCount
public void resetSurgeCycleCount()Reset the surge cycle counter. -
getSurgeApproachRate
public double getSurgeApproachRate()Get the surge approach rate.- Returns:
- rate of change of surge margin per second
-
setPIDParameters
public void setPIDParameters(double kp, double ki, double kd) Set PID controller parameters.- Parameters:
kp- proportional gainki- integral gainkd- derivative gain
-
setPIDSetpoint
public void setPIDSetpoint(double setpoint) Set PID setpoint.- Parameters:
setpoint- target surge margin
-
resetPID
public void resetPID()Reset the PID controller state. -
setSurgeControlLineOffset
public void setSurgeControlLineOffset(double offset) Set the surge control line offset.- Parameters:
offset- offset from surge line (e.g., 0.10 for 10%)
-
getSurgeControlLineOffset
public double getSurgeControlLineOffset()Get the surge control line offset.- Returns:
- offset from surge line
-
setMaxSurgeCyclesBeforeTrip
public void setMaxSurgeCyclesBeforeTrip(int maxCycles) Set the maximum surge cycles before trip.- Parameters:
maxCycles- maximum cycles
-
isUseHotGasBypass
public boolean isUseHotGasBypass()Check if hot gas bypass is enabled.- Returns:
- true if enabled
-
setUseHotGasBypass
public void setUseHotGasBypass(boolean use) Enable or disable hot gas bypass.- Parameters:
use- true to enable
-
getHotGasBypassFlow
public double getHotGasBypassFlow()Get hot gas bypass flow.- Returns:
- bypass flow in m³/hr
-
setHotGasBypassFlow
public void setHotGasBypassFlow(double flow) Set hot gas bypass flow.- Parameters:
flow- bypass flow in m³/hr
-
getSurgeWarningMargin
public double getSurgeWarningMargin()Get the surge warning margin.- Returns:
- warning margin
-
setSurgeWarningMargin
public void setSurgeWarningMargin(double margin) Set the surge warning margin.- Parameters:
margin- warning margin
-
getPredictiveHorizon
public double getPredictiveHorizon()Get the predictive horizon.- Returns:
- prediction horizon in seconds
-
setPredictiveHorizon
public void setPredictiveHorizon(double horizon) Set the predictive horizon.- Parameters:
horizon- prediction horizon in seconds
-
hashCode
-
equals
-
getSummary
Generate a summary of the anti-surge controller state.- Returns:
- multi-line summary string
-