Skip to content

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

Component Separator in the example flowsheet

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

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.

public ComponentSeparator()
Public Sub New()

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
public ComponentSeparator(string name, string description)
Public Sub New(name As String, description As String)

Properties

ComponentSepSpecs: Gets or sets the dictionary of per-compound separation specifications.

Gets or sets the dictionary of per-compound separation specifications.

public Dictionary<string, ComponentSeparationSpec> ComponentSepSpecs { get; set; }
Public Property ComponentSepSpecs As Dictionary(Of String, ComponentSeparationSpec)

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.

public string EmbeddedImageData { get; set; }
Public Property EmbeddedImageData As String

EnergyImb: Gets or sets the calculated energy imbalance (W).

Gets or sets the calculated energy imbalance (W).

public double EnergyImb { get; set; }
Public Property EnergyImb As Double

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.

public override bool HasPropertiesForDynamicMode { get; }
Public Overrides ReadOnly Property HasPropertiesForDynamicMode As Boolean

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.

public override bool MobileCompatible { get; }
Public Overrides ReadOnly Property MobileCompatible As Boolean

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.

public override SimulationObjectClass ObjectClass { get; set; }
Public Overrides Property ObjectClass As SimulationObjectClass

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.

public byte SpecifiedStreamIndex { get; set; }
Public Property SpecifiedStreamIndex As Byte

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.

public override bool SupportsDynamicMode { get; }
Public Overrides ReadOnly Property SupportsDynamicMode As Boolean

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.

public bool UseEmbeddedImage { get; set; }
Public Property UseEmbeddedImage As Boolean

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
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

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.

public override object CloneXML()
Public Overrides Function CloneXML() As Object

CloseEditForm(): Closes and disposes the editing form.

Closes and disposes the editing form.

public override void CloseEditForm()
Public Overrides Sub CloseEditForm()

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.

public override void CreateDynamicProperties()
Public Overrides Sub CreateDynamicProperties()

DeCalculate(): Clears all calculated results.

Clears all calculated results.

public override void DeCalculate()
Public Overrides Sub DeCalculate()

DisplayEditForm(): Opens or activates the editing form.

Opens or activates the editing form.

public override void DisplayEditForm()
Public Overrides Sub DisplayEditForm()

GetDisplayDescription(): Returns the localised display description.

Returns the localised display description.

public override string GetDisplayDescription()
Public Overrides Function GetDisplayDescription() As String

GetDisplayName(): Returns the localised display name.

Returns the localised display name.

public override string GetDisplayName()
Public Overrides Function GetDisplayName() As String

GetIconBitmapBytes(): Returns the icon bitmap as a byte array.

Returns the icon bitmap as a byte array.

public override byte[] GetIconBitmapBytes()
Public Overrides Function GetIconBitmapBytes() As Byte()

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
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As String()

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
public override string GetPropertyDescription(string p)
Public Overrides Function GetPropertyDescription(p As String) As 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
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property.

Returns the value of the specified property.

Parameter Type Description
prop String
su IUnitsOfMeasure
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

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
public override string GetReport(IUnitsOfMeasure su, CultureInfo ci, string numberformat)
Public Overrides Function GetReport(su As IUnitsOfMeasure, ci As CultureInfo, numberformat As String) As 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.
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

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.

public override void RunDynamicModel()
Public Overrides Sub RunDynamicModel()

SaveData(): Serializes the component separator state, including separation specs, to XML.

Serializes the component separator state, including separation specs, to XML.

public override List<XElement> SaveData()
Public Overrides Function SaveData() As List(Of XElement)

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
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

UpdateEditForm(): Refreshes the editing form with updated data.

Refreshes the editing form with updated data.

public override void UpdateEditForm()
Public Overrides Sub UpdateEditForm()

Fields

f: The classic (WinForms) editor window open for this unit operation, if any.

The classic (WinForms) editor window open for this unit operation, if any. Not saved with the flowsheet.

public object f
Public f As Object