Skip to content

Reverse Osmosis

DWSIM Plus

Available with a DWSIM Plus (Patreon) subscription.

Reverse Osmosis Unit Operation — membrane separation driven by transmembrane pressure with osmotic pressure correction (van't Hoff model). Ports ───── Inlet 0 : Feed Inlet 1 : Pump Power (energy stream, optional) Outlet 0 : Permeate Outlet 1 : Brine / Concentrate Algorithm ───────── 1. Obtain feed molar flow, composition, T, P. 2. Estimate feed volumetric flow [m³/s]. 3. Compute feed species concentrations [mol/m³]. 4. Compute feed osmotic pressure (van't Hoff). 5. Determine TMP from PressureSpec. 6. Apply concentration polarization: c_wall = c_feed × CPF. 7. Iterate (3×) NDP = TMP − (π_wall − π_permeate). 8. Water flux: Jw = Lp × NDP. 9. Permeate volumetric flow: Qp = Jw × Area; cap recovery at 0.99. 10. Permeate concentrations: cp,i = c_feed,i × (1 − R_i). 11. Brine concentrations: mass balance. 12. Iterate brine osmotic pressure. 13. Convert to molar flows; set outlet streams.

DWSIM.UnitOperations.ElectrolyteOps.ReverseOsmosisUnitOperation
Assembly DWSIM.UnitOperations.ElectrolyteOps.dll · Object ← BaseClass ← UnitOpBaseClass ← ReverseOsmosisUnitOperation

At a glance

Reverse Osmosis in the example flowsheet

Port Index Connected in the example
Inlet, material 0 Seawater
Inlet, energy 1
Outlet, material 0 Permeate
Outlet, material 1 Brine

Example

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

fs = (Flowsheet.Create("ROExample")
      .WithCompounds("Water", "Sodium (ion)", "Chloride (ion)")
      .WithPropertyPackage(PropertyPackages.Plus.ElectrolyteNRTL))

# Seawater, 35 g/kg of NaCl as ions (equal moles, so the feed is electroneutral),
# delivered by the high-pressure pump at 60 bar
seawater = (fs.AddMaterialStream("Seawater").At(Q.Celsius(25.0), Q.Bar(60.0))
            .SetCompoundMassFlow("Water", 9.65)              # kg/s
            .SetCompoundMassFlow("Sodium (ion)", 0.13768811)  # 5.989 mol/s
            .SetCompoundMassFlow("Chloride (ion)", 0.21231005))
permeate = fs.AddMaterialStream("Permeate")
brine = fs.AddMaterialStream("Brine")

ro = (fs.AddReverseOsmosis("RO-1")
      .WithPressureSpec(ROPressureSpec.FixedFeedP)
      .WithFeedPressure(Q.Bar(60.0))
      .WithPermeatePressure(Q.Bar(1.0))
      .WithWaterPermeability(2.8e-12)                  # m/(s.Pa), about 1 L/(m2.h.bar)
      .WithDefaultRejection(0.995)
      .WithConcentrationPolarizationFactor(1.1)
      .ConnectFeed(seawater, 0)
      .ConnectProduct(permeate, 0).ConnectProduct(brine, 1))
ro.Config.MembraneArea = 500.0                          # m2

fs.AutoLayout()
fs.Solve()

r = ro.Object.Results
tds = lambda s: (s.OverallMassFraction("Sodium (ion)") + s.OverallMassFraction("Chloride (ion)")) * 1e6
print(f"Feed osmotic pressure = {r.FeedOsmoticPressure / 1e5:.1f} bar")
print(f"Net driving pressure  = {r.NetDrivingPressure / 1e5:.1f} bar")
print(f"Water flux            = {r.WaterFlux * 3.6e6:.1f} L/(m2.h)")
print(f"Recovery              = {r.Recovery * 100.0:.1f} %")
print(f"Permeate TDS          = {tds(permeate):.0f} mg/kg (feed {tds(seawater):.0f}, brine {tds(brine):.0f})")

Output

Feed osmotic pressure = 30.3 bar
Net driving pressure  = 25.8 bar
Water flux            = 26.0 L/(m2.h)
Recovery              = 36.9 %
Permeate TDS          = 181 mg/kg (feed 35000, brine 54248)

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
Membrane Type yes
Membrane Area m2 yes
Water Permeability m/(s.Pa) yes
Pressure Spec yes
TMP Pa yes
Feed Pressure Pa yes
Permeate Pressure Pa yes
Default Rejection yes
Concentration Polarization Factor yes
Pump Efficiency yes
Feed Osmotic Pressure Pa result
Brine Osmotic Pressure Pa result
Permeate Osmotic Pressure Pa result
Net Driving Pressure Pa result
Water Flux m/s result
Recovery result
Salt Passage result
Permeate Flow m3/s result
Brine Flow m3/s result
Permeate Molar Flow mol/s result
Brine Molar Flow mol/s result
Energy Consumption kW result
Pump Power kW result

Learn more

API members

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

Constructors

ReverseOsmosisUnitOperation()
public ReverseOsmosisUnitOperation()
Public Sub New()

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.

public override string ComponentDescription { get; set; }
Public Overrides Property ComponentDescription As String

Config: Gets or sets the input configuration: membrane type and area, water permeability, pressure specification, default...

Gets or sets the input configuration: membrane type and area, water permeability, pressure specification, default and per-compound rejections and the concentration polarization factor.

public ReverseOsmosisConfig Config { get; set; }
Public Property Config As ReverseOsmosisConfig

IsPremium: Gets a value indicating that this unit operation is listed in the Premium group of the object palette (always true).

Gets a value indicating that this unit operation is listed in the Premium group of the object palette (always true).

public bool IsPremium { get; }
Public ReadOnly Property IsPremium As Boolean

MobileCompatible: Gets a value indicating whether this unit operation is compatible with mobile interfaces (always false).

Gets a value indicating whether this unit operation is compatible with mobile interfaces (always false).

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

ObjectClass: Gets the simulation object class category (separators).

Gets the simulation object class category (separators).

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

Prefix: Gets the default name prefix for this unit operation ('RO-').

Gets the default name prefix for this unit operation ("RO-").

public string Prefix { get; }
Public ReadOnly Property Prefix As String

Methods

Calculate(object): Calculates the object.

Calculates the object.

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 object by round-tripping through XML serialization.

Creates a deep copy of this object by round-tripping through XML serialization.

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

CloseEditForm(): Closes the editor of this object, if it is open.

Closes the editor of this object, if it is open.

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

CreateConnectors(): Creates the graphic connector definitions on the flowsheet: one feed inlet on the left, a Pump Power (energy) inlet...

Creates the graphic connector definitions on the flowsheet: one feed inlet on the left, a Pump Power (energy) inlet at the bottom placed last in the inlet list, and two outlets on the right (permeate on top, brine below).

public void CreateConnectors()
Public Sub CreateConnectors()

DeCalculate(): Decalculates the object.

Decalculates the object.

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

DisplayEditForm(): Opens the editor of this object.

Opens the editor of this object. A host that has no editor for it does nothing.

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

Draw(object): Draws the unit operation on the given SkiaSharp canvas: the embedded photo in photorealistic mode (draw mode 2)...

Draws the unit operation on the given SkiaSharp canvas: the embedded photo in photorealistic mode (draw mode 2), otherwise the vector icon.

Parameter Type Description
g Object The SkiaSharp canvas.
public void Draw(object g)
Public Sub Draw(g As Object)

GetDisplayDescription(): Returns the description string for this unit operation type.

Returns the description string for this unit operation type.

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

GetDisplayName(): Returns the display name for this unit operation type.

Returns the display name for this unit operation type.

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

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.

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

GetPreferredGraphicObjectHeight(): Returns the preferred height of the flowsheet graphic object, in pixels.

Returns the preferred height of the flowsheet graphic object, in pixels.

public override double GetPreferredGraphicObjectHeight()
Public Overrides Function GetPreferredGraphicObjectHeight() As Double

GetPreferredGraphicObjectWidth(): Returns the preferred width of the flowsheet graphic object, in pixels.

Returns the preferred width of the flowsheet graphic object, in pixels.

public override double GetPreferredGraphicObjectWidth()
Public Overrides Function GetPreferredGraphicObjectWidth() As Double

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

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.
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure) As String

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.
public override object GetPropertyValue(string prop, IUnitsOfMeasure su)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure) As Object

LoadData(List<XElement>): Restores the unit operation.

Restores the unit operation. The Config element, when present, is loaded into the existing Config; files saved without it keep the default configuration.

Parameter Type Description
data List<XElement> The XML elements written by SaveData.
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

PopulateEditorPanel(object): Populates the cross-platform (Avalonia) editor panel with controls.

Populates the cross-platform (Avalonia) editor panel with controls.

Parameter Type Description
ctner Object The editor panel (layout container) to populate.
public void PopulateEditorPanel(object ctner)
Public Sub PopulateEditorPanel(ctner As Object)

ReturnInstance(string): Creates and returns a new instance for deserialization.

Creates and returns a new instance for deserialization.

Parameter Type Description
typename String The type name to instantiate.
public object ReturnInstance(string typename)
Public Function ReturnInstance(typename As String) As Object

SaveData(): Serializes the unit operation, with its Config written as a Config element.

Serializes the unit operation, with its Config written as a Config element.

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

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

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.

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