Skip to content

Conversion Reactor

Represents a Conversion Reactor that calculates product composition from a set of conversion-type reactions with user-specified fractional conversions. Reactions are processed sequentially (by rank) and in parallel within each rank.

DWSIM.UnitOperations.Reactors.Reactor_Conversion
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Reactor ← Reactor_Conversion

At a glance

Conversion Reactor in the example flowsheet

Port Index Connected in the example
Inlet, material 0 Fuel + air
Inlet, energy 1 Q
Outlet, material 0 Flue gas
Outlet, material 1 Liquid
Outlet, energy 2

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("ConversionReactorExample")
      .WithCompounds("Methane", "Oxygen", "Nitrogen", "Carbon dioxide", "Water")
      .WithPropertyPackage(PropertyPackages.PengRobinson))

# CH4 + 2 O2 -> CO2 + 2 H2O, methane fully converted
stoich = Dictionary[String, Double]()
stoich["Methane"] = -1.0
stoich["Oxygen"] = -2.0
stoich["Carbon dioxide"] = 1.0
stoich["Water"] = 2.0
combustion = fs.DefineConversionReaction("Combustion", stoich, "Methane", "Vapor", "100")
fs.ReactionSet("Burner").Add(combustion)

feed = (fs.AddMaterialStream("Fuel + air")
        .At(Q.Celsius(25.0), Q.Bar(1.01325))
        .WithMolarFlow(Q.MolPerSecond(15.28))
        .SetCompoundMolarFlow("Methane", 1.0)
        .SetCompoundMolarFlow("Oxygen", 3.0)
        .SetCompoundMolarFlow("Nitrogen", 11.28))
flue_gas = fs.AddMaterialStream("Flue gas")
liquid = fs.AddMaterialStream("Liquid")          # empty here, but the port must be connected
duty = fs.AddEnergyStream("Q")

reactor = (fs.AddConversionReactor("R-1")
           .Adiabatic()
           .WithReactionSet("Burner")
           .WithPressureDrop(Q.Bar(0.0))
           .ConnectFeed(feed, 0)
           .ConnectProduct(flue_gas, 0)
           .ConnectProduct(liquid, 1)
           .ConnectEnergyFeed(duty, 1))

fs.AutoLayout()
fs.Solve()

print(f"Methane conversion   = {100.0 * reactor.Object.ComponentConversions['Methane']:.1f} %")
print(f"Adiabatic outlet T   = {flue_gas.TemperatureK:.0f} K")
print(f"Flue gas CO2         = {100.0 * flue_gas.OverallMoleFraction('Carbon dioxide'):.2f} mol %")
print(f"Flue gas O2          = {100.0 * flue_gas.OverallMoleFraction('Oxygen'):.2f} mol %")
print(f"Flue gas H2O         = {100.0 * flue_gas.OverallMoleFraction('Water'):.2f} mol %")

Output

Methane conversion   = 100.0 %
Adiabatic outlet T   = 1790 K
Flue gas CO2         = 6.54 mol %
Flue gas O2          = 6.54 mol %
Flue gas H2O         = 13.09 mol %

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_CR_0 Pressure Drop Pa yes
Calculation Mode Select the calculation mode of this reactor. result
Combustion: Extent % result
Methane: Conversion % result
Oxygen: Conversion % result
Nitrogen: Conversion % result
Carbon dioxide: Conversion % result
Water: Conversion % 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_Conversion(): Initializes a new default instance of the Reactor_Conversion class.

Initializes a new default instance of the Reactor_Conversion class.

public Reactor_Conversion()
Public Sub New()

Reactor_Conversion(string, string): Initializes a new instance of the Reactor_Conversion class with a name and description.

Initializes a new instance of the Reactor_Conversion class with a name and description.

Parameter Type Description
name String The display name of the conversion reactor.
description String A brief description of the conversion reactor.
public Reactor_Conversion(string name, string description)
Public Sub New(name As String, description As String)

Properties

HasPropertiesForDynamicMode: Gets a value indicating whether this reactor has no dedicated dynamic-mode properties.

Gets a value indicating whether this reactor has no dedicated dynamic-mode properties.

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

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.

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

SupportsDynamicMode: Gets a value indicating whether this reactor supports dynamic simulation mode.

Gets a value indicating whether this reactor supports dynamic simulation mode.

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

Methods

Calculate(object): Performs the conversion reactor calculation: applies each conversion reaction in sequence, computes the product...

Performs the conversion reactor calculation: applies each conversion reaction in sequence, computes the product composition and energy balance, and flashes the outlet stream.

Parameter Type Description
args Object Optional. If True, indicates a dynamic-mode call.
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()

CreateDynamicProperties(): Registers the dynamic properties (operating pressure, liquid level, volume, etc.) for dynamic simulation mode.

Registers the dynamic properties (operating pressure, liquid level, volume, etc.) for dynamic simulation mode.

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

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()

DisplayDynamicsEditForm(): Opens or activates the dynamics property editor form for this reactor.

Opens or activates the dynamics property editor form for this reactor.

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

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

Opens or activates the editing form for this conversion reactor.

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

GetDisplayDescription(): Returns the localised display description for this reactor.

Returns the localised display description for this reactor.

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

GetDisplayName(): Returns the localised display name for this reactor.

Returns the localised display name for this reactor.

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

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()

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()

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
public override string GetPropertyDescription(string p)
Public Overrides Function GetPropertyDescription(p As String) 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

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
public override string GetReport(IUnitsOfMeasure su, CultureInfo ci, string numberformat)
Public Overrides Function GetReport(su As IUnitsOfMeasure, ci As CultureInfo, numberformat As String) As 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.

public override List<Tuple<ReportItemType, string[]>> GetStructuredReport()
Public Overrides Function GetStructuredReport() As List(Of Tuple(Of ReportItemType, String()))

RunDynamicModel(): Executes one dynamic simulation time step, integrating mass flows and updating accumulation.

Executes one dynamic simulation time step, integrating mass flows and updating accumulation.

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

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