Skip to content

Mixer

Represents a mixer unit operation that combines up to six material inlet streams into one outlet stream by performing mass and energy balances. Outlet pressure is determined by the configured PressureBehavior (minimum, maximum, or average of inlet pressures).

DWSIM.UnitOperations.UnitOperations.Mixer
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Mixer

At a glance

Mixer in the example flowsheet

Port Index Connected in the example
Inlet, material 0 Condensate
Inlet, material 1 Make-up
Inlet, material 2
Inlet, material 3
Inlet, material 4
Inlet, material 5
Outlet, material 0 Blend

Example

This code runs on every build of this site, and the output below is what it printed.

fs = (Flowsheet.Create("MixerExample")
      .WithCompound("Water")
      .WithPropertyPackage(PropertyPackages.SteamTables))

hot = (fs.AddMaterialStream("Condensate")
       .At(Q.Celsius(90.0), Q.Bar(4.0))
       .WithMassFlow(Q.KgPerSecond(1.5)))
cold = (fs.AddMaterialStream("Make-up")
        .At(Q.Celsius(15.0), Q.Bar(2.5))
        .WithMassFlow(Q.KgPerSecond(3.5)))
blend = fs.AddMaterialStream("Blend")

mixer = (fs.AddMixer("MIX-1")
         .WithPressureBehavior(Mixer.PressureBehavior.Minimum)   # outlet at the lowest inlet pressure
         .ConnectFeed(hot, 0)
         .ConnectFeed(cold, 1)
         .ConnectProduct(blend, 0))

fs.AutoLayout()
fs.Solve()

b = blend.Object
print(f"Outlet flow     = {b.GetMassFlow():.3f} kg/s")
print(f"Outlet T        = {blend.TemperatureK - 273.15:.2f} C")
print(f"Outlet P        = {b.Phases[0].Properties.pressure / 1e5:.2f} bar")
h_mix = (1.5 * hot.Object.Phases[0].Properties.enthalpy
         + 3.5 * cold.Object.Phases[0].Properties.enthalpy) / 5.0
print(f"Outlet h        = {b.Phases[0].Properties.enthalpy:.2f} kJ/kg (flow-weighted inlets {h_mix:.2f})")

Output

Outlet flow     = 5.000 kg/s
Outlet T        = 37.53 C
Outlet P        = 2.50 bar
Outlet h        = 157.42 kJ/kg (flow-weighted inlets 157.42)

DWSIM 10.2.16.0, generated 2026-11-11.

Learn more

API members

Public members declared by this class. Inherited members are documented on the base classes.

Constructors

Mixer(): Initializes a new default instance of the Mixer class.

Initializes a new default instance of the Mixer class.

public Mixer()
Public Sub New()

Mixer(string, string): Initializes a new instance of the Mixer class with a name and description.

Initializes a new instance of the Mixer class with a name and description.

Parameter Type Description
name String The display name of the mixer.
description String A brief description of the mixer.
public Mixer(string name, string description)
Public Sub New(name As String, description As String)

Properties

EOHasEquations: Equations of its own (flows, pressure by its rule, energy) when no energy stream enters it.

Equations of its own (flows, pressure by its rule, energy) when no energy stream enters it.

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

EOTakesSaturatedStreams: The equations read the streams' flows, pressures and enthalpies: a saturated stream keeps them.

The equations read the streams' flows, pressures and enthalpies: a saturated stream keeps them.

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

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 the DWSIM mobile interface.

Gets a value indicating whether this unit operation is compatible with the DWSIM mobile interface.

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

ObjectClass: Gets or sets the simulation object class category (MixersSplitters).

Gets or sets the simulation object class category (MixersSplitters).

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

PressureCalculation: Gets or sets the rule used to determine the outlet stream pressure from the inlet stream pressures.

Gets or sets the rule used to determine the outlet stream pressure from the inlet stream pressures.

public Mixer.PressureBehavior PressureCalculation { get; set; }
Public Property PressureCalculation As Mixer.PressureBehavior

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

Methods

Calculate(object): Performs the mixer mass and energy balance: combines all connected inlet streams into the single outlet stream using...

Performs the mixer mass and energy balance: combines all connected inlet streams into the single outlet stream using the selected pressure rule and a PH flash to determine outlet temperature.

Parameter Type Description
args Object Optional calculation arguments (not used).
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CloneXML(): Creates a deep copy of this mixer via XML serialization.

Creates a deep copy of this mixer via XML serialization.

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

CloseEditForm(): Closes and disposes the editing form for this mixer if it is open.

Closes and disposes the editing form for this mixer if it is open.

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

DeCalculate(): Resets the outlet material stream to an uncalculated state.

Resets the outlet material stream to an uncalculated state.

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

DisplayEditForm(): Opens or activates the editing form for this mixer.

Opens or activates the editing form for this mixer.

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

EOEquationCount(IEquationOrientedContext): How many equations the object adds, for the streams connected to it.

How many equations the object adds, for the streams connected to it.

Parameter Type Description
context IEquationOrientedContext
public override int EOEquationCount(IEquationOrientedContext context)
Public Overrides Function EOEquationCount(context As IEquationOrientedContext) As Integer

EOEquationName(IEquationOrientedContext, int): What equation k says, for the solver's messages.

What equation k says, for the solver's messages.

Parameter Type Description
context IEquationOrientedContext
k Int32
public override string EOEquationName(IEquationOrientedContext context, int k)
Public Overrides Function EOEquationName(context As IEquationOrientedContext, k As Integer) As String

EOIsSmooth(IEquationOrientedContext, double[], int): False for an equation with no derivative at x (a minimum of tied pressures), which a check of the derivatives leaves...

False for an equation with no derivative at x (a minimum of tied pressures), which a check of the derivatives leaves out.

Parameter Type Description
context IEquationOrientedContext
x Double[]
k Int32
public override bool EOIsSmooth(IEquationOrientedContext context, double[] x, int k)
Public Overrides Function EOIsSmooth(context As IEquationOrientedContext, x As Double(), k As Integer) As Boolean

EOJacobian(IEquationOrientedContext, double[], Action<int, int, double>): False: a black box is differenced by the solver.

False: a black box is differenced by the solver.

Parameter Type Description
context IEquationOrientedContext
x Double[]
add Action<Int32,Int32,Double>
public override bool EOJacobian(IEquationOrientedContext context, double[] x, Action<int, int, double> add)
Public Overrides Function EOJacobian(context As IEquationOrientedContext, x As Double(), add As Action(Of Integer, Integer, Double)) As Boolean

EOParameters(): Nothing: as a black box, the object's own calculation reads any of its properties.

Nothing: as a black box, the object's own calculation reads any of its properties.

public override string[] EOParameters()
Public Overrides Function EOParameters() As String()

EOResiduals(IEquationOrientedContext, double[], double[], int): Writes the residuals, each divided by its tolerance, into r from position row.

Writes the residuals, each divided by its tolerance, into r from position row.

Parameter Type Description
context IEquationOrientedContext
x Double[]
r Double[]
row Int32
public override void EOResiduals(IEquationOrientedContext context, double[] x, double[] r, int row)
Public Overrides Sub EOResiduals(context As IEquationOrientedContext, x As Double(), r As Double(), row As Integer)

EOVariables(IEquationOrientedContext): The indices of the variables the residuals read, the object's own parameters the solver moves included.

The indices of the variables the residuals read, the object's own parameters the solver moves included.

Parameter Type Description
context IEquationOrientedContext
public override int[] EOVariables(IEquationOrientedContext context)
Public Overrides Function EOVariables(context As IEquationOrientedContext) As Integer()

GetDisplayDescription(): Returns the localized display description for the mixer type.

Returns the localized display description for the mixer type.

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

GetDisplayName(): Returns the localized display name for the mixer type.

Returns the localized display name for the mixer type.

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

GetIconBitmapBytes(): Returns the raw bytes of the mixer icon image resource.

Returns the raw bytes of the mixer icon image resource.

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

GetProperties(PropertyType): Returns the list of property identifiers available for this mixer.

Returns the list of property identifiers available for this mixer.

Parameter Type Description
proptype PropertyType The type of properties to retrieve.
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) 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 The property identifier string.
su IUnitsOfMeasure The unit system to use; defaults to SI if not provided.
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 The property identifier string.
su IUnitsOfMeasure The unit system to use; defaults to SI if not provided.
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

RunDynamicModel(): Executes the mixer calculation in dynamic simulation mode.

Executes the mixer calculation in dynamic simulation mode.

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

SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property; delegates to the base implementation.

Sets the value of the specified property; delegates to the base implementation.

Parameter Type Description
prop String The property identifier string.
propval Object The new property value.
su IUnitsOfMeasure The unit system of the supplied value; defaults to SI if not provided.
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 displayed data in the editing form if it is currently open.

Refreshes the displayed data in the editing form if it is currently open.

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