Class ThrottlingValve

All Implemented Interfaces:
Serializable, Runnable, AutoSizeable, CapacityConstrainedEquipment, ProcessEquipmentInterface, TwoPortInterface, ValveInterface, SimulationInterface, NamedInterface
Direct Known Subclasses:
BlowdownValve, CheckValve, ControlValve, ESDValve, HIPPSValve, PressureDrop, PSDValve, RuptureDisk, SafetyReliefValve, SafetyValve

public class ThrottlingValve extends TwoPortEquipment implements ValveInterface, CapacityConstrainedEquipment, AutoSizeable

ThrottlingValve class.

Version:
$Id: $Id
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

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

      static org.apache.logging.log4j.Logger logger
      Logger object for class.
    • thermoSystem

      SystemInterface thermoSystem
    • valveKvSet

      private boolean valveKvSet
    • isoThermal

      private boolean isoThermal
    • pressure

      double pressure
    • Kv

      private double Kv
    • maxMolarFlow

      private double maxMolarFlow
    • minMolarFlow

      private double minMolarFlow
    • maxValveOpening

      private double maxValveOpening
    • minValveOpening

      private double minValveOpening
    • percentValveOpening

      private double percentValveOpening
    • requestedValveOpening

      private double requestedValveOpening
    • valveTravelTimeSec

      private double valveTravelTimeSec
    • valveOpeningTravelTimeSec

      private double valveOpeningTravelTimeSec
    • valveClosingTravelTimeSec

      private double valveClosingTravelTimeSec
    • valveTimeConstantSec

      private double valveTimeConstantSec
    • travelModel

      private ValveTravelModel travelModel
    • molarFlow

      double molarFlow
    • pressureUnit

      private String pressureUnit
    • acceptNegativeDP

      private boolean acceptNegativeDP
    • valveMechanicalDesign

      ValveMechanicalDesign valveMechanicalDesign
    • isCalcPressure

      boolean isCalcPressure
    • gasValve

      private boolean gasValve
    • Fp

      private double Fp
    • deltaPressure

      private double deltaPressure
    • allowChoked

      private boolean allowChoked
    • allowLaminar

      private boolean allowLaminar
    • xt

      private double xt
    • autoSized

      private boolean autoSized
      Flag indicating if valve has been auto-sized.
    • maxDesignAIV

      private double maxDesignAIV
      Maximum design AIV (Acoustic-Induced Vibration) power level in kW.
    • minimumMolarFlow

      private static final double minimumMolarFlow
      See Also:
    • capacityConstraints

      private final Map<String, CapacityConstraint> capacityConstraints
      Storage for capacity constraints.
    • DESIGN_OPENING_PERCENT

      private static final double DESIGN_OPENING_PERCENT
      Default design opening percentage for valve sizing (50% for good control range).
      See Also:
    • MIN_DEFAULT_CV

      private static final double MIN_DEFAULT_CV
      Minimum design Cv when flow is zero or very low.
      See Also:
  • Constructor Details

    • ThrottlingValve

      public ThrottlingValve(String name)
      * Constructor for ThrottlingValve.
      Parameters:
      name - name of valve
    • ThrottlingValve

      public ThrottlingValve(String name, StreamInterface inletStream)

      Constructor for ThrottlingValve.

      Parameters:
      name - a String object
      inletStream - a StreamInterface object
  • Method Details

    • getDeltaPressure

      public double getDeltaPressure(String unit)

      getDeltaPressure.

      Parameters:
      unit - a String object
      Returns:
      a double
    • getCapacityDuty

      public double getCapacityDuty()

      getCapacityDuty.

      Specified by:
      getCapacityDuty in interface ProcessEquipmentInterface
      Returns:
      a double
    • getCapacityMax

      public double getCapacityMax()

      getCapacityMax.

      Specified by:
      getCapacityMax in interface ProcessEquipmentInterface
      Returns:
      a double
    • getOutletPressure

      public double getOutletPressure()
      Get outlet pressure of twoport.
      Specified by:
      getOutletPressure in interface TwoPortInterface
      Overrides:
      getOutletPressure in class TwoPortEquipment
      Returns:
      outlet pressure of TwoPortEquipment in unit bara
    • getThermoSystem

      public SystemInterface getThermoSystem()

      getThermoSystem.

      Specified by:
      getThermoSystem in interface ProcessEquipmentInterface
      Specified by:
      getThermoSystem in interface ValveInterface
      Overrides:
      getThermoSystem in class ProcessEquipmentBaseClass
      Returns:
      a SystemInterface object
    • getInletPressure

      public double getInletPressure()
      Get inlet pressure of twoport.
      Specified by:
      getInletPressure in interface TwoPortInterface
      Overrides:
      getInletPressure in class TwoPortEquipment
      Returns:
      inlet pressure of TwoPortEquipment in unit bara
    • setPressure

      public void setPressure(double pressure)

      Setter for the field pressure.

      Specified by:
      setPressure in interface ProcessEquipmentInterface
      Overrides:
      setPressure in class ProcessEquipmentBaseClass
      Parameters:
      pressure - a double
    • setPressure

      public void setPressure(double pressure, String unit)

      Setter for the field pressure.

      Parameters:
      pressure - a double
      unit - a String object
    • setOutletPressure

      public void setOutletPressure(double pressure)
      Set outlet pressure of twoport.
      Specified by:
      setOutletPressure in interface TwoPortInterface
      Overrides:
      setOutletPressure in class TwoPortEquipment
      Parameters:
      pressure - value to set in unit bara
    • setOutletPressure

      public void setOutletPressure(double pressure, String unit)

      setOutletPressure.

      Specified by:
      setOutletPressure in interface TwoPortInterface
      Overrides:
      setOutletPressure in class TwoPortEquipment
      Parameters:
      pressure - a double
      unit - a String object
    • needRecalculation

      public boolean needRecalculation()

      Check if process equipment needs recalculating.

      Specified by:
      needRecalculation in interface ProcessEquipmentInterface
      Returns:
      true or false
    • calcKv

      public void calcKv()
      calcKv.
    • calculateMolarFlow

      public double calculateMolarFlow()
      Calculates molar flow for a gas based on IEC 60534 standards. This method accounts for choked (critical) flow.
      Returns:
      Molar flow in mole/sec.
    • calculateOutletPressure

      public double calculateOutletPressure(double KvAdjusted)
      Calculates the outlet pressure based on the adjusted Kv value.
      Parameters:
      KvAdjusted - the adjusted flow coefficient (Kv)
      Returns:
      the calculated outlet pressure
    • adjustKv

      private double adjustKv(double Kv, double percentValveOpening)
      Adjusts the flow coefficient (Kv) based on the percentage valve opening.
      Parameters:
      Kv - Flow coefficient SI (for 100% opening)
      percentValveOpening - Percentage valve opening (0 to 100).
      Returns:
      Adjusted flow coefficient (Kv)
    • run

      public void run(UUID id)

      In this method all thermodynamic and unit operations will be calculated in a steady state calculation.

      Specified by:
      run in interface SimulationInterface
      Parameters:
      id - UUID
    • displayResult

      public void displayResult()

      displayResult.

      Specified by:
      displayResult in interface ProcessEquipmentInterface
      Overrides:
      displayResult in class ProcessEquipmentBaseClass
    • getResultTable

      public String[][] getResultTable()

      getResultTable.

      Specified by:
      getResultTable in interface ProcessEquipmentInterface
      Overrides:
      getResultTable in class ProcessEquipmentBaseClass
      Returns:
      an array of String objects
    • runTransient

      public void runTransient(double dt, UUID id)

      runTransient

      This method calculates thermodynamic and unit operations using difference equations if available and calculateSteadyState is true. Use setCalculateSteadyState to set the parameter. Sets calc identifier UUID.
      Specified by:
      runTransient in interface SimulationInterface
      Parameters:
      dt - Delta time [s]
      id - Calculation identifier
    • ensureValidMolarFlow

      private double ensureValidMolarFlow(double flow)
    • isNegligibleFlow

      private boolean isNegligibleFlow(double flow)
    • applyZeroFlowState

      private void applyZeroFlowState(UUID id)
    • runController

      public void runController(double dt, UUID id)

      runController.

      Parameters:
      dt - a double
      id - Calculation identifier
    • clampValveOpening

      private double clampValveOpening(double value)
    • applyTravelDynamics

      private double applyTravelDynamics(double current, double target, double dt)
    • getEffectiveOpeningTravelTime

      private double getEffectiveOpeningTravelTime()
    • getEffectiveClosingTravelTime

      private double getEffectiveClosingTravelTime()
    • setMinimumValveOpening

      public void setMinimumValveOpening(double minopen)

      setMinimumValveOpening.

      Parameters:
      minopen - a double
    • setMaximumValveOpening

      public void setMaximumValveOpening(double maxopen)
      Sets the maximum valve opening in percent.
      Parameters:
      maxopen - a double representing the maximum permitted opening
    • getMaximumValveOpening

      public double getMaximumValveOpening()
      Gets the maximum valve opening in percent.
      Returns:
      maximum valve opening percentage (0 to 100)
    • getMinimumValveOpening

      public double getMinimumValveOpening()
      Gets the minimum valve opening in percent.
      Returns:
      minimum valve opening percentage (0 to 100)
    • getKv

      public double getKv()
      Gets the Kv (metric flow coefficient) of the valve.
      Specified by:
      getKv in interface ValveInterface
      Returns:
      the metric flow coefficient
    • getCv

      public double getCv()

      getCv.

      Specified by:
      getCv in interface ValveInterface
      Returns:
      a double
    • getCv

      public double getCv(String unit)

      getCv.

      Specified by:
      getCv in interface ValveInterface
      Parameters:
      unit - can be SI or US SI is unit litre/minute US is gallons per minute
      Returns:
      a double
    • setCv

      public void setCv(double Cv)

      setCv.

      Specified by:
      setCv in interface ValveInterface
      Parameters:
      Cv - a double
    • setKv

      public void setKv(double Kv)
      Sets the Kv (metric flow coefficient) of the valve.
      Specified by:
      setKv in interface ValveInterface
      Parameters:
      Kv - the metric flow coefficient
    • setCv

      public void setCv(double cv, String unit)

      setCv.

      Specified by:
      setCv in interface ValveInterface
      Parameters:
      cv - a double
      unit - can be SI or US SI is unit litre/minute US is gallons per minute
    • setTravelTime

      public void setTravelTime(double travelTimeSec)
      Sets the total travel time (seconds) corresponding to a movement from fully closed to fully open.
      Specified by:
      setTravelTime in interface ValveInterface
      Parameters:
      travelTimeSec - full travel time in seconds
    • getTravelTime

      public double getTravelTime()
      Returns the configured full travel time (seconds) for the valve.
      Specified by:
      getTravelTime in interface ValveInterface
      Returns:
      full travel time in seconds
    • setOpeningTravelTime

      public void setOpeningTravelTime(double travelTimeSec)
      Sets the travel time for opening actions (seconds). When not specified, the symmetric travel time is used.
      Specified by:
      setOpeningTravelTime in interface ValveInterface
      Parameters:
      travelTimeSec - opening travel time in seconds
    • getOpeningTravelTime

      public double getOpeningTravelTime()
      Returns the configured opening travel time (seconds).
      Specified by:
      getOpeningTravelTime in interface ValveInterface
      Returns:
      opening travel time in seconds
    • setClosingTravelTime

      public void setClosingTravelTime(double travelTimeSec)
      Sets the travel time for closing actions (seconds). When not specified, the symmetric travel time is used.
      Specified by:
      setClosingTravelTime in interface ValveInterface
      Parameters:
      travelTimeSec - closing travel time in seconds
    • getClosingTravelTime

      public double getClosingTravelTime()
      Returns the configured closing travel time (seconds).
      Specified by:
      getClosingTravelTime in interface ValveInterface
      Returns:
      closing travel time in seconds
    • setTravelTimeConstant

      public void setTravelTimeConstant(double timeConstantSec)
      Sets the time constant (seconds) for first-order travel dynamics.
      Specified by:
      setTravelTimeConstant in interface ValveInterface
      Parameters:
      timeConstantSec - time constant in seconds
    • getTravelTimeConstant

      public double getTravelTimeConstant()
      Returns the configured time constant (seconds) for first-order travel dynamics.
      Specified by:
      getTravelTimeConstant in interface ValveInterface
      Returns:
      time constant in seconds
    • setTravelModel

      public void setTravelModel(ValveTravelModel travelModel)
      Sets the valve travel model used to translate requested opening to actual position.
      Specified by:
      setTravelModel in interface ValveInterface
      Parameters:
      travelModel - travel model implementation
    • getTravelModel

      public ValveTravelModel getTravelModel()
      Returns the current valve travel model.
      Specified by:
      getTravelModel in interface ValveInterface
      Returns:
      travel model
    • getCg

      public double getCg()

      getCg.

      Specified by:
      getCg in interface ValveInterface
      Returns:
      a double
    • getPercentValveOpening

      public double getPercentValveOpening()

      getPercentValveOpening.

      Specified by:
      getPercentValveOpening in interface ValveInterface
      Returns:
      a double
    • setPercentValveOpening

      public void setPercentValveOpening(double percentValveOpening)

      setPercentValveOpening.

      Specified by:
      setPercentValveOpening in interface ValveInterface
      Parameters:
      percentValveOpening - a double
    • getTargetPercentValveOpening

      public double getTargetPercentValveOpening()
      Returns the requested (target) valve opening before dynamic travel limitations are applied.
      Specified by:
      getTargetPercentValveOpening in interface ValveInterface
      Returns:
      requested valve opening in percent
    • setTargetPercentValveOpening

      public void setTargetPercentValveOpening(double percentValveOpening)
      Sets the requested (target) valve opening in percent. The actual valve opening may lag the request depending on the selected travel model.
      Specified by:
      setTargetPercentValveOpening in interface ValveInterface
      Parameters:
      percentValveOpening - target valve opening in percent
    • isValveKvSet

      public boolean isValveKvSet()

      isValveKvSet.

      Returns:
      a boolean
    • setValveKvSet

      public void setValveKvSet(boolean valveKvSet)

      Setter for the field valveKvSet.

      Parameters:
      valveKvSet - a boolean
    • isIsoThermal

      public boolean isIsoThermal()

      isIsoThermal.

      Specified by:
      isIsoThermal in interface ValveInterface
      Returns:
      a boolean
    • setIsoThermal

      public void setIsoThermal(boolean isoThermal)

      setIsoThermal.

      Specified by:
      setIsoThermal in interface ValveInterface
      Parameters:
      isoThermal - a boolean
    • getEntropyProduction

      public double getEntropyProduction(String unit)

      getEntropyProduction.

      Specified by:
      getEntropyProduction in interface ProcessEquipmentInterface
      Overrides:
      getEntropyProduction in class ProcessEquipmentBaseClass
      Parameters:
      unit - a String object
      Returns:
      a double
    • getExergyChange

      public double getExergyChange(String unit, double surroundingTemperature)
      Get exergy change production of the process equipment.
      Specified by:
      getExergyChange in interface ProcessEquipmentInterface
      Overrides:
      getExergyChange in class ProcessEquipmentBaseClass
      Parameters:
      unit - Supported units are J and kJ
      surroundingTemperature - The surrounding temperature in Kelvin
      Returns:
      change in exergy in specified unit
    • isAcceptNegativeDP

      public boolean isAcceptNegativeDP()

      isAcceptNegativeDP.

      Returns:
      a boolean
    • setAcceptNegativeDP

      public void setAcceptNegativeDP(boolean acceptNegativeDP)

      Setter for the field acceptNegativeDP.

      Parameters:
      acceptNegativeDP - a boolean
    • initMechanicalDesign

      public void initMechanicalDesign()

      Initialize a initMechanicalDesign for the equipment.

      Specified by:
      initMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      initMechanicalDesign in class ProcessEquipmentBaseClass
    • getMechanicalDesign

      public ValveMechanicalDesign getMechanicalDesign()

      Get a mechanicalDesign for the equipment.

      Specified by:
      getMechanicalDesign in interface ProcessEquipmentInterface
      Overrides:
      getMechanicalDesign in class ProcessEquipmentBaseClass
      Returns:
      a MechanicalDesign object
    • setIsCalcOutPressure

      public void setIsCalcOutPressure(boolean isSetPres)

      setIsCalcOutPressure.

      Parameters:
      isSetPres - a boolean
    • toJson

      public String toJson()

      Serializes the Process Equipment along with its state to a JSON string.

      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class TwoPortEquipment
      Returns:
      json string.
    • toJson

      public String toJson(ReportConfig cfg)
      Serializes the Process Equipment with configurable level of detail.
      Specified by:
      toJson in interface ProcessEquipmentInterface
      Overrides:
      toJson in class TwoPortEquipment
      Parameters:
      cfg - report configuration
      Returns:
      json string
    • isGasValve

      public boolean isGasValve()

      isGasValve.

      Returns:
      a boolean
    • setGasValve

      public void setGasValve(boolean gasValve)

      Setter for the field gasValve.

      Parameters:
      gasValve - a boolean
    • getFp

      public double getFp()

      getFp.

      Returns:
      a double
    • setFp

      public void setFp(double fp)

      setFp.

      Parameters:
      fp - a double
    • getDeltaPressure

      public double getDeltaPressure()

      Getter for the field deltaPressure.

      Returns:
      a double
    • setDeltaPressure

      public void setDeltaPressure(double deltaPressure, String unit)

      Setter for the field deltaPressure.

      Parameters:
      deltaPressure - a double
      unit - a String object
    • isAllowChoked

      public boolean isAllowChoked()

      isAllowChoked.

      Returns:
      a boolean
    • setAllowChoked

      public void setAllowChoked(boolean allowChoked)

      Setter for the field allowChoked.

      Parameters:
      allowChoked - a boolean
    • isAllowLaminar

      public boolean isAllowLaminar()

      isAllowLaminar.

      Returns:
      a boolean
    • setAllowLaminar

      public void setAllowLaminar(boolean allowLaminar)

      Setter for the field allowLaminar.

      Parameters:
      allowLaminar - a boolean
    • calculateAIV

      public double calculateAIV()
      Calculate Acoustic-Induced Vibration (AIV) power level.

      AIV is most significant at control valves where high pressure drops occur. The acoustic power generated is a function of mass flow rate, pressure drop, and temperature. This method implements the Energy Institute Guidelines formula for AIV screening.

      AIV Power Level interpretation (per Energy Institute Guidelines):

      • < 1 kW: Low risk - no special measures required
      • 1 - 10 kW: Medium risk - screening required
      • 10 - 25 kW: High risk - detailed assessment required
      • > 25 kW: Very high risk - design modifications needed
      Returns:
      AIV acoustic power level in kW
    • calculateAIVLikelihoodOfFailure

      public double calculateAIVLikelihoodOfFailure(double downstreamDiameter, double downstreamThickness)
      Calculate AIV Likelihood of Failure based on acoustic power and downstream pipe geometry.

      AIV LOF interpretation:

      • < 0.3: Low risk
      • 0.3 - 0.5: Medium risk - monitoring recommended
      • 0.5 - 0.7: High risk - detailed assessment required
      • > 0.7: Very high risk - design changes needed
      Parameters:
      downstreamDiameter - downstream pipe diameter in meters
      downstreamThickness - downstream pipe wall thickness in meters
      Returns:
      AIV likelihood of failure (0.0-1.0)
    • setMaxDesignAIV

      public void setMaxDesignAIV(double aivKW)
      Set maximum design AIV power level for capacity constraints.
      Parameters:
      aivKW - maximum AIV power level in kW
    • getMaxDesignAIV

      public double getMaxDesignAIV()
      Get maximum design AIV power level.
      Returns:
      maximum AIV power level in kW
    • initializeCapacityConstraints

      protected void initializeCapacityConstraints()
      Initializes default capacity constraints for the valve.

      NOTE: All constraints are disabled by default for backwards compatibility. Enable specific constraints when valve capacity analysis is needed (e.g., when Cv has been sized).

    • getCapacityConstraints

      public Map<String, CapacityConstraint> getCapacityConstraints()
      Gets all capacity constraints defined for this equipment.

      The map keys are constraint names (e.g., "speed", "gasLoadFactor") and values are the corresponding CapacityConstraint objects containing design values, current values, and utilization calculations.

      Specified by:
      getCapacityConstraints in interface CapacityConstrainedEquipment
      Returns:
      unmodifiable map of constraint name to CapacityConstraint
    • getBottleneckConstraint

      public CapacityConstraint getBottleneckConstraint()
      Gets the constraint with the highest utilization (the bottleneck).

      This method identifies which constraint is closest to or exceeding its design limit. Use this to determine what is limiting equipment capacity.

      Specified by:
      getBottleneckConstraint in interface CapacityConstrainedEquipment
      Returns:
      the bottleneck constraint, or null if no constraints are defined
    • isCapacityExceeded

      public boolean isCapacityExceeded()
      Checks if any capacity constraint is violated (exceeds 100% utilization).

      A violated constraint means the equipment is operating beyond its design capacity. For HARD constraints, this may indicate equipment trip or failure. For SOFT constraints, this indicates reduced efficiency or accelerated wear.

      Specified by:
      isCapacityExceeded in interface CapacityConstrainedEquipment
      Returns:
      true if any constraint utilization exceeds 1.0 (100%)
    • isHardLimitExceeded

      public boolean isHardLimitExceeded()
      Checks if any HARD constraint limit is exceeded.

      HARD limits represent absolute equipment limits (e.g., maximum speed) that cannot be exceeded without equipment trip or damage. This is more severe than general capacity exceedance.

      Specified by:
      isHardLimitExceeded in interface CapacityConstrainedEquipment
      Returns:
      true if any HARD constraint's max value is exceeded
    • getMaxUtilization

      public double getMaxUtilization()
      Gets the maximum utilization across all constraints.

      This gives a single number representing how close the equipment is to its limiting constraint. Values above 1.0 indicate the equipment is over capacity.

      Specified by:
      getMaxUtilization in interface CapacityConstrainedEquipment
      Returns:
      maximum utilization as fraction (1.0 = 100% of design capacity)
    • addCapacityConstraint

      public void addCapacityConstraint(CapacityConstraint constraint)
      Adds a new capacity constraint to this equipment.

      This allows dynamic addition of constraints at runtime. Constraints can be added during equipment configuration or based on operating conditions.

      Specified by:
      addCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraint - the constraint to add
    • removeCapacityConstraint

      public boolean removeCapacityConstraint(String constraintName)
      Removes a capacity constraint by name.
      Specified by:
      removeCapacityConstraint in interface CapacityConstrainedEquipment
      Parameters:
      constraintName - the name of the constraint to remove
      Returns:
      true if the constraint was found and removed
    • clearCapacityConstraints

      public void clearCapacityConstraints()
      Clears all capacity constraints from this equipment.
      Specified by:
      clearCapacityConstraints in interface CapacityConstrainedEquipment
    • autoSize

      public void autoSize(double safetyFactor)
      Auto-sizes the valve based on current flow conditions.

      This method calculates the required Cv value so that the valve operates at approximately 50% opening at the current flow rate. This provides good control range - the valve can open further for higher flows or close for lower flows.

      Design philosophy:

      • At normal flow, valve should be at ~50% opening (design point)
      • Maximum Cv (100% opening) = Cv needed at 50% opening * 2 (approximately)
      • This gives control range from ~25% to 100% opening for typical flow variations
      • For zero flow valves (bypass, emergency), uses minimum default Cv or estimates from connected equipment
      Specified by:
      autoSize in interface AutoSizeable
      Parameters:
      safetyFactor - safety factor to apply (e.g., 1.2 for 20% margin)
    • autoSize

      public void autoSize(double safetyFactor, double designOpeningPercent)
      Auto-sizes the valve based on current flow conditions with specified design opening.
      Parameters:
      safetyFactor - safety factor to apply (e.g., 1.2 for 20% margin)
      designOpeningPercent - the target valve opening percentage at design flow (typically 50%)
    • estimateCvFromFlow

      private double estimateCvFromFlow(double flowRateKghr)
      Estimates Cv from flow rate using simplified correlation.

      This is a rough estimate when the standard calculation fails. Uses typical valve sizing rules of thumb.

      Parameters:
      flowRateKghr - mass flow rate in kg/hr
      Returns:
      estimated Cv value
    • estimateCvForZeroFlowValve

      private double estimateCvForZeroFlowValve(double safetyFactor)
      Estimates Cv for a valve with zero or negligible flow.

      For valves like bypass valves, emergency relief valves, or startup valves that normally have no flow, this method estimates an appropriate Cv based on:

      • Connected stream design conditions (if available)
      • Pressure drop across the valve
      • Default minimum values based on valve type
      Parameters:
      safetyFactor - safety factor to apply
      Returns:
      estimated design Cv
    • autoSize

      public void autoSize()
      Automatically size using default safety factor (1.2 = 20% margin).
      Specified by:
      autoSize in interface AutoSizeable
    • autoSize

      public void autoSize(String company, String trDocument)
      Automatically size using company-specific design standards.

      This method applies design rules from the specified company's technical requirements (TR) documents. The standards are loaded from the NeqSim design database.

      Specified by:
      autoSize in interface AutoSizeable
      Parameters:
      company - company name (e.g., "Equinor", "Shell", "TotalEnergies")
      trDocument - TR document reference (e.g., "TR2000", "DEP-31.38.01.11")
    • isAutoSized

      public boolean isAutoSized()
      Check if equipment has been auto-sized.
      Specified by:
      isAutoSized in interface AutoSizeable
      Returns:
      true if autoSize() has been called successfully
    • getSizingReport

      public String getSizingReport()
      Get a detailed sizing report after auto-sizing.

      The report includes:

      • Design basis (flow rates, pressures, temperatures)
      • Calculated dimensions
      • Design parameters (K-factor, Cv, velocity, etc.)
      • Safety margins
      Specified by:
      getSizingReport in interface AutoSizeable
      Returns:
      formatted sizing report string
    • getSizingReportJson

      public String getSizingReportJson()
      Get sizing report as JSON for programmatic access.
      Specified by:
      getSizingReportJson in interface AutoSizeable
      Returns:
      JSON string with sizing data