Class StoichiometricReaction

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

public class StoichiometricReaction extends Object implements Serializable
Simple stoichiometric reaction model for bio-processing.

Defines a reaction by listing reactant and product stoichiometric coefficients, a limiting reactant, and a fractional conversion (X). This provides a straightforward way to model fermentation, enzymatic hydrolysis, and other bio-chemical conversions without requiring full Gibbs minimization.

Usage example:

// Glucose fermentation to ethanol
StoichiometricReaction rxn = new StoichiometricReaction("EthanolFermentation");
rxn.addReactant("glucose", 1.0);
rxn.addProduct("ethanol", 2.0);
rxn.addProduct("CO2", 2.0);
rxn.setLimitingReactant("glucose");
rxn.setConversion(0.90); // 90% conversion

// Apply to a thermo system
rxn.react(system);
Version:
1.0
Author:
NeqSim team
See Also:
  • Field Details

    • serialVersionUID

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

      private String name
      Name of this reaction.
    • stoichiometry

      private Map<String,Double> stoichiometry
      Stoichiometric coefficients keyed by component name. Negative for reactants.
    • limitingReactant

      private String limitingReactant
      Name of the limiting reactant component.
    • conversion

      private double conversion
      Fractional conversion of the limiting reactant (0.0 to 1.0).
    • molarBasis

      private boolean molarBasis
      Whether the reaction is on a molar (true) or mass (false) basis.
  • Constructor Details

    • StoichiometricReaction

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

    • addReactant

      public void addReactant(String componentName, double coefficient)
      Add a reactant to this reaction.
      Parameters:
      componentName - name matching NeqSim component database
      coefficient - positive stoichiometric coefficient (will be stored as negative internally)
    • addProduct

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

      public void setLimitingReactant(String componentName)
      Set the limiting reactant by component name.
      Parameters:
      componentName - name of limited reactant
    • getLimitingReactant

      public String getLimitingReactant()
      Get the limiting reactant name.
      Returns:
      limiting reactant
    • setConversion

      public void setConversion(double conversion)
      Set fractional conversion of the limiting reactant.
      Parameters:
      conversion - value between 0.0 and 1.0
    • getConversion

      public double getConversion()
      Get the fractional conversion.
      Returns:
      conversion value
    • setMolarBasis

      public void setMolarBasis(boolean molarBasis)
      Set whether this reaction is on a molar basis (default) or mass basis.
      Parameters:
      molarBasis - true for molar, false for mass
    • isMolarBasis

      public boolean isMolarBasis()
      Check if reaction is molar-based.
      Returns:
      true if molar basis
    • getStoichiometry

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

      public String getName()
      Get the reaction name.
      Returns:
      reaction name
    • react

      public double react(SystemInterface system)
      Apply this reaction to the given thermodynamic system.

      Computes moles reacted based on limiting reactant amount and conversion, then adjusts all component mole counts according to stoichiometry.

      Parameters:
      system - the thermodynamic system to react
      Returns:
      moles of limiting reactant consumed
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • join

      private static String join(List<String> parts, String delimiter)
      Join strings with a delimiter (Java 8 compatible).
      Parameters:
      parts - list of strings
      delimiter - the delimiter
      Returns:
      joined string