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¶

| 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¶
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.
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.
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).
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).
ObjectClass: Gets the simulation object class category (separators).
Gets the simulation object class category (separators).
Prefix: Gets the default name prefix for this unit operation ('RO-').
Gets the default name prefix for this unit operation ("RO-").
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.
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).
DeCalculate(): Decalculates the object.
Decalculates the object.
DisplayEditForm(): Opens the editor of this object.
Opens the editor of this object. A host that has no editor for it does nothing.
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. |
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.
GetPreferredGraphicObjectHeight(): Returns the preferred height of the flowsheet graphic object, in pixels.
Returns the preferred height of the flowsheet graphic object, in pixels.
GetPreferredGraphicObjectWidth(): Returns the preferred width of the flowsheet graphic object, in pixels.
Returns the preferred width of the flowsheet graphic object, in pixels.
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.
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. |
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. |
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. |
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.
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. |