Class LevelControlValve
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, ValveInterface, SimulationInterface, NamedInterface
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumControl action enumeration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanEnable/disable automatic control.private LevelControlValve.ControlActionControl action.private doubleControl error (setpoint - measured level).private doubleProportional controller gain.private doubleFail-safe position on loss of instrument air or power (% opening).private doubleLevel setpoint in % (0-100).private doubleMeasured level in % (0-100).private static final longSerialization version UID.Fields inherited from class ThrottlingValve
isCalcPressure, logger, molarFlow, pressure, thermoSystem, valveMechanicalDesignFields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionLevelControlValve(String name) Constructor for LevelControlValve.LevelControlValve(String name, StreamInterface inStream) Constructor for LevelControlValve. -
Method Summary
Modifier and TypeMethodDescriptionGet the control action.doubleGet the control error.doubleGet the controller gain.doubleGet the fail-safe position.doubleGet the level setpoint.doubleGet the measured level.booleanCheck if valve is in automatic control mode.voidrun()voidsetAutoMode(boolean auto) Enable or disable automatic control mode.voidSet the control action.voidsetControllerGain(double gain) Set the controller gain.voidsetFailSafePosition(double position) Set the fail-safe position.voidsetLevelSetpoint(double setpoint) Set the level setpoint.voidsetMeasuredLevel(double level) Set the measured level from level transmitter.toString()Methods inherited from class ThrottlingValve
calcKv, calculateMolarFlow, calculateOutletPressure, displayResult, getCapacityDuty, getCapacityMax, getCg, getClosingTravelTime, getCv, getCv, getDeltaPressure, getDeltaPressure, getEntropyProduction, getExergyChange, getFp, getInletPressure, getKv, getMechanicalDesign, getOpeningTravelTime, getOutletPressure, getPercentValveOpening, getResultTable, getTargetPercentValveOpening, getThermoSystem, getTravelModel, getTravelTime, getTravelTimeConstant, initMechanicalDesign, isAcceptNegativeDP, isAllowChoked, isAllowLaminar, isGasValve, isIsoThermal, isValveKvSet, needRecalculation, run, runController, runTransient, setAcceptNegativeDP, setAllowChoked, setAllowLaminar, setClosingTravelTime, setCv, setCv, setDeltaPressure, setFp, setGasValve, setIsCalcOutPressure, setIsoThermal, setKv, setMaximumValveOpening, setMinimumValveOpening, setOpeningTravelTime, setOutletPressure, setOutletPressure, setPercentValveOpening, setPressure, setPressure, setTargetPercentValveOpening, setTravelModel, setTravelTime, setTravelTimeConstant, setValveKvSet, toJson, toJsonMethods inherited from class TwoPortEquipment
getInletStream, getInletTemperature, getMassBalance, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletStream, setOutletTemperature, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, equals, getConditionAnalysisMessage, getController, getEnergyStream, getMassBalance, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getSpecification, getTemperature, getTemperature, hashCode, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setRegulatorOutSignal, setSpecification, setTemperature, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
equals, getConditionAnalysisMessage, getController, getExergyChange, getFluid, getMassBalance, getMassBalance, getPressure, getPressure, getReport_json, getRestCapacity, getSpecification, getTemperature, getTemperature, hashCode, reportResults, runConditionAnalysis, setController, setRegulatorOutSignal, setSpecification, setTemperature, validateSetupMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run_step, run_step, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTime, solvedMethods inherited from interface TwoPortInterface
getInletStream, getInletTemperature, getInStream, getOutletStream, getOutletTemperature, getOutStream, setInletPressure, setInletStream, setInletTemperature, setOutletStream, setOutletTemperature
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
levelSetpoint
private double levelSetpointLevel setpoint in % (0-100). -
measuredLevel
private double measuredLevelMeasured level in % (0-100). -
controlAction
Control action. -
controllerGain
private double controllerGainProportional controller gain. -
controlError
private double controlErrorControl error (setpoint - measured level). -
autoMode
private boolean autoModeEnable/disable automatic control. -
failSafePosition
private double failSafePositionFail-safe position on loss of instrument air or power (% opening).
-
-
Constructor Details
-
LevelControlValve
Constructor for LevelControlValve.- Parameters:
name- name of the level control valve
-
LevelControlValve
Constructor for LevelControlValve.- Parameters:
name- name of the level control valveinStream- 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
Set the control action.- Parameters:
action- control action (DIRECT or REVERSE)
-
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
Returns a string representation specific to control valves.
Returns a string representation specific to level control valves.
- Overrides:
toStringin classControlValve
-