Class ControlValveSizing_IEC_60534

java.lang.Object
neqsim.process.mechanicaldesign.valve.ControlValveSizing
neqsim.process.mechanicaldesign.valve.ControlValveSizing_IEC_60534
All Implemented Interfaces:
Serializable, ControlValveSizingInterface
Direct Known Subclasses:
ControlValveSizing_IEC_60534_full

public class ControlValveSizing_IEC_60534 extends ControlValveSizing

ControlValveSizing_IEC_60534 class.

Author:
esol
See Also:
  • Field Details

    • N1

      static final double N1
      Constant for liquids (flow in m^3/h, pressure in kPa).
      See Also:
    • N9

      static final double N9
      Constant for gases (flow in m^3/h, pressure in kPa, T in K @ 0°C ref).
      See Also:
    • rho0

      static final double rho0
      Reference density of water [kg/m^3] used in the standard.
      See Also:
    • R

      static final double R
      Universal gas constant [J/(mol*K)].
      See Also:
    • KV_TO_CV_FACTOR

      static final double KV_TO_CV_FACTOR
      Conversion factor from Kv to Cv.
      See Also:
    • FL

      double FL
    • Fd

      double Fd
    • D1

      double D1
    • D2

      double D2
    • d

      double d
    • FD

      double FD
    • allowLaminar

      boolean allowLaminar
    • fullOutput

      boolean fullOutput
  • Constructor Details

    • ControlValveSizing_IEC_60534

      public ControlValveSizing_IEC_60534()

      Constructor for ControlValveSizing_IEC_60534.

    • ControlValveSizing_IEC_60534

      public ControlValveSizing_IEC_60534(ValveMechanicalDesign valveMechanicalDesign)

      Constructor for ControlValveSizing_IEC_60534.

      Parameters:
      valveMechanicalDesign - a ValveMechanicalDesign object
  • Method Details

    • isAllowChoked

      public boolean isAllowChoked()

      isAllowChoked.

      Specified by:
      isAllowChoked in interface ControlValveSizingInterface
      Overrides:
      isAllowChoked in class ControlValveSizing
      Returns:
      a boolean
    • setAllowChoked

      public void setAllowChoked(boolean allowChoked)

      setAllowChoked.

      Specified by:
      setAllowChoked in interface ControlValveSizingInterface
      Overrides:
      setAllowChoked in class ControlValveSizing
      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
    • isFullOutput

      public boolean isFullOutput()

      isFullOutput.

      Returns:
      a boolean
    • setFullOutput

      public void setFullOutput(boolean fullOutput)

      Setter for the field fullOutput.

      Parameters:
      fullOutput - a boolean
    • getFL

      public double getFL()

      getFL.

      Returns:
      a double
    • setFL

      public void setFL(double FL)

      setFL.

      Parameters:
      FL - a double
    • getFd

      public double getFd()

      getFd.

      Returns:
      a double
    • setFd

      public void setFd(double Fd)

      setFd.

      Parameters:
      Fd - a double
    • getD1

      public double getD1()

      getD1.

      Returns:
      a double
    • setD1

      public void setD1(double D1)

      setD1.

      Parameters:
      D1 - a double
    • getD2

      public double getD2()

      getD2.

      Returns:
      a double
    • setD2

      public void setD2(double D2)

      setD2.

      Parameters:
      D2 - a double
    • getD

      public double getD()

      Getter for the field d.

      Returns:
      a double
    • setD

      public void setD(double d)

      Setter for the field d.

      Parameters:
      d - a double
    • calcValveSize

      public Map<String,Object> calcValveSize(double percentOpening)
      Calculates the valve size based on the fluid properties and operating conditions.
      Specified by:
      calcValveSize in interface ControlValveSizingInterface
      Overrides:
      calcValveSize in class ControlValveSizing
      Parameters:
      percentOpening - a double
      Returns:
      a Map object
    • getValve

      public ValveInterface getValve()

      getValve.

      Returns:
      a ValveInterface object
    • sizeControlValve

      public Map<String,Object> sizeControlValve(ControlValveSizing_IEC_60534.FluidType type, double rhoOrT, double MW, double mu, double gammaOrPsat, double ZOrPc, double P1, double P2, double Q, Double D1, Double D2, Double d, double FL, double Fd, double xTOrNone, boolean allowChoked, boolean allowLaminar, boolean fullOutput, double percentOpening)
      Sizes a control valve based on the provided parameters.
      Parameters:
      type - the type of fluid (LIQUID or GAS)
      rhoOrT - density for liquid or temperature for gas
      MW - molecular weight of the fluid
      mu - dynamic viscosity of the fluid
      gammaOrPsat - specific heat ratio for gas or saturation pressure for liquid
      ZOrPc - compressibility factor for gas or critical pressure for liquid
      P1 - upstream pressure
      P2 - downstream pressure
      Q - flow rate
      D1 - upstream pipe diameter
      D2 - downstream pipe diameter
      d - valve diameter
      FL - liquid pressure recovery factor
      Fd - valve style modifier
      xTOrNone - pressure drop ratio factor for gas
      allowChoked - whether to allow choked flow
      allowLaminar - whether to allow laminar flow
      fullOutput - whether to return full output
      percentOpening - Valve opening percentage (0-100)
      Returns:
      a map containing the sizing results
    • 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.
      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.).
    • 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.

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

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

      calculateFlowRateFromValveOpeningGas.

      Parameters:
      adjustedKv - a double
      inletStream - a StreamInterface object
      outletStream - a StreamInterface object
      Returns:
      a double
    • calculateFlowRateFromValveOpeningLiquid

      public double calculateFlowRateFromValveOpeningLiquid(double adjustedKv, double rho, double Psat, double Pc, double P1, double P2)
      Calculates liquid flow rate from valve opening.
      Parameters:
      adjustedKv - Max flow coefficient of the valve
      rho - Liquid density [kg/m^3]
      Psat - Saturation pressure [Pa]
      Pc - Critical pressure [Pa]
      P1 - Upstream pressure [Pa]
      P2 - Downstream pressure [Pa]
      Returns:
      Flow rate [m^3/s]
    • calculateFlowRateFromValveOpeningLiquid

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

      calculateFlowRateFromValveOpeningLiquid.

      Parameters:
      adjustedKv - a double
      inletStream - a StreamInterface object
      outletStream - a StreamInterface object
      Returns:
      a double
    • calculateValveOpeningFromFlowRateLiquid

      public double calculateValveOpeningFromFlowRateLiquid(double Q, double Kv, double rho, double Psat, double Pc, double P1, double P2)
      Calculates required valve opening for a given liquid flow rate.
      Parameters:
      Q - Desired flow rate [m^3/s]
      Kv - Max flow coefficient of the valve
      rho - Liquid density [kg/m^3]
      Psat - Saturation pressure [Pa]
      Pc - Critical pressure [Pa]
      P1 - Upstream pressure [Pa]
      P2 - Downstream pressure [Pa]
      Returns:
      Required valve opening percentage (0-100).
    • calculateValveOpeningFromFlowRateLiquid

      public double calculateValveOpeningFromFlowRateLiquid(double Q, double Kv, StreamInterface inletStream, StreamInterface outletStream)

      calculateValveOpeningFromFlowRateLiquid.

      Parameters:
      Q - a double
      Kv - a double
      inletStream - a StreamInterface object
      outletStream - a StreamInterface object
      Returns:
      a double
    • findOutletPressureForFixedKvLiquid

      public double findOutletPressureForFixedKvLiquid(double rho, double Psat, double Pc, double mu, double P1, double Q, double actualKv, double FL, double Fd, boolean allowChoked, boolean allowLaminar)
      Finds the outlet pressure for a given flow rate Q and a fixed (actual) Kv in a liquid valve. This is solved iteratively using a bisection search algorithm.
      Parameters:
      rho - Density of the liquid [kg/m^3]
      Psat - Saturation pressure [Pa]
      Pc - Critical pressure [Pa]
      mu - Dynamic viscosity [Pa.s] - Note: Not used in this turbulent model
      P1 - Upstream pressure [Pa]
      Q - Flow rate [m^3/s]
      actualKv - The actual installed valve's Kv
      FL - Liquid pressure recovery factor
      Fd - Valve style modifier
      allowChoked - Whether to allow choked flowfindOutletPressureForFixedKvLiquid
      allowLaminar - Whether to allow laminar flow
      Returns:
      Outlet pressure P2 [Pa]
    • findOutletPressureForFixedKvLiquid

      public double findOutletPressureForFixedKvLiquid(double actualKv, StreamInterface inletStream)

      findOutletPressureForFixedKvLiquid.

      Parameters:
      actualKv - a double
      inletStream - a StreamInterface object
      Returns:
      a double
    • 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.
      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.).
    • calculateFlowRateFromKvAndValveOpeningGas

      public double calculateFlowRateFromKvAndValveOpeningGas(double adjustedKv, double T, double MW, double mu, double gamma, double Z, double P1, double P2, double FL, double xT, boolean allowChoked)
      Calculates the flow rate for gas based on Kv and valve opening percentage.
      Parameters:
      adjustedKv - full flow coefficient (at 100% opening)
      T - temperature of the gas (K)
      MW - molecular weight of the gas (g/mol)
      mu - dynamic viscosity of the gas (Pa·s)
      gamma - specific heat ratio of the gas
      Z - compressibility factor of the gas
      P1 - upstream pressure (Pa)
      P2 - downstream pressure (Pa)
      FL - liquid pressure recovery factor
      xT - pressure drop ratio factor for gas
      allowChoked - whether to allow choked flow
      Returns:
      the calculated flow rate in m^3/s
    • calculateFlowRateFromKvAndValveOpeningGas

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

      calculateFlowRateFromKvAndValveOpeningGas.

      Parameters:
      adjustedKv - a double
      inletStream - a StreamInterface object
      outletStream - a StreamInterface object
      Returns:
      a double
    • calculateValveOpeningFromFlowRateGas

      public double calculateValveOpeningFromFlowRateGas(double Q, double Kv, double T, double MW, double mu, double gamma, double Z, double P1, double P2, double FL, double xT, boolean allowChoked)
      Calculates the valve opening percentage for gas based on the flow rate and Kv.
      Parameters:
      Q - desired flow rate in m^3/s
      Kv - full flow coefficient (at 100% opening)
      T - temperature of the gas (K)
      MW - molecular weight of the gas (g/mol)
      mu - dynamic viscosity of the gas (Pa·s)
      gamma - specific heat ratio of the gas
      Z - compressibility factor of the gas
      P1 - upstream pressure (Pa)
      P2 - downstream pressure (Pa)
      FL - liquid pressure recovery factor
      xT - pressure drop ratio factor for gas
      allowChoked - whether to allow choked flow
      Returns:
      the valve opening percentage (0 to 100%)
    • calculateValveOpeningFromFlowRateGas

      public double calculateValveOpeningFromFlowRateGas(double Q, double Kv, double valveOpening, StreamInterface inletStream, StreamInterface outletStream)

      calculateValveOpeningFromFlowRateGas.

      Parameters:
      Q - a double
      Kv - a double
      valveOpening - a double
      inletStream - a StreamInterface object
      outletStream - a StreamInterface object
      Returns:
      a double
    • findOutletPressureForFixedKvGas

      public double findOutletPressureForFixedKvGas(double T, double MW, double gamma, double Z, double P1, double Q, double actualKv)
      Finds the outlet pressure for a given flow rate and a fixed Kv in a gas valve. This is solved iteratively using a bisection search algorithm.
      Parameters:
      T - Temperature [K]
      MW - Molecular Weight [g/mol]
      gamma - Specific heat ratio
      Z - Compressibility Factor
      P1 - Upstream pressure [Pa]
      Q - Volumetric flow rate [m^3/s]
      actualKv - The actual installed valve's Kv
      Returns:
      The calculated outlet pressure P2 [Pa] that satisfies the conditions.
    • findOutletPressureForFixedKvGas

      public double findOutletPressureForFixedKvGas(double actualKv, StreamInterface inletStream)

      findOutletPressureForFixedKvGas.

      Parameters:
      actualKv - a double
      inletStream - a StreamInterface object
      Returns:
      a double
    • isChokedTurbulentL

      boolean isChokedTurbulentL(double dP, double P1, double Psat, double FF, double FL)
    • isChokedTurbulentG

      boolean isChokedTurbulentG(double x, double Fgamma, double xT)
    • ffCriticalPressureRatioL

      double ffCriticalPressureRatioL(double Psat, double Pc)
    • Kv_to_Cv

      double Kv_to_Cv(double Kv)
    • Cv_to_Kv

      double Cv_to_Kv(double Cv)
    • findOutletPressureForFixedKv

      public double findOutletPressureForFixedKv(double actualKv, 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.

      Specified by:
      findOutletPressureForFixedKv in interface ControlValveSizingInterface
      Overrides:
      findOutletPressureForFixedKv in class ControlValveSizing
      Parameters:
      actualKv - a double
      inletStream - a StreamInterface object
      Returns:
      a double