Class ControlValveSizing_IEC_60534_full

All Implemented Interfaces:
Serializable, ControlValveSizingInterface

public class ControlValveSizing_IEC_60534_full extends ControlValveSizing_IEC_60534
Provides a full implementation of the IEC 60534 standard for control valve sizing. This class extends the simplified version to include iterative calculations for:
  • Piping geometry factors (Fp, FLP, xTP) for valves installed with reducers/expanders.
  • Reynolds number corrections (FR) for laminar or transitional flow regimes.
The logic is a direct translation of the comprehensive calculations found in the 'fluids' Python library, ensuring high fidelity to the standard for a wide range of operating conditions.
Author:
esol
See Also:
  • Field Details

    • N2

      private static final double N2
      Constant related to valve geometry for Reynolds number calculation. Units: mm.
      See Also:
    • N4

      private static final double N4
      Constant for Reynolds number calculation. Units: m^3/hr, m^2/s.
      See Also:
    • N5

      private static final double N5
      Constant related to gas piping geometry for xTP calculation. Units: mm.
      See Also:
    • N18

      private static final double N18
      Constant for Reynolds factor calculation (full trim). Units: mm.
      See Also:
    • N32

      private static final double N32
      Constant for Reynolds factor calculation (reduced trim). Units: mm.
      See Also:
    • MAX_ITERATIONS

      private static final int MAX_ITERATIONS
      Maximum number of iterations for convergence loops.
      See Also:
    • CONVERGENCE_TOLERANCE

      private static final double CONVERGENCE_TOLERANCE
      Convergence tolerance for iterative calculations.
      See Also:
    • isFullTrim

      private boolean isFullTrim
  • Constructor Details

    • ControlValveSizing_IEC_60534_full

      public ControlValveSizing_IEC_60534_full()

      Constructor for ControlValveSizing_IEC_60534_full.

    • ControlValveSizing_IEC_60534_full

      public ControlValveSizing_IEC_60534_full(ValveMechanicalDesign valveMechanicalDesign)

      Constructor for ControlValveSizing_IEC_60534_full.

      Parameters:
      valveMechanicalDesign - a ValveMechanicalDesign object
  • Method Details

    • isFullTrim

      public boolean isFullTrim()

      isFullTrim.

      Returns:
      a boolean
    • setFullTrim

      public void setFullTrim(boolean isFullTrim)

      setFullTrim.

      Parameters:
      isFullTrim - a boolean
    • sizeControlValveLiquid

      public Map<String,Object> sizeControlValveLiquid(double rho, double Psat, double Pc, double P1, double P2, double Q, double percentOpening)
      Sizes a control valve for a liquid based on the provided parameters. Aligned with IEC 60534 and 'fluids' library.

      Overrides the simplified liquid sizing method to provide a full, iterative calculation including piping geometry and Reynolds number corrections.

      Overrides:
      sizeControlValveLiquid in class ControlValveSizing_IEC_60534
      Parameters:
      rho - Density of the liquid [kg/m^3]
      Psat - Saturation pressure of the liquid [Pa]
      Pc - Critical pressure of the liquid [Pa]
      P1 - Upstream pressure [Pa]
      P2 - Downstream pressure [Pa]
      Q - Volumetric flow rate [m^3/s]
      percentOpening - Valve opening percentage (0-100)
      Returns:
      A map containing the sizing results (Kv, Kv, choked, etc.).
    • sizeControlValveGas

      public Map<String,Object> sizeControlValveGas(double T, double MW, double gamma, double Z, double P1, double P2, double Q, double percentOpening)
      Sizes a control valve for a gas based on the provided parameters. CORRECTED to include Fgamma, aligning with IEC 60534 and 'fluids' library.

      Overrides the simplified gas sizing method to provide a full, iterative calculation including piping geometry and Reynolds number corrections.

      Overrides:
      sizeControlValveGas in class ControlValveSizing_IEC_60534
      Parameters:
      T - Temperature of the gas [K]
      MW - Molecular weight of the gas [g/mol]
      gamma - Specific heat ratio
      Z - Compressibility factor
      P1 - Upstream pressure [Pa]
      P2 - Downstream pressure [Pa]
      Q - Volumetric flow rate at inlet conditions [m^3/s]
      percentOpening - Valve opening percentage (0-100)
      Returns:
      A map containing the sizing results (Kv, Kv, Y, choked, etc.).
    • lossCoefficientPiping

      private double lossCoefficientPiping(double d, Double D1, Double D2)
      Calculates the sum of loss coefficients from inlet/outlet reducers/expanders. IEC 60534-2-1, Equation (6).
      Parameters:
      d - valve diameter (mm)
      D1 - upstream pipe diameter (mm)
      D2 - downstream pipe diameter (mm)
      Returns:
      the total loss coefficient
    • reynoldsValve

      private double reynoldsValve(double nu, double Q, double D1, double FL, double Fd, double C)
      Calculates the Reynolds number of a control valve. IEC 60534-2-1, Equation (20).
      Parameters:
      nu - kinematic viscosity (mm^2/s)
      Q - volumetric flow rate (m^3/h)
      D1 - upstream pipe diameter (mm)
      FL - liquid pressure recovery factor
      Fd - valve style modifier
      C - flow coefficient
      Returns:
      the Reynolds number
    • reynoldsFactor

      private double reynoldsFactor(double FL, double C, double d, double Rev, boolean fullTrim)
      Calculates the Reynolds number factor FR for laminar or transitional flow. IEC 60534-2-1, Section 7.3.
      Parameters:
      FL - liquid pressure recovery factor
      C - flow coefficient
      d - valve diameter (mm)
      Rev - Reynolds number
      fullTrim - true if full trim, false if reduced trim
      Returns:
      the Reynolds factor FR
    • isChokedTurbulentL

      private boolean isChokedTurbulentL(double dP, double P1, double Psat, double FF, Double FLP, Double FP)
      Overloaded method to check for choked flow with piping factors.
      Parameters:
      dP - pressure drop (kPa)
      P1 - upstream pressure (kPa)
      Psat - saturation pressure (kPa)
      FF - critical pressure ratio factor
      FLP - liquid pressure recovery factor with piping
      FP - piping geometry factor
      Returns:
      true if flow is choked, false otherwise
    • findOutletPressureForFixedKv

      public double findOutletPressureForFixedKv(double adjustedKv, StreamInterface inletStream)

      findOutletPressureForFixedKv.

      Finds the outlet pressure for a given Kv, valve opening, and inlet stream.

      Finds the outlet pressure for a given flow rate and fixed Kv, for both gas and liquid.

      Finds the outlet pressure for a given flow rate and fixed Kv. This method is inherited, but it remains consistent due to polymorphism. Its internal calls to `sizeControlValveGas` or `sizeControlValveLiquid` will correctly resolve to the overridden, full implementations in this class. It is overridden here for clarity and completeness.

      Specified by:
      findOutletPressureForFixedKv in interface ControlValveSizingInterface
      Overrides:
      findOutletPressureForFixedKv in class ControlValveSizing_IEC_60534
      Parameters:
      adjustedKv - a double
      inletStream - a StreamInterface object
      Returns:
      a double
    • calculateFlowRateFromValveOpening

      public double calculateFlowRateFromValveOpening(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream)

      calculateFlowRateFromValveOpening.

      Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.

      Calculates the flow rate through a control valve based on the valve opening, Kv, and inlet/outlet streams.

      Calculates the flow rate for a given valve opening using the full, iterative model. This method overrides the simplified base class implementation to ensure consistency.

      Specified by:
      calculateFlowRateFromValveOpening in interface ControlValveSizingInterface
      Overrides:
      calculateFlowRateFromValveOpening in class ControlValveSizing_IEC_60534
      Parameters:
      adjustedKv - a double
      inletStream - a StreamInterface object
      outletStream - a StreamInterface object
      Returns:
      a double
    • calculateValveOpeningFromFlowRate

      public double calculateValveOpeningFromFlowRate(double Q, double Kv, StreamInterface inletStream, StreamInterface outletStream, double percentValveOpening)
      Calculates the required valve opening for a given flow rate using the full, iterative model. This method overrides the simplified base class implementation.
      Parameters:
      Q - The desired flow rate [m^3/s].
      Kv - The maximum flow coefficient of the valve.
      inletStream - The stream entering the valve.
      outletStream - The stream leaving the valve.
      percentValveOpening - The current percent valve opening.
      Returns:
      The required valve opening (0-100).
    • calculateFlowRateFromValveOpeningLiquid_full

      private double calculateFlowRateFromValveOpeningLiquid_full(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream)
      Numerically solves for liquid flow rate using a bisection search.
      Parameters:
      adjustedKv - valve flow coefficient
      inletStream - inlet stream to the valve
      outletStream - outlet stream from the valve
      Returns:
      calculated flow rate [m^3/s]
    • calculateFlowRateFromValveOpeningGas_full

      private double calculateFlowRateFromValveOpeningGas_full(double adjustedKv, StreamInterface inletStream, StreamInterface outletStream)
      Numerically solves for gas flow rate using a bisection search.
      Parameters:
      adjustedKv - valve flow coefficient
      inletStream - inlet stream to the valve
      outletStream - outlet stream from the valve
      Returns:
      calculated flow rate [m^3/s]