Equilibrium Reactor¶
![]()
Represents an Equilibrium Reactor that determines product composition by minimising the Gibbs free energy along reaction-extent coordinates for a set of equilibrium-type reactions. Supports isothermal, adiabatic, and outlet-temperature operating modes.
DWSIM.UnitOperations.Reactors.Reactor_Equilibrium
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Reactor ← Reactor_Equilibrium
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Syngas |
| Inlet, energy | 1 |
Q |
| Outlet, material | 0 |
Shifted gas |
| Outlet, material | 1 |
Liquid |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("EquilibriumReactorExample")
.WithCompounds("Carbon monoxide", "Water", "Carbon dioxide", "Hydrogen")
.WithPropertyPackage(PropertyPackages.PengRobinson))
# CO + H2O <-> CO2 + H2, ln(Keq) = 4577.8/T - 4.33 on an activity basis in the vapor
stoich = Dictionary[String, Double]()
stoich["Carbon monoxide"] = -1.0
stoich["Water"] = -1.0
stoich["Carbon dioxide"] = 1.0
stoich["Hydrogen"] = 1.0
shift = fs.DefineEquilibriumReaction("WGS", stoich, "Carbon monoxide", "Vapor",
"Activity", "", "4577.8/T - 4.33")
fs.ReactionSet("Shift").Add(shift)
syngas = (fs.AddMaterialStream("Syngas")
.At(Q.Celsius(400.0), Q.Bar(20.0))
.WithMolarFlow(Q.MolPerSecond(10.0))
.SetCompoundMolarFlow("Carbon monoxide", 2.0)
.SetCompoundMolarFlow("Water", 4.0)
.SetCompoundMolarFlow("Carbon dioxide", 0.5)
.SetCompoundMolarFlow("Hydrogen", 3.5))
shifted = fs.AddMaterialStream("Shifted gas")
liquid = fs.AddMaterialStream("Liquid") # empty here, but the port must be connected
duty = fs.AddEnergyStream("Q")
reactor = (fs.AddEquilibriumReactor("R-1")
.Isothermal()
.WithReactionSet("Shift")
.WithPressureDrop(Q.Bar(0.0))
.ConnectFeed(syngas, 0)
.ConnectProduct(shifted, 0)
.ConnectProduct(liquid, 1)
.ConnectEnergyFeed(duty, 1))
fs.AutoLayout()
fs.Solve()
y = {c: shifted.OverallMoleFraction(c) for c in ("Carbon monoxide", "Water", "Carbon dioxide", "Hydrogen")}
k_calc = y["Carbon dioxide"] * y["Hydrogen"] / (y["Carbon monoxide"] * y["Water"])
print(f"CO conversion = {100.0 * reactor.Object.ComponentConversions['Carbon monoxide']:.1f} %")
print(f"Outlet CO = {100.0 * y['Carbon monoxide']:.2f} mol %")
print(f"Outlet H2 = {100.0 * y['Hydrogen']:.2f} mol %")
print(f"Keq from outlet = {k_calc:.2f} (correlation: {math.exp(4577.8 / 673.15 - 4.33):.2f})")
print(f"Heat removed = {-reactor.HeatDutyKW:.1f} kW")
Output
CO conversion = 80.8 %
Outlet CO = 3.84 mol %
Outlet H2 = 51.16 mol %
Keq from outlet = 11.85 (correlation: 11.83)
Heat removed = 61.1 kW
DWSIM 10.2.11.0, generated 2026-10-08.
Properties¶
IDs accepted by GetPropertyValue, SetPropertyValue, the sensitivity analysis, the optimizer, the Adjust block and dynamic events. Units are SI; pass another unit system to GetPropertyValue to get them converted.
| ID | Name | Unit (SI) | Input |
|---|---|---|---|
PROP_EQ_0 |
Pressure Drop | Pa | yes |
PROP_EQ_1 |
Outlet Temperature | K | yes |
Calculation Mode |
Select the calculation mode of this reactor. | result | |
Initial Gibbs Energy |
kW | result | |
Final Gibbs Energy |
kW | result | |
Carbon monoxide: Conversion |
% | result | |
Water: Conversion |
% | result | |
Carbon dioxide: Conversion |
% | result | |
Hydrogen: Conversion |
% | result | |
WGS: Extent |
mol/s | result |
Dynamic mode¶
Extra properties used when the flowsheet runs in dynamic mode.
| Name | Unit |
|---|---|
| Operating Pressure (Dynamics) | Pa |
| Liquid Level | m |
| Volume | m3 |
| Height | m |
| Minimum Pressure | Pa |
| Initialize using Inlet Stream | |
| Reset Contents |
Learn more¶
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
Reactor_Equilibrium(): Initializes a new default instance of the Reactor_Equilibrium class.
Initializes a new default instance of the Reactor_Equilibrium class.
Reactor_Equilibrium(string, string): Initializes a new instance of the Reactor_Equilibrium class with a name and description.
Initializes a new instance of the Reactor_Equilibrium class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the equilibrium reactor. |
description |
String |
A brief description of the equilibrium reactor. |
Properties¶
ComponentIDs: Gets or sets the list of compound IDs participating in the equilibrium reactions.
Gets or sets the list of compound IDs participating in the equilibrium reactions.
ExternalLoopMaximumIterations: Gets or sets the maximum number of iterations for the outer energy-balance loop.
Gets or sets the maximum number of iterations for the outer energy-balance loop.
ExternalLoopTolerance: Gets or sets the convergence tolerance for the outer (energy-balance) iteration loop.
Gets or sets the convergence tolerance for the outer (energy-balance) iteration loop.
FinalGibbsEnergy: Gets or sets the final total Gibbs free energy of the system (kJ/mol) after reaction.
Gets or sets the final total Gibbs free energy of the system (kJ/mol) after reaction.
HasPropertiesForDynamicMode: Gets a value indicating whether this reactor exposes dedicated dynamic-mode properties.
Gets a value indicating whether this reactor exposes dedicated dynamic-mode properties.
InitialGibbsEnergy: Gets or sets the initial total Gibbs free energy of the system (kJ/mol) before reaction.
Gets or sets the initial total Gibbs free energy of the system (kJ/mol) before reaction.
InternalLoopMaximumIterations: Gets or sets the maximum number of iterations for the inner optimisation loop.
Gets or sets the maximum number of iterations for the inner optimisation loop.
InternalLoopTolerance: Gets or sets the convergence tolerance for the inner (reaction-extent) optimisation loop.
Gets or sets the convergence tolerance for the inner (reaction-extent) optimisation loop.
MobileCompatible: Gets a value indicating whether this reactor is compatible with mobile/cross-platform interfaces.
Gets a value indicating whether this reactor is compatible with mobile/cross-platform interfaces.
PreviousReactionExtents: Gets or sets the dictionary of reaction extents from the previous iteration, used for warm-starting.
Gets or sets the dictionary of reaction extents from the previous iteration, used for warm-starting.
ReactionExtents: Gets or sets the dictionary of calculated reaction extents, keyed by reaction ID.
Gets or sets the dictionary of calculated reaction extents, keyed by reaction ID.
SupportsDynamicMode: Gets a value indicating whether this reactor supports dynamic simulation mode.
Gets a value indicating whether this reactor supports dynamic simulation mode.
UseIPOPTSolver: Gets or sets whether the IPOPT solver is used for the optimisation (otherwise a simplex method is used).
Gets or sets whether the IPOPT solver is used for the optimisation (otherwise a simplex method is used).
UsePreviousSolution: Gets or sets whether the solver uses the previous solution as a starting point.
Gets or sets whether the solver uses the previous solution as a starting point.
Methods¶
Calculate(object): Calculates the object.
Calculates the object.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Calculate_Internal(object): Internal solver that minimises Gibbs energy using IPOPT or simplex to find the equilibrium extents.
Internal solver that minimises Gibbs energy using IPOPT or simplex to find the equilibrium extents.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Calculate_Internal_Old(object): Legacy internal solver method retained for backward compatibility.
Legacy internal solver method retained for backward compatibility.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Calculate_Relaxation(object): Solves the equilibrium reactions using a successive-relaxation approach, processing reactions one at a time.
Solves the equilibrium reactions using a successive-relaxation approach, processing reactions one at a time.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
CloneXML(): Creates a deep copy of this reactor via XML serialization.
Creates a deep copy of this reactor via XML serialization.
CloseEditForm(): Closes and disposes the editing form.
Closes and disposes the editing form.
CreateDynamicProperties(): Registers the dynamic properties for dynamic simulation mode.
Registers the dynamic properties for dynamic simulation mode.
DeCalculate(): Clears the calculated results from the outlet material streams.
Clears the calculated results from the outlet material streams.
DisplayDynamicsEditForm(): Opens or activates the dynamics property editor form for this reactor.
Opens or activates the dynamics property editor form for this reactor.
DisplayEditForm(): Opens or activates the editing form for this reactor.
Opens or activates the editing form for this reactor.
GetDisplayDescription(): Returns the localised display description for this reactor.
Returns the localised display description for this reactor.
GetDisplayName(): Returns the localised display name for this reactor.
Returns the localised display name for this reactor.
GetIconBitmapBytes(): Returns the icon bitmap as a byte array.
Returns the icon bitmap as a byte array.
GetProperties(PropertyType): Returns an array of property identifiers for the specified property type.
Returns an array of property identifiers for the specified property type.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
GetPropertyDescription(string): Returns a human-readable description of the specified property.
Returns a human-readable description of the specified property.
| Parameter | Type | Description |
|---|---|---|
p |
String |
GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property.
Returns the unit string for the specified property.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
su |
IUnitsOfMeasure |
GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property, converted to the given unit system.
Returns the value of the specified property, converted to the given unit system.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
su |
IUnitsOfMeasure |
GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text report of the reactor results using the specified units and format.
Generates a plain-text report of the reactor results using the specified units and format.
| Parameter | Type | Description |
|---|---|---|
su |
IUnitsOfMeasure |
|
ci |
CultureInfo |
|
numberformat |
String |
GetStructuredReport(): Generates a structured report of the reactor results as a list of typed tuples.
Generates a structured report of the reactor results as a list of typed tuples.
LoadData(List<XElement>): Restores the reactor state, including reaction extents and component IDs, from XML.
Restores the reactor state, including reaction extents and component IDs, from XML.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
RunDynamicModel(): Executes one dynamic simulation time step for the equilibrium reactor.
Executes one dynamic simulation time step for the equilibrium reactor.
SaveData(): Serializes the reactor state, including reaction extents and component IDs, to XML.
Serializes the reactor state, including reaction extents and component IDs, to XML.
SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property from the given value and unit system.
Sets the value of the specified property from the given value and unit system.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
propval |
Object |
|
su |
IUnitsOfMeasure |
UpdateEditForm(): Refreshes the editing form with updated data.
Refreshes the editing form with updated data.
Validate(): Validates that inlet and outlet streams are connected before calculation.
Validates that inlet and outlet streams are connected before calculation.
Fields¶