Class KineticReaction

java.lang.Object
neqsim.process.equipment.reactor.KineticReaction
All Implemented Interfaces:
Serializable

public class KineticReaction extends Object implements Serializable
General kinetic reaction model for plug flow and stirred tank reactors.

Supports power-law, Langmuir-Hinshelwood-Hougen-Watson (LHHW), and reversible equilibrium rate expressions with Arrhenius temperature dependence. Reaction stoichiometry and kinetic parameters are defined independently, allowing flexible modeling of homogeneous and heterogeneous catalytic reactions.

The rate constant follows the modified Arrhenius form:

k(T) = A * T^n * exp(-Ea / (R*T))

For power-law kinetics the volumetric rate is:

r = k(T) * prod(Ci^alpha_i) for irreversible reactions

r = k(T) * [prod(Ci^alpha_i) - prod(Cj^beta_j) / Keq(T)] for reversible reactions

For LHHW kinetics:

r = k(T) * (driving force) / (adsorption term)^m

Usage example:

KineticReaction rxn = new KineticReaction("NH3 synthesis");
rxn.setRateType(KineticReaction.RateType.POWER_LAW);
rxn.addReactant("nitrogen", 1, 1.0);
rxn.addReactant("hydrogen", 3, 1.5);
rxn.addProduct("ammonia", 2);
rxn.setPreExponentialFactor(8.849e14);
rxn.setActivationEnergy(170000.0);
rxn.setHeatOfReaction(-92400.0);
Version:
1.0
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
    • R_GAS

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

      private String name
      Name of this reaction.
    • rateType

      private KineticReaction.RateType rateType
      Rate expression type.
    • rateBasis

      private KineticReaction.RateBasis rateBasis
      Rate basis.
    • stoichiometry

      private Map<String,Double> stoichiometry
      Stoichiometric coefficients: negative for reactants, positive for products.
    • reactionOrders

      private Map<String,Double> reactionOrders
      Reaction orders (kinetic exponents) for reactants.
    • productOrders

      private Map<String,Double> productOrders
      Reaction orders for products (used in reversible reactions).
    • preExponentialFactor

      private double preExponentialFactor
      Pre-exponential factor A in rate constant [units depend on rate law and basis].
    • activationEnergy

      private double activationEnergy
      Activation energy Ea [J/mol].
    • temperatureExponent

      private double temperatureExponent
      Temperature exponent n in modified Arrhenius k = A * T^n * exp(-Ea/RT).
    • heatOfReaction

      private double heatOfReaction
      Heat of reaction [J/mol] based on stoichiometry of first reactant. Negative = exothermic.
    • reversible

      private boolean reversible
      Whether the reaction is reversible.
    • eqCoeffs

      private double[] eqCoeffs
      Equilibrium constant correlation coefficients. ln(Keq) = eqCoeffs[0] + eqCoeffs[1]/T + eqCoeffs[2]*ln(T) + eqCoeffs[3]*T.
    • adsorptionTerms

      private Map<String,double[]> adsorptionTerms
      LHHW adsorption terms: component name to [Ki, adsorption order].
    • adsorptionExponent

      private int adsorptionExponent
      LHHW adsorption exponent m (denominator raised to power m).
    • adsorptionPreExpFactor

      private double adsorptionPreExpFactor
      LHHW adsorption pre-exponential factor.
    • adsorptionActivationEnergy

      private double adsorptionActivationEnergy
      LHHW adsorption activation energy [J/mol].
  • Constructor Details

    • KineticReaction

      public KineticReaction(String name)
      Constructor for KineticReaction.
      Parameters:
      name - the reaction name
  • Method Details

    • addReactant

      public void addReactant(String componentName, double stoichCoeff, double order)
      Add a reactant with stoichiometric coefficient and reaction order.
      Parameters:
      componentName - component name matching NeqSim database
      stoichCoeff - positive stoichiometric coefficient (stored internally as negative)
      order - kinetic order for this species in the rate expression
    • addProduct

      public void addProduct(String componentName, double stoichCoeff)
      Add a product with stoichiometric coefficient.
      Parameters:
      componentName - component name matching NeqSim database
      stoichCoeff - positive stoichiometric coefficient
    • addProduct

      public void addProduct(String componentName, double stoichCoeff, double reverseOrder)
      Add a product with stoichiometric coefficient and reverse reaction order.
      Parameters:
      componentName - component name matching NeqSim database
      stoichCoeff - positive stoichiometric coefficient
      reverseOrder - kinetic order in reverse rate expression (for reversible reactions)
    • calculateRate

      public double calculateRate(SystemInterface system, int phaseIndex)
      Calculate the reaction rate at given conditions.

      For POWER_LAW: r = k(T) * prod(Ci^alpha_i) [- prod(Cj^beta_j)/Keq(T) if reversible]

      For LHHW: r = k(T) * drivingForce / (adsorptionTerm)^m

      Parameters:
      system - the thermodynamic system with current T, P, composition
      phaseIndex - phase to evaluate concentrations in (0=combined, typically 0 or gas phase)
      Returns:
      reaction rate in units consistent with rateBasis
    • calculateRateConstant

      public double calculateRateConstant(double temperature)
      Calculate the Arrhenius rate constant at given temperature.

      k(T) = A * T^n * exp(-Ea / (R*T))

      Parameters:
      temperature - temperature in Kelvin
      Returns:
      rate constant k(T)
    • calculateEquilibriumConstant

      public double calculateEquilibriumConstant(double temperature)
      Calculate the equilibrium constant at given temperature.

      ln(Keq) = a + b/T + c*ln(T) + d*T

      Parameters:
      temperature - temperature in Kelvin
      Returns:
      equilibrium constant Keq
    • calculatePowerLawRate

      private double calculatePowerLawRate(SystemInterface system, int phaseIndex, double rateConstant, double temperature)
      Calculate power-law rate.
      Parameters:
      system - thermodynamic system
      phaseIndex - phase index
      rateConstant - pre-calculated k(T)
      temperature - temperature [K]
      Returns:
      rate [units per rateBasis]
    • calculateLHHWRate

      private double calculateLHHWRate(SystemInterface system, int phaseIndex, double rateConstant, double temperature)
      Calculate LHHW rate.
      Parameters:
      system - thermodynamic system
      phaseIndex - phase index
      rateConstant - pre-calculated k(T)
      temperature - temperature [K]
      Returns:
      LHHW rate
    • getConcentration

      private double getConcentration(SystemInterface system, int phaseIndex, String componentName)
      Get molar concentration of a component in the specified phase.
      Parameters:
      system - thermodynamic system
      phaseIndex - phase index
      componentName - component name
      Returns:
      concentration in mol/m3
    • getStoichiometricCoefficient

      public double getStoichiometricCoefficient(String componentName)
      Get the stoichiometric coefficient for a component.
      Parameters:
      componentName - component name
      Returns:
      stoichiometric coefficient (negative for reactants, positive for products)
    • getStoichiometry

      public Map<String,Double> getStoichiometry()
      Get the stoichiometry map.
      Returns:
      map of component name to stoichiometric coefficient
    • getName

      public String getName()
      Get the name of this reaction.
      Returns:
      reaction name
    • setRateType

      public void setRateType(KineticReaction.RateType rateType)
      Set the rate expression type.
      Parameters:
      rateType - POWER_LAW, LHHW, or EQUILIBRIUM
    • getRateType

      public KineticReaction.RateType getRateType()
      Get the rate expression type.
      Returns:
      rate type
    • setRateBasis

      public void setRateBasis(KineticReaction.RateBasis rateBasis)
      Set the rate basis.
      Parameters:
      rateBasis - VOLUME, CATALYST_MASS, or CATALYST_AREA
    • getRateBasis

      public KineticReaction.RateBasis getRateBasis()
      Get the rate basis.
      Returns:
      rate basis
    • setPreExponentialFactor

      public void setPreExponentialFactor(double preExponentialFactor)
      Set the pre-exponential factor A.
      Parameters:
      preExponentialFactor - A in k = A*T^n*exp(-Ea/RT)
    • getPreExponentialFactor

      public double getPreExponentialFactor()
      Get the pre-exponential factor.
      Returns:
      A
    • setActivationEnergy

      public void setActivationEnergy(double activationEnergy)
      Set the activation energy.
      Parameters:
      activationEnergy - Ea in J/mol
    • getActivationEnergy

      public double getActivationEnergy()
      Get the activation energy.
      Returns:
      Ea [J/mol]
    • setTemperatureExponent

      public void setTemperatureExponent(double temperatureExponent)
      Set the temperature exponent for modified Arrhenius.
      Parameters:
      temperatureExponent - n in k = A*T^n*exp(-Ea/RT)
    • getTemperatureExponent

      public double getTemperatureExponent()
      Get the temperature exponent.
      Returns:
      n
    • setHeatOfReaction

      public void setHeatOfReaction(double heatOfReaction)
      Set the heat of reaction.
      Parameters:
      heatOfReaction - delta H_rxn in J/mol (negative = exothermic)
    • getHeatOfReaction

      public double getHeatOfReaction()
      Get the heat of reaction.
      Returns:
      delta H_rxn [J/mol]
    • setReversible

      public void setReversible(boolean reversible)
      Set whether the reaction is reversible.
      Parameters:
      reversible - true for reversible reaction
    • isReversible

      public boolean isReversible()
      Check if reaction is reversible.
      Returns:
      true if reversible
    • setEquilibriumConstantCorrelation

      public void setEquilibriumConstantCorrelation(double a, double b, double c, double d)
      Set equilibrium constant correlation coefficients.

      ln(Keq) = a + b/T + c*ln(T) + d*T

      Parameters:
      a - constant term
      b - coefficient for 1/T
      c - coefficient for ln(T)
      d - coefficient for T
    • addAdsorptionTerm

      public void addAdsorptionTerm(String componentName, double kiFactor, double adsorptionOrder)
      Add an LHHW adsorption term for a component.
      Parameters:
      componentName - component name
      kiFactor - relative adsorption constant factor
      adsorptionOrder - adsorption concentration order
    • setAdsorptionExponent

      public void setAdsorptionExponent(int exponent)
      Set the LHHW adsorption exponent.
      Parameters:
      exponent - power m for denominator (adsorption term)^m
    • setAdsorptionPreExpFactor

      public void setAdsorptionPreExpFactor(double factor)
      Set the LHHW adsorption pre-exponential factor.
      Parameters:
      factor - pre-exponential factor for adsorption constant
    • setAdsorptionActivationEnergy

      public void setAdsorptionActivationEnergy(double energy)
      Set the LHHW adsorption activation energy.
      Parameters:
      energy - activation energy for adsorption [J/mol]
    • getAdsorptionExponent

      public int getAdsorptionExponent()
      Get the adsorption exponent.
      Returns:
      m