Class ShutdownLogic

java.lang.Object
neqsim.process.logic.shutdown.ShutdownLogic
All Implemented Interfaces:
ProcessLogic

public class ShutdownLogic extends Object implements 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
  • Field Details

    • name

      private final String name
    • actions

      private final List<ShutdownLogic.ActionWithDelay> actions
    • state

      private LogicState 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

      public ShutdownLogic(String name)
      Creates a shutdown logic sequence.
      Parameters:
      name - name of the shutdown sequence
  • Method Details

    • addAction

      public void addAction(LogicAction action, double delay)
      Adds an action to the shutdown sequence.
      Parameters:
      action - action to execute
      delay - 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: ProcessLogic
      Activates the logic sequence, starting execution.

      If the logic is already active, this may restart it or have no effect depending on implementation.

      Specified by:
      activate in interface ProcessLogic
    • deactivate

      public void deactivate()
      Description copied from interface: ProcessLogic
      Deactivates the logic sequence, pausing or stopping execution.

      The logic remains in its current state and can be reactivated later.

      Specified by:
      deactivate in interface ProcessLogic
    • reset

      public boolean reset()
      Description copied from interface: ProcessLogic
      Resets 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:
      reset in interface ProcessLogic
      Returns:
      true if reset was successful, false if permissives not met
    • execute

      public void execute(double timeStep)
      Description copied from interface: ProcessLogic
      Executes 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:
      execute in interface ProcessLogic
      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

      public String getName()
      Description copied from interface: ProcessLogic
      Gets the name of this logic sequence.
      Specified by:
      getName in interface ProcessLogic
      Returns:
      logic name
    • getState

      public LogicState getState()
      Description copied from interface: ProcessLogic
      Gets the current state of the logic.
      Specified by:
      getState in interface ProcessLogic
      Returns:
      current logic state
    • isActive

      public boolean isActive()
      Description copied from interface: ProcessLogic
      Checks if the logic is currently active (running).
      Specified by:
      isActive in interface ProcessLogic
      Returns:
      true if logic is active
    • isComplete

      public boolean isComplete()
      Description copied from interface: ProcessLogic
      Checks if the logic sequence has completed successfully.
      Specified by:
      isComplete in interface ProcessLogic
      Returns:
      true if logic has completed all steps
    • getTargetEquipment

      public List<ProcessEquipmentInterface> getTargetEquipment()
      Description copied from interface: ProcessLogic
      Gets the list of equipment targeted by this logic.
      Specified by:
      getTargetEquipment in interface ProcessLogic
      Returns:
      list of target equipment
    • getStatusDescription

      public String getStatusDescription()
      Description copied from interface: ProcessLogic
      Gets a description of the current status.
      Specified by:
      getStatusDescription in interface ProcessLogic
      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