Component Separator¶
![]()
Represents a Component Separator unit operation that splits an inlet material stream into two outlet streams based on user-defined per-compound separation specifications. Specifications can be given as absolute mass flow, absolute molar flow, or as a percentage of the inlet mass or molar flow for each compound. The energy imbalance is computed after the mass balance and passed to an optional connected energy stream.
DWSIM.UnitOperations.UnitOperations.ComponentSeparator
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← ComponentSeparator
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Sour-gas |
| Outlet, material | 0 |
Sweet-gas |
| Outlet, material | 1 |
CO2-rich |
| Outlet, energy | energy |
X-1 heat |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("ComponentSeparatorExample")
.WithCompounds("Methane", "Ethane", "Carbon dioxide")
.WithPropertyPackage(PropertyPackages.PengRobinson))
feed = (fs.AddMaterialStream("Sour-gas")
.At(Q.Celsius(35.0), Q.Bar(50.0))
.SetCompoundMolarFlow("Methane", 85.0) # mol/s
.SetCompoundMolarFlow("Ethane", 7.0)
.SetCompoundMolarFlow("Carbon dioxide", 8.0))
sweet = fs.AddMaterialStream("Sweet-gas")
co2 = fs.AddMaterialStream("CO2-rich")
heat = fs.AddEnergyStream("X-1 heat")
sep = (fs.AddComponentSeparator("X-1")
.ConnectFeed(feed)
.ConnectProduct(sweet, 0)
.ConnectProduct(co2, 1)
.ConnectEnergyProduct(heat, 0))
# Each spec gives the share of a compound sent to the specified outlet (port 0 here);
# the other outlet gets the rest.
x = sep.Object
x.SpecifiedStreamIndex = 0
for name, pct in (("Methane", 99.0), ("Ethane", 98.0), ("Carbon dioxide", 2.0)):
x.ComponentSepSpecs.Add(name, ComponentSeparationSpec(name, SeparationSpec.PercentInletMolarFlow, pct, ""))
fs.AutoLayout()
fs.Solve()
s, c = sweet.Object, co2.Object
print(f"Sweet gas flow = {s.Phases[0].Properties.molarflow:.2f} mol/s")
print(f"CO2 in sweet gas= {s.Phases[0].Compounds['Carbon dioxide'].MoleFraction * 100:.2f} mol%")
print(f"CO2-rich flow = {c.Phases[0].Properties.molarflow:.2f} mol/s, "
f"{c.Phases[0].Compounds['Carbon dioxide'].MoleFraction * 100:.1f} mol% CO2")
print(f"Mass balance = {feed.Object.GetMassFlow():.4f} kg/s in, {s.GetMassFlow() + c.GetMassFlow():.4f} kg/s out")
print(f"Energy imbalance= {x.EnergyImb:.3f} kW")
Output
Sweet gas flow = 91.17 mol/s
CO2 in sweet gas= 0.18 mol%
CO2-rich flow = 8.83 mol/s, 88.8 mol% CO2
Mass balance = 1.9262 kg/s in, 1.9262 kg/s out
Energy imbalance= 4.988 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_CP_0 |
Energy Balance | kW | result |
SpecifiedStreamIndex |
yes | ||
SepSpecValue_Methane |
yes | ||
SepSpecValue_Ethane |
yes | ||
SepSpecValue_Carbon dioxide |
yes |
Dynamic mode¶
Extra properties used when the flowsheet runs in dynamic mode.
| Name | Unit |
|---|---|
| Volume | m3 |
| Minimum Pressure | Pa |
| Initialize using Inlet Stream | |
| Reset Content |
Learn more¶
-
User guide
-
FluentAPI
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
ComponentSeparator(): Initializes a new default instance.
Initializes a new default instance.
ComponentSeparator(string, string): Initializes a new instance with a name and description.
Initializes a new instance with a name and description.
| Parameter | Type | Description |
|---|---|---|
name |
String |
|
description |
String |
Properties¶
ComponentSepSpecs: Gets or sets the dictionary of per-compound separation specifications.
Gets or sets the dictionary of per-compound separation specifications.
EmbeddedImageData: Gets or sets the Base64-encoded embedded image data used for the object icon.
Gets or sets the Base64-encoded embedded image data used for the object icon.
EnergyImb: Gets or sets the calculated energy imbalance (W).
Gets or sets the calculated energy imbalance (W).
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.
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.
ObjectClass: Gets or sets the simulation object class, identifying this object as a Separator.
Gets or sets the simulation object class, identifying this object as a Separator.
SpecifiedStreamIndex: Gets or sets the index of the outlet stream whose composition is specified.
Gets or sets the index of the outlet stream whose composition is specified.
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.
UseEmbeddedImage: Gets or sets a value indicating whether the embedded image should be used as the object icon.
Gets or sets a value indicating whether the embedded image should be used as the object icon.
Methods¶
Calculate(object): Calculates the component separator using the specified separation specs.
Calculates the component separator using the specified separation specs.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
CloneXML(): Creates a deep copy of this ComponentSeparator by serializing and deserializing via XML.
Creates a deep copy of this ComponentSeparator by serializing and deserializing via XML.
CloseEditForm(): Closes and disposes the editing form.
Closes and disposes the editing form.
CreateDynamicProperties(): Registers the dynamic properties for dynamic simulation mode: holdup volume (m3), minimum pressure (Pa)...
Registers the dynamic properties for dynamic simulation mode: holdup volume (m3), minimum pressure (Pa), initialization from the inlet stream and the reset flag for the holdup content.
DeCalculate(): Clears all calculated results.
Clears all calculated results.
DisplayEditForm(): Opens or activates the editing form.
Opens or activates the editing form.
GetDisplayDescription(): Returns the localised display description.
Returns the localised display description.
GetDisplayName(): Returns the localised display name.
Returns the localised display name.
GetIconBitmapBytes(): Returns the icon bitmap as a byte array.
Returns the icon bitmap as a byte array.
GetProperties(PropertyType): Returns an array of property identifiers for the specified property type.
Returns an array of property identifiers for the specified property type.
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
GetPropertyDescription(string): Returns a human-readable description of the specified property.
Returns a human-readable description of the specified property.
| Parameter | Type | Description |
|---|---|---|
p |
String |
GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit string for the specified property.
Returns the unit string for the specified property.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
su |
IUnitsOfMeasure |
GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property.
Returns the value of the specified property.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
su |
IUnitsOfMeasure |
GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text report of the component separator results.
Generates a plain-text report of the component separator results.
| Parameter | Type | Description |
|---|---|---|
su |
IUnitsOfMeasure |
|
ci |
CultureInfo |
|
numberformat |
String |
LoadData(List<XElement>): Restores the object state from a list of XML elements previously produced by SaveData.
Restores the object state from a list of XML elements previously produced by SaveData.
| Parameter | Type | Description |
|---|---|---|
data |
List<XElement> |
The list of XML elements containing the serialized state. |
RunDynamicModel(): Runs one dynamic-mode integration step: integrates the holdup (adds the inlet, subtracts both outlets over the time...
Runs one dynamic-mode integration step: integrates the holdup (adds the inlet, subtracts both outlets over the time step), keeps its pressure at or above the minimum pressure, and assigns the holdup composition, temperature, enthalpy and pressure to both outlet streams.
SaveData(): Serializes the component separator state, including separation specs, to XML.
Serializes the component separator state, including separation specs, to XML.
SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property.
Sets the value of the specified property.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
propval |
Object |
|
su |
IUnitsOfMeasure |
UpdateEditForm(): Refreshes the editing form with updated data.
Refreshes the editing form with updated data.
Fields¶