Continuous Stirred Tank Reactor (CSTR)¶
![]()
Represents a Continuous Stirred-Tank Reactor (CSTR) that models a well-mixed reactor vessel where reaction kinetics are evaluated at the outlet composition. Supports conversion, kinetic, and heterogeneous catalytic reactions with optional two-phase (liquid + vapour) outlet operation.
DWSIM.UnitOperations.Reactors.Reactor_CSTR
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Reactor ← Reactor_CSTR
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Feed |
| Inlet, energy | 1 |
Q |
| Inlet, material | 2 |
|
| Outlet, material | 0 |
Product |
| Outlet, material | 1 |
|
| Outlet, material | 2 |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("CSTRExample")
.WithCompounds("Ethylene oxide", "Water", "Ethylene glycol")
.WithPropertyPackage(PropertyPackages.NRTL))
# EO + H2O -> EG, first order in EO (water in large excess):
# r = k C_EO, k = A exp(-E/RT) = 0.311 1/min at 55 C with E = 80 kJ/mol
E = 80000.0 # J/mol
A = 0.311 / 60.0 * math.exp(E / (8.314 * 328.15)) # 1/s
hydration = fs.DefineKineticReaction(
"Hydration",
coefficients({"Ethylene oxide": -1, "Water": -1, "Ethylene glycol": 1}),
coefficients({"Ethylene oxide": 1, "Water": 0, "Ethylene glycol": 0}), # forward orders
coefficients({"Ethylene oxide": 0, "Water": 0, "Ethylene glycol": 0}), # reverse orders
"Ethylene oxide", "Liquid", "Molar Concentration", "mol/m3", "mol/[m3.s]", A, E)
fs.ReactionSet("EG").Add(hydration)
feed = (fs.AddMaterialStream("Feed")
.At(Q.Celsius(55.0), Q.Bar(5.0))
.WithMolarFlow(Q.MolPerSecond(11.0))
.SetCompoundMolarFlow("Ethylene oxide", 1.0)
.SetCompoundMolarFlow("Water", 10.0))
product = fs.AddMaterialStream("Product")
duty = fs.AddEnergyStream("Q")
reactor = (fs.AddCSTR("R-1")
.Isothermal()
.WithReactionSet("EG")
.WithVolume(Q.CubicMeters(0.25))
.WithPressureDrop(Q.Bar(0.0))
.ConnectFeed(feed, 0)
.ConnectProduct(product, 0)
.ConnectEnergyFeed(duty, 1))
fs.AutoLayout()
fs.Solve()
tau = reactor.Object.ResidenceTimeL # s
k = A * math.exp(-E / (8.314 * product.TemperatureK))
print(f"Residence time = {tau / 60.0:.1f} min")
print(f"EO conversion = {100.0 * reactor.Object.ComponentConversions['Ethylene oxide']:.1f} %"
f" (first order CSTR, k tau / (1 + k tau): {100.0 * k * tau / (1.0 + k * tau):.1f} %)")
print(f"Glycol produced = {product.MolarFlowMolPerSecond * product.OverallMoleFraction('Ethylene glycol'):.3f} mol/s")
print(f"Heat removed = {-reactor.HeatDutyKW:.1f} kW")
Output
Residence time = 18.2 min
EO conversion = 85.0 % (first order CSTR, k tau / (1 + k tau): 85.0 %)
Glycol produced = 0.850 mol/s
Heat removed = 83.5 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_CS_0 |
Pressure Drop | Pa | yes |
PROP_CS_1 |
Residence time | s | yes |
PROP_CS_2 |
Volume | m3 | yes |
PROP_CS_3 |
Temperature delta | K (difference) | yes |
PROP_CS_4 |
Heat load | kW | yes |
PROP_CS_5 |
Outlet Temperature | K | yes |
PROP_CS_6 |
Headspace | m3 | yes |
PROP_CS_7 |
Vapor residence time | s | yes |
PROP_CS_8 |
Overall Heat Transfer Coefficient | W/m2.K | yes |
PROP_CS_9 |
Heat Exchange Area | m2 | yes |
PROP_CS_10 |
Coolant Inlet Temperature | K | yes |
PROP_CS_11 |
Coolant Mass Flow Rate | kg/s | yes |
PROP_CS_12 |
Coolant Specific Heat | J/kg.K | yes |
PROP_CS_13 |
Coolant Flow Direction | yes | |
PROP_CS_14 |
Area Calculation Mode | yes | |
PROP_CS_15 |
Use Utility Stream | yes | |
PROP_CS_16 |
Wall Thickness | m | yes |
PROP_CS_17 |
Internal Heat Transfer Coefficient | W/m2.K | yes |
PROP_CS_18 |
External Heat Transfer Coefficient | W/m2.K | yes |
PROP_CS_19 |
Use Wall Properties | yes | |
PROP_CS_20 |
Calculated Overall HTC | W/m2.K | yes |
PROP_CS_21 |
Diameter | mm | yes |
PROP_CS_22 |
Calculate Internal HTC | yes | |
PROP_CS_23 |
Calculate External HTC | yes | |
PROP_CS_24 |
Jacket Diameter | mm | yes |
PROP_CS_25 |
Coolant Density | kg/m3 | yes |
PROP_CS_26 |
Coolant Viscosity | Pa.s | yes |
PROP_CS_27 |
Coolant Thermal Conductivity | W/m.K | yes |
PROP_CS_28 |
Calculated Internal HTC | W/m2.K | yes |
PROP_CS_29 |
Calculated External HTC | W/m2.K | yes |
PROP_CS_30 |
Impeller Diameter | mm | yes |
PROP_CS_31 |
Impeller Speed | RPM | yes |
PROP_CS_32 |
Impeller Type | yes | |
Mixture Reactions Use Headspace |
With a single outlet, mixture-phase reactions take place in the reactor volume plus the headspace when True, or in the reactor volume only when False. New reactors use False; files saved before this option keep True. | yes | |
Calculation Mode |
Select the calculation mode of this reactor. | result | |
Ethylene oxide: Conversion |
% | result | |
Water: Conversion |
% | result | |
Hydration: Extent |
mol/s | result | |
Hydration: Rate |
mol/[m3.s] | result | |
Hydration: Heat |
kW | result |
Dynamic mode¶
Extra properties used when the flowsheet runs in dynamic mode.
| Name | Unit |
|---|---|
| Operating Pressure | Pa |
| Liquid Level | m |
| Height | m |
| Minimum Pressure | Pa |
| Initialize using Inlet Stream | |
| Reset Contents |
Learn more¶
-
User guide
-
FluentAPI
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
Reactor_CSTR(): Initializes a new default instance of the Reactor_CSTR class.
Initializes a new default instance of the Reactor_CSTR class.
Reactor_CSTR(string, string): Initializes a new instance of the Reactor_CSTR class with a name and description.
Initializes a new instance of the Reactor_CSTR class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the CSTR. |
description |
String |
A brief description of the CSTR. |
Properties¶
CatalystAmount: Gets or sets the mass of catalyst loaded in the reactor (kg).
Gets or sets the mass of catalyst loaded in the reactor (kg).
Diameter: Gets or sets the reactor diameter (m).
Gets or sets the reactor diameter (m).
EquipmentTypes: Gets the list of equipment sub-types available for this reactor.
Gets the list of equipment sub-types available for this reactor.
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.
Headspace: Gets or sets the reactor headspace volume fraction (0�1).
Gets or sets the reactor headspace volume fraction (0�1).
Impeller: Gets or sets the impeller type for stirred-vessel internal HTC calculation.
Gets or sets the impeller type for stirred-vessel internal HTC calculation.
ImpellerDiameter: Gets or sets the impeller diameter (m) for internal HTC calculation.
Gets or sets the impeller diameter (m) for internal HTC calculation.
ImpellerSpeed: Gets or sets the impeller speed (RPM) for internal HTC calculation.
Gets or sets the impeller speed (RPM) for internal HTC calculation.
InitialNumberOfTimeSteps: Gets or sets the initial number of time sub-steps used in the CSTR transient solver.
Gets or sets the initial number of time sub-steps used in the CSTR transient solver.
IsothermalTemperature: Gets or sets the isothermal temperature (K) used when the reactor operates in isothermal mode.
Gets or sets the isothermal temperature (K) used when the reactor operates in isothermal mode.
MaxIterations: Gets or sets the maximum number of iterations for the CSTR solver.
Gets or sets the maximum number of iterations for the CSTR solver.
MixtureUsesHeadspaceInSingleOutlet: Gets or sets whether a Mixture-phase reaction in a CSTR with a single outlet reacts in Volume + Headspace.
Gets or sets whether a Mixture-phase reaction in a CSTR with a single outlet reacts in Volume + Headspace. When False (new reactors) it reacts in Volume, the same space as the liquid and vapour reactions with one outlet. Reactors saved before this setting existed load with True, as they ran then. With two outlets the reacting volume of a Mixture reaction is always Volume + Headspace.
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.
ResidenceTimeL: Gets or sets the liquid/solid residence time (s).
Gets or sets the liquid/solid residence time (s).
ResidenceTimeV: Gets or sets the vapour residence time (s).
Gets or sets the vapour residence time (s).
SupportsDynamicMode: Gets a value indicating whether this reactor supports dynamic simulation mode.
Gets a value indicating whether this reactor supports dynamic simulation mode.
Tolerance: Gets or sets the convergence tolerance for the CSTR iteration loop.
Gets or sets the convergence tolerance for the CSTR iteration loop.
Volume: Gets or sets the reactor vessel volume (m�).
Gets or sets the reactor vessel volume (m�).
Methods¶
Calculate(object): Performs the CSTR calculation, solving the mass and energy balances at the outlet composition using the selected...
Performs the CSTR calculation, solving the mass and energy balances at the outlet composition using the selected calculation model.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional. If True, indicates a dynamic-mode call. |
Calculate_Internal_1(object): Runs the CSTR calculation called by Calculate: solves the reaction rates, the outlet composition and...
Runs the CSTR calculation called by Calculate: solves the reaction rates, the outlet composition and the energy balance for the selected operation mode. In dynamic mode the reactor holdup is used in place of the inlet stream.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional. True for a dynamic-mode call; Nothing or False for steady state. |
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.
CreateDimensionsList(): Creates the dimensions list (Volume) for this CSTR.
Creates the dimensions list (Volume) for this CSTR.
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.
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 from XML.
Restores the reactor state from XML.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
List of XML elements containing the serialized state. |
RunDynamicModel(): Executes one dynamic simulation time step for the CSTR.
Executes one dynamic simulation time step for the CSTR.
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 |
UpdateDimensionsList(): Updates the dimension values from the current reactor volume.
Updates the dimension values from the current reactor volume.
UpdateEditForm(): Refreshes the editing form with updated data.
Refreshes the editing form with updated data.
Fields¶
DHRi: Heat of each reaction in the last calculation, keyed by reaction ID, in kW.
Heat of each reaction in the last calculation, keyed by reaction ID, in kW.
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.
RxiT: Overall rate of each reaction in the last calculation, keyed by reaction ID and reported as the reaction extent.
Overall rate of each reaction in the last calculation, keyed by reaction ID and reported as the reaction extent. It is the rate times the volume of the reacting phase (kinetic reactions) or times the catalyst amount (heterogeneous catalytic reactions), over the base compound stoichiometric coefficient, in mol/s. Rates from a Python script follow the same rule.