Cooler¶
![]()
Represents a cooler unit operation that reduces the temperature of an inlet material stream by removing a specified amount of heat, targeting an outlet temperature, outlet vapor fraction, or temperature change. Supports steady-state and dynamic simulation modes.
DWSIM.UnitOperations.UnitOperations.Cooler
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Cooler
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Gas-in |
| Inlet, energy | 1 |
|
| Outlet, material | 0 |
Gas-out |
| Outlet, energy | energy |
C-1 duty |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("CoolerExample")
.WithCompounds("Methane", "Ethane", "Propane", "N-butane", "N-pentane")
.WithPropertyPackage(PropertyPackages.PengRobinson))
gas = (fs.AddMaterialStream("Gas-in")
.At(Q.Celsius(120.0), Q.Bar(40.0))
.SetCompoundMolarFlow("Methane", 70.0) # mol/s
.SetCompoundMolarFlow("Ethane", 12.0)
.SetCompoundMolarFlow("Propane", 10.0)
.SetCompoundMolarFlow("N-butane", 5.0)
.SetCompoundMolarFlow("N-pentane", 3.0))
cooled = fs.AddMaterialStream("Gas-out")
duty = fs.AddEnergyStream("C-1 duty")
cooler = (fs.AddCooler("C-1")
.WithOutletTemperature(Q.Celsius(40.0))
.WithPressureDrop(Q.Bar(0.5))
.ConnectFeed(gas)
.ConnectProduct(cooled)
.ConnectEnergyProduct(duty, 0)) # heat removed leaves through the energy outlet
fs.AutoLayout()
fs.Solve()
w = gas.Object.GetMassFlow() # kg/s
h_in = gas.Object.Phases[0].Properties.enthalpy # kJ/kg
h_out = cooled.Object.Phases[0].Properties.enthalpy
print(f"Heat removed = {cooler.Object.DeltaQ:.1f} kW")
print(f"Check m*dh = {w * (h_in - h_out):.1f} kW")
print(f"Outlet T = {cooled.TemperatureK - 273.15:.2f} C")
print(f"Outlet P = {cooled.Object.Phases[0].Properties.pressure / 1e5:.2f} bar")
print(f"Vapor fraction = {cooled.Object.Phases[2].Properties.molarfraction:.4f}")
Output
Heat removed = 481.3 kW
Check m*dh = 481.3 kW
Outlet T = 40.00 C
Outlet P = 39.50 bar
Vapor fraction = 0.9923
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 |
|---|---|---|---|
HeatRemoved |
0 | Outlet conditions calculated from a specified heat removal duty (kW). | PROP_CL_0, PROP_CL_1, PROP_CL_3 |
OutletTemperature |
1 | Heat duty calculated to achieve the specified outlet temperature. | PROP_CL_0, PROP_CL_1, PROP_CL_2 |
OutletVaporFraction |
2 | Heat duty calculated to achieve the specified outlet vapor mole fraction. | PROP_CL_0, PROP_CL_1, PROP_CL_4 |
TemperatureChange |
3 | Heat duty calculated to achieve the specified temperature change. | PROP_CL_0, PROP_CL_1, PROP_CL_5 |
EnergyStream |
4 | Heat duty read from the connected energy stream. | PROP_CL_0, PROP_CL_1 |
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_CL_0 |
Pressure Drop | Pa | all modes |
PROP_CL_1 |
Efficiency | all modes | |
PROP_CL_2 |
Outlet Temperature | K | OutletTemperature |
PROP_CL_3 |
Heat Removed | kW | HeatRemoved |
PROP_CL_4 |
Outlet Molar Vapor Fraction | OutletVaporFraction |
|
PROP_CL_5 |
Temperature Difference | K (difference) | TemperatureChange |
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 | |
| Ambient Temperature | K |
| Ambient UA Product | |
| Wall Thermal Mass | |
| Wall Temperature | K |
Learn more¶
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
Cooler(): Initializes a new default instance of the Cooler class.
Initializes a new default instance of the Cooler class.
Cooler(string, string): Initializes a new instance of the Cooler class with a name and description.
Initializes a new instance of the Cooler class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the cooler. |
description |
String |
A brief description of the cooler. |
Properties¶
CalcMode: Gets or sets the active calculation mode that determines which variables are specified and which are calculated.
Gets or sets the active calculation mode that determines which variables are specified and which are calculated.
DeltaP: Gets or sets the pressure drop across the cooler (Pa).
Gets or sets the pressure drop across the cooler (Pa). Outlet pressure = inlet pressure - DeltaP.
DeltaQ: Gets or sets the heat duty removed from the stream (kW).
Gets or sets the heat duty removed from the stream (kW). Positive = cooling.
DeltaT: Gets or sets the calculated or specified temperature change across the cooler (K).
Gets or sets the calculated or specified temperature change across the cooler (K).
Efficiency: Gets or sets the efficiency (%) as a plain Double proxy for Eficiencia.
Gets or sets the efficiency (%) as a plain Double proxy for Eficiencia.
Eficiencia: Gets or sets the cooler efficiency as a percentage (0–100).
Gets or sets the cooler efficiency as a percentage (0–100).
EquipmentTypes: Gets the list of equipment sub-types available for this cooler.
Gets the list of equipment sub-types available for this cooler.
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 heat duty (kW) as a plain Double proxy for DeltaQ.
Gets or sets the heat duty (kW) as a plain Double proxy for DeltaQ.
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 (Exchangers).
Gets or sets the simulation object class category (Exchangers).
OutletTemperature: Gets or sets the target outlet temperature (K) used when CalcMode is OutletTemperature.
Gets or sets the target outlet temperature (K) used when CalcMode is OutletTemperature.
OutletVaporFraction: Gets or sets the target outlet vapor mole fraction used when CalcMode is OutletVaporFraction.
Gets or sets the target outlet vapor mole fraction used when CalcMode is OutletVaporFraction.
PressureDrop: Gets or sets the pressure drop (Pa) as a plain Double proxy for DeltaP.
Gets or sets the pressure drop (Pa) as a plain Double proxy for DeltaP.
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 plain Double proxy for DeltaT.
Gets or sets the temperature change (K) as a plain Double proxy for DeltaT.
Methods¶
Calculate(object): Performs the steady-state cooler calculation according to CalcMode.
Performs the steady-state cooler calculation according to CalcMode. Computes outlet enthalpy, temperature, vapor fraction, and heat removal duty from the inlet stream and specified parameters.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional calculation arguments (not used). |
CloneXML(): Creates a deep copy of this cooler via XML serialization.
Creates a deep copy of this cooler via XML serialization.
CloseEditForm(): Closes and disposes the editing form for this cooler if it is open.
Closes and disposes the editing form for this cooler if it is open.
CreateDimensionsList(): Creates the dimensions list used for equipment sizing (Area).
Creates the dimensions list used for equipment sizing (Area).
CreateDynamicProperties(): Registers dynamic properties (Flow Conductance, Volume, Minimum Pressure, initialization flags) used in dynamic...
Registers dynamic properties (Flow Conductance, Volume, Minimum Pressure, initialization flags) used in dynamic simulation mode.
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 cooler.
Opens or activates the editing form for this cooler.
GetCalculationModes(): Returns the list of available calculation mode names and IDs.
Returns the list of available calculation mode names and IDs.
GetDisplayDescription(): Returns the localized display description for the cooler type.
Returns the localized display description for the cooler type.
GetDisplayName(): Returns the localized display name for the cooler type.
Returns the localized display name for the cooler type.
GetIconBitmapBytes(): Returns the raw bytes of the cooler icon image resource.
Returns the raw bytes of the cooler icon image resource.
GetProperties(PropertyType): Returns the list of property identifiers available for this cooler.
Returns the list of property identifiers available for this cooler.
| 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_CL_0"). |
su |
IUnitsOfMeasure |
The unit system to use; defaults to SI if not provided. |
GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a text report summarizing the cooler's inlet, outlet, and calculation parameters.
Generates a text report summarizing the cooler'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.
RunDynamicModel(): Executes the cooler dynamic model for one integration time step, updating accumulation, temperature, and pressure.
Executes the cooler dynamic model for one integration time step, updating accumulation, temperature, and pressure.
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 the dimensions list (no-op for the cooler).
Updates the dimensions list (no-op for the cooler).
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¶