Pipe
Create Function
For creating a single pipe:
If using a standard type:
For creating multiple pipes at once:
If using a standard type:
Component Table Data
net.pipe
Parameter |
Datatype |
Value Range |
Explanation |
name |
string |
Name of the pipe |
|
from_junction |
integer |
\(>\) 0 |
Index of junction at which the pipe starts |
to_junction |
integer |
\(>\) 0 |
Index of junction at which the pipe ends |
std_type |
string |
A selected std type for the pipe |
|
length_km |
float |
\(>\) 0 |
Length of the pipe [km] |
diameter_m |
float |
\(\gt\) 0 |
Inner diameter of the pipe [m] |
k_mm |
float |
\(\gt\) 0 |
Pipe roughness [mm] |
loss_coefficient |
float |
\(\geq\) 0 |
An additional loss coefficient which might account for e.g. bends |
alpha_w_per_m2k |
float |
\(\geq\) 0 |
Heat transfer coefficient [W/(m^2K)] |
qext_w |
float |
\(>\) 0 |
An additional heat flow entering or leaving the pipe [W] |
text_k |
float |
\(>\) 0 |
The ambient temperature used for calculating heat losses [K] |
sections |
integer |
\(\geq\) 1 |
The number of internal pipe sections |
in_service |
boolean |
True / False |
Specifies if the line is in service. |
type |
string |
Type variable to classify junctions |
net.pipe_geodata
Parameter |
Datatype |
Explanation |
coords |
list |
List of (x,y) tuples that mark the inflexion points of the pipe |
Physical Model
For both the hydraulic and temperature calculation mode, the main function of the pipe element is to calculate pressure and heat losses, respectively.
Hydraulic mode
The following image shows the implemented pipe model with relevant quantities of the hydraulic calculations:
Losses are calculated in different ways for incompressible and compressible media. Please also note that for an incompressible fluid, the velocity along the pipe is constant. This is not the case for compressible fluids.
Incompressible media
The pressure loss for incompressible media is calculated according to the following formula:
Compressible media
For compressible media, the density is expressed with respect to a reference state using the law of ideal gases:
As reference state variables, the normal temperature and pressure are used by pandapipes. With this relation, also the pipe velocity can be expressed using reference values:
Inserting the equations from above in the differential equation for describing the pressure drop along a pipe results in the following formula, which is used by pandapipes to calculate the pressure drop for compressible media:
The equation for pressure drop also introduces a variable K. This is the compressibility factor, which is used to account for real gas behaviour.
After calculating the gas network, the pressure losses and velocities for the reference state are known. During post processing, the reference velocities are recalculated according to
The equations from above were implemented following [EH90].
Because the velocity of a compressible fluid changes along the pipe axis, it is possible to split a pipe into several sections, increasing the internal resolution. The parameter sections is used to increase the amount of internal pipe sections.
Friction models
Three friction models are used to calculate the velocity dependent friction factor:
Nikuradse
Prandtl-Colebrook
Swamee-Jain
Nikuradse is chosen by default. In this case, the friction factor is calculated by:
Note that in literature, Nikuradse is known as a model for turbulent flows. In pandapipes, the formula for the Nikuradse model is also applied for laminar flow.
If Prandtl-Colebrook is selected, the friction factor is calculated iteratively according to
Equations for pressure losses due to friction were taken from [EH90] and [Cer08].
The equation according to Swamee-Jain [SJ76] is an approximation of the calculation method according to Prandtl-Colebrook. It is an explicit formula for the friction factor of the transition zone of turbulent flows in pipes and is defined as follows:
Heat transfer mode
The following image shows the implemented pipe model with relevant quantities of the heat transfer calculations:
For heat transfer, two effects are considered by the pipe element:
The heat loss due to a temperature difference between the pipe medium and the surrounding temperature is calculated
An additional heat in- or outflow can be specified by the user
The heat losses are described by
according to [BS10]. If the default value of the sections parameter is changed, the resolution of temperature values can be increased.
Result Table Data
For incompressible media:
net.res_pipe
Parameter |
Datatype |
Explanation |
v_mean_m_per_s |
float |
The mean pipe 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 |
Mass flow into pipe [kg/s] |
mdot_to_kg_per_s |
float |
Mass flow out of pipe [kg/s] |
vdot_norm_m3_per_s |
float |
Norm volume flow [m^3/s] |
reynolds |
float |
Average Reynolds number |
lambda |
float |
Average pipe friction factor |
For compressible media:
net.res_pipe
Parameter |
Datatype |
Explanation |
v_from_m_per_s |
float |
The velocity at the pipe entry [m/s] |
v_to_m_per_s |
float |
The velocity at the pipe exit [m/s] |
v_mean_m_per_s |
float |
The mean pipe 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 |
Mass flow into pipe [kg/s] |
mdot_to_kg_per_s |
float |
Mass flow out of pipe [kg/s] |
vdot_norm_m3_per_s |
float |
Norm volume flow [m^3/s] |
reynolds |
float |
Average Reynolds number |
lambda |
float |
Average pipe 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) |