Class ProcessLogicIntegratedExample.GradualPressureReductionLogic

java.lang.Object
neqsim.process.util.example.ProcessLogicIntegratedExample.GradualPressureReductionLogic
All Implemented Interfaces:
ProcessLogic
Enclosing class:
ProcessLogicIntegratedExample

private static class ProcessLogicIntegratedExample.GradualPressureReductionLogic extends Object implements ProcessLogic
Example: Custom logic class for gradual pressure reduction.

This demonstrates how to create custom logic not in the library by implementing the ProcessLogic interface. For production use, move this to a separate file like: neqsim/process/logic/control/GradualPressureReductionLogic.java

Usage example:

// Create instance
ProcessLogic customLogic =
    new GradualPressureReductionLogic("Gradual Reduction", inletValve, 30.0, // target opening
                                                                             // %
        2.0 // step size %
    );

// Add to runner
runner.addLogic(customLogic);

// Activate and execute
customLogic.activate();
while (!customLogic.isComplete()) {
  customLogic.execute(1.0); // 1 second timestep
  system.runTransient(1.0);
}
Version:
1.0
Author:
ESOL
  • Field Details

    • name

      private final String name
    • valve

      private final ControlValve valve
    • targetOpening

      private final double targetOpening
    • step

      private final double step
    • state

      private LogicState state
    • currentOpening

      private double currentOpening
  • Constructor Details

    • GradualPressureReductionLogic

      public GradualPressureReductionLogic(String name, ControlValve valve, double targetOpening, double step)
      Creates gradual pressure reduction logic.
      Parameters:
      name - logic name
      valve - control valve to adjust
      targetOpening - target valve opening (%)
      step - opening change per time step (%)
  • Method Details

    • 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
    • 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
    • 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