Class GibbsReactorCO2
- All Implemented Interfaces:
Serializable, Runnable, ProcessEquipmentInterface, TwoPortInterface, SimulationInterface, NamedInterface
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleDefault damping factor for composition updates during iteration.private static final String[]Default inert components for CO2/acid gas systems.private static final intDefault maximum number of iterations for convergence.private static final doubleDefault convergence tolerance for the reactor.private static final org.apache.logging.log4j.LoggerLogger for this class.private static final doubleMinimum CO2 density (kg/m³) required for bulk phase reactions to proceed.private static final doubleThreshold in ppm for considering a component present in the mixture.private static final longFields inherited from class TwoPortEquipment
inStream, outStreamFields inherited from class ProcessEquipmentBaseClass
conditionAnalysisMessage, energyStream, hasController, isSolved, properties, reportFields inherited from class SimulationBaseClass
calcIdentifier, calculateSteadyState, timeFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionGibbsReactorCO2(String name) Creates a new GibbsReactorCO2 with the specified name.GibbsReactorCO2(String name, StreamInterface inlet) Creates a new GibbsReactorCO2 with the specified name and inlet stream. -
Method Summary
Modifier and TypeMethodDescriptionprivate SystemInterfaceComputes the chemical equilibrium based on inlet composition.private GibbsReactorcreateConfiguredReactor(String name, StreamInterface inlet) Creates a GibbsReactor with standard configuration for acid gas systems.private GibbsReactorcreateH2SReactor(StreamInterface inlet, double no2ppm) Creates and configures a reactor for H2S oxidation (first stage).private GibbsReactorcreateSO2Reactor(StreamInterface h2sOutlet) Creates and configures a reactor for SO2 processing (second stage).private doublegetCO2Density(StreamInterface stream) Gets the density of CO2 in the stream.private doublegetComponentMoleFraction(StreamInterface stream, String componentName) Gets the mole fraction of a component in a stream.private doublegetComponentPpm(StreamInterface stream, String componentName) Gets the concentration of a component in ppm (parts per million).private booleanhasSignificantConcentration(double ppm) Checks if a concentration exceeds the significance threshold.voidrun()voidIn this method all thermodynamic and unit operations will be calculated in a steady state calculation.private SystemInterfacerunSingleReactor(StreamInterface inlet) Runs a single-stage reactor for systems with both NO2 and H2S.private SystemInterfaceRuns a single-stage reactor with SO2 set as inert.private SystemInterfacerunTwoStageOxidation(StreamInterface inlet, double no2ppm, double h2sppm) Runs a two-stage oxidation sequence for systems containing oxygen.private voidsetDefaultInertComponents(GibbsReactor reactor) Sets the default list of inert components on a reactor.Methods inherited from class TwoPortEquipment
getInletPressure, getInletStream, getInletTemperature, getMassBalance, getOutletPressure, getOutletStream, getOutletTemperature, setInletPressure, setInletStream, setInletTemperature, setOutletPressure, setOutletStream, setOutletTemperature, toJson, toJson, validateSetupMethods inherited from class ProcessEquipmentBaseClass
copy, displayResult, equals, getConditionAnalysisMessage, getController, getEnergyStream, getEntropyProduction, getExergyChange, getMassBalance, getMechanicalDesign, getMinimumFlow, getPressure, getPressure, getProperty, getReport_json, getResultTable, getSpecification, getTemperature, getTemperature, getThermoSystem, hashCode, initMechanicalDesign, isActive, isActive, isSetEnergyStream, reportResults, run_step, runConditionAnalysis, setController, setEnergyStream, setEnergyStream, setFlowValveController, setMinimumFlow, setPressure, setRegulatorOutSignal, setSpecification, setTemperature, solvedMethods inherited from class SimulationBaseClass
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagNameMethods inherited from interface ProcessEquipmentInterface
getCapacityDuty, getCapacityMax, getExergyChange, getFluid, getRestCapacity, needRecalculationMethods inherited from interface SimulationInterface
getCalculateSteadyState, getCalculationIdentifier, getTime, increaseTime, isRunInSteps, run_step, runTransient, runTransient, setCalculateSteadyState, setCalculationIdentifier, setRunInSteps, setTimeMethods inherited from interface TwoPortInterface
getInStream, getOutStream
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
private static final org.apache.logging.log4j.Logger loggerLogger for this class. -
PPM_THRESHOLD
private static final double PPM_THRESHOLDThreshold in ppm for considering a component present in the mixture.- See Also:
-
DEFAULT_DAMPING
private static final double DEFAULT_DAMPINGDefault damping factor for composition updates during iteration.- See Also:
-
DEFAULT_MAX_ITERATIONS
private static final int DEFAULT_MAX_ITERATIONSDefault maximum number of iterations for convergence.- See Also:
-
DEFAULT_TOLERANCE
private static final double DEFAULT_TOLERANCEDefault convergence tolerance for the reactor.- See Also:
-
DEFAULT_INERT_COMPONENTS
Default inert components for CO2/acid gas systems. -
MIN_CO2_DENSITY
private static final double MIN_CO2_DENSITYMinimum CO2 density (kg/m³) required for bulk phase reactions to proceed.- See Also:
-
-
Constructor Details
-
GibbsReactorCO2
Creates a new GibbsReactorCO2 with the specified name.- Parameters:
name- the equipment name
-
GibbsReactorCO2
Creates a new GibbsReactorCO2 with the specified name and inlet stream.- Parameters:
name- the equipment nameinlet- the inlet stream
-
-
Method Details
-
run
In this method all thermodynamic and unit operations will be calculated in a steady state calculation.
- Parameters:
id- UUID
-
run
public void run() -
computeEquilibrium
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
Runs a single-stage reactor for systems with both NO2 and H2S.- Parameters:
inlet- the inlet stream- Returns:
- the outlet thermo system
-
runSingleReactorWithSO2Inert
Runs a single-stage reactor with SO2 set as inert.- Parameters:
inlet- the inlet stream- Returns:
- the outlet thermo system
-
runTwoStageOxidation
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 streamno2ppm- NO2 concentration in ppmh2sppm- H2S concentration in ppm (unused but kept for API consistency)- Returns:
- the outlet thermo system
-
createH2SReactor
Creates and configures a reactor for H2S oxidation (first stage).- Parameters:
inlet- the inlet streamno2ppm- NO2 concentration in ppm- Returns:
- configured H2S reactor
-
createSO2Reactor
Creates and configures a reactor for SO2 processing (second stage).- Parameters:
h2sOutlet- the outlet stream from the H2S reactor- Returns:
- configured SO2 reactor
-
createConfiguredReactor
Creates a GibbsReactor with standard configuration for acid gas systems.- Parameters:
name- the reactor nameinlet- the inlet stream- Returns:
- configured reactor with default settings and inert components
-
setDefaultInertComponents
Sets the default list of inert components on a reactor.- Parameters:
reactor- the reactor to configure
-
getComponentPpm
Gets the concentration of a component in ppm (parts per million).- Parameters:
stream- the stream to querycomponentName- the component name- Returns:
- concentration in ppm, or 0.0 if component not found
-
getComponentMoleFraction
Gets the mole fraction of a component in a stream.- Parameters:
stream- the stream to querycomponentName- 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
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
-