Relief Valve¶
![]()
Represents a safety relief valve (PSV / PRV) unit operation that opens progressively between a set-point pressure and a fully-opened pressure, relieving fluid to a downstream line. The orifice area, discharge coefficient, and back-pressure corrections follow API 520 / ASME Section VIII methodology.
DWSIM.UnitOperations.UnitOperations.ReliefValve
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← ReliefValve
At a glance¶

| Port | Index | Connected in the example |
|---|---|---|
| Inlet, material | 0 |
Relief-in |
| Outlet, material | 0 |
Flare |
Example¶
This code runs on every build of this site, and the output below is what it printed.
fs = (Flowsheet.Create("ReliefValveExample")
.WithCompounds("Methane", "Ethane", "Propane")
.WithPropertyPackage(PropertyPackages.PengRobinson))
# protected system at 8.5 bar, between the set pressure and the fully opened pressure
relief_in = (fs.AddMaterialStream("Relief-in")
.At(Q.Celsius(40.0), Q.Bar(8.5))
.SetCompoundMolarFlow("Methane", 5.0) # mol/s, a first guess for the steady state
.SetCompoundMolarFlow("Ethane", 0.6)
.SetCompoundMolarFlow("Propane", 0.3)
.AsPressureSpec())
flare = fs.AddMaterialStream("Flare").At(Q.Celsius(40.0), Q.Atm(1.0)).AsPressureSpec()
psv = (fs.AddExternalUnitOperation("Relief Valve", "PSV-1")
.ConnectFeed(relief_in)
.ConnectProduct(flare))
rv = psv.Object.__implementation__ # the generic builder holds an ISimulationObject
rv.SetPointPressure = 8.0e5 # Pa
rv.FullyOpenedPressure = 8.8e5 # Pa
rv.OrificeArea = 1.26e-4 # m2, API letter E
rv.DischargeCoefficient = 0.975
rv.DefinedOpeningKvRelationShipType = Valve.OpeningKvRelationshipType.Linear
fs.AutoLayout()
fs.Solve()
flare.Object.Phases[0].Properties.pressure = 101325.0 # boundary pressure for the dynamic run
# the relief valve computes its flow in dynamic mode only
(fs.Dynamics.DefineIntegrator("Int1")
.WithIntegrationStep(Q.Seconds(1.0))
.WithDuration(Q.Seconds(5.0))
.Monitor("Flare", "PROP_MS_2", "kg/s", "relief flow"))
fs.Dynamics.DefineSchedule("Sch1").WithIntegrator("Int1").UseCurrentStateAsInitial(True).MakeCurrent()
result = fs.RunDynamics("Sch1").Execute()
lift = (8.5e5 - rv.SetPointPressure) / (rv.FullyOpenedPressure - rv.SetPointPressure)
print(f"Lift = {lift * 100.0:.1f} %")
print(f"Relief flow = {result.GetSeries('relief flow').Final:.4f} kg/s")
print(f"Flare T = {flare.TemperatureK - 273.15:.1f} C")
print(f"Flare P = {flare.PressurePa / 1e5:.3f} bar")
Output
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 |
|---|---|---|---|
PROP_RV_0 |
Calculation Mode | yes | |
PROP_RV_1 |
Set Pressure | Pa | yes |
PROP_RV_2 |
Overpressure | % | yes |
PROP_RV_3 |
Back Pressure | Pa | yes |
PROP_RV_4 |
Discharge Coefficient (Kd) | yes | |
PROP_RV_5 |
Back Pressure Correction Factor (Kb) | yes | |
PROP_RV_6 |
Combination Correction Factor (Kc) | yes | |
PROP_RV_7 |
Orifice Area | m2 | yes |
PROP_RV_8 |
Standard Orifice | yes | |
PROP_RV_9 |
Relieving Pressure | Pa | result |
PROP_RV_10 |
Relieving Capacity | kg/s | result |
PROP_RV_11 |
Required Orifice Area | m2 | result |
PROP_RV_12 |
Choked Flow | result | |
PROP_RV_13 |
Fully-Opened Pressure | Pa | yes |
PROP_RV_14 |
Viscosity Correction Factor (Kv) | yes | |
PROP_RV_15 |
Liquid Back Pressure Correction Factor (Kw) | yes | |
PROP_RV_16 |
Calculate Viscosity Correction | yes | |
PROP_RV_17 |
Update Outlet Stream | yes |
Learn more¶
API members¶
Public members declared by this class. Inherited members are documented on the base classes.
Constructors¶
ReliefValve(): Initializes a new default instance of the ReliefValve class.
Initializes a new default instance of the ReliefValve class.
ReliefValve(string, string): Initializes a new instance of the ReliefValve class with a name and description.
Initializes a new instance of the ReliefValve class with a name and description.
| Parameter | Type | Description |
|---|---|---|
Name |
String |
The display name of the relief valve. |
Description |
String |
A brief description of the relief valve. |
Properties¶
BackPressure: Gets or sets the total back pressure (Pa, absolute) the steady-state calculation discharges to.
Gets or sets the total back pressure (Pa, absolute) the steady-state calculation discharges to. Default atmospheric.
BackPressureCoefficient: Gets or sets the back-pressure correction factor applied to the relieving capacity.
Gets or sets the back-pressure correction factor applied to the relieving capacity.
CalculateViscosityCorrection: Gets or sets whether the steady state works out the liquid viscosity correction Kv from the Reynolds number through...
Gets or sets whether the steady state works out the liquid viscosity correction Kv from the Reynolds number through the orifice (API 520 Part I) and stores it in ViscosityCoefficient, which the dynamic model then uses. Default False: the user value is used as it is.
CalculationMode: Gets or sets the steady-state calculation mode.
Gets or sets the steady-state calculation mode. Rating gives the relieving capacity of OrificeArea; Sizing gives the area the inlet mass flow needs and the smallest API 526 orifice that holds it. Both report the required area. Default Rating.
CharacteristicParameter: Gets or sets the characteristic parameter used with the equal-percentage inherent curve.
Gets or sets the characteristic parameter used with the equal-percentage inherent curve.
CombinationCorrectionFactor: Gets or sets the combination correction factor Kc (rupture disk upstream of the valve).
Gets or sets the combination correction factor Kc (rupture disk upstream of the valve). Default 1.
DefinedOpeningKvRelationShipType: Gets or sets the relationship type between valve opening and effective Kv.
Gets or sets the relationship type between valve opening and effective Kv.
DischargeCoefficient: Gets or sets the effective discharge coefficient of the orifice.
Gets or sets the effective discharge coefficient of the orifice.
FullyOpenedPressure: Gets or sets the pressure (Pa) at which the relief valve is fully open.
Gets or sets the pressure (Pa) at which the relief valve is fully open.
HasPropertiesForDynamicMode: Gets a value indicating whether this unit operation has no dedicated dynamic-mode properties.
Gets a value indicating whether this unit operation has no dedicated dynamic-mode properties.
LiquidBackPressureCoefficient: Gets or sets the liquid back pressure correction factor Kw (balanced bellows valves).
Gets or sets the liquid back pressure correction factor Kw (balanced bellows valves). Default 1.
MobileCompatible: Gets a value indicating this unit operation is not compatible with mobile/cross-platform interfaces.
Gets a value indicating this unit operation is not compatible with mobile/cross-platform interfaces.
ObjectClass: Gets or sets the simulation object class category (PressureChangers).
Gets or sets the simulation object class category (PressureChangers).
OpeningKvRelDataTableX: Gets or sets the X-axis data (opening %) for a user-defined Kv data table.
Gets or sets the X-axis data (opening %) for a user-defined Kv data table.
OpeningKvRelDataTableY: Gets or sets the Y-axis data (Kv %) for a user-defined Kv data table.
Gets or sets the Y-axis data (Kv %) for a user-defined Kv data table.
OrificeArea: Gets or sets the effective orifice area (m²).
Gets or sets the effective orifice area (m²). Default is API orifice designation "D".
OverpressurePercent: Gets or sets the allowable overpressure, % of the gauge set pressure.
Gets or sets the allowable overpressure, % of the gauge set pressure. With a set pressure above zero, the API 520 relieving pressure is P1 = Patm + (Pset - Patm) (1 + overpressure / 100); with no set pressure, P1 is the inlet stream pressure. Default 10.
PercentOpeningVersusPercentKvExpression: Gets or sets the expression relating percentage opening to percentage Kv (e.g.
Gets or sets the expression relating percentage opening to percentage Kv (e.g. "1.0*OP").
ResultCapacity: Result: relieving capacity (kg/s) of the orifice in use (rating) or of the selected API 526 orifice (sizing).
Result: relieving capacity (kg/s) of the orifice in use (rating) or of the selected API 526 orifice (sizing).
ResultChokedFlow: Result: True when the flow through the orifice is critical (choked).
Result: True when the flow through the orifice is critical (choked).
ResultFlowRegime: Result: the flow regime the steady-state calculation used (Vapor, Liquid or Two-Phase).
Result: the flow regime the steady-state calculation used (Vapor, Liquid or Two-Phase).
ResultMessage: Result: warnings of the last steady-state calculation, empty when there were none.
Result: warnings of the last steady-state calculation, empty when there were none.
ResultRelievingPressure: Result: relieving pressure P1 used by the steady-state calculation (Pa, absolute).
Result: relieving pressure P1 used by the steady-state calculation (Pa, absolute).
ResultRequiredArea: Result: effective orifice area (m²) the inlet mass flow needs at the relieving conditions.
Result: effective orifice area (m²) the inlet mass flow needs at the relieving conditions.
ResultStandardOrifice: Result: API 526 orifice letter, the one matching the orifice area (rating) or the smallest that holds the required...
Result: API 526 orifice letter, the one matching the orifice area (rating) or the smallest that holds the required area (sizing).
SetPointPressure: Gets or sets the set-point pressure (Pa) at which the relief valve begins to open.
Gets or sets the set-point pressure (Pa) at which the relief valve begins to open.
StandardOrificeAreas: Gets the list of standard API orifice letter designations with their areas.
Gets the list of standard API orifice letter designations with their areas.
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.
UpdateOutletStream: Gets or sets whether the steady state writes the outlet stream: the inlet mass flow and composition at the back...
Gets or sets whether the steady state writes the outlet stream: the inlet mass flow and composition at the back pressure, with the inlet enthalpy (isenthalpic letdown, as the dynamic model writes it). Default False, which leaves the outlet stream untouched as the steady state always did.
ViscosityCoefficient: Gets or sets the viscosity correction coefficient applied to the discharge calculation.
Gets or sets the viscosity correction coefficient applied to the discharge calculation.
Methods¶
Calculate(object): Steady-state relief valve calculation (API 520 Part I).
Steady-state relief valve calculation (API 520 Part I). The inlet stream gives the relieving state (temperature, phase split, density, k, viscosity) and the mass flow to relieve; the set pressure and the overpressure give the relieving pressure P1; BackPressure gives P2.
| Parameter | Type | Description |
|---|---|---|
args |
Object |
CloneXML(): Creates a deep copy via XML serialization.
Creates a deep copy via XML serialization.
CloseEditForm(): Closes and disposes the editing form.
Closes and disposes the editing form.
DeCalculate(): Clears the outlet stream when the steady state writes it (UpdateOutletStream); otherwise the...
Clears the outlet stream when the steady state writes it (UpdateOutletStream); otherwise the outlet stream is left alone, as the steady state leaves it.
DisplayEditForm(): Opens or activates the editing form.
Opens or activates the editing form.
GetDisplayDescription(): Returns the display description for this unit operation.
Returns the display description for this unit operation.
GetDisplayName(): Returns the display name for this unit operation.
Returns the display name for this unit operation.
GetEditingForm(): Returns the editing form instance.
Returns the editing form instance.
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.
GetProperties(PropertyType): Returns the property identifiers of the given type (PROP_RV_0 to PROP_RV_17).
Returns the property identifiers of the given type (PROP_RV_0 to PROP_RV_17).
| Parameter | Type | Description |
|---|---|---|
proptype |
PropertyType |
GetPropertyUnit(string, IUnitsOfMeasure): Returns the unit of a property in the given unit system (SI when Nothing).
Returns the unit of a property in the given unit system (SI when Nothing).
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
su |
IUnitsOfMeasure |
GetPropertyValue(string, IUnitsOfMeasure): Returns the value of a property in the given unit system (SI when Nothing).
Returns the value of a property in the given unit system (SI when Nothing).
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
su |
IUnitsOfMeasure |
RunDynamicModel(): Performs the dynamic-mode calculation for the relief valve.
Performs the dynamic-mode calculation for the relief valve.
SetPropertyValue(string, object, IUnitsOfMeasure): Sets a property from a value in the given unit system (SI when Nothing).
Sets a property from a value in the given unit system (SI when Nothing). The standard orifice (PROP_RV_8) takes an API 526 letter, D to T, and writes its area to the orifice area.
| Parameter | Type | Description |
|---|---|---|
prop |
String |
|
propval |
Object |
|
su |
IUnitsOfMeasure |
UpdateEditForm(): Refreshes the editing form with updated data.
Refreshes the editing form with updated data.
Fields¶