# Pipe (TL)

Rigid conduit for fluid flow in thermal liquid systems

**Library:**Simscape / Foundation Library / Thermal Liquid / Elements

## Description

The Pipe (TL) block represents a pipeline segment with a fixed volume of liquid. The liquid experiences pressure losses due to viscous friction and heat transfer due to convection between the fluid and the pipe wall. Viscous friction follows from the Darcy-Weisbach equation, while the heat exchange coefficient follows from Nusselt number correlations.

### Pipe Effects

The block lets you include dynamic compressibility and fluid inertia effects. Turning on each of these effects can improve model fidelity at the cost of increased equation complexity and potentially increased simulation cost:

When dynamic compressibility is off, the liquid is assumed to spend negligible time in the pipe volume. Therefore, there is no accumulation of mass in the pipe, and mass inflow equals mass outflow. This is the simplest option. It is appropriate when the liquid mass in the pipe is a negligible fraction of the total liquid mass in the system.

When dynamic compressibility is on, an imbalance of mass inflow and mass outflow can cause liquid to accumulate or diminish in the pipe. As a result, pressure in the pipe volume can rise and fall dynamically, which provides some compliance to the system and modulates rapid pressure changes. This is the default option.

If dynamic compressibility is on, you can also turn on fluid inertia. This effect results in additional flow resistance, besides the resistance due to friction. This additional resistance is proportional to the rate of change of mass flow rate. Accounting for fluid inertia slows down rapid changes in flow rate but can also cause the flow rate to overshoot and oscillate. This option is appropriate in a very long pipe. Turn on fluid inertia and connect multiple pipe segments in series to model the propagation of pressure waves along the pipe, such as in the water hammer phenomenon.

### Mass Balance

The mass conservation equation for the pipe is

$${\dot{m}}_{\text{A}}+{\dot{m}}_{\text{B}}=\{\begin{array}{cc}0,& \text{if}\text{\hspace{0.17em}}\text{fluid}\text{\hspace{0.17em}}\text{dynamic}\text{\hspace{0.17em}}\text{compressibility}\text{\hspace{0.17em}}\text{is}\text{\hspace{0.17em}}\text{'off'}\\ V\rho \left(\frac{1}{\beta}\frac{dp}{dt}-\alpha \frac{dT}{dt}\right),& \text{if}\text{\hspace{0.17em}}\text{fluid}\text{\hspace{0.17em}}\text{dynamic}\text{\hspace{0.17em}}\text{compressibility}\text{\hspace{0.17em}}\text{is}\text{\hspace{0.17em}}\text{'on'}\end{array}$$

where:

$${\dot{m}}_{\text{A}}$$ and $${\dot{m}}_{\text{B}}$$ are the mass flow rates through ports

**A**and**B**.*V*is the pipe fluid volume.*ρ*is the thermal liquid density in the pipe.*β*is the isothermal bulk modulus in the pipe.*α*is the isobaric thermal expansion coefficient in the pipe.*p*is the thermal liquid pressure in the pipe.*T*is the thermal liquid temperature in the pipe.

### Momentum Balance

The table shows the momentum conservation equations for each half pipe.

For half pipe adjacent to port A |
$${p}_{A}-p=\{\begin{array}{cc}\Delta {p}_{\text{v,A}},& \text{if}\text{\hspace{0.17em}}\text{fluid}\text{\hspace{0.17em}}\text{inertia}\text{\hspace{0.17em}}\text{is}\text{\hspace{0.17em}}\text{off}\\ \Delta {p}_{\text{v,A}}+\frac{L}{2S}{\ddot{m}}_{\text{A}},& \text{if}\text{\hspace{0.17em}}\text{fluid}\text{\hspace{0.17em}}\text{inertia}\text{\hspace{0.17em}}\text{is}\text{\hspace{0.17em}}\text{on}\end{array}$$ |

For half pipe adjacent to port B |
$${p}_{B}-p=\{\begin{array}{cc}\Delta {p}_{\text{v,B}},& \text{if}\text{\hspace{0.17em}}\text{fluid}\text{\hspace{0.17em}}\text{inertia}\text{\hspace{0.17em}}\text{is}\text{\hspace{0.17em}}\text{off}\\ \Delta {p}_{\text{v,B}}+\frac{L}{2S}{\ddot{m}}_{\text{B}},& \text{if}\text{\hspace{0.17em}}\text{fluid}\text{\hspace{0.17em}}\text{inertia}\text{\hspace{0.17em}}\text{is}\text{\hspace{0.17em}}\text{on}\end{array}$$ |

In the equations:

*S*is the pipe cross-sectional area.*p*,*p*_{A}, and*p*_{B}are the liquid pressures in the pipe, at port**A**and port**B**.*Δp*_{v,A}and*Δp*_{v,B}are the viscous friction pressure losses between the pipe volume center and ports**A**and**B**.

### Viscous Friction Pressure Losses

The table shows the viscous friction pressure loss equations for each half pipe.

For half pipe adjacent to port A |
$$\Delta {p}_{\text{v,A}}=\{\begin{array}{cc}\lambda \nu \left(\frac{L+{L}_{\text{eq}}}{\text{2}}\right)\frac{{\dot{m}}_{\text{A}}}{2{D}^{2}S},& \text{if}\text{\hspace{0.17em}}{\text{Re}}_{\text{A}}<{\text{Re}}_{\text{l}}\\ {f}_{\text{A}}\left(\frac{L+{L}_{\text{eq}}}{2}\right)\frac{{\dot{m}}_{\text{A}}\left|{\dot{m}}_{\text{A}}\right|}{2\rho D{S}^{2}},& {\text{ifRe}}_{\text{A}}\ge {\text{Re}}_{\text{t}}\end{array}$$ |

For half pipe adjacent to port B |
$$\Delta {p}_{\text{v,B}}=\{\begin{array}{cc}\lambda \nu \left(\frac{L+{L}_{\text{eq}}}{\text{2}}\right)\frac{{\dot{m}}_{\text{B}}}{2{D}^{2}S},& \text{if}\text{\hspace{0.17em}}{\text{Re}}_{\text{B}}<{\text{Re}}_{\text{l}}\\ {f}_{\text{B}}\left(\frac{L+{L}_{\text{eq}}}{2}\right)\frac{{\dot{m}}_{\text{B}}\left|{\dot{m}}_{\text{B}}\right|}{2\rho D{S}^{2}},& {\text{ifRe}}_{\text{B}}\ge {\text{Re}}_{\text{t}}\end{array}$$ |

In the equations:

*λ*is the pipe shape factor.*ν*is the kinematic viscosity of the thermal liquid in the pipe.*L*_{eq}is the aggregate equivalent length of the local pipe resistances.*D*is the hydraulic diameter of the pipe.*f*_{A}and*f*_{B}are the Darcy friction factors in the pipe halves adjacent to ports**A**and**B**.Re

_{A}and*Re*_{B}are the Reynolds numbers at ports**A**and**B**.Re

_{l}is the Reynolds number above which the flow transitions to turbulent.Re

_{t}is the Reynolds number below which the flow transitions to laminar.

The Darcy friction factors follow from the Haaland approximation for the turbulent regime:

$$f=\frac{1}{{\left[-1.8{\mathrm{log}}_{10}\left(\frac{6.9}{\mathrm{Re}}+{\left(\frac{1}{3.7}\frac{r}{D}\right)}^{1.11}\right)\right]}^{2}},$$

where:

*f*is the Darcy friction factor.*r*is the pipe surface roughness.

### Energy Balance

The energy conservation equation for the pipe is

$$V\frac{d\left(\rho u\right)}{dt}={\varphi}_{\text{A}}+{\varphi}_{\text{B}}+{Q}_{H},$$

where:

*Φ*_{A}and*Φ*_{B}are the total energy flow rates into the pipe through ports**A**and**B**.*Q*_{H}is the heat flow rate into the pipe through the pipe wall.

### Wall Heat Flow Rate

The heat flow rate between the thermal liquid and the pipe wall is:

$${Q}_{H}={Q}_{conv}+\frac{k{S}_{H}}{D}\left({T}_{H}-T\right),$$

where:

*Q*_{H}is the net heat flow rate.*Q*_{conv}is the portion of the heat flow rate attributed to convection at nonzero flow rates.*k*is the thermal conductivity of the thermal liquid in the pipe.*S*_{H}is the surface area of the pipe wall, the product of the pipe perimeter and length.*T*_{H}is the temperature at the pipe wall.

Assuming an exponential temperature distribution along the pipe, the convective heat transfer is

$${Q}_{conv}=\left|{\dot{m}}_{avg}\right|{c}_{p,avg}\left({T}_{H}-{T}_{in}\right)\left(1-\text{exp}\left(-\frac{h{A}_{H}}{\left|{\dot{m}}_{avg}\right|{c}_{p,avg}}\right)\right),$$

where:

$${\dot{m}}_{avg}=\left({\dot{m}}_{A}-{\dot{m}}_{B}\right)/2$$ is the average mass flow rate from port

**A**to port**B**.$${c}_{{p}_{avg}}$$ is the specific heat evaluated at the average temperature.

*T*_{in}is the inlet temperature depending on flow direction.

The heat transfer coefficient, *h*_{coeff}, depends
on the Nusselt number:

$${h}_{coeff}=Nu\frac{{k}_{avg}}{D},$$

where *k*_{avg}, is the thermal conductivity
evaluated at the average temperature. The Nusselt number depends on the flow regime. The
Nusselt number in the laminar flow regime is constant and equal to the **Nusselt
number for laminar flow heat transfer** parameter value. The Nusselt number in
the turbulent flow regime is computed from the Gnielinski correlation:

$$N{u}_{tur}=\frac{\frac{{f}_{avg}}{8}\left({\mathrm{Re}}_{avg}-1000\right){\mathrm{Pr}}_{avg}}{1+12.7\sqrt{\frac{{f}_{avg}}{8}}\left({\mathrm{Pr}}_{avg}^{2/3}-1\right)},$$

where *f*_{avg} is the Darcy friction factor at the
average Reynolds number, *Re*_{avg}, and
*Pr*_{avg} is the Prandtl number evaluated at the
average temperature. The average Reynolds number is computed as:

$${\mathrm{Re}}_{avg}=\frac{\left|{\dot{m}}_{avg}\right|D}{S{\mu}_{avg}},$$

where *μ*_{avg} is the dynamic viscosity evaluated
at the average temperature. When the average Reynolds number is between the
**Laminar flow upper Reynolds number limit** and the **Turbulent
flow lower Reynolds number limit** parameter values, the Nusselt number follows a
smooth transition between the laminar and turbulent Nusselt number values.

### Assumptions and Limitations

The pipe wall is rigid.

The flow is fully developed.

The effect of gravity is negligible.

## Ports

### Conserving

## Parameters

## Model Examples

## References

[1] White, F. M., *Fluid
Mechanics*. 7th Ed, Section 6.8. McGraw-Hill, 2011.

[2] Cengel, Y. A., *Heat and
Mass Transfer – A Practical Approach*. 3rd Ed, Section 8.5. McGraw-Hill,
2007.

## Extended Capabilities

## Version History

**Introduced in R2013b**