Energy Recycle¶
![]()
Represents an energy recycle convergence block that iterates energy stream values until the recycle loop converges within the specified tolerance.
DWSIM.UnitOperations.SpecialOps.EnergyRecycle
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← SpecialOpBaseClass ← EnergyRecycle
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, energy | 0 |
Q-recovered |
| Outlet, energy | 0 |
Q-return |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("EnergyRecycleExample")
.WithCompound("Water")
.WithPropertyPackage(PropertyPackages.SteamTables))
feed = fs.AddMaterialStream("Feed").At(Q.Celsius(25.0), Q.Bar(10.0)).WithMassFlow(Q.KgPerSecond(2.0))
preheated = fs.AddMaterialStream("Preheated")
hot = fs.AddMaterialStream("Hot")
product = fs.AddMaterialStream("Product")
q_recovered = fs.AddEnergyStream("Q-recovered") # leaves the cooler
q_return = fs.AddEnergyStream("Q-return").WithEnergyFlow(Q.Kilowatts(0.0)) # first guess
q_steam = fs.AddEnergyStream("Q-steam")
preheater = (fs.AddHeater("H-1")
.WithCalcMode(Heater.CalculationMode.EnergyStream) # duty comes from Q-return
.ConnectFeed(feed).ConnectProduct(preheated).ConnectEnergyFeed(q_return, 1))
steam_heater = (fs.AddHeater("H-2").WithOutletTemperature(Q.Celsius(150.0))
.ConnectFeed(preheated).ConnectProduct(hot).ConnectEnergyFeed(q_steam, 1))
cooler = (fs.AddCooler("C-1").WithOutletTemperature(Q.Celsius(60.0))
.ConnectFeed(hot).ConnectProduct(product).ConnectEnergyProduct(q_recovered, 0))
recycle = (fs.AddUnitOperation(ObjectType.OT_EnergyRecycle, "ER-1")
.ConnectEnergyFeed(q_recovered, 0)
.ConnectEnergyProduct(q_return, 0))
er = recycle.Object.__implementation__
fs.AutoLayout()
fs.Solve() # the solver iterates the loop until the energy recycle converges
print(f"Heat recovered = {q_recovered.EnergyFlowKW:.1f} kW (returned {q_return.EnergyFlowKW:.1f} kW)")
print(f"Preheated feed = {preheated.TemperatureK - 273.15:.2f} C")
print(f"Steam heater duty = {steam_heater.HeatDutyKW:.1f} kW")
print(f"Energy recycle = converged in {er.IterationsTaken} iterations, error {er.ConvergenceHistory.EnergyE:.2e} kW")
Output
Heat recovered = 761.2 kW (returned 761.2 kW)
Preheated feed = 115.76 C
Steam heater duty = 292.4 kW
Energy recycle = converged in 2 iterations, error 0.00e+00 kW
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_ER_0 |
Maximum Iterations | yes | |
PROP_ER_1 |
Power Tolerance | kW | yes |
PROP_ER_2 |
Power Error | kW | result |
Learn more¶
-
User guide
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
EnergyRecycle(): Initializes a new default instance of the EnergyRecycle class.
Initializes a new default instance of the EnergyRecycle class.
EnergyRecycle(string, string): Initializes a new instance of the EnergyRecycle class with a name and description.
Initializes a new instance of the EnergyRecycle class with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
The display name of the energy recycle block. |
description |
String |
A brief description of the energy recycle block. |
Properties¶
AccelerationMethod: Gets or sets the convergence acceleration method (e.g.
Gets or sets the convergence acceleration method (e.g. None or Wegstein).
ContinuePastMaximumIterations: Asked whether the recycle should keep iterating past its maximum.
Asked whether the recycle should keep iterating past its maximum. The host assigns it; without one the recycle stops with a timeout, as the material recycle does.
ConvergenceHistory: Gets or sets the convergence history (current and previous energy values) for the recycle loop.
Gets or sets the convergence history (current and previous energy values) for the recycle loop.
ConvergenceParameters: Gets or sets the convergence tolerance parameters for the energy recycle loop.
Gets or sets the convergence tolerance parameters for the energy recycle loop.
HasPropertiesForDynamicMode: Gets a value indicating whether this energy recycle block exposes properties for dynamic mode.
Gets a value indicating whether this energy recycle block exposes properties for dynamic mode.
IterationCount: Gets or sets the current iteration counter during an active convergence run.
Gets or sets the current iteration counter during an active convergence run.
IterationsTaken: Gets or sets the total number of iterations taken during the last convergence run.
Gets or sets the total number of iterations taken during the last convergence run.
MaximumIterations: Gets or sets the maximum number of iterations allowed before convergence is considered failed.
Gets or sets the maximum number of iterations allowed before convergence is considered failed.
MobileCompatible: Gets a value indicating whether this energy recycle block is compatible with the DWSIM mobile interface.
Gets a value indicating whether this energy recycle block is compatible with the DWSIM mobile interface.
SupportsDynamicMode: Gets a value indicating whether this energy recycle block supports dynamic simulation mode.
Gets a value indicating whether this energy recycle block supports dynamic simulation mode.
WegsteinParameters: Gets or sets the Wegstein acceleration parameters used during convergence.
Gets or sets the Wegstein acceleration parameters used during convergence.
Methods¶
Calculate(object): Performs one iteration of the energy recycle convergence, applying optional Wegstein acceleration, and updates the...
Performs one iteration of the energy recycle convergence, applying optional Wegstein acceleration, and updates the connected outlet energy stream with the new energy flow value.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
Optional calculation arguments (not used). |
CloneXML(): Creates a deep copy of this energy recycle block by serializing and deserializing via XML.
Creates a deep copy of this energy recycle block by serializing and deserializing via XML.
CloseEditForm(): Closes and disposes the editing form for this energy recycle block if it is open.
Closes and disposes the editing form for this energy recycle block if it is open.
DeCalculate(): Resets the iteration counter, effectively unsetting the convergence state.
Resets the iteration counter, effectively unsetting the convergence state.
DisplayEditForm(): Opens or activates the editing form for this energy recycle block.
Opens or activates the editing form for this energy recycle block.
GetDisplayDescription(): Returns the localized display description for the energy recycle block type.
Returns the localized display description for the energy recycle block type.
GetDisplayName(): Returns the localized display name for the energy recycle block type.
Returns the localized display name for the energy recycle block type.
GetIconBitmapBytes(): Returns the raw bytes of the energy recycle icon image resource.
Returns the raw bytes of the energy recycle icon image resource.
GetProperties(PropertyType): Returns the list of property identifiers available for this energy recycle block filtered by property type.
Returns the list of property identifiers available for this energy recycle block filtered by property type.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
The type of properties to retrieve. |
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 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_ER_0"). |
su |
IUnitsOfMeasure |
The unit system to use for conversion; defaults to SI if not provided. |
LoadData(List<XElement>): Restores the energy recycle state from a list of XML elements.
Restores the energy recycle state from a list of XML elements.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
The list of XElement objects containing the serialized state. |
MAX(object): Returns the maximum value from an array-like object.
Returns the maximum value from an array-like object.
| Parameter | Type | Description |
|---|---|---|
Vv |
Object |
An array whose maximum element is to be found. |
RunDynamicModel(): Executes the dynamic simulation model step for this energy recycle block (no-op).
Executes the dynamic simulation model step for this energy recycle block (no-op).
SaveData(): Serializes the energy recycle state to a list of XML elements for persistence.
Serializes the energy recycle state to a list of XML elements for persistence.
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. |
propval |
Object |
The new value in the units of su. |
su |
IUnitsOfMeasure |
The unit system of the supplied value; defaults to SI if not provided. |
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¶