Skip to content

Valve

Represents a valve unit operation that models a pressure letdown device. The valve reduces stream pressure via an isenthalpic (adiabatic) or isentropic flash, optionally using flow coefficient (Kv/Cv) equations for liquid, gas, steam, or two-phase service.

DWSIM.UnitOperations.UnitOperations.Valve
Assembly DWSIM.UnitOperations.dll · Object ← BaseClass ← UnitOpBaseClass ← Valve

At a glance

Valve in the example flowsheet

Port Index Connected in the example
Inlet, material 0 CW-in
Outlet, material 0 CW-out

Example

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

fs = (Flowsheet.Create("ValveExample")
      .WithCompound("Water")
      .WithPropertyPackage(PropertyPackages.SteamTables))

water_in = (fs.AddMaterialStream("CW-in")
            .At(Q.Celsius(25.0), Q.Bar(6.0))
            .WithMassFlow(Q.KgPerSecond(10.0)))
water_out = fs.AddMaterialStream("CW-out")

valve = (fs.AddValve("FV-1")
         .WithCalcMode(Valve.CalculationMode.Kv_Liquid)   # pressure drop from flow and Kv
         .WithKv(50.0)                                    # m3/h at 1 bar
         .ConnectFeed(water_in)
         .ConnectProduct(water_out))

fs.AutoLayout()
fs.Solve()

q = water_in.VolumetricFlowM3PerSecond * 3600.0   # m3/h
dp = (water_in.PressurePa - water_out.PressurePa) / 1e5
print(f"Volumetric flow = {q:.2f} m3/h")
print(f"Pressure drop   = {dp:.4f} bar")
print(f"Outlet P        = {water_out.PressurePa / 1e5:.4f} bar")
print(f"Outlet T        = {water_out.TemperatureK - 273.15:.3f} C")

Output

Volumetric flow = 36.10 m3/h
Pressure drop   = 0.5203 bar
Outlet P        = 5.4797 bar
Outlet T        = 25.012 C

DWSIM 10.2.11.0, generated 2026-10-08.

Calculation modes

Set with CalcMode (CalculationMode). The mode decides which properties are inputs; every other one is a result and is overwritten by the calculation.

Mode Value What it does Inputs
DeltaP 0 Outlet pressure is calculated from a user-specified pressure drop (ΔP). PROP_VA_0, PROP_VA_1
OutletPressure 1 Pressure drop is calculated from a user-specified outlet pressure. PROP_VA_0, PROP_VA_2
Kv_Liquid 2 Outlet pressure is calculated from the flow coefficient (Kv/Cv) equation for liquid service. PROP_VA_0, PROP_VA_4
Kv_Gas 3 Outlet pressure is calculated from the flow coefficient (Kv/Cv) equation for gas service. PROP_VA_0, PROP_VA_4
Kv_Steam 4 Outlet pressure is calculated from a simplified steam sizing equation. PROP_VA_0, PROP_VA_4
Kv_General 5 Outlet pressure is calculated using the appropriate Kv equation selected automatically based on stream phase. PROP_VA_0, PROP_VA_4

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 in
PROP_VA_0 Calculation Mode all modes
PROP_VA_1 Pressure Drop Pa DeltaP
PROP_VA_2 Outlet Pressure Pa OutletPressure
PROP_VA_3 Temperature Drop K (difference) result
PROP_VA_4 Kv(max) Kv_Liquid, Kv_Gas, Kv_Steam, Kv_General
PROP_VA_5 Opening result
PROP_VA_6 Characteristic Parameter result
Actual Flow Coefficient result

Dynamic mode

Extra properties used when the flowsheet runs in dynamic mode.

Name Unit
Actuator Delay s
Actuator Time Constant s
Opening Setpoint
Cavitation Alarm
Liquid Pressure Recovery Factor FL

Learn more

API members

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

Constructors

Valve(): Initializes a new default instance of the Valve class.

Initializes a new default instance of the Valve class.

public Valve()
Public Sub New()

Valve(string, string): Initializes a new instance of the Valve class with the specified name and description.

Initializes a new instance of the Valve class with the specified name and description.

Parameter Type Description
name String The display name assigned to this valve object.
description String A short description of this valve object.
public Valve(string name, string description)
Public Sub New(name As String, description As String)

Properties

ActualKv: Gets or sets the actual (effective) flow coefficient calculated during the last simulation step, accounting for the...

Gets or sets the actual (effective) flow coefficient calculated during the last simulation step, accounting for the current opening percentage.

public double ActualKv { get; set; }
Public Property ActualKv As Double

CalcMode: Gets or sets the active calculation mode that determines how the valve outlet condition is computed.

Gets or sets the active calculation mode that determines how the valve outlet condition is computed.

public Valve.CalculationMode CalcMode { get; set; }
Public Property CalcMode As Valve.CalculationMode

CharacteristicParameter: Gets or sets the rangeability (characteristic) parameter used in the equal-percentage flow characteristic calculation.

Gets or sets the rangeability (characteristic) parameter used in the equal-percentage flow characteristic calculation. Default is 50.

public double CharacteristicParameter { get; set; }
Public Property CharacteristicParameter As Double

DefinedOpeningKvRelationShipType: Gets or sets the type of opening/Kv characteristic curve to apply when...

Gets or sets the type of opening/Kv characteristic curve to apply when EnableOpeningKvRelationship is True.

public Valve.OpeningKvRelationshipType DefinedOpeningKvRelationShipType { get; set; }
Public Property DefinedOpeningKvRelationShipType As Valve.OpeningKvRelationshipType

DeltaP: Gets or sets the pressure drop (Pa) across the valve (P_inlet − P_outlet).

Gets or sets the pressure drop (Pa) across the valve (P_inlet − P_outlet).

public double? DeltaP { get; set; }
Public Property DeltaP As Double?

DeltaQ: Gets or sets the heat duty (kJ/s) of the valve.

Gets or sets the heat duty (kJ/s) of the valve. Always zero for an adiabatic valve.

public double? DeltaQ { get; set; }
Public Property DeltaQ As Double?

DeltaT: Gets or sets the temperature change (K) across the valve (T_outlet − T_inlet).

Gets or sets the temperature change (K) across the valve (T_outlet − T_inlet).

public double? DeltaT { get; set; }
Public Property DeltaT As Double?

EnableOpeningKvRelationship: Gets or sets a value indicating whether the opening/Kv relationship feature is active.

Gets or sets a value indicating whether the opening/Kv relationship feature is active. When True, the effective Kv is calculated from the stem opening using the selected characteristic curve.

public bool EnableOpeningKvRelationship { get; set; }
Public Property EnableOpeningKvRelationship As Boolean

EquipmentTypes: Gets the list of equipment sub-types supported by this valve object.

Gets the list of equipment sub-types supported by this valve object.

public override List<string> EquipmentTypes { get; }
Public Overrides ReadOnly Property EquipmentTypes As List(Of String)

EstimatedDiameter: Gets or sets the estimated valve body diameter in metres, calculated from flow and Kv.

Gets or sets the estimated valve body diameter in metres, calculated from flow and Kv.

public double EstimatedDiameter { get; set; }
Public Property EstimatedDiameter As Double

Fi: Gets or sets the incipient cavitation factor (Fi).

Gets or sets the incipient cavitation factor (Fi). Default is 0.9.

public double Fi { get; set; }
Public Property Fi As Double

FL: Gets or sets the liquid pressure recovery factor (FL) of the valve.

Gets or sets the liquid pressure recovery factor (FL) of the valve. Default is 0.9.

public double FL { get; set; }
Public Property FL As Double

FlowCoefficient: Gets or sets whether the flow coefficient is expressed as Kv (metric, m³/h at 1 bar drop) or Cv (imperial).

Gets or sets whether the flow coefficient is expressed as Kv (metric, m³/h at 1 bar drop) or Cv (imperial).

public Valve.FlowCoefficientType FlowCoefficient { get; set; }
Public Property FlowCoefficient As Valve.FlowCoefficientType

FP: Gets or sets the piping geometry factor (FP) accounting for inlet/outlet fittings.

Gets or sets the piping geometry factor (FP) accounting for inlet/outlet fittings. Default is 1.0.

public double FP { get; set; }
Public Property FP As Double

Fs: Gets or sets the valve style modifier (Fs).

Gets or sets the valve style modifier (Fs). Default is 1.0.

public double Fs { get; set; }
Public Property Fs As Double

HasPropertiesForDynamicMode: Gets a value indicating whether this valve exposes properties specific to dynamic mode.

Gets a value indicating whether this valve exposes properties specific to dynamic mode.

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

HeatDuty: Gets or sets the heat duty (kJ/s) associated with the valve.

Gets or sets the heat duty (kJ/s) associated with the valve. For an adiabatic valve this is always zero. Proxies DeltaQ.

public double HeatDuty { get; set; }
Public Property HeatDuty As Double

Hinlet: Gets or sets the specific enthalpy of the inlet stream in kJ/kg.

Gets or sets the specific enthalpy of the inlet stream in kJ/kg.

public double Hinlet { get; set; }
Public Property Hinlet As Double

Houtlet: Gets or sets the specific enthalpy of the outlet stream in kJ/kg.

Gets or sets the specific enthalpy of the outlet stream in kJ/kg.

public double Houtlet { get; set; }
Public Property Houtlet As Double

Kv: Gets or sets the maximum flow coefficient (Kv or Cv depending on FlowCoefficient) for the valve...

Gets or sets the maximum flow coefficient (Kv or Cv depending on FlowCoefficient) for the valve at fully open position.

public double Kv { get; set; }
Public Property Kv As Double

MinimumOpening: Runtime-only.

Runtime-only. Lowest opening (%) the stem can reach: a passing valve that no longer shuts tight. Zero for a healthy valve.

public double MinimumOpening { get; set; }
Public Property MinimumOpening As Double

MobileCompatible: Gets a value indicating that this valve is compatible with the DWSIM mobile platform.

Gets a value indicating that this valve is compatible with the DWSIM mobile platform.

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

N6: Gets or sets the numerical constant N6 used in the gas Kv sizing equation (SI units).

Gets or sets the numerical constant N6 used in the gas Kv sizing equation (SI units). Default is 31.6.

public double N6 { get; set; }
Public Property N6 As Double

ObjectClass: Gets the simulation object class category for this valve (PressureChangers).

Gets the simulation object class category for this valve (PressureChangers).

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

OpeningKvRelDataTableX: Gets or sets the X-axis data points (opening percentage values) for the tabulated opening/Kv relationship.

Gets or sets the X-axis data points (opening percentage values) for the tabulated opening/Kv relationship.

public List<double> OpeningKvRelDataTableX { get; set; }
Public Property OpeningKvRelDataTableX As List(Of Double)

OpeningKvRelDataTableY: Gets or sets the Y-axis data points (Kv percentage values) for the tabulated opening/Kv relationship.

Gets or sets the Y-axis data points (Kv percentage values) for the tabulated opening/Kv relationship.

public List<double> OpeningKvRelDataTableY { get; set; }
Public Property OpeningKvRelDataTableY As List(Of Double)

OpeningPct: Gets or sets the valve stem opening as a percentage (0–100).

Gets or sets the valve stem opening as a percentage (0–100). In dynamic mode with actuator delay configured, setting this value enqueues the new opening for deferred application rather than applying it immediately.

public double OpeningPct { get; set; }
Public Property OpeningPct As Double

OrificeDiameter: Orifice bore, m (dynamic orifice model).

Orifice bore, m (dynamic orifice model).

public double OrificeDiameter { get; set; }
Public Property OrificeDiameter As Double

OrificeDischargeCoefficient: Discharge coefficient of the orifice, 0.6 to 0.65 for a thin sharp-edged plate (dynamic orifice model).

Discharge coefficient of the orifice, 0.6 to 0.65 for a thin sharp-edged plate (dynamic orifice model).

public double OrificeDischargeCoefficient { get; set; }
Public Property OrificeDischargeCoefficient As Double

OrificeThroatPressure: Pressure at the orifice throat from the last dynamic step, Pa (equal to the downstream pressure when the flow is not...

Pressure at the orifice throat from the last dynamic step, Pa (equal to the downstream pressure when the flow is not choked).

public double OrificeThroatPressure { get; set; }
Public Property OrificeThroatPressure As Double

OutletPressure: Gets or sets the specified or calculated outlet pressure (Pa).

Gets or sets the specified or calculated outlet pressure (Pa).

public double? OutletPressure { get; set; }
Public Property OutletPressure As Double?

OutletTemperature: Gets or sets the calculated outlet stream temperature (K).

Gets or sets the calculated outlet stream temperature (K).

public double OutletTemperature { get; set; }
Public Property OutletTemperature As Double

PercentOpeningVersusPercentKvExpression: Gets or sets the mathematical expression that relates valve stem opening percentage (variable OP) to the effective...

Gets or sets the mathematical expression that relates valve stem opening percentage (variable OP) to the effective Kv as a percentage of the maximum Kv. Used when EnableOpeningKvRelationship is True and DefinedOpeningKvRelationShipType is UserDefined.

public string PercentOpeningVersusPercentKvExpression { get; set; }
Public Property PercentOpeningVersusPercentKvExpression As String

PressureDrop: Gets or sets the pressure drop (Pa) across the valve.

Gets or sets the pressure drop (Pa) across the valve. Proxies DeltaP.

public double PressureDrop { get; set; }
Public Property PressureDrop As Double

StemLocked: Runtime-only.

Runtime-only. While True, writes to OpeningPct from controllers, events or the user are ignored and the stem stays where it is; ForceOpening still moves it. Operator-training malfunctions (stuck valve, valve driven to its fail position) set this.

public bool StemLocked { get; set; }
Public Property StemLocked As Boolean

SupportsDynamicMode: Gets a value indicating whether this valve supports dynamic simulation mode.

Gets a value indicating whether this valve supports dynamic simulation mode.

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

TemperatureChange: Gets or sets the temperature change (K) across the valve as a result of the pressure letdown.

Gets or sets the temperature change (K) across the valve as a result of the pressure letdown. Proxies DeltaT.

public double TemperatureChange { get; set; }
Public Property TemperatureChange As Double

UseOrificeFlow: Dynamic mode only: compute the flow with the compressible orifice equations (isentropic nozzle with choking for gas...

Dynamic mode only: compute the flow with the compressible orifice equations (isentropic nozzle with choking for gas, Cd A sqrt(2 rho dP) for liquid and homogeneous two-phase) instead of the ISA Kv forms. This is the model for a restriction orifice or a blowdown valve given by bore and discharge coefficient; the opening characteristic still scales the open area.

public bool UseOrificeFlow { get; set; }
Public Property UseOrificeFlow As Boolean

xT: Gets or sets the pressure differential ratio factor (xT) used in gas/two-phase Kv calculations.

Gets or sets the pressure differential ratio factor (xT) used in gas/two-phase Kv calculations. Default is 0.75.

public double xT { get; set; }
Public Property xT As Double

Methods

Calculate(object): Performs the steady-state valve calculation.

Performs the steady-state valve calculation. Determines the outlet pressure from the selected CalcMode (DeltaP, OutletPressure, or Kv-based), then performs an isenthalpic (PH) flash to find the outlet temperature and phase state.

Parameter Type Description
args Object Optional two-element array: args(0) is the inlet MaterialStream, args(1) is the outlet MaterialStream. When Nothing, connected streams are used.
public override void Calculate(object args = null)
Public Overrides Sub Calculate(args As Object = Nothing)

CalculateDynamicMassFlow(double, double): Mass flow through the valve in dynamic mode (kg/s) for the given inlet and outlet pressures (Pa), from the inlet...

Mass flow through the valve in dynamic mode (kg/s) for the given inlet and outlet pressures (Pa), from the inlet stream's current state and the current opening. Nothing on the streams changes, so a pressure-flow network solver can call it repeatedly.

Parameter Type Description
P1 Double
P2 Double
public double CalculateDynamicMassFlow(double P1, double P2)
Public Function CalculateDynamicMassFlow(P1 As Double, P2 As Double) As Double

CalculateKv(): Calculates and updates the valve's maximum flow coefficient (Kv or Cv) from the current inlet and outlet stream...

Calculates and updates the valve's maximum flow coefficient (Kv or Cv) from the current inlet and outlet stream conditions. The appropriate sizing equation is selected based on the current CalcMode and the phase state of the inlet stream. Also back-calculates the full-open Kv from the opening/Kv relationship when enabled.

public void CalculateKv()
Public Sub CalculateKv()

CloneXML(): Creates a deep copy of this valve by serialising and deserialising via the custom XML mechanism.

Creates a deep copy of this valve by serialising and deserialising via the custom XML mechanism.

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

CloseEditForm(): Closes and disposes the editing form for this valve if it is currently open.

Closes and disposes the editing form for this valve if it is currently open.

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

CreateDimensionsList(): Creates the list of physical dimensions associated with this valve (diameter).

Creates the list of physical dimensions associated with this valve (diameter).

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

CreateDynamicProperties(): Registers dynamic simulation properties for this valve, specifically the actuator delay.

Registers dynamic simulation properties for this valve, specifically the actuator delay.

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

DeCalculate(): Clears the results on the outlet stream, resetting temperatures, pressures, enthalpies, and compositions to...

Clears the results on the outlet stream, resetting temperatures, pressures, enthalpies, and compositions to indeterminate values. Called when the calculation is invalidated.

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

DisplayEditForm(): Opens (or activates) the editing form for this valve in the flowsheet UI.

Opens (or activates) the editing form for this valve in the flowsheet UI.

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

F_F(double, double): Calculates the liquid critical pressure ratio factor F_F = 0.96 − 0.28 × √(Pv/Pc), used to determine the effective...

Calculates the liquid critical pressure ratio factor F_F = 0.96 − 0.28 × √(Pv/Pc), used to determine the effective pressure at which choked liquid flow begins.

Parameter Type Description
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
public double F_F(double Pv, double Pc)
Public Function F_F(Pv As Double, Pc As Double) As Double

F_k(double): Calculates the ratio of specific heats factor F_k = k / 1.4, used in gas Kv sizing equations.

Calculates the ratio of specific heats factor F_k = k / 1.4, used in gas Kv sizing equations.

Parameter Type Description
k Double Ratio of specific heats (Cp/Cv) of the gas.
public double F_k(double k)
Public Function F_k(k As Double) As Double

ForceOpening(double): Moves the stem to value (%) regardless of the lock or the actuator delay.

Moves the stem to value (%) regardless of the lock or the actuator delay.

Parameter Type Description
value Double
public void ForceOpening(double value)
Public Sub ForceOpening(value As Double)

GetBaseKv(): The flow coefficient on the Kv basis, before the opening characteristic.

The flow coefficient on the Kv basis, before the opening characteristic.

public double GetBaseKv()
Public Function GetBaseKv() As Double

GetCalculationModes(): Returns an array of strings describing all available calculation modes for this valve.

Returns an array of strings describing all available calculation modes for this valve.

public override string[] GetCalculationModes()
Public Overrides Function GetCalculationModes() As String()

GetDisplayDescription(): Returns the localised description string for this valve, shown in the object palette and tooltips.

Returns the localised description string for this valve, shown in the object palette and tooltips.

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

GetDisplayName(): Returns the localised display name for this valve, shown in the flowsheet and property grid.

Returns the localised display name for this valve, shown in the flowsheet and property grid.

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

GetEffectiveKv(): The flow coefficient (Kv basis) at the current opening, through the opening/Kv relationship.

The flow coefficient (Kv basis) at the current opening, through the opening/Kv relationship.

public double GetEffectiveKv()
Public Function GetEffectiveKv() As Double

GetIconBitmapBytes(): Returns the raw bytes of the valve icon PNG resource, used for cross-platform icon loading.

Returns the raw bytes of the valve icon PNG resource, used for cross-platform icon loading.

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

GetProperties(PropertyType): Returns an array of property identifier strings for the valve, filtered by the requested property access type.

Returns an array of property identifier strings for the valve, filtered by the requested property access type.

Parameter Type Description
proptype PropertyType Specifies whether to return read-only, read-write, write-only, or all properties.
public override string[] GetProperties(PropertyType proptype)
Public Overrides Function GetProperties(proptype As PropertyType) As String()

GetPropertyDescription(string): Returns a user-facing description for the specified property name, displayed in the property grid tooltip.

Returns a user-facing description for the specified property name, displayed in the property grid tooltip.

Parameter Type Description
p String The property display name (e.g., "Pressure Drop").
public override string GetPropertyDescription(string p)
Public Overrides Function GetPropertyDescription(p As String) As String

GetPropertyUnit(string, IUnitsOfMeasure): Returns the display unit string for the specified property in the given unit system.

Returns the display unit string for the specified property in the given unit system.

Parameter Type Description
prop String Property identifier string.
su IUnitsOfMeasure Unit system to use for the unit label; defaults to SI when Nothing.
public override string GetPropertyUnit(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyUnit(prop As String, su As IUnitsOfMeasure = Nothing) As String

GetPropertyValue(string, IUnitsOfMeasure): Returns the value of the specified property, converted to the requested unit system.

Returns the value of the specified property, converted to the requested unit system.

Parameter Type Description
prop String Property identifier string (e.g., "PROP_VA_0").
su IUnitsOfMeasure Unit system to convert the value to; defaults to SI when Nothing.
public override object GetPropertyValue(string prop, IUnitsOfMeasure su = null)
Public Overrides Function GetPropertyValue(prop As String, su As IUnitsOfMeasure = Nothing) As Object

GetReport(IUnitsOfMeasure, CultureInfo, string): Generates a plain-text results report for this valve, listing inlet conditions, calculation parameters, and results.

Generates a plain-text results report for this valve, listing inlet conditions, calculation parameters, and results.

Parameter Type Description
su IUnitsOfMeasure Unit system used to convert values for display.
ci CultureInfo Culture info controlling number formatting.
numberformat String Format string applied to numeric values (e.g., "G6").
public override string GetReport(IUnitsOfMeasure su, CultureInfo ci, string numberformat)
Public Overrides Function GetReport(su As IUnitsOfMeasure, ci As CultureInfo, numberformat As String) As String

GetStructuredReport(): Generates a structured results report as a list of typed tuples, used by the UI report viewer.

Generates a structured results report as a list of typed tuples, used by the UI report viewer. Each tuple contains a ReportItemType tag and an array of display strings.

public override List<Tuple<ReportItemType, string[]>> GetStructuredReport()
Public Overrides Function GetStructuredReport() As List(Of Tuple(Of ReportItemType, String()))

KvFromOrifice(double, double): Calculates the equivalent flow coefficient (Kv) of a round orifice, as the water flow in m3/h (density 1000 kg/m3)...

Calculates the equivalent flow coefficient (Kv) of a round orifice, as the water flow in m3/h (density 1000 kg/m3) that passes it with a 1 bar pressure drop.

Parameter Type Description
diameter Double Orifice diameter in m.
dischargeCoefficient Double Orifice discharge coefficient (dimensionless).
public static double KvFromOrifice(double diameter, double dischargeCoefficient)
Public Shared Function KvFromOrifice(diameter As Double, dischargeCoefficient As Double) As Double

KvGas(double, double, double, double, double): Calculates the valve flow coefficient (Kv) for single-phase gas service per ANSI/ISA-75.01.01, applying the...

Calculates the valve flow coefficient (Kv) for single-phase gas service per ANSI/ISA-75.01.01, applying the choked-flow correction via Y and x_choked.

Parameter Type Description
Wi Double Mass flow rate in kg/h.
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
k Double Ratio of specific heats (Cp/Cv) of the gas.
rho Double Gas density at inlet conditions in kg/m³.
public object KvGas(double Wi, double P1, double P2, double k, double rho)
Public Function KvGas(Wi As Double, P1 As Double, P2 As Double, k As Double, rho As Double) As Object

KvLiquid(double, double, double, double, double, double): Calculates the valve flow coefficient (Kv) for single-phase liquid service per ANSI/ISA-75.01.01, applying the...

Calculates the valve flow coefficient (Kv) for single-phase liquid service per ANSI/ISA-75.01.01, applying the choked-flow limit based on F_L and F_F.

Parameter Type Description
Wi Double Mass flow rate in kg/h.
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
rho Double Liquid density in kg/m³.
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
public double KvLiquid(double Wi, double P1, double P2, double rho, double Pv, double Pc)
Public Function KvLiquid(Wi As Double, P1 As Double, P2 As Double, rho As Double, Pv As Double, Pc As Double) As Double

KvTwoPhase(double, double, double, double, double, double, double, double, double, double): Calculates the combined Kv for two-phase (gas/liquid) flow using the Masoneilan blending method.

Calculates the combined Kv for two-phase (gas/liquid) flow using the Masoneilan blending method.

Parameter Type Description
Wi Double Total mass flow rate in kg/h.
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
rhog Double Vapour phase density at inlet in kg/m³.
rhol Double Liquid phase density at inlet in kg/m³.
k Double Ratio of specific heats (Cp/Cv) of the vapour phase.
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
massfrac_gas Double Mass fraction of the vapour phase.
massfrac_liq Double Mass fraction of the liquid phase.
public double KvTwoPhase(double Wi, double P1, double P2, double rhog, double rhol, double k, double Pv, double Pc, double massfrac_gas, double massfrac_liq)
Public Function KvTwoPhase(Wi As Double, P1 As Double, P2 As Double, rhog As Double, rhol As Double, k As Double, Pv As Double, Pc As Double, massfrac_gas As Double, massfrac_liq As Double) As Double

OrificeMassFlow(MaterialStream, double, double, double, double): Calculates the total mass flow rate through the valve for two-phase service given a known Kv.

Calculates the total mass flow rate through the valve for two-phase service given a known Kv. Uses the Masoneilan blending method to combine liquid and gas contributions.

Parameter Type Description
ims MaterialStream
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
T1 Double
openFraction Double
public double OrificeMassFlow(MaterialStream ims, double P1, double P2, double T1, double openFraction)
Public Function OrificeMassFlow(ims As MaterialStream, P1 As Double, P2 As Double, T1 As Double, openFraction As Double) As Double

P1TwoPhase(double, double, double, double, double, double, double, double): Iteratively calculates the inlet pressure P1 for two-phase service given a known mass flow rate, outlet pressure and...

Iteratively calculates the inlet pressure P1 for two-phase service given a known mass flow rate, outlet pressure and flow coefficient, using Newton's method.

Parameter Type Description
Wi Double Total mass flow rate in kg/h.
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P2 Double Outlet pressure in bar.
Ti Double Inlet temperature in K.
rhog20 Double Gas density at standard conditions (273.15 K, 101325 Pa) in kg/m³.
rhol Double Liquid phase density in kg/m³.
massfrac_gas Double Mass fraction of the vapour phase.
massfrac_liq Double Mass fraction of the liquid phase.
public double P1TwoPhase(double Wi, double Kv, double P2, double Ti, double rhog20, double rhol, double massfrac_gas, double massfrac_liq)
Public Function P1TwoPhase(Wi As Double, Kv As Double, P2 As Double, Ti As Double, rhog20 As Double, rhol As Double, massfrac_gas As Double, massfrac_liq As Double) As Double

P2_Gas(double, double, double, double, double): Calculates the outlet pressure P2 for single-phase gas service given a known mass flow rate and flow coefficient...

Calculates the outlet pressure P2 for single-phase gas service given a known mass flow rate and flow coefficient, using bisection search within the non-choked pressure range.

Parameter Type Description
Wi Double Gas mass flow rate in kg/h.
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P1 Double Inlet pressure in bar.
k Double Ratio of specific heats (Cp/Cv) of the gas.
rho Double Gas density at inlet conditions in kg/m³.
public object P2_Gas(double Wi, double Kv, double P1, double k, double rho)
Public Function P2_Gas(Wi As Double, Kv As Double, P1 As Double, k As Double, rho As Double) As Object

P2Liquid(double, double, double, double, double, double): Calculates the outlet pressure P2 for single-phase liquid service given a known mass flow rate and flow coefficient...

Calculates the outlet pressure P2 for single-phase liquid service given a known mass flow rate and flow coefficient, applying the choked-flow limit.

Parameter Type Description
Wi Double Mass flow rate in kg/h.
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P1 Double Inlet pressure in bar.
rho Double Liquid density in kg/m³.
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
public double P2Liquid(double Wi, double Kv, double P1, double rho, double Pv, double Pc)
Public Function P2Liquid(Wi As Double, Kv As Double, P1 As Double, rho As Double, Pv As Double, Pc As Double) As Double

P2TwoPhase(double, double, double, double, double, double, double, double, double, double): Calculates the outlet pressure P2 for two-phase service given a known mass flow rate, inlet conditions and flow...

Calculates the outlet pressure P2 for two-phase service given a known mass flow rate, inlet conditions and flow coefficient using bisection search.

Parameter Type Description
Wi Double Total mass flow rate in kg/h.
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P1 Double Inlet pressure in bar.
rhog Double Vapour phase density at inlet in kg/m³.
rhol Double Liquid phase density at inlet in kg/m³.
k Double Ratio of specific heats (Cp/Cv) of the vapour phase.
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
massfrac_gas Double Mass fraction of the vapour phase.
massfrac_liq Double Mass fraction of the liquid phase.
public double P2TwoPhase(double Wi, double Kv, double P1, double rhog, double rhol, double k, double Pv, double Pc, double massfrac_gas, double massfrac_liq)
Public Function P2TwoPhase(Wi As Double, Kv As Double, P1 As Double, rhog As Double, rhol As Double, k As Double, Pv As Double, Pc As Double, massfrac_gas As Double, massfrac_liq As Double) As Double

RunDynamicModel(): Executes the valve model for one dynamic simulation time step, updating mass flow rates and pressures on connected...

Executes the valve model for one dynamic simulation time step, updating mass flow rates and pressures on connected streams based on the current opening and flow coefficient. Handles actuator delay by deferring opening changes when configured.

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

SetCalculationMode(int): Sets the valve calculation mode by its integer identifier and returns the name of the new mode.

Sets the valve calculation mode by its integer identifier and returns the name of the new mode.

Parameter Type Description
modeID Int32 Integer identifier corresponding to a CalculationMode value.
public override object SetCalculationMode(int modeID)
Public Overrides Function SetCalculationMode(modeID As Integer) As Object

SetPropertyValue(string, object, IUnitsOfMeasure): Sets the value of the specified property, converting from the supplied unit system to SI.

Sets the value of the specified property, converting from the supplied unit system to SI.

Parameter Type Description
prop String Property identifier string (e.g., "PROP_VA_1").
propval Object The new value to assign.
su IUnitsOfMeasure Unit system of the supplied value; defaults to SI when Nothing.
public override bool SetPropertyValue(string prop, object propval, IUnitsOfMeasure su = null)
Public Overrides Function SetPropertyValue(prop As String, propval As Object, su As IUnitsOfMeasure = Nothing) As Boolean

SimpleKvGas(double, double, double, double, double): Calculates the valve flow coefficient (Kv) for single-phase gas service using the simplified ISA equation.

Calculates the valve flow coefficient (Kv) for single-phase gas service using the simplified ISA equation. Applies the choked-flow correction when the downstream pressure falls below half the upstream pressure.

Parameter Type Description
Wi Double Mass flow rate in kg/h.
rhog20 Double Gas density at standard conditions (273.15 K, 101325 Pa) in kg/m³.
P1 Double Inlet pressure in Pa.
P2 Double Outlet pressure in Pa.
Ti Double Inlet temperature in K.
public double SimpleKvGas(double Wi, double rhog20, double P1, double P2, double Ti)
Public Function SimpleKvGas(Wi As Double, rhog20 As Double, P1 As Double, P2 As Double, Ti As Double) As Double

SimpleKvLiquid(double, double, double, double): Calculates the valve flow coefficient (Kv) for single-phase liquid service using the simplified ISA equation.

Calculates the valve flow coefficient (Kv) for single-phase liquid service using the simplified ISA equation.

Parameter Type Description
Wi Double Mass flow rate in kg/h.
rho Double Liquid density in kg/m³.
P1 Double Inlet pressure in Pa.
P2 Double Outlet pressure in Pa.
public double SimpleKvLiquid(double Wi, double rho, double P1, double P2)
Public Function SimpleKvLiquid(Wi As Double, rho As Double, P1 As Double, P2 As Double) As Double

SimpleWTwoPhase(double, double, double, double, double, double, double, double): Calculates the total mass flow rate through the valve for two-phase service using simplified (non-ISA) liquid and...

Calculates the total mass flow rate through the valve for two-phase service using simplified (non-ISA) liquid and gas equations, suitable for iterative pressure calculations.

Parameter Type Description
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P1 Double Inlet pressure in Pa.
P2 Double Outlet pressure in Pa.
Ti Double Inlet temperature in K.
rhog20 Double Gas density at standard conditions (273.15 K, 101325 Pa) in kg/m³.
rhol Double Liquid phase density at inlet in kg/m³.
massfrac_gas Double Mass fraction of the vapour phase.
massfrac_liq Double Mass fraction of the liquid phase.
public double SimpleWTwoPhase(double Kv, double P1, double P2, double Ti, double rhog20, double rhol, double massfrac_gas, double massfrac_liq)
Public Function SimpleWTwoPhase(Kv As Double, P1 As Double, P2 As Double, Ti As Double, rhog20 As Double, rhol As Double, massfrac_gas As Double, massfrac_liq As Double) As Double

UpdateDimensionsList(): Updates the valve's estimated diameter dimension based on the current volumetric flow rate and Kv coefficient.

Updates the valve's estimated diameter dimension based on the current volumetric flow rate and Kv coefficient.

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

UpdateEditForm(): Refreshes the content of the editing form with the latest calculated values, if the form is currently open.

Refreshes the content of the editing form with the latest calculated values, if the form is currently open.

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

WGas(double, double, double, double, double): Calculates the gas mass flow rate through the valve given a known Kv per ANSI/ISA-75.01.01, applying the choked-flow...

Calculates the gas mass flow rate through the valve given a known Kv per ANSI/ISA-75.01.01, applying the choked-flow correction via Y and x_choked.

Parameter Type Description
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
k Double Ratio of specific heats (Cp/Cv) of the gas.
rho Double Gas density at inlet conditions in kg/m³.
public object WGas(double Kv, double P1, double P2, double k, double rho)
Public Function WGas(Kv As Double, P1 As Double, P2 As Double, k As Double, rho As Double) As Object

WLiquid(double, double, double, double, double, double): Calculates the mass flow rate through the valve for single-phase liquid service given a known Kv, applying the...

Calculates the mass flow rate through the valve for single-phase liquid service given a known Kv, applying the choked-flow limit based on F_L and F_F.

Parameter Type Description
Kv Double Effective flow coefficient (m³/h at 1 bar drop).
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
rho Double Liquid density in kg/m³.
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
public double WLiquid(double Kv, double P1, double P2, double rho, double Pv, double Pc)
Public Function WLiquid(Kv As Double, P1 As Double, P2 As Double, rho As Double, Pv As Double, Pc As Double) As Double

WTwoPhase(double, double, double, double, double, double, double, double, double, double): Calculates the total mass flow rate through the valve for two-phase service given a known Kv, combining the ISA...

Calculates the total mass flow rate through the valve for two-phase service given a known Kv, combining the ISA liquid (WLiquid) and gas (WGas) flow equations weighted by the phase mass fractions, including their choked-flow limits.

Parameter Type Description
Kv Double Effective flow coefficient (m3/h at 1 bar drop).
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
rhog Double Vapour phase density at inlet conditions in kg/m3.
rhol Double Liquid phase density at inlet conditions in kg/m3.
k Double Ratio of specific heats (Cp/Cv) of the vapour phase.
Pv Double Liquid vapour pressure at inlet temperature in bar.
Pc Double Mixture critical pressure in bar.
massfrac_gas Double Mass fraction of the vapour phase.
massfrac_liq Double Mass fraction of the liquid phase.
public double WTwoPhase(double Kv, double P1, double P2, double rhog, double rhol, double k, double Pv, double Pc, double massfrac_gas, double massfrac_liq)
Public Function WTwoPhase(Kv As Double, P1 As Double, P2 As Double, rhog As Double, rhol As Double, k As Double, Pv As Double, Pc As Double, massfrac_gas As Double, massfrac_liq As Double) As Double

x_choked(double, double): Calculates the choked-flow pressure differential ratio x_choked = F_k × xT.

Calculates the choked-flow pressure differential ratio x_choked = F_k × xT. Flow is choked when the actual ratio x exceeds this value.

Parameter Type Description
k Double Ratio of specific heats (Cp/Cv) of the gas.
xT Double Pressure differential ratio factor at choked flow for the valve style.
public double x_choked(double k, double xT)
Public Function x_choked(k As Double, xT As Double) As Double

x_ratio(double, double): Calculates the pressure differential ratio x = (P1 − P2) / P1.

Calculates the pressure differential ratio x = (P1 − P2) / P1.

Parameter Type Description
P1 Double Inlet pressure in bar.
P2 Double Outlet pressure in bar.
public double x_ratio(double P1, double P2)
Public Function x_ratio(P1 As Double, P2 As Double) As Double

Y_factor(double, double, double): Calculates the expansion factor Y, which accounts for the change in gas density as it flows through the valve...

Calculates the expansion factor Y, which accounts for the change in gas density as it flows through the valve restriction (per ANSI/ISA-75.01.01).

Parameter Type Description
x Double Pressure differential ratio (P1 − P2) / P1.
k Double Ratio of specific heats (Cp/Cv) of the gas.
xT Double Pressure differential ratio factor at choked flow for the valve style.
public double Y_factor(double x, double k, double xT)
Public Function Y_factor(x As Double, k As Double, xT As Double) As Double

Fields

f: 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 object f
Public f As Object