Class LevelControlValve

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ValveInterface, SimulationInterface, NamedInterface

public class LevelControlValve extends ControlValve
Level control valve (LCV) for automatic level regulation in vessels.

LevelControlValve automatically modulates its opening to maintain a vessel level setpoint. It extends ControlValve and adds level control logic with proportional control action. This is essential for separator level control and liquid discharge applications.

Key features:

  • Automatic level control
  • Configurable level setpoint (0-100%)
  • Proportional control action
  • Configurable control gain
  • Fail-open or fail-closed configurations

Control action:

  • DIRECT: Increase opening increases outflow, decreases level (most common for liquid discharge)
  • REVERSE: Increase opening decreases outflow, increases level (rare)

Common applications:

  • Separator liquid level control
  • Vessel dump valves
  • Boot level control
  • Tank level regulation
  • Interface level control

Example usage:

// Create separator with liquid outlet
Separator separator = new Separator("V-101", feedStream);
Stream liquidOut = new Stream("Liquid Out", separator.getLiquidOutStream());

// Create level control valve
LevelControlValve lcv = new LevelControlValve("LCV-101", liquidOut);
lcv.setLevelSetpoint(50.0); // Control to 50% level
lcv.setControllerGain(3.0); // Proportional gain
lcv.setMeasuredLevel(45.0); // Current level from transmitter
lcv.setCv(150.0);
lcv.run();

System.out.println("Valve opening: " + lcv.getPercentValveOpening() + "%");
System.out.println("Level error: " + lcv.getControlError() + "%");
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • levelSetpoint

      private double levelSetpoint
      Level setpoint in % (0-100).
    • measuredLevel

      private double measuredLevel
      Measured level in % (0-100).
    • controlAction

      private LevelControlValve.ControlAction controlAction
      Control action.
    • controllerGain

      private double controllerGain
      Proportional controller gain.
    • controlError

      private double controlError
      Control error (setpoint - measured level).
    • autoMode

      private boolean autoMode
      Enable/disable automatic control.
    • failSafePosition

      private double failSafePosition
      Fail-safe position on loss of instrument air or power (% opening).
  • Constructor Details

    • LevelControlValve

      public LevelControlValve(String name)
      Constructor for LevelControlValve.
      Parameters:
      name - name of the level control valve
    • LevelControlValve

      public LevelControlValve(String name, StreamInterface inStream)
      Constructor for LevelControlValve.
      Parameters:
      name - name of the level control valve
      inStream - inlet stream
  • Method Details

    • setLevelSetpoint

      public void setLevelSetpoint(double setpoint)
      Set the level setpoint.
      Parameters:
      setpoint - level setpoint in % (0-100)
    • getLevelSetpoint

      public double getLevelSetpoint()
      Get the level setpoint.
      Returns:
      level setpoint in %
    • setMeasuredLevel

      public void setMeasuredLevel(double level)
      Set the measured level from level transmitter.
      Parameters:
      level - measured level in % (0-100)
    • getMeasuredLevel

      public double getMeasuredLevel()
      Get the measured level.
      Returns:
      measured level in %
    • setControlAction

      public void setControlAction(LevelControlValve.ControlAction action)
      Set the control action.
      Parameters:
      action - control action (DIRECT or REVERSE)
    • getControlAction

      public LevelControlValve.ControlAction getControlAction()
      Get the control action.
      Returns:
      current control action
    • setControllerGain

      public void setControllerGain(double gain)
      Set the controller gain.
      Parameters:
      gain - proportional gain (typical range: 1.0 to 10.0)
    • getControllerGain

      public double getControllerGain()
      Get the controller gain.
      Returns:
      controller gain
    • getControlError

      public double getControlError()
      Get the control error.
      Returns:
      control error (setpoint - measured level) in %
    • setAutoMode

      public void setAutoMode(boolean auto)
      Enable or disable automatic control mode.
      Parameters:
      auto - true for automatic, false for manual
    • isAutoMode

      public boolean isAutoMode()
      Check if valve is in automatic control mode.
      Returns:
      true if automatic, false if manual
    • setFailSafePosition

      public void setFailSafePosition(double position)
      Set the fail-safe position.
      Parameters:
      position - fail-safe position in % (0=fail-closed, 100=fail-open)
    • getFailSafePosition

      public double getFailSafePosition()
      Get the fail-safe position.
      Returns:
      fail-safe position in %
    • run

      public void run()

      Override run method to implement level control logic.

    • toString

      public String toString()

      Returns a string representation specific to control valves.

      Returns a string representation specific to level control valves.

      Overrides:
      toString in class ControlValve