Compressor¶
![]()
Represents a compressor unit operation that raises the pressure of a gas or vapor stream using adiabatic or polytropic compression. Supports multiple calculation modes including outlet pressure, pressure ratio, power required, and performance curves.
DWSIM.UnitOperations.UnitOperations.Compressor
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Compressor
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Gas-in |
| Inlet, energy | 1 |
K-1 power |
| Outlet, material | 0 |
Gas-out |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("CompressorExample")
.WithCompounds("Methane", "Ethane", "Propane")
.WithPropertyPackage(PropertyPackages.PengRobinson))
gas_in = (fs.AddMaterialStream("Gas-in")
.At(Q.Celsius(30.0), Q.Bar(20.0))
.SetCompoundMolarFlow("Methane", 90.0) # mol/s
.SetCompoundMolarFlow("Ethane", 7.0)
.SetCompoundMolarFlow("Propane", 3.0))
gas_out = fs.AddMaterialStream("Gas-out")
power = fs.AddEnergyStream("K-1 power")
compressor = (fs.AddCompressor("K-1")
.WithOutletPressure(Q.Bar(60.0))
.WithAdiabaticEfficiencyPercent(75.0)
.ConnectFeed(gas_in)
.ConnectProduct(gas_out)
.ConnectEnergyFeed(power, 1)) # energy inlet is port 1
fs.AutoLayout()
fs.Solve()
k1 = compressor.Object
print(f"Power required = {k1.DeltaQ:.1f} kW")
print(f"Outlet T = {gas_out.TemperatureK - 273.15:.1f} C")
print(f"Adiabatic head = {k1.AdiabaticHead:.0f} m")
print(f"Adiabatic coeff = {k1.AdiabaticCoefficient:.3f}")
print(f"Mass flow = {gas_in.Object.GetMassFlow():.3f} kg/s")
Output
Power required = 395.1 kW
Outlet T = 133.4 C
Adiabatic head = 17613 m
Adiabatic coeff = 1.282
Mass flow = 1.787 kg/s
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 | Outlet conditions calculated from a specified outlet pressure. | PROP_CO_1, PROP_CO_4 |
Delta_P |
1 | Outlet conditions calculated from a specified pressure increase (Pa). | PROP_CO_0, PROP_CO_1 |
EnergyStream |
2 | Power input read from the connected energy stream. | PROP_CO_1 |
PowerRequired |
3 | Outlet pressure calculated to consume the specified power. | PROP_CO_1, PROP_CO_3 |
Head |
4 | Outlet pressure calculated from a specified polytropic or adiabatic head. | PROP_CO_1, AdiabaticHead |
Curves |
5 | Outlet conditions determined from pump performance curves. | PROP_CO_1, RotationSpeed |
PressureRatio |
6 | Outlet conditions calculated from a specified pressure ratio. | PROP_CO_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_CO_0 |
Pressure Increase | Pa | Delta_P |
PROP_CO_1 |
Adiabatic Efficiency | % | all modes |
PROP_CO_2 |
Temperature Difference | K (difference) | result |
PROP_CO_3 |
Power Required | kW | PowerRequired |
PROP_CO_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 | |
| Motor Torque | |
| Surge Flow Fraction | |
| Surge Alarm | |
| Design Inlet Volumetric Flow | m3/s |
| Integrate Casing Holdup | |
| Rated Speed |
Learn more¶
-
User guide
-
Tutorials
-
FluentAPI
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
Compressor(): Initializes a new default instance of the Compressor class.
Initializes a new default instance of the Compressor class.
Compressor(string, string): Initializes a new instance of the Compressor class with a name and description.
Initializes a new instance of the Compressor class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the compressor. |
description |
String |
A brief description of the compressor. |
Properties¶
AdiabaticCoefficient: Gets or sets the calculated adiabatic head coefficient.
Gets or sets the calculated adiabatic head coefficient.
AdiabaticEfficiency: Gets or sets the adiabatic (isentropic) efficiency (%).
Gets or sets the adiabatic (isentropic) efficiency (%).
AdiabaticHead: Gets or sets the calculated adiabatic head (J/kg).
Gets or sets the calculated adiabatic head (J/kg).
CalcMode: Gets or sets the active calculation mode.
Gets or sets the active calculation mode.
CurveEff: Gets or sets the efficiency read from the performance curve (%).
Gets or sets the efficiency read from the performance curve (%).
CurveFlow: Gets or sets the volumetric flow rate read from the performance curve (m³/s).
Gets or sets the volumetric flow rate read from the performance curve (m³/s).
CurveHead: Gets or sets the head read from the performance curve (m).
Gets or sets the head read from the performance curve (m).
CurvePower: Gets or sets the power read from the performance curve (kW).
Gets or sets the power read from the performance curve (kW).
Curves: Gets or sets the dictionary of performance curves keyed by rotation speed (RPM).
Gets or sets the dictionary of performance curves 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 increase across the compressor (Pa).
Gets or sets the pressure increase across the compressor (Pa).
DeltaQ: Gets or sets the shaft power required (kW).
Gets or sets the shaft power required (kW).
DeltaT: Gets or sets the calculated temperature change across the compressor (K).
Gets or sets the calculated temperature change across the compressor (K).
DesignInletVolumetricFlow: Inlet volumetric flow (m3/s) recorded by the last steady-state calculation.
Inlet volumetric flow (m3/s) recorded by the last steady-state calculation. The dynamic surge alarm compares the running inlet flow against a fraction of this value.
EquipmentTypes: Gets the list of equipment sub-types available for this compressor.
Gets the list of equipment sub-types available for this compressor.
EquipType: Gets or sets the equipment sub-type identifier string.
Gets or sets the equipment sub-type identifier string.
HasPropertiesForDynamicMode: Gets a value indicating whether this unit operation exposes properties for dynamic mode.
Gets a value indicating whether this unit operation exposes properties for dynamic mode.
HeatDuty: Gets or sets the shaft power (kW) as a proxy for DeltaQ.
Gets or sets the shaft power (kW) as a proxy for DeltaQ.
IgnorePhase: Gets or sets whether the phase check is bypassed during calculation.
Gets or sets whether the phase check is bypassed during calculation.
MobileCompatible: Gets a value indicating whether this unit operation is compatible with the DWSIM mobile interface.
Gets a value indicating whether this unit operation is compatible with the DWSIM mobile interface.
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 (K).
Gets or sets the calculated outlet temperature (K).
PolytropicCoefficient: Gets or sets the calculated polytropic head coefficient.
Gets or sets the calculated polytropic head coefficient.
PolytropicEfficiency: Gets or sets the polytropic efficiency (%).
Gets or sets the polytropic efficiency (%).
PolytropicHead: Gets or sets the calculated polytropic head (J/kg).
Gets or sets the calculated polytropic head (J/kg).
POut: Gets or sets the specified outlet pressure (Pa).
Gets or sets the specified outlet pressure (Pa).
PressureIncrease: Gets or sets the pressure increase (Pa) as a proxy for DeltaP.
Gets or sets the pressure increase (Pa) as a proxy for DeltaP.
PressureRatio: Gets or sets the specified pressure ratio (outlet/inlet).
Gets or sets the specified pressure ratio (outlet/inlet).
ProcessPath: Gets or sets the thermodynamic process path (adiabatic or polytropic).
Gets or sets the thermodynamic process path (adiabatic or polytropic).
Speed: Gets or sets the operating rotation speed (RPM) used for curve interpolation.
Gets or sets the operating rotation speed (RPM) used for curve interpolation.
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 (K) as a proxy for DeltaT.
Gets or sets the temperature change (K) as a proxy for DeltaT.
Methods¶
Calculate(object): Performs the compressor calculation: determines outlet pressure, temperature, and power consumption using the...
Performs the compressor calculation: determines outlet pressure, temperature, and power consumption using the selected CalcMode and ProcessPath.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional calculation arguments (not used). |
CloneXML(): Creates a deep copy of this compressor via XML serialization.
Creates a deep copy of this compressor via XML serialization.
CloseEditForm(): Closes and disposes the editing form for this compressor if it is open.
Closes and disposes the editing form for this compressor if it is open.
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 dimensions list (Flow, Pressure, PressureDiff, Efficiency, Power).
Creates the dimensions list (Flow, Pressure, PressureDiff, Efficiency, Power).
CreateDynamicProperties(): Registers the dynamic properties for dynamic simulation mode: flow conductance, casing volume and holdup options...
Registers the dynamic properties for dynamic simulation mode: flow conductance, casing volume and holdup options, minimum pressure, rotor inertia, current, target and rated speeds (RPM), motor torque, and the surge limit and alarm.
DeCalculate(): Resets the outlet material and energy streams to an uncalculated state.
Resets the outlet material and energy streams to an uncalculated state.
DisplayEditForm(): Opens or activates the editing form for this compressor.
Opens or activates the editing form for this compressor.
GetCalculationModes(): Returns the list of available calculation mode names and IDs.
Returns the list of available calculation mode names and IDs.
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 compressor type.
Returns the localized display description for the compressor type.
GetDisplayName(): Returns the localized display name for the compressor type.
Returns the localized display name for the compressor type.
GetIconBitmapBytes(): Returns the raw bytes of the compressor icon image resource.
Returns the raw bytes of the compressor icon image resource.
GetProperties(PropertyType): Returns the list of property identifiers available for this compressor.
Returns the list of property identifiers available for this compressor.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
The type of properties to retrieve. |
GetPropertyDescription(string): Returns a human-readable description for the specified property name, used in the property grid.
Returns a human-readable description for the specified property name, used in the property grid.
| Parameter | Type | Description |
|---|---|---|
p |
String |
The property display name. |
GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property.
Returns the unit string for the specified property.
| 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 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 |
The property identifier string (e.g., "PROP_CO_0"). |
su |
IUnitsOfMeasure |
The unit system to use; defaults to SI if not provided. |
GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a text report summarizing the compressor's inlet, outlet, and calculation parameters.
Generates a text report summarizing the compressor's inlet, outlet, and calculation parameters.
| Parameter | Type | Description |
|---|---|---|
su |
IUnitsOfMeasure |
The unit system for reported values. |
ci |
CultureInfo |
The culture info used for number formatting. |
numberformat |
String |
The numeric format string. |
GetStructuredReport(): Generates a structured (tabular) results report for display in the UI.
Generates a structured (tabular) results report for display in the UI.
LoadData(List<XElement>): Restores the compressor state from a list of XML elements, including performance curves.
Restores the compressor state from a list of XML elements, including performance curves.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
The list of XElement objects containing the serialized 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 motor torque and inertia. By default the compressor acts as a pressure-flow element and sets the outlet to the inlet pressure plus the pressure rise at the current flow and speed; with "Integrate Casing Holdup" enabled it integrates the casing volume as a capacity. The pressure rise comes from the curve map in Curves mode, or from the flow conductance scaled by the square of the speed ratio. The surge alarm is updated at the end.
SaveData(): Serializes the compressor state, including performance curve data, into a list of XML elements.
Serializes the compressor state, including performance curve data, into a list of XML elements.
SetCalculationMode(int): Sets the calculation mode by numeric ID and returns the mode name.
Sets the calculation mode by numeric ID and returns the mode name.
| Parameter | Type | Description |
|---|---|---|
modeID |
Int32 |
The integer ID of the desired calculation mode. |
SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property from the given unit system.
Sets the value of the specified property from the given unit system.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
The property identifier string. |
propval |
Object |
The new value to assign. |
su |
IUnitsOfMeasure |
The unit system of the supplied value; defaults to SI if not provided. |
UpdateDimensionsList(): Updates all dimension values from the current calculated results.
Updates all dimension values from the current calculated results.
UpdateEditForm(): Refreshes the displayed data in the editing form if it is currently open.
Refreshes the displayed data in the editing form if it is currently open.
Fields¶