Expander¶
![]()
Represents an expander (turbine) unit operation that reduces the pressure of a gas or vapor stream through isentropic or polytropic expansion, generating shaft work.
DWSIM.UnitOperations.UnitOperations.Expander
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Expander
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Gas-in |
| Outlet, material | 0 |
Gas-out |
| Outlet, energy | energy |
X-1 power |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("ExpanderExample")
.WithCompounds("Methane", "Ethane", "Propane")
.WithPropertyPackage(PropertyPackages.PengRobinson))
gas_in = (fs.AddMaterialStream("Gas-in")
.At(Q.Celsius(40.0), Q.Bar(60.0))
.SetCompoundMolarFlow("Methane", 90.0) # mol/s
.SetCompoundMolarFlow("Ethane", 7.0)
.SetCompoundMolarFlow("Propane", 3.0))
gas_out = fs.AddMaterialStream("Gas-out")
power = fs.AddEnergyStream("X-1 power")
expander = (fs.AddExpander("X-1")
.WithOutletPressure(Q.Bar(20.0))
.WithAdiabaticEfficiencyPercent(80.0)
.ConnectFeed(gas_in)
.ConnectProduct(gas_out)
.ConnectEnergyProduct(power)) # the shaft power leaves on the energy stream
fs.AutoLayout()
fs.Solve()
x1 = expander.Object
print(f"Power generated = {x1.DeltaQ:.1f} kW")
print(f"Energy stream = {power.EnergyFlowKW:.1f} kW")
print(f"Outlet T = {gas_out.TemperatureK - 273.15:.1f} C")
print(f"Outlet vapor = {gas_out.Object.Phases[2].Properties.molarfraction:.4f} (mole fraction)")
print(f"Adiabatic head = {x1.AdiabaticHead:.0f} m")
Output
Power generated = 176.0 kW
Energy stream = 176.0 kW
Outlet T = -23.8 C
Outlet vapor = 1.0000 (mole fraction)
Adiabatic head = 13068 m
DWSIM 10.2.11.0, generated 2026-10-08.
Calculation modes¶
Set with CalcMode (CalculationMode). The mode decides which properties are inputs; every other one is a result and is overwritten by the calculation.
| Mode | Value | What it does | Inputs |
|---|---|---|---|
OutletPressure |
0 | Calculation is based on a specified outlet pressure. | PROP_TU_1, PROP_TU_4 |
Delta_P |
1 | Calculation is based on a specified pressure drop across the expander. | PROP_TU_0, PROP_TU_1 |
PowerGenerated |
2 | Calculation is based on a specified shaft power generated. | PROP_TU_1, PROP_TU_3 |
Head |
3 | Calculation is based on a specified expander head (adiabatic or polytropic). | PROP_TU_1, AdiabaticHead |
Curves |
4 | Calculation is driven by user-defined performance curves. | PROP_TU_1, RotationSpeed |
PressureRatio |
5 | Calculation is based on a specified outlet-to-inlet pressure ratio. | PROP_TU_1, PressureRatio |
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 in |
|---|---|---|---|
PROP_TU_0 |
Pressure Drop | Pa | Delta_P |
PROP_TU_1 |
Adiabatic Efficiency | % | all modes |
PROP_TU_2 |
Temperature Difference | K (difference) | result |
PROP_TU_3 |
Power Generated | kW | PowerGenerated |
PROP_TU_4 |
Pressure | Pa | OutletPressure |
PolytropicEfficiency |
Polytropic Efficiency | % | result |
AdiabaticCoefficient |
Adiabatic Coefficient | result | |
PolytropicCoefficient |
Polytropic Coefficient | result | |
AdiabaticHead |
Adiabatic Head | m | Head |
PolytropicHead |
Polytropic Head | m | result |
RotationSpeed |
Rotation Speed | rpm | Curves |
PressureRatio |
PressureRatio |
Dynamic mode¶
Extra properties used when the flowsheet runs in dynamic mode.
| Name | Unit |
|---|---|
| Flow Conductance | [kg/s]/[Pa^0.5] |
| Volume | m3 |
| Minimum Pressure | Pa |
| Initialize using Inlet Stream | |
| Reset Content | |
| Rotational Inertia | |
| Current Speed | |
| Target Speed | |
| Generator Torque | |
| Rated Speed |
Learn more¶
-
User guide
-
FluentAPI
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
Expander(): Initializes a new instance of the Expander class with default settings.
Initializes a new instance of the Expander class with default settings.
Expander(string, string): Initializes a new instance of the Expander class with a specified name and description.
Initializes a new instance of the Expander class with a specified name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the expander unit operation. |
description |
String |
A brief description of this expander instance. |
Properties¶
AdiabaticCoefficient: Gets or sets the isentropic (adiabatic) volume exponent coefficient, calculated from inlet and outlet conditions.
Gets or sets the isentropic (adiabatic) volume exponent coefficient, calculated from inlet and outlet conditions.
AdiabaticEfficiency: Gets or sets the adiabatic (isentropic) efficiency of the expander (%).
Gets or sets the adiabatic (isentropic) efficiency of the expander (%).
AdiabaticHead: Gets or sets the adiabatic head of the expander (m).
Gets or sets the adiabatic head of the expander (m).
CalcMode: Gets or sets the active calculation mode for the expander.
Gets or sets the active calculation mode for the expander.
CurveEff: Gets or sets the efficiency value interpolated from the performance curves at the current flow (%).
Gets or sets the efficiency value interpolated from the performance curves at the current flow (%).
CurveFlow: Gets or sets the volumetric or molar flow value read from the performance curves at the operating point.
Gets or sets the volumetric or molar flow value read from the performance curves at the operating point.
CurveHead: Gets or sets the head value interpolated from the performance curves at the current flow (m).
Gets or sets the head value interpolated from the performance curves at the current flow (m).
CurvePower: Gets or sets the power value interpolated from the performance curves at the current flow (kW).
Gets or sets the power value interpolated from the performance curves at the current flow (kW).
Curves: Gets or sets the collection of performance curve sets, keyed by rotation speed (rpm).
Gets or sets the collection of performance curve sets, keyed by rotation speed (rpm).
CurvesDB: Gets or sets the serialized performance curves database string.
Gets or sets the serialized performance curves database string.
DeltaP: Gets or sets the pressure drop across the expander (Pa).
Gets or sets the pressure drop across the expander (Pa).
DeltaQ: Gets or sets the shaft power generated by the expander (kW).
Gets or sets the shaft power generated by the expander (kW). Positive values represent generated power.
DeltaT: Gets or sets the temperature change of the stream across the expander (K).
Gets or sets the temperature change of the stream across the expander (K).
EquipmentTypes: Gets the list of equipment sub-types available for this expander (e.g., Steam, Gas).
Gets the list of equipment sub-types available for this expander (e.g., Steam, Gas).
EquipType: Gets or sets the equipment type identifier used for selecting performance curve data sets.
Gets or sets the equipment type identifier used for selecting performance curve data sets.
HasPropertiesForDynamicMode: Gets a value indicating whether this unit operation exposes additional properties in dynamic mode.
Gets a value indicating whether this unit operation exposes additional properties in dynamic mode.
HeatDuty: Gets or sets the shaft power generated by the expander (kW).
Gets or sets the shaft power generated by the expander (kW). Alias for DeltaQ.
IgnorePhase: Gets or sets a value indicating whether phase validation of the inlet stream is bypassed.
Gets or sets a value indicating whether phase validation of the inlet stream is bypassed.
MobileCompatible: Gets a value indicating whether this unit operation is compatible with DWSIM Mobile.
Gets a value indicating whether this unit operation is compatible with DWSIM Mobile.
ObjectClass: Gets or sets the simulation object class category (PressureChangers).
Gets or sets the simulation object class category (PressureChangers).
OutletTemperature: Gets or sets the calculated outlet temperature of the stream (K).
Gets or sets the calculated outlet temperature of the stream (K).
PolytropicCoefficient: Gets or sets the polytropic volume exponent coefficient, calculated from inlet and outlet conditions.
Gets or sets the polytropic volume exponent coefficient, calculated from inlet and outlet conditions.
PolytropicEfficiency: Gets or sets the polytropic efficiency of the expander (%).
Gets or sets the polytropic efficiency of the expander (%).
PolytropicHead: Gets or sets the polytropic head of the expander (m).
Gets or sets the polytropic head of the expander (m).
POut: Gets or sets the outlet pressure of the expander (Pa).
Gets or sets the outlet pressure of the expander (Pa).
PressureDrop: Gets or sets the pressure drop across the expander (Pa).
Gets or sets the pressure drop across the expander (Pa). Alias for DeltaP.
PressureRatio: Gets or sets the outlet-to-inlet pressure ratio across the expander.
Gets or sets the outlet-to-inlet pressure ratio across the expander.
ProcessPath: Gets or sets the thermodynamic path (adiabatic or polytropic) used for expansion.
Gets or sets the thermodynamic path (adiabatic or polytropic) used for expansion.
Speed: Gets or sets the rotation speed of the expander impeller (rpm).
Gets or sets the rotation speed of the expander impeller (rpm).
SupportsDynamicMode: Gets a value indicating whether this unit operation supports dynamic simulation mode.
Gets a value indicating whether this unit operation supports dynamic simulation mode.
TemperatureChange: Gets or sets the temperature change of the stream (K).
Gets or sets the temperature change of the stream (K). Alias for DeltaT.
Methods¶
Calculate(object): Performs the main thermodynamic calculation for the expander: determines outlet conditions (pressure, temperature...
Performs the main thermodynamic calculation for the expander: determines outlet conditions (pressure, temperature, enthalpy) and the shaft power generated based on the selected calculation mode and thermodynamic path.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional arguments passed to the calculation routine (unused). |
CloneXML(): Creates a deep copy of this expander by serializing and deserializing through XML.
Creates a deep copy of this expander by serializing and deserializing through XML.
CloseEditForm(): Closes the editing form for this expander if it is currently open and not already disposed.
Closes the editing form for this expander if it is currently open and not already disposed.
CreateCurves(): Creates an empty set of performance curves for one rotational speed: head ('HEAD'), efficiency ('EFF') and power...
Creates an empty set of performance curves for one rotational speed: head ("HEAD"), efficiency ("EFF") and power ("POWER").
CreateDimensionsList(): Creates the list of sizing dimensions applicable to this expander (flow, pressure, efficiency, power).
Creates the list of sizing dimensions applicable to this expander (flow, pressure, efficiency, power).
CreateDynamicProperties(): Registers the dynamic properties for dynamic simulation mode: flow conductance, casing volume, minimum pressure...
Registers the dynamic properties for dynamic simulation mode: flow conductance, casing volume, minimum pressure, holdup initialization and reset options, rotor inertia, current and target speeds (RPM) and generator torque.
DeCalculate(): Resets the outlet material stream and energy stream to an uncalculated state, clearing all previously computed values.
Resets the outlet material stream and energy stream to an uncalculated state, clearing all previously computed values.
DisplayEditForm(): Opens or activates the editing form for this expander unit operation.
Opens or activates the editing form for this expander unit operation.
GetCalculationModes(): Returns an array of strings describing the available calculation modes for display in the UI.
Returns an array of strings describing the available calculation modes for display in the UI.
GetChartModel(string): Builds an OxyPlot model of one map kind in the units of the first enabled curve, with the operating point marked...
Builds an OxyPlot model of one map kind in the units of the first enabled curve, with the operating point marked when the flow axis is an actual volumetric flow.
| Parameter | Type | Description |
|---|---|---|
name |
String |
GetChartModelNames(): Chart names the PFD chart object can embed: the performance map, one series per measured speed, with the operating...
Chart names the PFD chart object can embed: the performance map, one series per measured speed, with the operating point.
GetDisplayDescription(): Returns the localized display description for the expander unit operation.
Returns the localized display description for the expander unit operation.
GetDisplayName(): Returns the localized display name for the expander unit operation.
Returns the localized display name for the expander unit operation.
GetIconBitmapBytes(): Returns the icon for this expander as a raw byte array (PNG format).
Returns the icon for this expander as a raw byte array (PNG format).
GetProperties(PropertyType): Returns the list of property identifiers for this expander filtered by the specified access type.
Returns the list of property identifiers for this expander filtered by the specified access type.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
The property access type (read-only, read-write, write-read, or all). |
GetPropertyDescription(string): Returns a human-readable description of the specified property for display in the properties panel.
Returns a human-readable description of the specified property for display in the properties panel.
| Parameter | Type | Description |
|---|---|---|
p |
String |
The display name of the property. |
GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property in the given unit system.
Returns the unit string for the specified property in the given unit system.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
The property identifier string. |
su |
IUnitsOfMeasure |
The unit system to use; defaults to SI if not provided. |
GetPropertyValue(string, IUnitsOfMeasure): Returns the current value of the specified property, converted to the given unit system.
Returns the current value of the specified property, converted to the given unit system.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
The property identifier string (e.g., "PROP_TU_0" or "AdiabaticHead"). |
su |
IUnitsOfMeasure |
The unit system to use for unit conversion; defaults to SI if not provided. |
GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text report of the expander's inlet conditions, calculation parameters, and results.
Generates a plain-text report of the expander's inlet conditions, calculation parameters, and results.
| Parameter | Type | Description |
|---|---|---|
su |
IUnitsOfMeasure |
The unit system to use for displaying property values. |
ci |
CultureInfo |
The culture info used for number formatting. |
numberformat |
String |
The numeric format string applied to all output values. |
GetStructuredReport(): Generates a structured report of the expander's calculation parameters and results, formatted as a list of typed...
Generates a structured report of the expander's calculation parameters and results, formatted as a list of typed report items for display in the UI.
LoadData(List<XElement>): Loads the expander's state from a list of XML elements, restoring saved properties and performance curves.
Loads the expander's state from a list of XML elements, restoring saved properties and performance curves.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
The list of XElement objects containing the saved state. |
ReadCurveMap(double, double, double, ref double, ref double, ref double): Reads the performance map at a flow and a speed.
Reads the performance map at a flow and a speed. The curves of every measured speed are interpolated along their own flow axis (actual volumetric flow when the unit of that axis carries the @ P,T suffix, molar flow otherwise), and the readings are then interpolated across the measured speeds. Head, power and efficiency come back in SI (m, kW, fraction), and NaN where the machine has no enabled curve of that kind.
| Parameter | Type | Description |
|---|---|---|
qactual |
Double |
|
qmolar |
Double |
|
atspeed |
Double |
|
head |
Double |
|
power |
Double |
|
efficiency |
Double |
RunDynamicModel(): Runs one dynamic-mode integration step.
Runs one dynamic-mode integration step. The rotor speed moves towards the target speed at a rate set by the generator torque and inertia, the casing holdup is integrated and its pressure updated, and the outlet takes the holdup pressure minus the pressure drop (from the curve map in Curves mode, otherwise from the flow conductance), limited below by the minimum pressure.
SaveData(): Saves the expander's current state as a list of XML elements, including performance curves.
Saves the expander's current state as a list of XML elements, including performance curves.
SetCalculationMode(int): Sets the active calculation mode of the expander by numeric ID.
Sets the active calculation mode of the expander by numeric ID.
| Parameter | Type | Description |
|---|---|---|
modeID |
Int32 |
The integer ID corresponding to a CalculationMode value. |
SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property, converting from the given unit system to SI.
Sets the value of the specified property, converting from the given unit system to SI.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
The property identifier string (e.g., "PROP_TU_0" or "AdiabaticHead"). |
propval |
Object |
The new value to assign to the property. |
su |
IUnitsOfMeasure |
The unit system of the supplied value; defaults to SI if not provided. |
UpdateDimensionsList(): Updates the sizing dimensions list with the current calculated values from the expander.
Updates the sizing dimensions list with the current calculated values from the expander.
UpdateEditForm(): Refreshes the editing form with the latest calculated values if the form is currently open.
Refreshes the editing form with the latest calculated values if the form is currently open.
Fields¶