Energy Stream¶
![]()
Represents an energy stream that carries a heat or power flow between unit operations in a flowsheet. Implements CAPE-OPEN identification and collection interfaces.
DWSIM.UnitOperations.Streams.EnergyStream
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← EnergyStream
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, energy | 0 |
|
| Outlet, energy | 0 |
E-1 |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("EnergyStreamExample")
.WithCompound("Water")
.WithPropertyPackage(PropertyPackages.SteamTables))
water_in = (fs.AddMaterialStream("Water-in")
.At(Q.Celsius(25.0), Q.Bar(3.0))
.WithMassFlow(Q.KgPerSecond(2.0)))
water_out = fs.AddMaterialStream("Water-out")
duty = fs.AddEnergyStream("Q-1").WithEnergyFlow(Q.Kilowatts(500.0))
heater = (fs.AddHeater("E-1")
.WithCalcMode(Heater.CalculationMode.EnergyStream) # the heater takes its duty from Q-1
.ConnectFeed(water_in)
.ConnectProduct(water_out)
.ConnectEnergyFeed(duty, 1)) # energy inlet is port 1
fs.AutoLayout()
fs.Solve()
h_in = water_in.Object.Phases[0].Properties.enthalpy # kJ/kg
h_out = water_out.Object.Phases[0].Properties.enthalpy
print(f"Energy flow = {duty.EnergyFlowKW:.1f} kW")
print(f"Outlet T = {water_out.TemperatureK - 273.15:.2f} C")
print(f"m (h_out - h_in) = {2.0 * (h_out - h_in):.1f} kW")
Output
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_ES_0 |
Amount of heat flow carried by this stream. | kW | yes |
Learn more¶
-
User guide
-
Tutorials
-
FluentAPI
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
EnergyStream(): Initializes a new default instance of the EnergyStream class.
Initializes a new default instance of the EnergyStream class.
EnergyStream(string, string): Initializes a new instance of the EnergyStream class with a name and description.
Initializes a new instance of the EnergyStream class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the energy stream. |
description |
String |
A brief description of the energy stream. |
Properties¶
EnergyFlow: Power (energy) associated with this stream.
Power (energy) associated with this stream.
HasPropertiesForDynamicMode: Gets a value indicating whether this energy stream exposes properties specific to dynamic mode.
Gets a value indicating whether this energy stream exposes properties specific to dynamic mode.
MobileCompatible: Gets a value indicating whether this energy stream is compatible with the DWSIM mobile interface.
Gets a value indicating whether this energy stream is compatible with the DWSIM mobile interface.
ObjectClass: Gets or sets the simulation object class for this energy stream.
Gets or sets the simulation object class for this energy stream.
SupportsDynamicMode: Gets a value indicating whether this energy stream supports dynamic simulation mode.
Gets a value indicating whether this energy stream supports dynamic simulation mode.
Methods¶
Assign(EnergyStream): Copies the energy flow property from the specified source energy stream to this instance.
Copies the energy flow property from the specified source energy stream to this instance.
| Parameter | Type | Description |
|---|---|---|
ASource |
EnergyStream |
The source EnergyStream whose properties are copied. |
Calculate(object): Marks the energy stream as calculated (clears its dirty state).
Marks the energy stream as calculated (clears its dirty state).
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional calculation arguments (not used). |
CloneXML(): Creates a deep copy of this energy stream by serializing and deserializing via XML.
Creates a deep copy of this energy stream by serializing and deserializing via XML.
CloseEditForm(): Closes and disposes the editing form for this energy stream if it is open.
Closes and disposes the editing form for this energy stream if it is open.
CreateParamCol(): Creates the CAPE-OPEN real parameters exposed by this energy stream: 'work' (the energy flow, in J/s)...
Creates the CAPE-OPEN real parameters exposed by this energy stream: "work" (the energy flow, in J/s), "temperatureLow" and "temperatureHigh" (in K).
DisplayEditForm(): Opens or activates the editing form for this energy stream.
Opens or activates the editing form for this energy stream.
GetDisplayDescription(): Returns the localized display description for the energy stream object type.
Returns the localized display description for the energy stream object type.
GetDisplayName(): Returns the localized display name for the energy stream object type.
Returns the localized display name for the energy stream object type.
GetEnergyConsumption(): Returns the current energy flow value of the stream in watts (SI).
Returns the current energy flow value of the stream in watts (SI).
GetIconBitmapBytes(): Returns the raw bytes of the energy stream icon image resource.
Returns the raw bytes of the energy stream icon image resource.
GetProperties(PropertyType): Returns the list of property identifiers available for this energy stream filtered by the specified property type.
Returns the list of property identifiers available for this energy stream filtered by the specified property type.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
The type of properties to retrieve (read-only, read-write, write-read, or all). |
GetPropertyDescription(string): Returns a human-readable description for the specified property identifier.
Returns a human-readable description for the specified property identifier.
| Parameter | Type | Description |
|---|---|---|
p |
String |
The property identifier 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 (e.g., "PROP_ES_0"). |
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_ES_0"). |
su |
IUnitsOfMeasure |
The unit system to use for conversion; defaults to SI if not provided. |
GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text report of the energy stream results using the specified unit system and formatting options.
Generates a plain-text report of the energy stream results using the specified unit system and formatting options.
| Parameter | Type | Description |
|---|---|---|
su |
IUnitsOfMeasure |
The unit system to use for property values in the report. |
ci |
CultureInfo |
The culture info used for number formatting. |
numberformat |
String |
The numeric format string applied to values. |
GetStructuredReport(): Generates a structured report of the energy stream results as a list of labeled tuples for display.
Generates a structured report of the energy stream results as a list of labeled tuples for display.
Init(): Initializes the CAPE-OPEN parameter collection of this energy stream (skipped when running on Mono) and marks the...
Initializes the CAPE-OPEN parameter collection of this energy stream (skipped when running on Mono) and marks the stream as initialized.
RunDynamicModel(): Executes the dynamic simulation model step for this energy stream (no-op for energy streams).
Executes the dynamic simulation model step for this energy stream (no-op for energy streams).
SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property after converting from the given unit system to SI.
Sets the value of the specified property after converting from the given unit system to SI.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
The property identifier string (e.g., "PROP_ES_0"). |
propval |
Object |
The property value to set in the units of su. |
su |
IUnitsOfMeasure |
The unit system of the supplied value; defaults to SI if not provided. |
SetValue(double): Sets the energy flow of this stream directly using a value in kilowatts.
Sets the energy flow of this stream directly using a value in kilowatts.
| Parameter | Type | Description |
|---|---|---|
energyflow_kW |
Double |
The energy flow value in kilowatts (kW). |
ThrowCAPEException(ref Exception, string, string, string, string, string, string, int): Stores CAPE-OPEN error information and throws a CapeComputationException wrapping the original exception.
Stores CAPE-OPEN error information and throws a CapeComputationException wrapping the original exception.
| Parameter | Type | Description |
|---|---|---|
ex |
Exception |
The original exception that triggered the CAPE-OPEN error. |
name |
String |
The name of the component raising the exception. |
description |
String |
A human-readable description of the error. |
interf |
String |
The name of the CAPE-OPEN interface where the error occurred. |
moreinfo |
String |
Additional information about the error condition. |
operation |
String |
The name of the operation that failed. |
scope |
String |
The scope in which the error occurred. |
code |
Int32 |
The CAPE-OPEN error code. |
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¶