Class ShutdownLogic
java.lang.Object
neqsim.process.logic.shutdown.ShutdownLogic
- All Implemented Interfaces:
ProcessLogic
Shutdown logic with controlled ramp-down of equipment.
Shutdown sequences gradually reduce equipment operation to prevent thermal shock, pressure surges, or other process upsets. This follows industry best practices for safe process shutdown.
Key features:
- Sequential action execution with timing
- Rate-limited valve closure (gradual ramp-down)
- Equipment cool-down periods
- Configurable ramp rates
- Emergency vs. controlled shutdown modes
Example usage:
ShutdownLogic shutdown = new ShutdownLogic("Reactor Shutdown");
shutdown.setRampDownTime(600.0); // 10 minutes normal shutdown
// Add shutdown actions in sequence
shutdown.addAction(new ReduceFeedAction(feedValve, 50.0), 0.0); // Reduce to 50%
shutdown.addAction(new ReduceFeedAction(feedValve, 0.0), 60.0); // Close after 60s
shutdown.addAction(new StopHeaterAction(heater), 120.0); // Stop heater
shutdown.addAction(new ActivateCoolingAction(cooler), 180.0); // Start cooling
shutdown.addAction(new WaitForTempAction(reactor, 50.0), 300.0); // Wait to cool
shutdown.addAction(new StopAgitatorAction(agitator), 600.0); // Finally stop mixing
// Controlled shutdown
shutdown.activate();
while (!shutdown.isComplete()) {
shutdown.execute(timeStep);
}
// Emergency shutdown (faster)
shutdown.setEmergencyMode(true);
shutdown.activate();
- Version:
- 1.0
- Author:
- ESOL
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classInternal class to store an action with its delay. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ShutdownLogic.ActionWithDelay> private intprivate doubleprivate doubleprivate booleanprivate doubleprivate final Stringprivate doubleprivate LogicState -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the logic sequence, starting execution.voidaddAction(LogicAction action, double delay) Adds an action to the shutdown sequence.voidDeactivates the logic sequence, pausing or stopping execution.voidexecute(double timeStep) Executes one time step of the logic sequence.intGets the number of actions in the sequence.intGets the number of completed actions.doubleGets the effective shutdown time based on mode.doubleGets the configured emergency shutdown time.getName()Gets the name of this logic sequence.doubleGets the shutdown progress as a percentage.doubleGets the configured ramp-down time.getState()Gets the current state of the logic.Gets a description of the current status.Gets the list of equipment targeted by this logic.booleanisActive()Checks if the logic is currently active (running).booleanChecks if the logic sequence has completed successfully.booleanChecks if shutdown is in emergency mode.booleanreset()Resets the logic sequence to its initial state.voidsetEmergencyMode(boolean emergency) Sets whether this is an emergency shutdown (faster) or controlled shutdown.voidsetEmergencyShutdownTime(double emergencyTime) Sets the emergency shutdown time (faster than controlled).voidsetRampDownTime(double rampTime) Sets the total ramp-down time for controlled shutdown.
-
Field Details
-
name
-
actions
-
state
-
currentActionIndex
private int currentActionIndex -
elapsedTime
private double elapsedTime -
currentDelay
private double currentDelay -
emergencyMode
private boolean emergencyMode -
rampDownTime
private double rampDownTime -
emergencyShutdownTime
private double emergencyShutdownTime
-
-
Constructor Details
-
ShutdownLogic
Creates a shutdown logic sequence.- Parameters:
name- name of the shutdown sequence
-
-
Method Details
-
addAction
Adds an action to the shutdown sequence.- Parameters:
action- action to executedelay- delay in seconds before executing (relative to shutdown start)
-
setEmergencyMode
public void setEmergencyMode(boolean emergency) Sets whether this is an emergency shutdown (faster) or controlled shutdown.- Parameters:
emergency- true for emergency mode (accelerated timing)
-
setRampDownTime
public void setRampDownTime(double rampTime) Sets the total ramp-down time for controlled shutdown.- Parameters:
rampTime- time in seconds (default 300s)
-
setEmergencyShutdownTime
public void setEmergencyShutdownTime(double emergencyTime) Sets the emergency shutdown time (faster than controlled).- Parameters:
emergencyTime- time in seconds (default 30s)
-
getEffectiveShutdownTime
public double getEffectiveShutdownTime()Gets the effective shutdown time based on mode.- Returns:
- shutdown time in seconds
-
getRampDownTime
public double getRampDownTime()Gets the configured ramp-down time.- Returns:
- ramp-down time in seconds
-
getEmergencyShutdownTime
public double getEmergencyShutdownTime()Gets the configured emergency shutdown time.- Returns:
- emergency shutdown time in seconds
-
activate
public void activate()Description copied from interface:ProcessLogicActivates the logic sequence, starting execution.If the logic is already active, this may restart it or have no effect depending on implementation.
- Specified by:
activatein interfaceProcessLogic
-
deactivate
public void deactivate()Description copied from interface:ProcessLogicDeactivates the logic sequence, pausing or stopping execution.The logic remains in its current state and can be reactivated later.
- Specified by:
deactivatein interfaceProcessLogic
-
reset
public boolean reset()Description copied from interface:ProcessLogicResets the logic sequence to its initial state.This prepares the logic for a fresh execution. Reset may require certain permissive conditions to be met.
- Specified by:
resetin interfaceProcessLogic- Returns:
- true if reset was successful, false if permissives not met
-
execute
public void execute(double timeStep) Description copied from interface:ProcessLogicExecutes one time step of the logic sequence.This method should be called repeatedly in transient simulations to advance the logic through its steps.
- Specified by:
executein interfaceProcessLogic- Parameters:
timeStep- time increment in seconds
-
isEmergencyMode
public boolean isEmergencyMode()Checks if shutdown is in emergency mode.- Returns:
- true if emergency shutdown
-
getProgress
public double getProgress()Gets the shutdown progress as a percentage.- Returns:
- progress 0-100%
-
getName
Description copied from interface:ProcessLogicGets the name of this logic sequence.- Specified by:
getNamein interfaceProcessLogic- Returns:
- logic name
-
getState
Description copied from interface:ProcessLogicGets the current state of the logic.- Specified by:
getStatein interfaceProcessLogic- Returns:
- current logic state
-
isActive
public boolean isActive()Description copied from interface:ProcessLogicChecks if the logic is currently active (running).- Specified by:
isActivein interfaceProcessLogic- Returns:
- true if logic is active
-
isComplete
public boolean isComplete()Description copied from interface:ProcessLogicChecks if the logic sequence has completed successfully.- Specified by:
isCompletein interfaceProcessLogic- Returns:
- true if logic has completed all steps
-
getTargetEquipment
Description copied from interface:ProcessLogicGets the list of equipment targeted by this logic.- Specified by:
getTargetEquipmentin interfaceProcessLogic- Returns:
- list of target equipment
-
getStatusDescription
Description copied from interface:ProcessLogicGets a description of the current status.- Specified by:
getStatusDescriptionin interfaceProcessLogic- Returns:
- status description
-
getActionCount
public int getActionCount()Gets the number of actions in the sequence.- Returns:
- action count
-
getCompletedActionCount
public int getCompletedActionCount()Gets the number of completed actions.- Returns:
- completed count
-