Class LeakModel

java.lang.Object
neqsim.process.safety.release.LeakModel
All Implemented Interfaces:
Serializable

public class LeakModel extends Object implements Serializable
Calculates source terms for leak and rupture release scenarios.

This class provides methods for calculating time-dependent release rates from pressurized vessels or pipes. The calculations use NeqSim thermodynamics for accurate real-gas properties and phase behavior.

Key capabilities:

  • Choked (sonic) and subsonic flow
  • Two-phase flashing releases
  • Time-dependent blowdown from vessels
  • Jet properties (velocity, momentum)
  • Droplet size estimation for liquid releases

Example usage:

SystemInterface gas = new SystemSrkEos(300.0, 50.0);
gas.addComponent("methane", 1.0);
gas.setMixingRule("classic");

LeakModel leak = new LeakModel.builder().fluid(gas).holeDiameter(0.02) // 20mm hole
    .orientation(ReleaseOrientation.HORIZONTAL).vesselVolume(10.0) // 10 m³
    .dischargeCoefficient(0.62).build();

SourceTermResult result = leak.calculateSourceTerm(300.0); // 5 minutes
result.exportToPHAST("release.csv");

References:

  • API 520 - Sizing and Selection of Pressure-Relieving Devices
  • CCPS - Guidelines for Consequence Analysis
  • Yellow Book (TNO) - Methods for calculation of physical effects
Version:
1.0
Author:
ESOL
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • fluid

      private final SystemInterface fluid
    • holeDiameter

      private final double holeDiameter
    • orientation

      private final ReleaseOrientation orientation
    • vesselVolume

      private final double vesselVolume
    • dischargeCoefficient

      private final double dischargeCoefficient
    • backPressure

      private final double backPressure
    • scenarioName

      private final String scenarioName
  • Constructor Details

  • Method Details

    • calculateMassFlowRate

      public double calculateMassFlowRate(SystemInterface system)
      Calculates the instantaneous mass flow rate through the orifice.

      Uses choked or subsonic flow equations depending on pressure ratio.

      Parameters:
      system - thermodynamic system at current conditions
      Returns:
      mass flow rate [kg/s]
    • calculateJetVelocity

      public double calculateJetVelocity(SystemInterface system)
      Calculates the jet velocity at the orifice exit.
      Parameters:
      system - thermodynamic system at current conditions
      Returns:
      jet velocity [m/s]
    • calculateJetMomentum

      public double calculateJetMomentum(SystemInterface system)
      Calculates the jet momentum (reaction force).
      Parameters:
      system - thermodynamic system at current conditions
      Returns:
      jet momentum / reaction force [N]
    • calculateDropletSMD

      public double calculateDropletSMD(SystemInterface system)
      Estimates liquid droplet Sauter Mean Diameter (SMD) for two-phase releases.

      Uses correlation from CCPS Guidelines for Consequence Analysis.

      Parameters:
      system - thermodynamic system at current conditions
      Returns:
      droplet SMD [m], or 0 if all vapor
    • calculateSourceTerm

      public SourceTermResult calculateSourceTerm(double duration)
      Calculates time-dependent source term for vessel blowdown.
      Parameters:
      duration - simulation duration [s]
      Returns:
      source term result with time series
    • calculateSourceTerm

      public SourceTermResult calculateSourceTerm(double duration, double timeStep)
      Calculates time-dependent source term for vessel blowdown.
      Parameters:
      duration - simulation duration [s]
      timeStep - time step [s]
      Returns:
      source term result with time series
    • builder

      public static LeakModel.Builder builder()
      Creates a new builder for LeakModel.
      Returns:
      new builder instance