Class DryGasSealAnalyzer

java.lang.Object
neqsim.process.equipment.compressor.DryGasSealAnalyzer

public class DryGasSealAnalyzer extends Object
High-level analysis module for dry gas seal condensation risk assessment in centrifugal compressors. Combines isenthalpic expansion modelling, retrograde condensation mapping, dead-leg cooldown simulation, condensate accumulation rate estimation, and flash vaporisation impact pressure calculation into a single orchestrated analysis.

This analyzer addresses a well-documented failure mode in high-pressure gas compressors (API 692): gas leaking through the primary dry gas seal clearance undergoes isenthalpic (Joule-Thomson) expansion from seal cavity pressure to primary vent pressure. When the seal gas contains C3+ hydrocarbons, this expansion can produce liquid condensation in the primary vent piping, standpipe dead-legs, and seal faces.

Key physics modelled:

  • Isenthalpic (PH-flash) expansion through seal gap at multiple outlet pressures
  • Retrograde condensation mapping over the full T-P operating envelope
  • Dead-leg cooldown transient (lumped thermal model with natural convection)
  • Condensate accumulation rate from continuous seal leakage
  • Flash vaporisation impact pressure during repressurisation (water hammer analogy)
  • Gas Conditioning Unit (GCU) sizing: required cooling, separation, and reheating

Usage example:

SystemInterface sealGas = new SystemPrEos(273.15 + 44.0, 422.0);
sealGas.addComponent("methane", 0.7997);
sealGas.addComponent("ethane", 0.0996);
// ... add remaining components
sealGas.setMixingRule("classic");

DryGasSealAnalyzer analyzer = new DryGasSealAnalyzer("GIC-Seal");
analyzer.setSealGas(sealGas);
analyzer.setSealCavityPressure(421.0, "barg");
analyzer.setSealCavityTemperature(44.0, "C");
analyzer.setPrimaryVentPressure(1.5, "barg");
analyzer.setSealLeakageRate(280.0, "NL/min");
analyzer.setStandpipeGeometry(1.5, 0.038);
analyzer.setStandpipeCount(2);
analyzer.setAmbientTemperature(25.0, "C");
analyzer.runFullAnalysis();

Map<String, Object> results = analyzer.getResults();
boolean safe = analyzer.isSafeToOperate();
double fillTimeHours = analyzer.getStandpipeFillTimeHours();
Version:
1.0
Author:
neqsim
See Also:
  • Field Details

    • logger

      private static final org.apache.logging.log4j.Logger logger
      Logger object for class.
    • STD_TEMPERATURE_K

      private static final double STD_TEMPERATURE_K
      Standard conditions: 0 degC, 1.01325 bara for normal litres.
      See Also:
    • STD_PRESSURE_BARA

      private static final double STD_PRESSURE_BARA
      See Also:
    • STEFAN_BOLTZMANN

      private static final double STEFAN_BOLTZMANN
      Stefan-Boltzmann constant in W/(m2 K4).
      See Also:
    • name

      private final String name
      Analyzer tag/name.
    • sealGas

      private SystemInterface sealGas
      The seal gas fluid (will be cloned for each sub-analysis).
    • sealCavityPressureBara

      private double sealCavityPressureBara
      Seal cavity pressure in bara.
    • sealCavityTemperatureK

      private double sealCavityTemperatureK
      Seal cavity temperature in Kelvin.
    • primaryVentPressureBara

      private double primaryVentPressureBara
      Primary vent back-pressure in bara.
    • sealClearanceM

      private double sealClearanceM
      Primary seal radial clearance in metres.
    • sealLeakageNLmin

      private double sealLeakageNLmin
      Seal leakage rate at standard conditions in normal litres per minute.
    • standpipeLengthM

      private double standpipeLengthM
      Standpipe (dead-leg) length in metres.
    • standpipeIDM

      private double standpipeIDM
      Standpipe inner diameter in metres.
    • standpipeCount

      private int standpipeCount
      Number of standpipes (typically 2: drive end + non-drive end).
    • standpipeWallThicknessM

      private double standpipeWallThicknessM
      Standpipe wall thickness in metres (for cooldown model).
    • insulationThicknessM

      private double insulationThicknessM
      Pipe insulation thickness in metres (0 = bare pipe).
    • insulationConductivity

      private double insulationConductivity
      Insulation thermal conductivity in W/(m K).
    • ambientTemperatureK

      private double ambientTemperatureK
      Ambient temperature in Kelvin.
    • windSpeedMs

      private double windSpeedMs
      Wind speed in m/s (for forced convection on pipe exterior).
    • results

      private final Map<String,Object> results
      Master results map (nested hierarchy).
    • analysisComplete

      private boolean analysisComplete
      Whether the full analysis has been run.
    • gcuSuperheatMarginK

      private double gcuSuperheatMarginK
      GCU superheat margin above dew point in Kelvin.
    • gcuSubcoolMarginK

      private double gcuSubcoolMarginK
      GCU subcool margin below dew point in Kelvin.
  • Constructor Details

    • DryGasSealAnalyzer

      public DryGasSealAnalyzer(String name)
      Constructor for DryGasSealAnalyzer.
      Parameters:
      name - the analyzer tag or compressor seal identification
  • Method Details

    • setSealGas

      public void setSealGas(SystemInterface sealGas)
      Sets the seal gas thermodynamic system. The fluid is cloned internally so the original is not modified.
      Parameters:
      sealGas - the thermodynamic system representing the seal gas composition
    • setSealCavityPressure

      public void setSealCavityPressure(double pressure, String unit)
      Sets the seal cavity pressure (upstream of the seal gap).
      Parameters:
      pressure - the pressure value
      unit - pressure unit: "bara", "barg", "Pa", "MPa"
    • setSealCavityTemperature

      public void setSealCavityTemperature(double temperature, String unit)
      Sets the seal cavity temperature (upstream of the seal gap).
      Parameters:
      temperature - the temperature value
      unit - temperature unit: "C", "K", "F"
    • setPrimaryVentPressure

      public void setPrimaryVentPressure(double pressure, String unit)
      Sets the primary vent back-pressure (downstream of seal gap).
      Parameters:
      pressure - the pressure value
      unit - pressure unit: "bara", "barg", "Pa", "MPa"
    • setSealClearance

      public void setSealClearance(double clearance, String unit)
      Sets the primary seal radial clearance.
      Parameters:
      clearance - the clearance in the specified unit
      unit - length unit: "m", "mm", "um"
    • setSealLeakageRate

      public void setSealLeakageRate(double rate, String unit)
      Sets the seal leakage rate at standard conditions.
      Parameters:
      rate - the leakage rate
      unit - rate unit: "NL/min", "Nm3/hr", "kg/hr"
    • setStandpipeGeometry

      public void setStandpipeGeometry(double lengthM, double innerDiameterM)
      Sets the standpipe (dead-leg) geometry.
      Parameters:
      lengthM - length in metres
      innerDiameterM - inner diameter in metres
    • setStandpipeCount

      public void setStandpipeCount(int count)
      Sets the number of standpipe dead-legs.
      Parameters:
      count - number of standpipes
    • setStandpipeWallThickness

      public void setStandpipeWallThickness(double thicknessM)
      Sets the standpipe wall thickness for thermal model.
      Parameters:
      thicknessM - wall thickness in metres
    • setInsulation

      public void setInsulation(double thicknessM, double conductivity)
      Sets the pipe insulation properties.
      Parameters:
      thicknessM - insulation thickness in metres (0 for bare pipe)
      conductivity - insulation thermal conductivity in W/(m K)
    • setAmbientTemperature

      public void setAmbientTemperature(double temperature, String unit)
      Sets the ambient temperature.
      Parameters:
      temperature - the temperature value
      unit - temperature unit: "C", "K", "F"
    • setWindSpeed

      public void setWindSpeed(double speedMs)
      Sets the wind speed for forced convection heat transfer calculation.
      Parameters:
      speedMs - wind speed in m/s
    • setGCUMargins

      public void setGCUMargins(double superheatK, double subcoolK)
      Sets the GCU superheat and subcool margins per API 692.
      Parameters:
      superheatK - margin above dew point for reheating in Kelvin
      subcoolK - margin below dew point for cooling in Kelvin
    • runFullAnalysis

      public void runFullAnalysis()
      Runs the complete dry gas seal condensation analysis. This is the main entry point that chains all sub-analyses in sequence.

      Sub-analyses executed:

      1. Isenthalpic expansion through seal gap (JT cooling + condensation)
      2. Retrograde condensation map over T-P space
      3. Dead-leg cooldown transient simulation
      4. Condensate accumulation rate calculation
      5. Flash vaporisation impact pressure estimation
      6. GCU sizing calculation
    • runIsenthalpicExpansionAnalysis

      private Map<String,Object> runIsenthalpicExpansionAnalysis()
      Models isenthalpic (constant enthalpy) expansion of seal gas leaking through the dry gas seal clearance from seal cavity pressure to primary vent pressure.

      Physics: Gas leaks through the narrow annular seal gap (typically 3-5 um operating, up to 0.23 mm static). The process is approximately isenthalpic (negligible heat transfer in the short transit through the seal). The PH-flash at each outlet pressure gives the temperature and phase distribution after expansion.

      Governing equation (Joule-Thomson coefficient):

      $$\mu_{JT} = \left(\frac{\partial T}{\partial P}\right)_H = \frac{1}{C_p}\left[T \left(\frac{\partial V}{\partial T}\right)_P - V\right]$$
      Returns:
      map with outlet temperatures, liquid fractions, and JT coefficients at each pressure step
    • getVentConditions

      private Map<String,Object> getVentConditions(double inletEnthalpy)
      Gets the outlet conditions at the primary vent pressure after isenthalpic expansion.
      Parameters:
      inletEnthalpy - the inlet enthalpy in J/mol
      Returns:
      map with vent outlet temperature, liquid fraction, and phase details
    • runRetrogradeCdensationMap

      private Map<String,Object> runRetrogradeCdensationMap()
      Maps the retrograde condensation region by performing TP flash calculations over a grid of temperatures and pressures covering the seal gas standstill operating envelope.

      This produces the condensation contour map used for operational planning: any T-P condition in the two-phase region will produce liquid in the seal gas piping.

      Returns:
      map with condensation grid data, dew point curve, and maximum condensation conditions
    • runDeadLegCooldown

      private Map<String,Object> runDeadLegCooldown()
      Simulates the transient cooldown of gas trapped in a standpipe dead-leg after compressor shutdown. Uses a lumped thermal capacitance model combining natural convection and radiation heat loss from the pipe exterior.

      Governing equation (lumped thermal model):

      $$(\rho C_p)_{eff} V \frac{dT}{dt} = -U A_{outer} (T - T_{amb})$$

      where the overall heat transfer coefficient U includes:

      • Internal natural convection: Churchill-Chu correlation for vertical cylinders
      • Pipe wall conduction: $k_{steel} / t_{wall}$
      • Insulation conduction: $k_{ins} / t_{ins}$ (if present)
      • External combined convection + radiation

      At each time step, the gas T-P state is re-flashed (TP flash) to detect when condensation first occurs during cooldown and how liquid fraction evolves.

      Returns:
      map with cooldown temperature profile, time to dew point, and liquid accumulation
    • calculateExternalHTC

      private double calculateExternalHTC(double outerRadius, double surfaceTemperatureK)
      Calculates the external heat transfer coefficient combining forced convection (wind) and radiation from a horizontal/vertical cylinder in air.

      Forced convection uses the Churchill-Bernstein correlation for cross-flow over a cylinder:

      $$Nu = 0.3 + \frac{0.62 Re^{1/2} Pr^{1/3}}{[1 + (0.4/Pr)^{2/3}]^{1/4}} \left[1 + \left(\frac{Re}{282000}\right)^{5/8}\right]^{4/5}$$

      Radiation uses the Stefan-Boltzmann law with emissivity 0.9 (oxidised steel):

      $$h_{rad} = \varepsilon \sigma (T_s^2 + T_{amb}^2)(T_s + T_{amb})$$
      Parameters:
      outerRadius - outer radius of pipe (including insulation) in metres
      surfaceTemperatureK - pipe surface temperature in Kelvin
      Returns:
      combined external heat transfer coefficient in W/(m2 K)
    • calculateOverallU

      private double calculateOverallU(double ri, double ro, double rIns, double steelK, double hExt)
      Calculates the overall heat transfer coefficient for the pipe wall + insulation composite.

      For cylindrical geometry:

      $$\frac{1}{U} = \frac{r_{ins}}{r_i h_{int}} + \frac{r_{ins} \ln(r_o/r_i)}{k_{steel}} + \frac{r_{ins} \ln(r_{ins}/r_o)}{k_{ins}} + \frac{1}{h_{ext}}$$

      Internal convection is assumed to be dominated by natural convection at low velocities (stagnant dead-leg), approximated as h_int = 5 W/(m2 K).

      Parameters:
      ri - inner radius in metres
      ro - outer radius of steel wall in metres
      rIns - outer radius including insulation in metres
      steelK - steel thermal conductivity in W/(m K)
      hExt - external heat transfer coefficient in W/(m2 K)
      Returns:
      overall heat transfer coefficient in W/(m2 K) based on outer area
    • runCondensateAccumulation

      private Map<String,Object> runCondensateAccumulation()
      Calculates the condensate accumulation rate from continuous seal leakage, considering both the JT expansion mechanism (primary) and retrograde condensation from gas cooling in dead-legs (secondary).

      Method: Converts the seal leakage rate from NL/min to actual molar flow at standard conditions, then applies the liquid mole fraction from the isenthalpic expansion to get the liquid production rate.

      The accumulation rate is:

      $$\dot{V}_{liq} = \dot{n}_{leak} \cdot x_{liq} \cdot \frac{MW_{liq}}{\rho_{liq}}$$

      where $\dot{n}_{leak}$ is the molar leakage rate, $x_{liq}$ is the liquid mole fraction from PH-flash at vent conditions, $MW_{liq}$ is the liquid molar mass, and $\rho_{liq}$ is the liquid density.

      Returns:
      map with accumulation rates, standpipe fill times, and daily volumes
    • runFlashVaporisationImpact

      private Map<String,Object> runFlashVaporisationImpact()
      Estimates the pressure impulse generated when accumulated liquid condensate flashes to vapour during rapid repressurisation of the seal gas system.

      Physics: When liquid condensate trapped in a standpipe dead-leg is suddenly exposed to high pressure gas during compressor restart or re-pressurisation, the liquid evaporates rapidly. The volume expansion generates a pressure wave that propagates through the piping and can impact the seal faces.

      The analysis uses two approaches:

      1. Confined flash pressure: TV flash of liquid at original dead-leg volume to find the equilibrium pressure after complete evaporation
      2. Water hammer analogy: Pressure rise from slug deceleration in a confined pipe using the Joukowsky equation: $\Delta P = \rho \cdot c \cdot \Delta v$
      Returns:
      map with flash pressure, slug velocity, impact pressure, and slug acceleration
    • runGCUSizing

      private Map<String,Object> runGCUSizing()
      Sizes a Gas Conditioning Unit (GCU) per API 692 guidelines. The GCU removes heavy hydrocarbons from the seal gas by cooling below the dew point, separating the condensed liquid, and reheating the dry gas above the dew point plus a safety margin.

      GCU design basis (per API 692):

      • Cool seal gas to dew point minus subcool margin (typically 17 degC below)
      • Separate liquid at the lowest temperature
      • Reheat gas to dew point plus superheat margin (typically 17 degC above)
      • Size the cooler, separator, and heater

      The required cooling duty is:

      $$Q_{cool} = \dot{m} \cdot (h_{in} - h_{cooled})$$

      and the reheating duty is:

      $$Q_{heat} = \dot{m}_{dry} \cdot (h_{out} - h_{separated})$$
      Returns:
      map with GCU sizing data: duties, temperatures, liquid production, and dry gas composition
    • getResults

      public Map<String,Object> getResults()
      Returns the complete results hierarchy from the full analysis.
      Returns:
      map with all sub-analysis results
    • isSafeToOperate

      public boolean isSafeToOperate()
      Returns whether the seal gas system is safe from condensation at the configured conditions. The system is considered safe only if no liquid is produced at any point in the isenthalpic expansion path and no retrograde condensation occurs at ambient conditions.
      Returns:
      true if no condensation risk, false if condensation is predicted
    • getStandpipeFillTimeHours

      public double getStandpipeFillTimeHours()
      Returns the estimated time in hours for the standpipe dead-legs to fill with condensate from continuous seal leakage.
      Returns:
      fill time in hours, or -1 if no condensation occurs or analysis not complete
    • getMaxJTLiquidFraction

      public double getMaxJTLiquidFraction()
      Returns the maximum liquid volume fraction produced during isenthalpic expansion.
      Returns:
      maximum liquid volume percent, or 0 if no condensation
    • isAnalysisComplete

      public boolean isAnalysisComplete()
      Returns whether the full analysis has been completed.
      Returns:
      true if runFullAnalysis() has been called and completed
    • getName

      public String getName()
      Returns the analyzer name.
      Returns:
      the name/tag
    • toJson

      public String toJson()
      Returns the results as a JSON string.
      Returns:
      JSON representation of all results
    • convertPressureToBara

      private static double convertPressureToBara(double pressure, String unit)
      Converts a pressure value to bara.
      Parameters:
      pressure - the pressure value
      unit - the unit string
      Returns:
      pressure in bara
    • convertTemperatureToKelvin

      private static double convertTemperatureToKelvin(double temperature, String unit)
      Converts a temperature value to Kelvin.
      Parameters:
      temperature - the temperature value
      unit - the unit string
      Returns:
      temperature in Kelvin