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¶

| 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
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¶
-
User guide
-
Tutorials
-
FluentAPI
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.
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. |
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.
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.
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.
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.
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).
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.
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).
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.
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.
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.
Fi: Gets or sets the incipient cavitation factor (Fi).
Gets or sets the incipient cavitation factor (Fi). Default is 0.9.
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.
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).
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.
Fs: Gets or sets the valve style modifier (Fs).
Gets or sets the valve style modifier (Fs). Default is 1.0.
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.
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.
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.
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.
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.
MinimumOpening: Runtime-only.
Runtime-only. Lowest opening (%) the stem can reach: a passing valve that no longer shuts tight. Zero for a healthy valve.
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.
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.
ObjectClass: Gets the simulation object class category for this valve (PressureChangers).
Gets the simulation object class category for this valve (PressureChangers).
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.
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.
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.
OrificeDiameter: Orifice bore, m (dynamic orifice model).
Orifice bore, m (dynamic orifice model).
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).
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).
OutletPressure: Gets or sets the specified or calculated outlet pressure (Pa).
Gets or sets the specified or calculated outlet pressure (Pa).
OutletTemperature: Gets or sets the calculated outlet stream temperature (K).
Gets or sets the calculated outlet stream temperature (K).
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.
PressureDrop: Gets or sets the pressure drop (Pa) across the valve.
Gets or sets the pressure drop (Pa) across the valve. Proxies DeltaP.
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.
SupportsDynamicMode: Gets a value indicating whether this valve supports dynamic simulation mode.
Gets a value indicating whether this valve supports dynamic simulation mode.
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.
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.
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.
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. |
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 |
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.
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.
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.
CreateDimensionsList(): Creates the list of physical dimensions associated with this valve (diameter).
Creates the list of physical dimensions associated with this valve (diameter).
CreateDynamicProperties(): Registers dynamic simulation properties for this valve, specifically the actuator delay.
Registers dynamic simulation properties for this valve, specifically the actuator delay.
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.
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.
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. |
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. |
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 |
GetBaseKv(): The flow coefficient on the Kv basis, before the opening characteristic.
The flow coefficient on the Kv basis, before the opening characteristic.
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.
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.
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.
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.
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.
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. |
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"). |
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. |
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. |
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"). |
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.
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). |
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³. |
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. |
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. |
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 |
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. |
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³. |
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. |
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. |
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.
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. |
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. |
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. |
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. |
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. |
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.
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.
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³. |
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. |
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. |
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. |
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. |
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. |
Fields¶