Skip to content

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

Expander in the example flowsheet

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

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.

public Expander()
Public Sub New()

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

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.

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

AdiabaticEfficiency: Gets or sets the adiabatic (isentropic) efficiency of the expander (%).

Gets or sets the adiabatic (isentropic) efficiency of the expander (%).

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

AdiabaticHead: Gets or sets the adiabatic head of the expander (m).

Gets or sets the adiabatic head of the expander (m).

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

CalcMode: Gets or sets the active calculation mode for the expander.

Gets or sets the active calculation mode for the expander.

public Expander.CalculationMode CalcMode { get; set; }
Public Property CalcMode As Expander.CalculationMode

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

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

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.

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

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

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

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

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

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

public Dictionary<int, Dictionary<string, Curve>> Curves { get; set; }
Public Property Curves As Dictionary(Of Integer, Dictionary(Of String, Curve))

CurvesDB: Gets or sets the serialized performance curves database string.

Gets or sets the serialized performance curves database string.

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

DeltaP: Gets or sets the pressure drop across the expander (Pa).

Gets or sets the pressure drop across the expander (Pa).

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

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.

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

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

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

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

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

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.

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

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.

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

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.

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

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.

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

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.

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

ObjectClass: Gets or sets the simulation object class category (PressureChangers).

Gets or sets the simulation object class category (PressureChangers).

public override SimulationObjectClass ObjectClass { get; set; }
Public Overrides Property ObjectClass As SimulationObjectClass

OutletTemperature: Gets or sets the calculated outlet temperature of the stream (K).

Gets or sets the calculated outlet temperature of the stream (K).

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

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.

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

PolytropicEfficiency: Gets or sets the polytropic efficiency of the expander (%).

Gets or sets the polytropic efficiency of the expander (%).

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

PolytropicHead: Gets or sets the polytropic head of the expander (m).

Gets or sets the polytropic head of the expander (m).

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

POut: Gets or sets the outlet pressure of the expander (Pa).

Gets or sets the outlet pressure of the expander (Pa).

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

PressureDrop: Gets or sets the pressure drop across the expander (Pa).

Gets or sets the pressure drop across the expander (Pa). Alias for DeltaP.

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

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.

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

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.

public Expander.ProcessPathType ProcessPath { get; set; }
Public Property ProcessPath As Expander.ProcessPathType

Speed: Gets or sets the rotation speed of the expander impeller (rpm).

Gets or sets the rotation speed of the expander impeller (rpm).

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

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.

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

TemperatureChange: Gets or sets the temperature change of the stream (K).

Gets or sets the temperature change of the stream (K). Alias for DeltaT.

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

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).
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

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.

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

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.

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

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").

public Dictionary<string, Curve> CreateCurves()
Public Function CreateCurves() As Dictionary(Of String, Curve)

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

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

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.

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

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.

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

DisplayEditForm(): Opens or activates the editing form for this expander unit operation.

Opens or activates the editing form for this expander unit operation.

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

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.

public override string[] GetCalculationModes()
Public Overrides Function GetCalculationModes() As String()

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
public override object GetChartModel(string name)
Public Overrides Function GetChartModel(name As String) As Object

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.

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

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

Returns the localized display description for the expander unit operation.

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

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

Returns the localized display name for the expander unit operation.

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

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

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

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

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

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.
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

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
public void ReadCurveMap(double qactual, double qmolar, double atspeed, ref double head, ref double power, ref double efficiency)
Public Sub ReadCurveMap(qactual As Double, qmolar As Double, atspeed As Double, head As Double, power As Double, efficiency As 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.

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

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.

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

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.
public override object SetCalculationMode(int modeID)
Public Overrides Function SetCalculationMode(modeID As Integer) As Object

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.
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 sizing dimensions list with the current calculated values from the expander.

Updates the sizing dimensions list with the current calculated values from the expander.

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

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.

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

Fields

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

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

public object f
Public f As Object