# Pipe (TL)

Closed conduit for the transport of fluid between thermal liquid components

**Library:**Simscape / Fluids / Thermal Liquid / Pipes & Fittings

## Description

The Pipe (TL) block models thermal liquid flow through a pipe. The
temperature across the pipe is calculated from the temperature differential between
ports, pipe elevation, and any additional heat transfer at port **H**.

The pipe can have a constant or varying elevation between ports **A**
and **B**. For a constant elevation differential, use the
**Elevation gain from port A to port B** parameter. You can specify
a variable elevation by setting **Elevation gain specification** to
`Variable`

. This exposes physical signal port
**EL**.

You can optionally model fluid dynamic compressibility, inertia, and wall flexibility. When these phenomena are modeled, the flow properties are calculated for each number of pipe segments that you specify.

### Pipe Flexibility

Flexible walls are modeled by a uniform radial expansion that maintains the
original pipe cross-sectional shape. You can specify the pipe area in the
**Nominal cross-sectional area** parameter, meaning that there
is no specified cross-sectional geometry modeled by the block. However, the block
uses the pipe hydraulic diameter in heat transfer and pressure loss
calculations.

The deformation of the pipe diameter is calculated as:

$$\dot{D}=\frac{{D}_{\text{S}}-D}{\tau},$$

where:

*D*is the post-deformation, steady-state pipe diameter,_{S}$${D}_{\text{S}}={D}_{N}+{K}_{c}\left(p-{p}_{atm}\right),$$

where

*K*_{c}is the**Static pressure-diameter compliance**,*p*is the tube pressure, and*p*is the atmospheric pressure. Assuming elastic deformation of a thin-walled, open-ended pipe, you can calculate_{atm}*K*_{c}as:$${K}_{\text{c}}=\frac{{D}^{2}}{2tE},$$

where

*t*is the pipe wall thickness and*E*is Young's modulus.*D*is the nominal pipe diameter, or the diameter previous to deformation:_{N}$${D}_{\text{N}}=\sqrt{\frac{4S}{\pi}},$$

where

*S*is the**Nominal cross-sectional area**of the pipe.*D*is the pipe**Hydraulic diameter**.*τ*is the**Viscoelastic pressure time constant**.

### Heat Transfer at the Pipe Wall

You can model heat transfer to and from the pipe walls in multiple ways. There are
two analytical models: the `Gnielinski correlation`

, which
models the Nusselt number as a function of the Reynolds and Prandtl numbers with
predefined coefficients, and the ```
Dittus-Boelter correlation - Nusselt =
a*Re^b*Pr^c
```

, which models the Nusselt number as a function of the
Reynolds and Prandtl numbers with user-defined coefficients.

The ```
Nominal temperature differential vs. nominal mass flow
rate
```

, ```
Tabulated data - Colburn factor vs. Reynolds
number
```

, and ```
Tabulated data - Nusselt number vs.
Reynolds number & Prandtl number
```

are look-up table
parameterizations based on user-supplied data.

Heat transfer between the fluid and pipe wall occurs through convection,
*Q*_{Conv} and conduction,
*Q*_{Cond}.

Heat transfer due to conduction is:

$${Q}_{\text{Cond}}=\frac{{k}_{\text{I}}{S}_{\text{H}}}{D}\left({T}_{\text{H}}-{T}_{\text{I}}\right),$$

where:

*D*is the**Hydraulic diameter**if the pipe walls are rigid, and is the pipe steady-state diameter,*D*, if the pipe walls are flexible._{S}*k*is the thermal conductivity of the thermal liquid, defined internally for each pipe segment._{I}*S*is the surface area of the pipe wall._{H}*T*is the pipe wall temperature._{H}*T*is the fluid temperature, taken at the pipe internal node._{I}

Heat transfer due to convection is:

$${Q}_{\text{Conv}}={c}_{\text{p,Avg}}\left|{\dot{m}}_{\text{Avg}}\right|\left({T}_{\text{H}}-{T}_{\text{In}}\right)\left[1-\text{exp}\left(-\frac{h{S}_{\text{H}}}{{c}_{\text{p,Avg}}\left|{\dot{m}}_{\text{Avg}}\right|}\right)\right],$$

where:

*c*_{p, Avg}is the average fluid specific heat.$$\dot{m}$$

_{Avg}is the average mass flow rate through the pipe.*T*is the fluid inlet port temperature._{In}*h*is the pipe heat transfer coefficient.

The heat transfer coefficient *h* is:

$$h=\frac{\text{Nu}{k}_{\text{Avg}}}{D},$$

except when parameterizing by ```
Nominal temperature
differential vs. nominal mass flow rate
```

, where
*k _{Avg}* is the average thermal
conductivity of the thermal liquid over the entire pipe and

*Nu*is the average Nusselt number in the pipe.

**Analytical Parameterizations**

When **Heat transfer parameterization** is set to
`Gnielinski correlation`

and the flow is turbulent,
the average Nusselt number is calculated as:

$$\text{Nu}=\frac{\raisebox{1ex}{$f$}\!\left/ \!\raisebox{-1ex}{$8$}\right.\left(\text{Re}-1000\right)\text{Pr}}{1+12.7{\left(\text{}\raisebox{1ex}{$f$}\!\left/ \!\raisebox{-1ex}{$8$}\right.\right)}^{1/2}\left({\text{Pr}}^{\text{2/3}}-1\right)},$$

where:

*f*is the average Darcy friction factor, according to the Haaland correlation:$$f={\left\{-1.8{\text{log}}_{\text{10}}\left[\frac{6.9}{\text{Re}}+{\left(\frac{{\u03f5}_{\text{R}}}{3.7D}\right)}^{1.11}\right]\right\}}^{\text{-2}},$$

where

*ε*_{R}is the pipe**Internal surface absolute roughness**.*Re*is the Reynolds number.*Pr*is the Prandtl number.

When the flow is laminar, the Nusselt number is the **Nusselt number
for laminar flow heat transfer** parameter.

When **Heat transfer parameterization** is set to
`Dittus-Boelter correlation`

and the flow is
turbulent, the average Nusselt number is calculated as:

$$\text{Nu}=a{\text{Re}}_{}^{b}{\text{Pr}}_{}^{c},$$

where:

*a*is the value of the**Coefficient a**parameter.*b*is the value of the**Exponent b**parameter.*c*is the value of the**Exponent c**parameter.

The block default Dittus-Boelter correlation is:

$$\text{Nu}=0.023{\text{Re}}_{}^{0.8}{\text{Pr}}_{}^{0.4}.$$

When the flow is laminar, the Nusselt number is the **Nusselt number
for laminar flow heat transfer** parameter.

**Parameterization By Tabulated Data**

When **Heat transfer parameterization** is set to
```
Tabulated data - Colburn factor vs. Reynolds
number
```

, the average Nusselt number is calculated as:

$$\text{Nu}={\text{J}}_{\text{M}}(\text{Re}){\text{RePr}}_{}^{1/3}.$$

where *J*_{M} is the
Colburn-Chilton factor.

When **Heat transfer parameterization** is set to
```
Tabulated data - Nusselt number vs. Reynolds number &
Prandtl number
```

, the Nusselt number is interpolated from the
three-dimensional array of avergae Nusselt number as a function of both average
Reynolds number and average Prandtl number:

$$\text{Nu}=\text{Nu}(\text{Re},\text{Pr}).$$

When **Heat transfer parameterization** is set to
```
Nominal temperature difference vs. nominal mass flow
rate
```

and the flow is turbulent, the heat transfer coefficient
is calculated as:

$$h=\frac{{h}_{\text{N}}{D}_{\text{N}}^{1.8}}{{\dot{m}}_{\text{N}}^{0.8}}\frac{{\dot{m}}_{\text{Avg}}^{0.8}}{{D}^{1.8}},$$

where:

$$\dot{m}$$

_{N}is the**Nominal mass flow rate**.$$\dot{m}$$

_{Avg}is the average mass flow rate:$${\dot{m}}_{Avg}=\frac{{\dot{m}}_{\text{A}}-{\dot{m}}_{\text{B}}}{2}.$$

*h*_{N}is the nominal heat transfer coefficient, which is calculated as:$${h}_{\text{N}}=\frac{{\dot{m}}_{\text{N}}{c}_{\text{p,N}}}{{S}_{\text{H,N}}}\text{ln}\left(\frac{{T}_{\text{H,N}}-{T}_{\text{In,N}}}{{T}_{\text{H,N}}-{T}_{\text{Out,N}}}\right),$$

where:

*S*is the nominal wall surface area._{H,N}*T*is the_{H,N}**Nominal wall temperature**.*T*is the_{In,N}**Nominal inflow temperature**.*T*is the_{Out,N}**Nominal outflow temperature**.

This relationship is based on the assumption that the Nusselt number is proportional to the Reynolds number:

$$\frac{hD}{k}\propto {\left(\frac{\dot{m}D}{S\mu}\right)}^{0.8}.$$

If the pipe walls are rigid, the expression for the heat transfer coefficient becomes:

$$h=\frac{{h}_{\text{N}}}{{\dot{m}}_{\text{N}}^{0.8}}{\dot{m}}_{Avg}^{0.8}.$$

### Pressure Losses Due to Viscous Friction

There are multiple ways to model the pressure differential over the pipe. The
`Haaland correlation`

provides an analytical model for
flows through circular pipes with a Darcy friction factor. The ```
Nominal
pressure drop vs. nominal mass flow rate
```

and the
```
Tabulated data - Darcy friction factor vs. Reynolds
number
```

parameterizations allow you to provide data that the block
will use as a look-up table during simulation.

**Analytical parameterization**

When **Viscous friction parameterization** is set to
`Haaland correlation`

and the flow is turbulent,
the pressure loss due to friction at pipe walls is determined by the
Darcy-Weisbach equation:

$${p}_{A}-{p}_{I}=f\frac{{\dot{m}}_{A}\left|{\dot{m}}_{A}\right|}{2{\rho}_{\text{I}}D{S}^{2}}\left(\frac{L+{L}_{\text{Add}}}{2}\right),$$

where:

*L*is the**Pipe length**.*L*is the_{E}**Aggregate equivalent length of local resistances**, which is the equivalent length of a tube that introduces the same amount of loss as the sum of the losses due to other local resistances in the tube.

The pressure differential between port **B** and internal
node I is:

$${p}_{\text{B}}-{p}_{\text{I}}=f\frac{{\dot{m}}_{\text{B}}\left|{\dot{m}}_{\text{B}}\right|}{2{\rho}_{\text{I}}D{S}^{2}}\left(\frac{L+{L}_{\text{Add}}}{2}\right),$$

When the flow is laminar, the pressure loss due to friction is calculated in
terms of the **Laminar friction constant for Darcy friction
factor**, *λ*. The pressure differential between
port **A** and internal node I is:

$${p}_{\text{A}}-{p}_{\text{I}}=\frac{\lambda \mu {\dot{m}}_{\text{A}}}{2\rho {D}^{2}S}\left(\frac{L+{L}_{\text{Add}}}{2}\right).$$

The pressure differential between port **B**
and internal node I is:

$${p}_{\text{B}}-{p}_{\text{I}}=\frac{\lambda \mu {\dot{m}}_{\text{B}}}{2\rho {D}^{2}S}\left(\frac{L+{L}_{\text{Add}}}{2}\right).$$

For transitional flows, the pressure differential due to viscous friction is a smoothed blend between the values for laminar and turbulent pressure losses.

**Parameterization by Tabulated Data**

When **Viscous friction parameterization** is set to
`Nominal pressure drop vs. nominal mass flow rate`

,
the pressure loss due to viscous friction is calculated over the two pipe halves
with the loss coefficient *K _{p}*:

$$\Delta {p}_{f,A}=\frac{1}{2}{K}_{\text{p}}{\dot{m}}_{A}\sqrt{{\dot{m}}_{A}^{2}+{\dot{m}}_{\text{Th}}^{2}}$$

$$\Delta {p}_{f,B}=\frac{1}{2}{K}_{\text{p}}{\dot{m}}_{B}\sqrt{{\dot{m}}_{B}^{2}+{\dot{m}}_{\text{Th}}^{2}}$$

where:

$${\dot{m}}_{\text{Th}}$$ is the

**Mass flow rate threshold for flow reversal**.*K*_{p}is a pressure loss coefficient. For flexible pipe walls, the pressure loss coefficient is:$${K}_{\text{p}}=\frac{{p}_{\text{N}}}{{\dot{m}}_{\text{N}}^{2}}{D}_{\text{N}},$$

where:

*p*is the_{N}**Nominal pressure drop**.$$\dot{m}$$

_{N}is the**Nominal mass flow rate**.

The pressure loss coefficient is

$${K}_{\text{p}}=\frac{{p}_{N}}{{\dot{m}}_{\text{N}}^{2}},$$

when the pipe walls are rigid. When the

**Nominal pressure drop**and**Nominal mass flow rate**parameters are vectors, the value of*K*is determined as a least-squares fit of the vector elements._{p}

When the

When **Viscous friction parameterization** is set to
```
Tabulated data – Darcy friction factor vs. Reynolds
number
```

, the friction factor is interpolated from the tabulated
data as a function of the Reynolds number:

$$f=f(\text{Re}).$$

### Momentum Balance

The pressure differential over the pipe is due to the pressure at the pipe ports, friction at the pipe walls, and hydrostatic changes due to any change in elevation:

$${p}_{\text{A}}-{p}_{\text{B}}=\Delta {p}_{f}+{\rho}_{\text{I}}g\Delta z,$$

where:

*p*is the pressure at a port_{A}**A**.*p*is the pressure at a port_{B}**B**.*Δp*is the pressure differential due to viscous friction,_{f}*Δp*._{f,A}+Δp_{f,B}*g*is**Gravitational acceleration**.*Δz*the elevation differential between port**A**and port**B**, or*z*._{A}- z_{B}*ρ*is the internal fluid density, which is measured at each pipe segment. If fluid dynamic compressibility is not modeled, this is:_{I}$${p}_{\text{I}}=\frac{{p}_{\text{A}}+{p}_{\text{B}}}{2}.$$

When fluid inertia is not modeled, the momentum balance between port
**A** and internal node I is:

$${p}_{\text{A}}-{p}_{\text{I}}=\Delta {p}_{f,A}+{\rho}_{\text{I}}g\frac{\Delta z}{2}.$$

When fluid inertia is not modeled, the momentum balance between port
**B** and internal node I is:

$${p}_{\text{B}}-{p}_{\text{I}}=\Delta {p}_{f,B}-{\rho}_{\text{I}}g\frac{\Delta z}{2}.$$

When fluid inertia is modeled, the momentum balance between port
**A** and internal node I is:

$${p}_{\text{A}}-{p}_{\text{I}}=\Delta {p}_{f,A}+{\rho}_{\text{I}}g\frac{\Delta z}{2}+\frac{{\ddot{m}}_{\text{A}}}{S}\frac{L}{2},$$

where:

$$\ddot{m}$$

_{A}is the fluid inertia at port**A**.*L*is the**Pipe length**.*S*is the**Nominal cross-sectional area**.

When fluid inertia is modeled, the momentum balance between port
**B** and internal node I is:

$${p}_{\text{B}}-{p}_{\text{I}}=\Delta {p}_{f,B}-{\rho}_{\text{I}}g\frac{\Delta z}{2}+\frac{{\ddot{m}}_{\text{B}}}{S}\frac{L}{2},$$

where

$$\ddot{m}$$_{B} is the fluid inertia at port
**B**.

### Pipe Discretization

You can divide the pipe into multiple segments. If a pipe has more than one segment, the mass flow, energy flow, and momentum balance equations are calculated for each segment. Having multiple pipe segments can allow you to track changes to variables such as fluid density when fluid dynamic compressibility is modeled.

If you would like to capture specific phenomena in your application, such as water
hammer, choose a number of segments that provides sufficient resolution of the
transient. The following formula, from the Nyquist sampling theorem, provides a rule
of thumb for pipe discretization into a minimum of *N* segments:

$$N=2L\frac{f}{c},$$

where:

*L*is the**Pipe length**.*f*is the transient frequency.*c*is the speed of sound.

In some cases, such as modeling thermal transients along a pipe, it may be better suited to your application to connect multiple Pipe (TL) blocks in series.

### Mass Balance

For a rigid pipe with an incompressible fluid, the pipe mass conversation equation is:

$${\dot{m}}_{\text{A}}+{\dot{m}}_{\text{B}}=0,$$

where:

$$\dot{m}$$

_{A}is the mass flow rate at port**A**.$$\dot{m}$$

_{B}is the mass flow rate at port**B**.

For a flexible pipe with an incompressible fluid, the pipe mass conservation equation is:

$${\dot{m}}_{\text{A}}+{\dot{m}}_{\text{B}}={\rho}_{\text{I}}\dot{V},$$

where:

*ρ*is the thermal liquid density at internal node I. Each pipe segment has an internal node._{I}$$\dot{V}$$ is the rate of deformation of the pipe volume.

For a flexible pipe with a compressible fluid, the pipe mass conservation equation is: This dependence is captured by the bulk modulus and thermal expansion coefficient of the thermal liquid:

$${\dot{m}}_{\text{A}}+{\dot{m}}_{\text{B}}={\rho}_{\text{I}}\dot{V}+{\rho}_{\text{I}}V\left(\frac{{\dot{p}}_{\text{I}}}{{\beta}_{\text{I}}}-{\alpha}_{\text{I}}{\dot{T}}_{\text{I}}\right),$$

where:

*p*is the thermal liquid pressure at the internal node I._{I}$$\dot{T}$$

_{I}is the rate of change of the thermal liquid temperature at the internal node I.*β*is the thermal liquid bulk modulus._{I}*α*is the liquid thermal expansion coefficient.

### Energy Balance

The energy accumulation rate in the pipe at internal node I is defined as:

$$\stackrel{.}{E}={\varphi}_{\text{A}}+{\varphi}_{\text{B}}+{\varphi}_{\text{H}}-{\dot{m}}_{Avg}g\Delta z,$$

where:

*ϕ*is the energy flow rate at port_{A}**A**.*ϕ*is the energy flow rate at port_{B}**B**.*ϕ*is the energy flow rate at port_{H}**H**.

The total energy is defined as:

$$E={\rho}_{\text{I}}{u}_{\text{I}}V,$$

where:

*u*is the fluid specific internal energy at node I._{I}*V*is the pipe volume.

If the fluid is compressible, the expression for energy accumulation rate is:

$$\dot{E}={\rho}_{\text{I}}V{\left(\frac{du}{dp}\frac{dp}{dt}+\frac{du}{dT}\frac{dT}{dt}\right)}_{\text{I}}.$$

If the fluid is compressible and the pipe walls are flexible, the expression for energy accumulation rate is:

$$\dot{E}={\rho}_{\text{I}}V{\left(\frac{du}{dp}\frac{dp}{dt}+\frac{du}{dT}\frac{dT}{dt}\right)}_{\text{I}}+\left({\rho}_{\text{I}}{u}_{\text{I}}+{p}_{\text{I}}\right){\left(\frac{dV}{dt}\right)}_{\text{I}}.$$

## Ports

### Input

### Conserving

## Parameters

## Model Examples

## Extended Capabilities

## See Also

**Introduced in R2016a**