Skip to content

Plug Flow Reactor (PFR)

Represents a Plug Flow Reactor (PFR) that integrates kinetic, heterogeneous catalytic, and conversion reactions along the reactor length using an ODE solver. Temperature, pressure, and composition profiles are computed section by section.

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

At a glance

Plug Flow Reactor (PFR) in the example flowsheet

Port Index Connected in the example
Inlet, material 0 Ethane
Inlet, energy 1 Q
Inlet, material 2
Outlet, material 0 Cracked gas
Outlet, material 1

Example

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

fs = (Flowsheet.Create("PFRExample")
      .WithCompounds("Ethane", "Ethylene", "Hydrogen")
      .WithPropertyPackage(PropertyPackages.PengRobinson))

# C2H6 -> C2H4 + H2, first order: k = 0.072 1/s at 1000 K, E = 82 kcal/mol
E = 82000.0 * 4.184                                     # J/mol
A = 0.072 * math.exp(E / (8.314 * 1000.0))              # 1/s
cracking = fs.DefineKineticReaction(
    "Cracking",
    coefficients({"Ethane": -1, "Ethylene": 1, "Hydrogen": 1}),
    coefficients({"Ethane": 1, "Ethylene": 0, "Hydrogen": 0}),      # forward orders
    coefficients({"Ethane": 0, "Ethylene": 0, "Hydrogen": 0}),      # reverse orders
    "Ethane", "Vapor", "Molar Concentration", "mol/m3", "mol/[m3.s]", A, E)
fs.ReactionSet("Cracking").Add(cracking)

feed = (fs.AddMaterialStream("Ethane")
        .At(Q.Kelvin(1100.0), Q.Bar(6.0 * 1.01325))
        .WithMolarFlow(Q.MolPerSecond(10.0))
        .SetCompoundMolarFlow("Ethane", 10.0))
product = fs.AddMaterialStream("Cracked gas")
duty = fs.AddEnergyStream("Q")

reactor = (fs.AddPFR("R-1")
           .Isothermal()
           .WithReactionSet("Cracking")
           .WithVolume(Q.CubicMeters(0.12))
           .ConnectFeed(feed, 0)
           .ConnectProduct(product, 0)
           .ConnectEnergyFeed(duty, 1))
reactor.Object.Length = 10.0                            # m; the diameter follows from the volume

fs.AutoLayout()
fs.Solve()

# isothermal, isobaric design equation with volume change (epsilon = 1)
X = reactor.Object.ComponentConversions["Ethane"]
k = A * math.exp(-E / (8.314 * 1100.0))
c0 = feed.PressurePa / (8.314 * 1100.0)
v_hand = 10.0 / (k * c0) * (2.0 * math.log(1.0 / (1.0 - X)) - X)
print(f"Ethane conversion    = {100.0 * X:.1f} %")
print(f"Ethylene produced    = {product.MolarFlowMolPerSecond * product.OverallMoleFraction('Ethylene'):.2f} mol/s")
print(f"Volume for this X    = {v_hand:.4f} m3 by hand (reactor: 0.12 m3)")
print(f"Residence time       = {reactor.Object.ResidenceTime:.3f} s")
print(f"Heat supplied        = {reactor.HeatDutyKW:.0f} kW")

Output

Ethane conversion    = 80.1 %
Ethylene produced    = 8.01 mol/s
Volume for this X    = 0.1190 m3 by hand (reactor: 0.12 m3)
Residence time       = 0.796 s
Heat supplied        = 1151 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.

All 42 properties
ID Name Unit (SI) Input
PROP_PF_0 Pressure Drop Pa yes
PROP_PF_1 Residence time s yes
PROP_PF_2 Volume m3 yes
PROP_PF_3 Tube Length m yes
PROP_PF_4 Catalyst loading kg/m3 yes
PROP_PF_5 Catalyst diameter mm yes
PROP_PF_6 Catalyst void fraction yes
PROP_PF_7 Temperature delta K (difference) yes
PROP_PF_8 Heat load kW yes
PROP_PF_9 Tube Diameter mm yes
PROP_PF_10 Number of Tubes yes
PROP_PF_11 Integration Step yes
PROP_PF_12 Outlet Temperature K yes
PROP_PF_13 Overall Heat Transfer Coefficient W/m2.K yes
PROP_PF_14 Heat Exchange Area m2 yes
PROP_PF_15 Coolant Inlet Temperature K yes
PROP_PF_16 Coolant Mass Flow Rate kg/s yes
PROP_PF_17 Coolant Specific Heat J/kg.K yes
PROP_PF_18 Coolant Flow Direction yes
PROP_PF_19 Area Calculation Mode yes
PROP_PF_20 Use Utility Stream yes
PROP_PF_21 Wall Thickness m yes
PROP_PF_22 Internal Heat Transfer Coefficient W/m2.K yes
PROP_PF_23 External Heat Transfer Coefficient W/m2.K yes
PROP_PF_24 Use Wall Properties yes
PROP_PF_25 Calculated Overall HTC W/m2.K yes
PROP_PF_26 Calculate Internal HTC yes
PROP_PF_27 Calculate External HTC yes
PROP_PF_28 Jacket Diameter mm yes
PROP_PF_29 Coolant Density kg/m3 yes
PROP_PF_30 Coolant Viscosity Pa.s yes
PROP_PF_31 Coolant Thermal Conductivity W/m.K yes
PROP_PF_32 Calculated Internal HTC W/m2.K yes
PROP_PF_33 Calculated External HTC W/m2.K yes
PROP_PF_34 Catalyst Particle Sphericity yes
Calculation Mode Select the calculation mode of this reactor. result
Ethane: Conversion % result
Ethylene: Conversion % result
Hydrogen: Conversion % result
Cracking: Reaction Extent mol/s result
Cracking: Reaction Rate mol/[m3.s] result
Cracking: Reaction Heat kW result

Dynamic mode

Extra properties used when the flowsheet runs in dynamic mode.

Name Unit
Max Sections
Reset Contents

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

Reactor_PFR(): Initializes a new default instance of the Reactor_PFR class.

Initializes a new default instance of the Reactor_PFR class.

public Reactor_PFR()
Public Sub New()

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

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

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

Properties

AccumulationStreams: Gets or sets the list of accumulation streams used for dynamic-mode mass balance tracking.

Gets or sets the list of accumulation streams used for dynamic-mode mass balance tracking.

public List<MaterialStream> AccumulationStreams { get; set; }
Public Property AccumulationStreams As List(Of MaterialStream)

CatalystLoading: Gets or sets the catalyst mass loading (kg/m� of reactor volume).

Gets or sets the catalyst mass loading (kg/m� of reactor volume).

public double CatalystLoading { get; set; }
Public Property CatalystLoading As Double

CatalystParticleDiameter: Gets or sets the catalyst particle equivalent diameter (m).

Gets or sets the catalyst particle equivalent diameter (m).

public double CatalystParticleDiameter { get; set; }
Public Property CatalystParticleDiameter As Double

CatalystParticleSphericity: Gets or sets the catalyst particle sphericity (0-1).

Gets or sets the catalyst particle sphericity (0-1).

public double CatalystParticleSphericity { get; set; }
Public Property CatalystParticleSphericity As Double

CatalystVoidFraction: Gets or sets the void fraction of the catalyst bed (0�1).

Gets or sets the void fraction of the catalyst bed (0�1).

public double CatalystVoidFraction { get; set; }
Public Property CatalystVoidFraction As Double

Diameter: Gets or sets the reactor tube internal diameter (m).

Gets or sets the reactor tube internal diameter (m).

public double Diameter { get; set; }
Public Property Diameter As Double

dV: Gets or sets the volume increment (m�) used as the ODE integration step.

Gets or sets the volume increment (m�) used as the ODE integration step.

public double dV { get; set; }
Public Property dV As Double

EquipmentTypes: Gets the list of equipment sub-types available for this reactor.

Gets the list of equipment sub-types available for this reactor.

public override List<string> EquipmentTypes { get; }
Public Overrides ReadOnly Property EquipmentTypes As List(Of String)

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.

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

InternalSolver: Gets or sets the internal ODE solver type index (0 = Oslo/RK, 1 = manual Euler).

Gets or sets the internal ODE solver type index (0 = Oslo/RK, 1 = manual Euler).

public int InternalSolver { get; set; }
Public Property InternalSolver As Integer

Length: Gets or sets the reactor tube length (m).

Gets or sets the reactor tube length (m).

public double Length { get; set; }
Public Property Length As Double

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

NumberOfTubes: Gets or sets the number of parallel tubes in the reactor.

Gets or sets the number of parallel tubes in the reactor.

public int NumberOfTubes { get; set; }
Public Property NumberOfTubes As Integer

Profile: Gets or sets the composition/flow/temperature profile computed along the reactor length.

Gets or sets the composition/flow/temperature profile computed along the reactor length.

public List<Tuple<double, double, double, List<ProfileItem>>> Profile { get; set; }
Public Property Profile As List(Of Tuple(Of Double, Double, Double, List(Of ProfileItem)))

ReactorSizingType: Gets or sets the sizing calculation mode for the PFR.

Gets or sets the sizing calculation mode for the PFR.

public Reactor_PFR.SizingType ReactorSizingType { get; set; }
Public Property ReactorSizingType As Reactor_PFR.SizingType

ResidenceTime: Gets or sets the calculated residence time (s).

Gets or sets the calculated residence time (s).

public double ResidenceTime { get; set; }
Public Property ResidenceTime As Double

SlurryViscosityMode: Gets or sets the slurry viscosity model index (0 = default).

Gets or sets the slurry viscosity model index (0 = default).

public int SlurryViscosityMode { get; set; }
Public Property SlurryViscosityMode As Integer

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

UserDefinedPressureDrop: Gets or sets the user-defined total pressure drop (Pa) when...

Gets or sets the user-defined total pressure drop (Pa) when UseUserDefinedPressureDrop is True.

public double UserDefinedPressureDrop { get; set; }
Public Property UserDefinedPressureDrop As Double

UseUserDefinedPressureDrop: Gets or sets whether a user-defined total pressure drop is used instead of computing it from the Ergun equation.

Gets or sets whether a user-defined total pressure drop is used instead of computing it from the Ergun equation.

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

Volume: Gets or sets the total reactor volume (m�).

Gets or sets the total reactor volume (m�).

public double Volume { get; set; }
Public Property Volume As Double

Methods

Calculate(object): Performs the PFR calculation by integrating the reaction-rate ODEs along the reactor volume, computing temperature...

Performs the PFR calculation by integrating the reaction-rate ODEs along the reactor volume, computing temperature, pressure, and composition profiles.

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)

Calculate_Internal(double, object): Internal calculation routine that integrates the PFR ODEs using the specified volume-fraction scale factor.

Internal calculation routine that integrates the PFR ODEs using the specified volume-fraction scale factor.

Parameter Type Description
dVF Double Volume fraction scale factor applied to the integration step.
args Object Optional. If True, indicates a dynamic-mode call.
public bool Calculate_Internal(double dVF, object args = null)
Public Function Calculate_Internal(dVF As Double, args As Object = Nothing) As Boolean

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

CreateDimensionsList(): Creates the dimensions list (Volume, Length, Diameter) for this PFR.

Creates the dimensions list (Volume, Length, Diameter) for this PFR.

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

CreateDynamicProperties(): Registers the dynamic properties for dynamic simulation mode.

Registers the dynamic properties 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()

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

GetChartModel(string): Returns an OxyPlot chart model for the specified profile chart name.

Returns an OxyPlot chart model for the specified profile chart name.

Parameter Type Description
name String
public override object GetChartModel(string name)
Public Overrides Function GetChartModel(name As String) As Object

GetChartModelNames(): Returns the list of available profile chart names for this PFR.

Returns the list of available profile chart names for this PFR.

public override List<string> GetChartModelNames()
Public Overrides Function GetChartModelNames() As List(Of String)

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

LoadData(List<XElement>): Restores the reactor state, including accumulation streams and profile data, from XML.

Restores the reactor state, including accumulation streams and profile data, 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

ODEFunc(double, double[]): Evaluates the system of ODEs (molar flow derivatives with respect to volume) for the PFR integration at the current...

Evaluates the system of ODEs (molar flow derivatives with respect to volume) for the PFR integration at the current position and composition.

Parameter Type Description
x Double Current volume coordinate (m�).
y Double[] Current molar flows (mol/s) for each compound.
public double[] ODEFunc(double x, double[] y)
Public Function ODEFunc(x As Double, y As Double()) As Double()

RunDynamicModel(): Executes one dynamic simulation time step for the PFR.

Executes one dynamic simulation time step for the PFR.

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

SaveData(): Serializes the reactor state, including profile and accumulation streams, to XML.

Serializes the reactor state, including profile and accumulation streams, 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

UpdateDimensionsList(): Updates the dimension values from the current reactor geometry.

Updates the dimension values from the current reactor geometry.

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

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

Refreshes the editing form with updated data.

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

Fields

DHRi: Heat of each reaction over the whole reactor, keyed by reaction ID: the reaction heat (kJ/kmol of base compound)...

Heat of each reaction over the whole reactor, keyed by reaction ID: the reaction heat (kJ/kmol of base compound) times the base compound consumed (the extent in RxiT times its stoichiometric coefficient, mol/s) divided by 1000, a heat flow in kW.

public Dictionary<string, double> DHRi
Public DHRi As Dictionary(Of String, Double)

DHRT: Heat of reaction released in each integration segment along the reactor, in kW, one entry per segment.

Heat of reaction released in each integration segment along the reactor, in kW, one entry per segment.

public List<double> DHRT
Public DHRT As List(Of Double)

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

points: Profile data points along the reactor, used by the profile charts.

Profile data points along the reactor, used by the profile charts. Each entry is a Double array with the axial position (m), the molar concentration of each compound (mol/m3), the temperature (K) and the pressure (Pa).

public ArrayList points
Public points As ArrayList

Rxi: Rate of each reaction at the current integration point, keyed by reaction ID, converted to SI units from the...

Rate of each reaction at the current integration point, keyed by reaction ID, converted to SI units from the reaction's rate unit.

public Dictionary<string, double> Rxi
Public Rxi As Dictionary(Of String, Double)

RxiT: Extent of each reaction over the whole reactor, keyed by reaction ID.

Extent of each reaction over the whole reactor, keyed by reaction ID. Computed after the solve from the change in the base reactant molar flow between feed and outlet, divided by its stoichiometric coefficient, and split among reactions that share the base reactant in proportion to their rates. Stored in mol/s, the SI molar flow unit, like the CSTR.

public Dictionary<string, double> RxiT
Public RxiT As Dictionary(Of String, Double)