Thermo Property Editor¶
DWSIM Plus
Available with a DWSIM Plus (Patreon) subscription.
![]()
Thermo property editor: exposes the binary interaction parameters of the flowsheet property packages (PR, SRK, PR78, NRTL, UNIQUAC and Wilson) as object properties, so tools such as Adjust and sensitivity analysis can read and change them. It copies the source (inlet) stream to the target (outlet) stream unchanged.
DWSIM.UnitOperations.ExtensionPack.ThermoPropertyEditor
Assembly DWSIM.UnitOperations.ExtensionPack.dll · Object ← BaseClass ← UnitOpBaseClass ← ThermoPropertyEditor
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Feed |
| Outlet, material | 0 |
Copy |
Example¶
This code runs on every build of this site, and the output below is what it printed.
def run(kij=None):
fs = (Flowsheet.Create("ThermoEditorExample")
.WithCompounds("Methane", "Carbon dioxide")
.WithPropertyPackage(PropertyPackages.PengRobinson))
feed = (fs.AddMaterialStream("Feed")
.At(Q.Celsius(-40.0), Q.Bar(40.0))
.SetCompoundMolarFlow("Methane", 60.0)
.SetCompoundMolarFlow("Carbon dioxide", 40.0))
copy = fs.AddMaterialStream("Copy")
# The outlet is a copy of the inlet. The object's properties are the BIPs of the
# flowsheet property packages, named "<package>: <c1> / <c2>: <parameter>".
editor = (fs.AddThermoPropertyEditor("TPE-1")
.ConnectFeed(feed)
.ConnectProduct(copy))
obj = editor.Object
kij_id = next(p for p in obj.GetProperties(PropertyType.ALL) if p.endswith("Carbon dioxide: kij"))
if kij is not None:
obj.SetPropertyValue(kij_id, kij) # set before the solve
fs.AutoLayout()
fs.Solve()
vf = copy.Object.Phases[2].Properties.molarfraction
return fs, editor, kij_id, obj.GetPropertyValue(kij_id), vf
fs, editor, kij_id, kij_db, vf_db = run()
print(f"Property ID = {kij_id}")
print(f"kij (database) = {kij_db:.4f}, vapor fraction = {vf_db:.4f}")
for kij in (0.0, 0.15):
fs, editor, _, k, vf = run(kij)
print(f"kij = {k:.4f}, vapor fraction = {vf:.4f}")
Output
Property ID = Peng-Robinson (PR): Methane / Carbon dioxide: kij
kij (database) = 0.0793, vapor fraction = 0.8456
kij = 0.0000, vapor fraction = 0.7715
kij = 0.1500, vapor fraction = 0.8757
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 |
|---|---|---|---|
Peng-Robinson (PR): Methane / Carbon dioxide: kij |
yes |
Learn more¶
-
User guide
-
FluentAPI
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
ThermoPropertyEditor(): Initializes a new default instance of the ThermoPropertyEditor class.
Initializes a new default instance of the ThermoPropertyEditor class.
ThermoPropertyEditor(string, string): Initializes a new instance of the ThermoPropertyEditor class with a name and description.
Initializes a new instance of the ThermoPropertyEditor class with a name and description.
| Parameter | Type | Description |
|---|---|---|
Name |
String |
The name of this unit operation. |
Description |
String |
A brief description of this unit operation. |
Properties¶
ComponentDescription: Gets or sets the CAPE-OPEN component description for this unit operation.
Gets or sets the CAPE-OPEN component description for this unit operation.
ComponentName: Gets or sets the CAPE-OPEN component name for this unit operation.
Gets or sets the CAPE-OPEN component name for this unit operation.
IsPremium: Gets a value indicating whether this unit operation is a premium (DWSIM Patreon) unit operation.
Gets a value indicating whether this unit operation is a premium (DWSIM Patreon) unit operation. Always True; the object palette lists it under the Premium category.
MobileCompatible: Gets a value indicating whether this unit operation is compatible with mobile interfaces.
Gets a value indicating whether this unit operation is compatible with mobile interfaces. Always False.
ObjectClass: Gets or sets the simulation object class category (Logical).
Gets or sets the simulation object class category (Logical).
Methods¶
Calculate(object): Calculates the object.
Calculates the object.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
CloneXML(): Creates a deep copy of this object by round-tripping through XML serialization.
Creates a deep copy of this object by round-tripping through XML serialization.
CloseEditForm(): Closes the editor of this object, if it is open.
Closes the editor of this object, if it is open.
DisplayEditForm(): Opens the editor of this object.
Opens the editor of this object. A host that has no editor for it does nothing.
GetDisplayDescription(): Returns the description string for this unit operation type.
Returns the description string for this unit operation type.
GetDisplayName(): Returns the display name for this unit operation type.
Returns the display name for this unit operation type.
GetIconBitmapBytes(): Returns the raw bytes of the icon image for this unit operation.
Returns the raw bytes of the icon image for this unit operation.
GetProperties(PropertyType): Get a list of all properties of the object.
Get a list of all properties of the object.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
Type of the property. |
GetPropertyUnit(string, IUnitsOfMeasure): Gets the units of a property.
Gets the units of a property.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
Property identifier. |
su |
IUnitsOfMeasure |
Units system to use. Null to use the default (SI) system. |
GetPropertyValue(string, IUnitsOfMeasure): Returns the value of a named property, converting from SI to the current unit system.
Returns the value of a named property, converting from SI to the current unit system. Falls back to extra properties if the property is not found in the base implementation.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
The property identifier string. |
su |
IUnitsOfMeasure |
Optional units-of-measure system used for conversion; uses the shared SI system when Nothing. |
LoadData(List<XElement>): Restores the unit operation state from a list of XML elements previously produced by SaveData.
Restores the unit operation state from a list of XML elements previously produced by SaveData.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
The list of XElement objects containing serialized state. |
PerformPostCalcValidation(): Post-calculation validation hook.
Post-calculation validation hook. Does nothing for this object.
SaveData(): Serializes the unit operation state to a list of XML elements for persistence.
Serializes the unit operation state to a list of XML elements for persistence.
SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of a property.
Sets the value of a property.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
Property identifier. |
propval |
Object |
Property value to set at the specified units. |
su |
IUnitsOfMeasure |
Units system to use. Null to use the default (SI) system. |
UpdateEditForm(): Redraws the editor of this object with the current values, if it is open.
Redraws the editor of this object with the current values, if it is open.
Validate(): Validates the object, checking its connections and other parameters.
Validates the object, checking its connections and other parameters.
Fields¶