# Pipe (TL)

Rigid or flexible thermal liquid conduit

## Library

Thermal Liquid/Pipes & Fittings

## Description

The Pipe (TL) block models the flow dynamics of a thermal liquid through a pipe segment or pipeline. The pipe model accounts for viscous friction losses and convective heat transfer with the pipe wall. Dynamic compressibility, fluid inertia, and pipe wall compliance are optional model features selectable through the block dialog box.

Pipe Schematic

The pipe wall can be rigid or flexible. A flexible pipe wall can expand and contract radially in response to internal pressure fluctuations. This radial compliance allows the pipe fluid volume to vary during simulation. The Pipe wall specification parameter provides the choice of rigid or flexible pipe walls.

The pipe consists of one or more pipe segments, each comprising a fluid volume with distinct pressure and temperature states. These states evolve dynamically during simulation and depend on the initial values specified in the block dialog box. The initial state inputs can be scalar values or vectors with sizes consistent with the number of pipe segments. A scalar input means that the value specified applies to all pipe segments.

### Block Variants

The pipe inlets can be at different elevations. The elevation gain from port A to port B can be constant or variable. To specify a variable elevation gain, change the block variant to `Variable elevation`. You can change variants by right-clicking the block and selecting Simscape > Block choices. Revert to the `Constant elevation` variant to model a pipe with a constant elevation gain between the ports.

### Pipe Geometry

The pipe diameter is fixed for rigid pipe walls and variable for flexible pipe walls. A rigid pipe can have a noncircular cross section with the hydraulic diameter taken as the pipe diameter:

`$D={D}_{H},$`
where:

• D is the pipe diameter.

• DH hydraulic diameter specified in the block dialog box.

A flexible pipe is assumed circular in cross section. The pipe wall can expand and contract in the radial direction. The rate of expansion or contraction is given by

`$\frac{dD}{dt}=\frac{{K}_{p}\left(p-{p}_{Atm}\right)}{\tau }-\frac{D-{D}_{Nom}}{\tau },$`
where:

• Kp is the static pressure-diameter compliance.

• p is the internal pipe pressure.

• pAtm is the environment pressure external to the pipe.

• DNom is the nominal, or specified, pipe diameter.

• τ is the characteristic response time for pipe diameter changes.

The static pressure-diameter compliance is defined as

`${K}_{p}=\frac{{D}_{0}}{E}\left(\frac{{D}^{2}{}_{Ext,0}+{D}^{2}{}_{0}}{{D}_{Ext,0}^{2}-{D}^{2}{}_{0}}+v\right),$`
where:

• D0 is the initial internal diameter.

• DExt,0 is the initial external diameter.

• E is the pipe wall elasticity modulus.

• v is the pipe wall Poisson ratio.

### Mass Balance

The mass balance in the pipe depends on the dynamic compressibility setting. If the Fluid dynamic compressibility parameter is set to `Off`, the mass balance equation is

`${\stackrel{˙}{m}}_{A}+{\stackrel{˙}{m}}_{B}=0,$`
where:

• ${\stackrel{˙}{m}}_{A}$ and ${\stackrel{˙}{m}}_{B}$ are the mass flow rates into the pipe through ports A and B.

If the Fluid dynamic compressibility parameter is set to `On` and the Pipe wall specification parameter is set to `Rigid`, the mass balance equation becomes

`${\stackrel{˙}{m}}_{A}+{\stackrel{˙}{m}}_{B}=\rho V\left(\frac{1}{\beta }\frac{dp}{dt}-\alpha \frac{dT}{dt}\right),$`
where:

• V is the pipe volume.

• α is the isobaric thermal expansion coefficient.

• β is the isothermal bulk modulus.

• p is the thermal liquid pressure.

• T is the thermal liquid temperature.

If the Fluid dynamic compressibility parameter is set to `On` and the Pipe wall specification parameter is set to `Flexible`, the mass balance equation becomes

`${\stackrel{˙}{m}}_{A}+{\stackrel{˙}{m}}_{B}=\rho V\left(\frac{1}{\beta }\frac{dp}{dt}-\alpha \frac{dT}{dt}\right)+\rho \frac{dV}{dt}.$`

### Momentum Balance

The momentum balance in the pipe depends on the dynamic compressibility and fluid inertia settings. If the Fluid dynamic compressibility parameter is set to `On` and the Fluid inertia parameter is set to `Off`, the momentum conservation equation in the half pipe adjacent to port A is

`$\left({p}_{A}-p\right)=\Delta {p}_{Loss,A}+\frac{\rho g\Delta z}{2},$`
while in the half pipe adjacent to port B it is
`$\left({p}_{B}-p\right)S=\Delta {p}_{Loss,B}-\frac{\rho g\Delta z}{2}.$`
In the equations:

• pA and pB are the pressures at ports A and B.

• S is the cross-sectional area of the pipe.

• ΔpLoss, A and ΔpLoss, B are the pressure losses due to viscous friction in the port-A and port-B half pipes.

• ρ is the mass density in the pipe volume.

If the Fluid dynamic compressibility and Fluid inertia parameters are both set to `On`, the momentum conservation equation in the half pipe adjacent to port A becomes

`$\left({p}_{A}-p\right)=\Delta {p}_{Loss,A}+\frac{\rho g\Delta z}{2}+\frac{{\stackrel{¨}{m}}_{A}L}{2S},$`
while in the half pipe adjacent to port B it becomes
`$\left({p}_{B}-p\right)=\Delta {p}_{Loss,B}-\frac{\rho g\Delta z}{2}+\frac{{\stackrel{¨}{m}}_{B}L}{2S}.$`

In the equations:

• L is the pipe length.

If the Fluid dynamic compressibility parameter is set to `Off`, the block computes the mass balance between ports A and B directly as

`${p}_{A}-{p}_{B}=\Delta {p}_{Loss,A}-\Delta {p}_{Loss,B}+\rho g\Delta z.$`

### Viscous Friction Losses

The form of the pressure loss terms depends on the flow regime in the pipe. For laminar flows, the pressure loss in the half pipe adjacent to port A is

`$\Delta {p}_{Loss,A}=\frac{{\stackrel{˙}{m}}_{A}{\mu }_{A}\lambda {L}_{Eff}}{4{D}^{2}{\rho }_{A}S},$`
while in the half pipe adjacent to port B it is
`$\Delta {p}_{Loss,B}=\frac{{\stackrel{˙}{m}}_{B}{\mu }_{B}\lambda {L}_{Eff}}{4{D}^{2}{\rho }_{B}S},$`
where:

• μA and μB are the fluid dynamic viscosities at ports A and B.

• λ is the pipe shape factor.

• LEff is the effective pipe length, including the aggregate length of all pipe flow resistances.

For turbulent flows, the pressure loss in the half pipe adjacent to port A is

`$\Delta {p}_{Loss,A}=\frac{{f}_{Turb,A}{L}_{Eff}{\stackrel{˙}{m}}_{A}|{\stackrel{˙}{m}}_{A}|}{4D{\rho }_{A}{S}^{2}},$`
while in the half pipe adjacent to port B it is
`$\Delta {p}_{Loss,B}=\frac{{f}_{Turb,B}{L}_{Eff}{\stackrel{˙}{m}}_{B}|{\stackrel{˙}{m}}_{B}|}{4D{\rho }_{B}{S}^{2}},$`
where:

• fTurb,A and fTurb,B are the Darcy friction factors for turbulent flows.

If the Viscous friction parameterization parameter is set to `Correlation`, the block computes the Darcy friction factor through analytical expressions. For the half pipe adjacent to port A, the Darcy friction factor is

`${f}_{Turb,A}=\frac{1}{{\left[-1.8{\mathrm{log}}_{10}\left(\frac{6.9}{{\mathrm{Re}}_{A}}+{\left(\frac{r}{3.7D}\right)}^{1.11}\right)\right]}^{2}},$`
while for the half pipe adjacent to port B it is
`${f}_{Turb,B}=\frac{1}{{\left[-1.8{\mathrm{log}}_{10}\left(\frac{6.9}{{\mathrm{Re}}_{B}}+{\left(\frac{r}{3.7D}\right)}^{1.11}\right)\right]}^{2}},$`
where:

• ReA and ReB are the Reynolds numbers at ports A and B.

• r is the internal surface absolute roughness.

If the Viscous friction parameterization parameter is set to ```Tabulated data — Darcy friction factor vs. Reynolds number``` and the flow is turbulent, the block obtains the Darcy friction factor through tabular data specified in terms of the Reynolds number. If the flow is laminar, the block computes the friction factor is computed using the expression

`${f}_{Lam}=\frac{\lambda }{{\mathrm{Re}}_{Lam}}.$`

The block smooths the transition between laminar and turbulent regimes based on the Reynolds number at port A.

### Energy Balance

The energy conservation equation for the pipe volume is

`$\frac{de}{dt}={\varphi }_{A}+{\varphi }_{B}+{\varphi }_{H}-\stackrel{˙}{m}g\Delta z,$`
where:

• e is the total energy in of the fluid in the pipe:

`$e=\rho uV$`

• ΦA and ΦB are the energy flow rates into the pipe through the pipe inlets.

• ΦH is the heat flow rate into the pipe through the pipe wall.

• $\stackrel{˙}{m}$ is the average mass flow rate through the pipe:

`$\stackrel{˙}{m}=\frac{{\stackrel{˙}{m}}_{A}-{\stackrel{˙}{m}}_{B}}{2}$`

The heat flow rate through port H is given by

`${\varphi }_{H}=\frac{{h}_{A}+{h}_{B}}{2}{S}_{Wall}\left({T}_{H}-T\right),$`
where:

• hA and hA are the liquid-wall heat transfer coefficients at the pipe inlets.

• TH is the pipe wall temperature given by port H.

• SWall is the pipe wall surface area.

If the Fluid dynamic compressibility parameter is set to `On` and the Pipe wall specification parameter is set to `Rigid`,

`$\frac{de}{dt}=\rho V\left[\frac{du}{dp}\frac{dp}{dt}+\frac{du}{dT}\frac{dT}{dt}\right].$`
If the Fluid dynamic compressibility parameter is set to `On` and the Pipe wall specification parameter is set to `Flexible`,
`$\frac{de}{dt}=\rho V\left[\frac{du}{dp}\frac{dp}{dt}+\frac{du}{dT}\frac{dT}{dt}\right]+\rho \left(u+\frac{p}{\rho }\right)\frac{dV}{dt}.$`

### Heat Flow Rate

Heat flow calculations between the thermal liquid and the pipe wall are based on the convective heat transfer coefficient. For the half pipe adjacent to port A, the heat transfer coefficient is

`${h}_{A}=\frac{{\text{Nu}}_{A}{k}_{A}}{D},$`
while in the half pipe adjacent to port B it is
`${h}_{B}=\frac{{\text{Nu}}_{B}{k}_{B}}{D},$`
where:

• hA and hA are the heat transfer coefficients at ports A and B.

• NuA and NuB are the Nusselt numbers at ports A and B.

• kA and kB are the fluid thermal conductivities at ports A and B.

The block can obtain the Nusselt numbers through empirical correlations for tubes or through tabulated data. If the Heat transfer parameterization parameter is set to `Correlation`, the laminar-regime Nusselt number is a specified constant. The turbulent-regime Nusselt number is computed using the Gnielinski equation. For the half pipe adjacent to port A, this equation reads

`$\text{Nu}=\frac{\left({f}_{Turb,A}}{8}\right)\left({\mathrm{Re}}_{A}-1000\right){\mathrm{Pr}}_{A}}{1+12.7{\left({f}_{Turb,A}}{8}\right)}^{1/2}\left({\mathrm{Pr}}_{A}{}^{2/3}-1\right)},$`
`$\text{Nu}=\frac{\left({f}_{Turb,B}}{8}\right)\left({\mathrm{Re}}_{B}-1000\right){\mathrm{Pr}}_{B}}{1+12.7{\left({f}_{Turb,B}}{8}\right)}^{1/2}\left({\mathrm{Pr}}_{B}{}^{2/3}-1\right)}.$`

If the Heat transfer parameterization parameter is set to ```Tabulated data — Colburn factor vs. Reynolds number```, the block obtains the Nusselt number in the half pipe adjacent to port A through the equation

`$N{u}_{A}=j\left(R{e}_{A}\right){\mathrm{Re}}_{A}{\mathrm{Pr}}_{A}{}^{1/3},$`
and in the half pipe adjacent to port B through the equation
`$N{u}_{B}=j\left(R{e}_{B}\right){\mathrm{Re}}_{B}{\mathrm{Pr}}_{B}{}^{1/3},$`
where:

• j(ReA) and j(ReB are the Colburn factors at ports A and B specified as lookup tables in terms of the Reynolds number.

If the Heat transfer parameterization parameter is set to ```Tabulated data — Nusselt number vs. Reynolds number & Prandtl number```, the block obtains the Nusselt number in the half pipe adjacent to port A through the equation

`$N{u}_{A}=Nu\left({\mathrm{Re}}_{A},P{r}_{A}\right),$`
and in the half pipe adjacent to port B through the equation
`$N{u}_{B}=Nu\left({\mathrm{Re}}_{B},P{r}_{B}\right).$`

## Assumptions and Limitations

• The flow in the pipe is fully developed.

• Flexible pipes are circular in cross-section and expand only in the radial direction.

## Parameters

### Configuration Tab

Fluid dynamic compressibility

Dynamic compressibility setting. Select `On` to make the fluid density dependent on pressure and temperature. Select `Off` to treat the fluid density as a constant. Dynamic compressibility impacts the transient response of the fluid at small time scales and can slow down simulation.

Fluid inertia

Option to model the effects of fluid inertia in the pipe. Fluid inertia imparts on the fluid a resistance to changes in mass flow rate. This parameter is visible only when Fluid dynamic compressibility is set to `On`.

Number of segments

Number of pipe segments to include in the pipeline. This parameter is visible only when Fluid dynamic compressibility is set to `On`. The default value is `1`.

Pipe length

Distance between pipe inlets A and B. The default value is `5` m.

Nominal cross-sectional area

Cross-sectional area of an equivalent circular pipe. This area is assumed constant throughout the length of the pipe. The default value is `0.01` m^2.

Pipe wall specification

Option to model the pipe wall as rigid or flexible. Select `Flexible` to account for the expansion and contraction of the pipe wall due to fluid pressure. This parameter is visible only when Fluid dynamic compressibility is set to `On`. The default setting is `Rigid`.

Hydraulic diameter (rigid pipe)

Diameter of a pipe equivalent in cross-sectional area but circular in cross-sectional shape. This parameter is visible only when Pipe wall specification is set to `Rigid`. The default value is `0.1128` m.

Static pressure-diameter compliance

Proportionality constant between the radial strain of the pipe and pressure. The default value is `1.2e-6` m/MPa. This parameter is visible only when Pipe wall specification is set to `Flexible`.

Viscoelastic process time constant

Characteristic time for a unit pipe deformation to occur. The default value is `0.01` s. This parameter is visible only when Pipe wall specification is set to `Flexible`.

Elevation gain from port A to port B

Change in elevation from port A to port B. This value enables the block to compute the elevation head of the pipe. The elevation gain can be positive or negative. The default value is `0`, corresponding to a horizontal pipe.

This parameter is active when the block variant is set to `Constant elevation`. To view or change the active block variant, right-click the block and select Simscape > Block choices.

Gravitational acceleration

Value of the gravitational constant. The default value is `9.81` m/s^2.

### Viscous Friction Tab

Viscous friction parameterization

Method of computing the viscous friction factor in laminar and turbulent flows. Select `Correlation` to automatically compute the viscous friction factor from semi-empirical correlations. Select ```Tabulated data — Darcy friction factor vs. Reynolds number``` to directly provide the viscous friction factor as a 1-way lookup table.

Aggregate equivalent length of local resistances

Pressure loss due to local resistances such as bends, inlets, and fittings, expressed as the equivalent length of these resistances. The default value is `1` m. This parameter is visible only when Viscous friction parameterization is set to `Correlation`.

Internal surface absolute roughness

Average height of all surface defects on the internal surface of the pipe. This parameter enables the calculation of the friction factor in the turbulent flow regime. The default value is `1.5e-5` m. This parameter is visible only when Viscous friction parameterization is set to `Correlation`.

Reynolds number vector for Darcy friction factor

Vector of Reynolds numbers at which to specify the Darcy friction factor data. The block uses the Reynolds and Darcy friction factor vectors to construct a 1-D lookup table. The default vector is a 12-element array ranging from `400` to `1e+8`. This parameter is visible only when Viscous friction parameterization is set to ```Tabulate data – Darcy friction factor vs. Reynolds number```.

Darcy friction factor vector

Vector of Darcy friction factors at the Reynolds numbers specified in the Reynolds number vector for Darcy friction factor parameter. The default vector is a 12-element array ranging from `0.264` to `0.0214`. This parameter is visible only when Viscous friction parameterization is set to ```Tabulate data – Darcy friction factor vs. Reynolds number```.

Shape factor for laminar flow viscous friction

Proportionality constant between the inverse of the Reynolds number and the Darcy friction factor in the laminar flow regime. This parameter encodes the pipe cross-sectional shape in the calculation of laminar friction losses. The default value, corresponding to a circular pipe cross-section, is `64`. This parameter is visible only when Viscous friction parameterization is set to `Correlation`.

Laminar flow upper Reynolds number limit

Reynolds number separating the laminar and transitional flow regimes. The flow is laminar below this number and transitional above it. The default value is `2e+3`.

Turbulent flow lower Reynolds number limit

Reynolds number separating the transitional and turbulent flow regimes. The flow is transitional below this number and turbulent above it. The default value is `4e+3`.

### Heat Transfer Tab

Heat transfer parameterization

Method of obtaining the Nusselt number in laminar and turbulent flows for use in heat transfer calculations. Select `Correlation` to automatically compute the Nusselt number from semi-empirical correlations. Select ```Tabulated data — Colburn factor vs. Reynolds number``` to compute the Nusselt number from Colburn factor data that you provide. Select ```Tabulated data — Nusselt number vs. Reynolds number & Prandtl number``` to directly provide the Nusselt number as a 2-way lookup table.

Nusselt number for laminar flow heat transfer

Proportionality constant between convective and conductive heat transfer in the laminar regime. This parameter enables the calculation of convective heat transfer in laminar flows. The parameter value changes with the pipe cross-sectional area and thermal boundary conditions, e.g., constant temperature or constant heat flux at the pipe wall. The default value, corresponding to a circular pipe cross section, is 3.66. This parameter is visible only when Heat transfer parameterization is set to `Correlation`.

Reynolds number vector for Colburn factor

Vector of Reynolds numbers at which to specify the Colburn factor 1-D lookup table. The default vector is `[100,150,1000]`. This parameter is visible only when Heat transfer parameterization is set to ```Tabulated data – Colburn factor vs. Reynolds number```.

Colburn factor vector

Vector of Colburn factors at the Reynolds numbers provided in the Reynolds number vector for Colburn factor vector. The default vector is `[0.019,0.013,0.002]`. This parameter is visible only when Heat transfer parameterization is set to ```Tabulated data – Colburn factor vs. Reynolds number```.

Reynolds number vector for Nusselt number

M-element vector of Reynolds numbers at which to specify the Nusselt number 2-D lookup table. The default vector is `[100,150,1000]`. This parameter is visible only when Heat transfer parameterization is set to ```Tabulated data – Nusselt number vs. Reynolds number & Prandtl number```.

Prandtl number vector for Nusselt number

N-element vector of Prandtl numbers at which to specify the Nusselt number 2-D lookup table. The default vector is `[1,10]`. This parameter is visible only when Heat transfer parameterization is set to ```Tabulated data – Nusselt number vs. Reynolds number & Prandtl number```.

Nusselt number table, Nu(Re,Pr)

M×N matrix with the Nusselt numbers at the Reynolds and Prandtl numbers specified. The default matrix is `[3.72,4.21,;3.75,4.44;4.21,7.15]`. This parameter is visible only when Heat transfer parameterization is set to ```Tabulated data – Nusselt number vs. Reynolds number & Prandtl number```.

### Initial Conditions Tab

Initial liquid temperature

Initial temperature specified as a scalar, 2-element vector, or n-element vector:

• If the parameter input is a scalar, the initial temperature specified applies to all pipe segments.

• If the parameter is a 2-element vector, the initial temperature varies linearly between the two values across the pipe segments.

• If the parameter is an n-element vector, each value gives the temperature of a pipe segment. The vector size must match the specified number of pipe segments.

The default value, corresponding to room temperature, is `293.15` K.

Initial liquid pressure

Initial liquid pressure specified as a scalar, 2-element vector, or n-element vector:

• If the parameter input is a scalar, the initial pressure specified applies to all pipe segments.

• If the parameter is a 2-element vector, the initial pressure varies linearly between the two values across the pipe segments.

• If the parameter is an n-element vector, each value gives the pressure of a pipe segment. The vector size must match the specified number of pipe segments.

The default value, corresponding to atmospheric pressure, is `0.101325` Pa.

## Ports

• A — Thermal liquid port representing pipe inlet A.

• B — Thermal liquid port representing pipe inlet B.

• H — Thermal conserving port for modeling heat transfer between the pipe and the environment.

• El — Physical signal input port for the elevation gain between the ports. This port is active when the block variant is set to `Variable elevation`. To change the active block variant, right-click the block and select Simscape > Block choices.