Skip to content

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

Gibbs Reactor (Reaktoro) in the example flowsheet

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

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.

public Reactor_ReaktoroGibbs()
Public Sub New()

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.
public Reactor_ReaktoroGibbs(string name, string description)
Public Sub New(name As String, description As String)

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.

public bool AqueousPhase { get; set; }
Public Property AqueousPhase As Boolean

ComponentDescription: Gets or sets the display description of this unit operation.

Gets or sets the display description of this unit operation.

public override string ComponentDescription { get; set; }
Public Overrides Property ComponentDescription As String

ComponentName: Gets or sets the display name of this unit operation.

Gets or sets the display name of this unit operation.

public override string ComponentName { get; set; }
Public Overrides Property ComponentName As String

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.

public Dictionary<string, double> CompoundConversions { get; set; }
Public Property CompoundConversions As Dictionary(Of String, Double)

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.

public Dictionary<string, string> CompoundNames { get; set; }
Public Property CompoundNames As Dictionary(Of String, String)

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.

public List<string> CompoundsList { get; set; }
Public Property CompoundsList As List(Of String)

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.

public string DatabaseName { get; set; }
Public Property DatabaseName As String

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.

public List<string> ElementsList { get; set; }
Public Property ElementsList As List(Of String)

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.

public string EmbeddedImageData { get; set; }
Public Property EmbeddedImageData As String

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.

public string ExternalDatabaseContents { get; set; }
Public Property ExternalDatabaseContents As String

ExternalDatabaseFileName: Gets or sets the file path to the external Reaktoro database.

Gets or sets the file path to the external Reaktoro database.

public string ExternalDatabaseFileName { get; set; }
Public Property ExternalDatabaseFileName As String

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.

public bool GaseousPhase { get; set; }
Public Property GaseousPhase As Boolean

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.

public override bool HasPropertiesForDynamicMode { get; }
Public Overrides ReadOnly Property HasPropertiesForDynamicMode As Boolean

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.

public bool LiquidPhase { get; set; }
Public Property LiquidPhase As Boolean

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.

public bool MineralPhase { get; set; }
Public Property MineralPhase As Boolean

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.

public override bool MobileCompatible { get; }
Public Overrides ReadOnly Property MobileCompatible As Boolean

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.

public Dictionary<string, string> SpeciesMaps { get; set; }
Public Property SpeciesMaps As Dictionary(Of String, String)

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.

public override bool SupportsDynamicMode { get; }
Public Overrides ReadOnly Property SupportsDynamicMode As Boolean

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.

public bool UseEmbeddedImage { get; set; }
Public Property UseEmbeddedImage As Boolean

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.

public bool UseExternalDatabase { get; set; }
Public Property UseExternalDatabase As Boolean

Methods

Calculate(object): Calculates the object.

Calculates the object.

Parameter Type Description
args Object
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy of this reactor via XML serialization.

Creates a deep copy of this reactor via XML serialization.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

CloseEditForm(): Closes and disposes the editing form.

Closes and disposes the editing form.

public override void CloseEditForm()
Public Overrides Sub CloseEditForm()

DeCalculate(): Clears the calculated results from the outlet material streams.

Clears the calculated results from the outlet material streams.

public override void DeCalculate()
Public Overrides Sub DeCalculate()

DisplayEditForm(): Opens or activates the editing form for this reactor.

Opens or activates the editing form for this reactor.

public override void DisplayEditForm()
Public Overrides Sub DisplayEditForm()

GetDisplayDescription(): Returns the display description for this unit operation.

Returns the display description for this unit operation.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the display name for this unit operation.

Returns the display name for this unit operation.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetEditingForm(): Returns the editing form instance for this reactor.

Returns the editing form instance for this reactor.

public override object GetEditingForm()
Public Overrides Function GetEditingForm() As Object

GetIconBitmapBytes(): Returns the icon bitmap as a byte array.

Returns the icon bitmap as a byte array.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

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.

public string GetListOfCompounds()
Public Function GetListOfCompounds() As String

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
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As 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
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

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
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

LoadData(List<XElement>): Restores the reactor state from XML.

Restores the reactor state from XML.

Parameter Type Description
data List<XElement>
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

PerformPostCalcValidation(): Performs post-calculation validation checks.

Performs post-calculation validation checks.

public override void PerformPostCalcValidation()
Public Overrides Sub PerformPostCalcValidation()

SaveData(): Serializes the reactor state to XML.

Serializes the reactor state to XML.

public override List<XElement> SaveData()
Public Overrides Function SaveData() As List(Of XElement)

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
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

UpdateEditForm(): Refreshes the editing form with updated data.

Refreshes the editing form with updated data.

public override void UpdateEditForm()
Public Overrides Sub UpdateEditForm()

Validate(): Validates that inlet and outlet streams are connected before calculation.

Validates that inlet and outlet streams are connected before calculation.

public override void Validate()
Public Overrides Sub Validate()

Fields

f: The classic (WinForms) editor window open for this reactor, if any.

The classic (WinForms) editor window open for this reactor, if any. Not saved with the flowsheet.

public object f
Public f As Object