Gibbs Reactor (Reaktoro)¶
![]()
Represents a Gibbs Reactor that uses the Reaktoro library to perform a Gibbs free-energy minimisation for geochemical and aqueous-phase equilibrium calculations. Supports aqueous, gaseous, liquid, and mineral phases.
DWSIM.UnitOperations.Reactors.Reactor_ReaktoroGibbs
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Reactor ← Reactor_ReaktoroGibbs
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Feed |
| Outlet, material | 0 |
Syngas |
| Outlet, energy | 1 |
Q |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("ReaktoroGibbsExample")
.WithCompounds("Methane", "Water", "Carbon monoxide", "Carbon dioxide", "Hydrogen")
.WithPropertyPackage(PropertyPackages.PengRobinson))
feed = (fs.AddMaterialStream("Feed")
.At(Q.Celsius(850.0), Q.Bar(15.0))
.WithMolarFlow(Q.MolPerSecond(4.0))
.SetCompoundMolarFlow("Methane", 1.0)
.SetCompoundMolarFlow("Water", 3.0))
syngas = fs.AddMaterialStream("Syngas")
heat = fs.AddEnergyStream("Q")
reformer = (fs.AddReaktoroGibbsReactor("R-1")
.WithDatabase("supcrtbl")
.WithAqueousPhase(False)) # gas phase only
rk = reformer.Object
rk.CreateConnectors() # the ports are otherwise created on the first draw
reformer.ConnectFeed(feed, 0).ConnectProduct(syngas, 0)
# the heat leaves on outlet port 1
reformer.ConnectEnergyProduct(heat, 1)
rk.GaseousPhase = True
for element in ("C", "H", "O"):
rk.ElementsList.Add(element)
# DWSIM compound -> Reaktoro substance (feed), and Reaktoro species -> DWSIM compound (products)
species = {"Methane": "CH4", "Water": "H2O", "Carbon monoxide": "CO",
"Carbon dioxide": "CO2", "Hydrogen": "H2"}
for compound, formula in species.items():
rk.CompoundsList.Add(compound)
rk.CompoundNames[compound] = formula
rk.SpeciesMaps[formula + "(g)"] = compound
fs.AutoLayout()
fs.Solve()
y = {c: syngas.OverallMoleFraction(c) for c in species}
print(f"CH4 conversion = {100.0 * rk.ComponentConversions['Methane']:.1f} %")
print(f"Syngas H2 / CO = {100.0 * y['Hydrogen']:.2f} / {100.0 * y['Carbon monoxide']:.2f} mol %")
print(f"Syngas CH4 = {100.0 * y['Methane']:.2f} mol %")
print(f"Syngas CO2 = {100.0 * y['Carbon dioxide']:.2f} mol %")
print(f"Heat of reaction = {-heat.EnergyFlowKW:.1f} kW absorbed (formation enthalpies at 25 C)")
Output
CH4 conversion = 89.0 %
Syngas H2 / CO = 51.66 / 9.95 mol %
Syngas CH4 = 1.90 mol %
Syngas CO2 = 5.45 mol %
Heat of reaction = 170.3 kW absorbed (formation enthalpies at 25 C)
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 |
|---|---|---|---|
Methane: Conversion |
% | result | |
Water: Conversion |
% | result |
Learn more¶
-
User guide
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
Reactor_ReaktoroGibbs(): Initializes a new default instance of the Reactor_ReaktoroGibbs class.
Initializes a new default instance of the Reactor_ReaktoroGibbs class.
Reactor_ReaktoroGibbs(string, string): Initializes a new instance of the Reactor_ReaktoroGibbs class with a name and description.
Initializes a new instance of the Reactor_ReaktoroGibbs class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the reactor. |
description |
String |
A brief description of the reactor. |
Properties¶
AqueousPhase: Gets or sets whether an aqueous phase is included in the Reaktoro system.
Gets or sets whether an aqueous phase is included in the Reaktoro system.
ComponentDescription: Gets or sets the display description of this unit operation.
Gets or sets the display description of this unit operation.
ComponentName: Gets or sets the display name of this unit operation.
Gets or sets the display name of this unit operation.
CompoundConversions: Gets or sets the dictionary of compound molar conversions calculated by the reactor.
Gets or sets the dictionary of compound molar conversions calculated by the reactor.
CompoundNames: Gets or sets a mapping from DWSIM compound names to Reaktoro species names.
Gets or sets a mapping from DWSIM compound names to Reaktoro species names.
CompoundsList: Gets or sets the list of Reaktoro species names participating in the equilibrium calculation.
Gets or sets the list of Reaktoro species names participating in the equilibrium calculation.
DatabaseName: Gets or sets the name of the Reaktoro thermodynamic database, e.g.
Gets or sets the name of the Reaktoro thermodynamic database, e.g. "supcrtbl". A name stored by an older version carries a file extension, which is dropped when the database is opened: Reaktoro 2 carries its databases embedded and names them without one. supcrtbl is the default: the H2O(g) of supcrt98/07/16 loses its heat capacity above about 1000 K, which pushes the gas-phase equilibrium constants off at reforming temperatures.
ElementsList: Gets or sets the list of chemical element symbols used for the elemental balance.
Gets or sets the list of chemical element symbols used for the elemental balance.
EmbeddedImageData: Gets or sets the Base64-encoded embedded image data for the custom icon.
Gets or sets the Base64-encoded embedded image data for the custom icon.
ExternalDatabaseContents: Gets or sets the full text contents of the external database file.
Gets or sets the full text contents of the external database file.
ExternalDatabaseFileName: Gets or sets the file path to the external Reaktoro database.
Gets or sets the file path to the external Reaktoro database.
GaseousPhase: Gets or sets whether a gaseous phase is included in the Reaktoro system.
Gets or sets whether a gaseous phase is included in the Reaktoro system.
HasPropertiesForDynamicMode: Gets a value indicating this reactor has no dedicated dynamic-mode properties.
Gets a value indicating this reactor has no dedicated dynamic-mode properties.
LiquidPhase: Gets or sets whether a liquid (non-aqueous) phase is included in the Reaktoro system.
Gets or sets whether a liquid (non-aqueous) phase is included in the Reaktoro system.
MineralPhase: Gets or sets whether mineral (solid) phases are included in the Reaktoro system.
Gets or sets whether mineral (solid) phases are included in the Reaktoro system.
MobileCompatible: Gets a value indicating this reactor is not compatible with mobile/cross-platform interfaces.
Gets a value indicating this reactor is not compatible with mobile/cross-platform interfaces.
SpeciesMaps: Gets or sets the mapping from Reaktoro species to DWSIM compounds for output processing.
Gets or sets the mapping from Reaktoro species to DWSIM compounds for output processing.
SupportsDynamicMode: Gets a value indicating this reactor does not support dynamic simulation mode.
Gets a value indicating this reactor does not support dynamic simulation mode.
UseEmbeddedImage: Gets or sets whether the embedded image is used for the unit operation icon.
Gets or sets whether the embedded image is used for the unit operation icon.
UseExternalDatabase: Gets or sets whether an external (user-supplied) database file is used instead of the built-in one.
Gets or sets whether an external (user-supplied) database file is used instead of the built-in one.
Methods¶
Calculate(object): Calculates the object.
Calculates the object.
| 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.
DeCalculate(): Clears the calculated results from the outlet material streams.
Clears the calculated results from the outlet material streams.
DisplayEditForm(): Opens or activates the editing form for this reactor.
Opens or activates the editing form for this reactor.
GetDisplayDescription(): Returns the display description for this unit operation.
Returns the display description for this unit operation.
GetDisplayName(): Returns the display name for this unit operation.
Returns the display name for this unit operation.
GetEditingForm(): Returns the editing form instance for this reactor.
Returns the editing form instance for this reactor.
GetIconBitmapBytes(): Returns the icon bitmap as a byte array.
Returns the icon bitmap as a byte array.
GetListOfCompounds(): Returns a newline-separated list of Reaktoro species names from the selected database.
Returns a newline-separated list of Reaktoro species names from the selected database.
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 |
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 |
LoadData(List<XElement>): Restores the reactor state from XML.
Restores the reactor state from XML.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
PerformPostCalcValidation(): Performs post-calculation validation checks.
Performs post-calculation validation checks.
SaveData(): Serializes the reactor state to XML.
Serializes the reactor state 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¶