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¶

| 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¶
-
User guide
-
FluentAPI
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 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.
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.
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.
ObjectClass: Gets the simulation object class category (Reactors).
Gets the simulation object class category (Reactors).
Prefix: Gets the default name prefix for this unit operation ('HDS-').
Gets the default name prefix for this unit operation ("HDS-").
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: 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.
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 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). |
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 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. |
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. |
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. |
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.
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. |
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.
Fields¶