Skip to content

Hydrodesulphurisation (HDS) Reactor

DWSIM Plus

Available with a DWSIM Plus (Patreon) subscription.

Shortcut Hydrodesulfurizer. Applies a pseudo-nth-order kinetic to the mass-weighted inlet sulfur content (from pseudocomponent-level WtPctSulfur) to compute conversion and H2 consumption. Optionally applies HDN kinetics to nitrogen. Simplification: the outlet stream is a flow-through copy of the feed. Contaminant reduction is reported via Results rather than mutated into downstream compound records. Metals (Ni/V/Fe/Na) are not removed here (they poison catalysts) — use a guard-bed / HDM for those.

DWSIM.UnitOperations.Refining.HDS.HDSUnitOperation
Assembly DWSIM.UnitOperations.Refining.dll · Object ← BaseClass ← UnitOpBaseClass ← HDSUnitOperation

At a glance

Hydrodesulphurisation (HDS) Reactor in the example flowsheet

Port Index Connected in the example
Inlet, material 0 Diesel
Inlet, material 1 Treat-gas
Outlet, material 0 ULSD
Outlet, material 1 Sour-offgas

Example

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

fs = Flowsheet.Create("HDSExample").WithCompounds("Hydrogen", "Hydrogen sulfide", "Ammonia", "Methane")
# Diesel as three pseudocomponents: name, NBP, SG, MW, aromatics mass fraction, S wt%, N wt%
cuts = [("Diesel-1", 503.0, 0.82, 170.0, 0.20, 0.6, 0.005),
        ("Diesel-2", 563.0, 0.85, 220.0, 0.25, 1.1, 0.012),
        ("Diesel-3", 623.0, 0.87, 280.0, 0.30, 1.7, 0.025)]
for name, nbp, sg, mw, xa, s, n in cuts:
    CompoundExtensions.WithPseudoComponent(fs, name, Q.Kelvin(nbp), sg, mw,
                                           paraffinFrac=0.5, naphtenicFrac=0.5 - xa, aromaticFrac=xa)
fs.WithPropertyPackage(PropertyPackages.PengRobinson)

feed = fs.AddMaterialStream("Diesel").At(Q.Celsius(340.0), Q.Bar(45.0))
for name, *_ in cuts:
    feed.SetCompoundMassFlow(name, 10.0)                  # kg/s each, 30 kg/s in total
# Sulfur and nitrogen ride on each pseudocomponent of the feed stream
for name, nbp, sg, mw, xa, s, n in cuts:
    comp = feed.Object.Phases[0].Compounds[name]
    ContaminantKeys.Set(comp, ContaminantKeys.WtPctSulfur, s)
    ContaminantKeys.Set(comp, ContaminantKeys.WtPctNitrogen, n)

treat_gas = (fs.AddMaterialStream("Treat-gas").At(Q.Celsius(60.0), Q.Bar(45.0))
             .SetCompoundMolarFlow("Hydrogen", 900.0)       # mol/s
             .SetCompoundMolarFlow("Methane", 60.0))
product = fs.AddMaterialStream("ULSD")
offgas = fs.AddMaterialStream("Sour-offgas")

hds = (fs.AddHDS("HDS-1")
       .WithReactorTemperature(Q.Celsius(350.0))
       .WithReactorPressure(Q.Bar(45.0))
       .WithH2PartialPressure(Q.Bar(38.0))
       .WithLHSV(1.5)
       .WithReactionOrder(1.5)
       .WithArrhenius(8.0e3, 110000.0)      # k0 and activation energy in J/mol
       .WithEnableHDN(True)
       .ConnectFeed(feed, 0).ConnectFeed(treat_gas, 1)
       .ConnectProduct(product, 0).ConnectProduct(offgas, 1))

fs.AutoLayout()
fs.Solve()

r = hds.Object.Results
print(f"Sulfur in feed     = {r.Inlet.SulfurWtPct:.3f} wt%")
print(f"Sulfur in product  = {r.Outlet.SulfurWtPct * 1e4:.0f} ppmw ({r.SulfurConversion * 100.0:.1f} % HDS)")
print(f"Nitrogen removal   = {r.NitrogenConversion * 100.0:.1f} %")
print(f"H2S produced       = {r.H2SProducedMolPerS * 34.08 * 3.6:.0f} kg/h")
print(f"H2 consumption     = {r.H2ConsumptionKgPerS * 3600.0:.0f} kg/h")

Output

Sulfur in feed     = 1.133 wt%
Sulfur in product  = 202 ppmw (98.2 % HDS)
Nitrogen removal   = 99.5 %
H2S produced       = 1278 kg/h
H2 consumption     = 390 kg/h

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
Reactor Temperature K yes
Reactor Pressure Pa yes
H2 Partial Pressure Pa yes
LHSV (1/h) 1/h yes
Reaction Order NF yes
Activation Energy (kJ/mol) kJ/mol yes
Enable HDN NF yes
Feed Mass Flow kg/s result
Feed Molar Flow mol/s result
Sulfur Conversion NF result
Nitrogen Conversion NF result
Mercaptan Conversion NF result
Inlet Sulfur (wt%) wt% result
Outlet Sulfur (wt%) wt% result
Inlet Nitrogen (wt%) wt% result
Outlet Nitrogen (wt%) wt% result
Sulfur Removed kg/s result
Nitrogen Removed kg/s result
H2 Consumption kg/s result
H2S Produced (mol/s) NF result
NH3 Produced (mol/s) NF result
Feed xP NF result
Feed xN NF result
Feed xA NF result

Learn more

API members

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

Constructors

HDSUnitOperation()
public HDSUnitOperation()
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 HDS configuration: reactor temperature, pressure and H2 partial pressure, LHSV, sulfur kinetics...

Gets or sets the HDS configuration: reactor temperature, pressure and H2 partial pressure, LHSV, sulfur kinetics (order, pre-exponential factor, activation energy, H2 pressure order), mercaptan conversion, the optional HDN kinetics, H2 consumption factors, aromatic saturation, and the compound names used for H2, H2S and NH3. Saved with the flowsheet.

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

IsRefining: Gets a value that is always true.

Gets a value that is always true. It marks this class as a refining unit operation, so the flowsheet object palettes (which read it by reflection) list it under the Refining category.

public bool IsRefining { get; }
Public ReadOnly Property IsRefining 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. Always false.

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

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

Gets the simulation object class category (Reactors).

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

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

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

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: two material inlets on the left edge ('Feed'...

Creates the graphic connector definitions on the flowsheet: two material inlets on the left edge ("Feed", "Hydrogen") and two material outlets on the right edge ("Treated Product", "Sour Offgas"). The energy connector is disabled.

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 icon on the given SkiaSharp canvas.

Draws the unit operation icon on the given SkiaSharp canvas. Draw mode 2 uses the embedded PNG image (falling back to the vector icon if the image cannot be loaded), draw mode 1 draws the vector icon as a silhouette, and any other mode draws the vector icon.

Parameter Type Description
g Object The SkiaSharp canvas (SKCanvas).
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 state from a list of XML elements previously produced by SaveData.

Restores the unit operation state from a list of XML elements previously produced by SaveData.

Parameter Type Description
data List<XElement> The list of XElement objects containing serialized state.
public override bool LoadData(List<XElement> data)
Public Overrides Function LoadData(data As List(Of XElement)) As Boolean

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

Populates the cross-platform editor panel with controls. Only the Avalonia editor panel (AvaloniaEditorPanel) is filled; other container types are left unchanged.

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. Not used; a new HDSUnitOperation is always returned.
public object ReturnInstance(string typename)
Public Function ReturnInstance(typename As String) As Object

SaveData(): Serializes the unit operation state to a list of XML elements for persistence.

Serializes the unit operation state to a list of XML elements for persistence.

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()

Fields

_editorForm: 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 FormEditorHDS _editorForm
Public _editorForm As FormEditorHDS