Class StoichiometricReaction
java.lang.Object
neqsim.process.equipment.reactor.StoichiometricReaction
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate doubleFractional conversion of the limiting reactant (0.0 to 1.0).private StringName of the limiting reactant component.private booleanWhether the reaction is on a molar (true) or mass (false) basis.private StringName of this reaction.private static final longSerialization version UID.Stoichiometric coefficients keyed by component name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProduct(String componentName, double coefficient) Add a product to this reaction.voidaddReactant(String componentName, double coefficient) Add a reactant to this reaction.doubleGet the fractional conversion.Get the limiting reactant name.getName()Get the reaction name.Get the stoichiometry map.booleanCheck if reaction is molar-based.private static StringJoin strings with a delimiter (Java 8 compatible).doublereact(SystemInterface system) Apply this reaction to the given thermodynamic system.voidsetConversion(double conversion) Set fractional conversion of the limiting reactant.voidsetLimitingReactant(String componentName) Set the limiting reactant by component name.voidsetMolarBasis(boolean molarBasis) Set whether this reaction is on a molar basis (default) or mass basis.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerialization version UID.- See Also:
-
name
Name of this reaction. -
stoichiometry
-
limitingReactant
Name of the limiting reactant component. -
conversion
private double conversionFractional conversion of the limiting reactant (0.0 to 1.0). -
molarBasis
private boolean molarBasisWhether the reaction is on a molar (true) or mass (false) basis.
-
-
Constructor Details
-
StoichiometricReaction
Constructor for StoichiometricReaction.- Parameters:
name- the reaction name
-
-
Method Details
-
addReactant
Add a reactant to this reaction.- Parameters:
componentName- name matching NeqSim component databasecoefficient- positive stoichiometric coefficient (will be stored as negative internally)
-
addProduct
Add a product to this reaction.- Parameters:
componentName- name matching NeqSim component databasecoefficient- positive stoichiometric coefficient
-
setLimitingReactant
Set the limiting reactant by component name.- Parameters:
componentName- name of limited reactant
-
getLimitingReactant
-
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
-
getName
-
react
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
-
join
-