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 Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate final Stringprivate LogicStateprivate final doubleprivate final doubleprivate final ControlValve -
Constructor Summary
ConstructorsConstructorDescriptionGradualPressureReductionLogic(String name, ControlValve valve, double targetOpening, double step) Creates gradual pressure reduction logic. -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate()Activates the logic sequence, starting execution.voidDeactivates the logic sequence, pausing or stopping execution.voidexecute(double timeStep) Executes one time step of the logic sequence.getName()Gets the name of this logic sequence.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.booleanreset()Resets the logic sequence to its initial state.
-
Field Details
-
name
-
valve
-
targetOpening
private final double targetOpening -
step
private final double step -
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 namevalve- control valve to adjusttargetOpening- target valve opening (%)step- opening change per time step (%)
-
-
Method Details
-
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
-
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
-
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
-