Class GibbsReactorCO2

All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface

public class GibbsReactorCO2 extends TwoPortEquipment
A specialized Gibbs reactor for CO2/acid gas equilibrium calculations.

This two-port equipment encapsulates the reaction sequence commonly used for modeling acid gas systems containing CO2, H2S, SO2, and NOx compounds. The reactor automatically selects the appropriate reaction pathway based on inlet stream composition:

  • NO2 + H2S present: Single reactor handles both species
  • Oxygen present: Two-stage reaction (H2S oxidation followed by SO2 processing)
  • Otherwise: Single reactor with SO2 as inert

Important limitations:

  • This model considers only bulk (homogeneous) phase reactions. Surface reactions, heterogeneous catalysis, and interfacial phenomena are not included.
  • Reactions are disabled when CO2 density falls below 300 kg/m³.

Usage example:

Stream feed = new Stream("feed", thermoSystem);
GibbsReactorCO2 reactor = new GibbsReactorCO2("acid gas reactor", feed);
reactor.run();
Stream outlet = reactor.getOutletStream();
Version:
1.0
Author:
NeqSim Team
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • logger

      private static final org.apache.logging.log4j.Logger logger
      Logger for this class.
    • PPM_THRESHOLD

      private static final double PPM_THRESHOLD
      Threshold in ppm for considering a component present in the mixture.
      See Also:
    • DEFAULT_DAMPING

      private static final double DEFAULT_DAMPING
      Default damping factor for composition updates during iteration.
      See Also:
    • DEFAULT_MAX_ITERATIONS

      private static final int DEFAULT_MAX_ITERATIONS
      Default maximum number of iterations for convergence.
      See Also:
    • DEFAULT_TOLERANCE

      private static final double DEFAULT_TOLERANCE
      Default convergence tolerance for the reactor.
      See Also:
    • DEFAULT_INERT_COMPONENTS

      private static final String[] DEFAULT_INERT_COMPONENTS
      Default inert components for CO2/acid gas systems.
    • MIN_CO2_DENSITY

      private static final double MIN_CO2_DENSITY
      Minimum CO2 density (kg/m³) required for bulk phase reactions to proceed.
      See Also:
  • Constructor Details

    • GibbsReactorCO2

      public GibbsReactorCO2(String name)
      Creates a new GibbsReactorCO2 with the specified name.
      Parameters:
      name - the equipment name
    • GibbsReactorCO2

      public GibbsReactorCO2(String name, StreamInterface inlet)
      Creates a new GibbsReactorCO2 with the specified name and inlet stream.
      Parameters:
      name - the equipment name
      inlet - the inlet stream
  • Method Details

    • run

      public void run(UUID id)

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

      Parameters:
      id - UUID
    • run

      public void run()
    • computeEquilibrium

      private SystemInterface computeEquilibrium(StreamInterface inlet)
      Computes the chemical equilibrium based on inlet composition.

      Note: Only bulk (homogeneous) phase reactions are considered. Surface reactions and heterogeneous catalysis are not modeled. Reactions are disabled if CO2 density is below 300.0 kg/m³.

      Parameters:
      inlet - the inlet stream
      Returns:
      the equilibrated thermo system, or null if calculation fails or reactions are skipped
    • runSingleReactor

      private SystemInterface runSingleReactor(StreamInterface inlet)
      Runs a single-stage reactor for systems with both NO2 and H2S.
      Parameters:
      inlet - the inlet stream
      Returns:
      the outlet thermo system
    • runSingleReactorWithSO2Inert

      private SystemInterface runSingleReactorWithSO2Inert(StreamInterface inlet)
      Runs a single-stage reactor with SO2 set as inert.
      Parameters:
      inlet - the inlet stream
      Returns:
      the outlet thermo system
    • runTwoStageOxidation

      private SystemInterface runTwoStageOxidation(StreamInterface inlet, double no2ppm, double h2sppm)
      Runs a two-stage oxidation sequence for systems containing oxygen.

      Stage 1: H2S oxidation reactions Stage 2: SO2 processing based on remaining oxygen

      Parameters:
      inlet - the inlet stream
      no2ppm - NO2 concentration in ppm
      h2sppm - H2S concentration in ppm (unused but kept for API consistency)
      Returns:
      the outlet thermo system
    • createH2SReactor

      private GibbsReactor createH2SReactor(StreamInterface inlet, double no2ppm)
      Creates and configures a reactor for H2S oxidation (first stage).
      Parameters:
      inlet - the inlet stream
      no2ppm - NO2 concentration in ppm
      Returns:
      configured H2S reactor
    • createSO2Reactor

      private GibbsReactor createSO2Reactor(StreamInterface h2sOutlet)
      Creates and configures a reactor for SO2 processing (second stage).
      Parameters:
      h2sOutlet - the outlet stream from the H2S reactor
      Returns:
      configured SO2 reactor
    • createConfiguredReactor

      private GibbsReactor createConfiguredReactor(String name, StreamInterface inlet)
      Creates a GibbsReactor with standard configuration for acid gas systems.
      Parameters:
      name - the reactor name
      inlet - the inlet stream
      Returns:
      configured reactor with default settings and inert components
    • setDefaultInertComponents

      private void setDefaultInertComponents(GibbsReactor reactor)
      Sets the default list of inert components on a reactor.
      Parameters:
      reactor - the reactor to configure
    • getComponentPpm

      private double getComponentPpm(StreamInterface stream, String componentName)
      Gets the concentration of a component in ppm (parts per million).
      Parameters:
      stream - the stream to query
      componentName - the component name
      Returns:
      concentration in ppm, or 0.0 if component not found
    • getComponentMoleFraction

      private double getComponentMoleFraction(StreamInterface stream, String componentName)
      Gets the mole fraction of a component in a stream.
      Parameters:
      stream - the stream to query
      componentName - the component name
      Returns:
      mole fraction, or 0.0 if component not found
    • hasSignificantConcentration

      private boolean hasSignificantConcentration(double ppm)
      Checks if a concentration exceeds the significance threshold.
      Parameters:
      ppm - concentration in ppm
      Returns:
      true if concentration is above threshold
    • getCO2Density

      private double getCO2Density(StreamInterface stream)
      Gets the density of CO2 in the stream.

      This method calculates the CO2 density by running a thermodynamic flash calculation on a cloned system. If CO2 is not present or an error occurs, returns 0.0.

      Parameters:
      stream - the stream to query
      Returns:
      CO2 density in kg/m³, or 0.0 if CO2 is not present or calculation fails