Valve¶
Create Function¶
-
create_valve
(net, from_junction, to_junction, diameter_m, opened=True, loss_coefficient=0, name=None, index=None, type='valve', **kwargs)¶ Creates a valve element in net[“valve”] from valve parameters.
- Parameters
net (pandapipesNet) – The net for which this valve should be created
from_junction (int) – ID of the junction on one side which the valve will be connected with
to_junction (int) – ID of the junction on the other side which the valve will be connected with
diameter_m (float) – The valve diameter in [m]
opened (bool, default True) – Flag to show if the valve is opened and allows for fluid flow or if it is closed to block the fluid flow.
loss_coefficient (float, default 0) – The pressure loss coefficient introduced by the valve shape
name (str, default None) – A name tag for this valve
index (int, default None) – Force a specified ID if it is available. If None, the index one higher than the highest already existing index is selected.
type (str, default None) – An identifier for special types of valves
kwargs – Additional keyword arguments will be added as further columns to the net[“valve”] table
- Returns
index - The unique ID of the created element
- Return type
int
- Example
>>> create_valve(net, 0, 1, diameter_m=4e-3, name="valve1")
Component Table Data====================
net.valve
Parameter |
Datatype |
Value Range |
Explanation |
name |
string |
name of the valve |
|
from_junction |
integer |
\(>\) 0 |
index of junction at which the valve starts |
to_junction |
integer |
\(>\) 0 |
Index of junction at which the valve ends |
diameter_m |
float |
\(\gt\) 0 |
inner diameter of the pipe [m] |
opened |
boolean |
true/false |
Indicates if the valve is opened |
loss coefficient |
float |
\(\geq\) 0 |
An additional pressure loss coefficient |
type |
string |
type variable to classify junctions |
Physical Model¶
A valve is an edge component which can be used to connect or disconnect network sections. The valve can be modelled as ideal component, which is either fully open or closed causing no losses. However, a pressure loss coefficient can be imposed as well. This property considers a specific loss caused by the component when opened and models internal pressure losses. There are no losses when the component is closed.
The valve is considered as branch element with no length and is modelled accordingly.
Result Table Data¶
For incompressible media:
net.res_valve
Parameter |
Datatype |
Explanation |
v_mean_m_per_s |
float |
The mean valve velocity [m/s] |
p_from_bar |
float |
pressure at “from”-junction [bar] |
p_to_bar |
float |
pressure at “to” junction [bar] |
t_from_k |
float |
temperature at “from”-junction [K] |
t_to_k |
float |
temperature at “to”-junction [K] |
mdot_from_kg_per_s |
float |
massflow into valve [kg/s] |
mdot_to_kg_per_s |
float |
massflow out of valve [kg/s] |
vdot_norm_m3_per_s |
float |
norm volume flow [m^3/s] |
For compressible media:
net.res_valve
Parameter |
Datatype |
Explanation |
v_from_m_per_s |
float |
The velocity at the valve entry [m/s] |
v_to_m_per_s |
float |
The velocity at the valve exit [m/s] |
v_mean_m_per_s |
float |
The mean valve velocity [m/s] |
p_from_bar |
float |
pressure at “from”-junction [bar] |
p_to_bar |
float |
pressure at “to” junction [bar] |
t_from_k |
float |
temperature at “from”-junction [K] |
t_to_k |
float |
temperature at “to”-junction [K] |
mdot_from_kg_per_s |
float |
massflow into valve [kg/s] |
mdot_to_kg_per_s |
float |
massflow out of valve [kg/s] |
vdot_norm_m3_per_s |
float |
norm volume flow [m^3/s] |
reynolds |
float |
Average Reynolds number |
lambda |
float |
Average valve friction factor |
normfactor_from |
float |
Normfactor to calculate real gas velocity at “from”-junction (only for gas flows) |
normfactor_to |
float |
Normfactor to calculate real gas velocity at “to”-junction (only for gas flows) |