# Pipe (IL)

**Libraries:**

Simscape /
Fluids /
Isothermal Liquid /
Pipes & Fittings

## Description

The Pipe (IL) block models flow in a rigid or flexible-walled pipe with losses due to wall
friction. The effects of dynamic compressibility, fluid inertia, and pipe elevation can
be optionally modeled. You can define multiple pipe segments and set the liquid pressure
for each segment. By segmenting the pipe and selecting **Fluid
inertia**, you can model events such as water hammer in your system.

### Pipe Characteristics

The pipe block can be divided into segments with the **Number of
segments** parameter. When the pipe is composed of a number of
segments, the pressure in each segment is calculated based on the inlet pressure and
the effect on the segment mass flow rate of the fluid compressibility and wall
flexibility, if applicable. The fluid volume in each segment remains fixed. For a
two-segment pipe, the pressure evolves linearly with respect to the pressure defined
at ports **A** and **B**. For a pipe with three or
more segments, you can specify the fluid pressure in each segment in vector or
scalar form in the **Initial liquid pressure** parameter. The
scalar form will apply a constant value over all segments.

**Flexible Walls**

You can model flexible walls for all cross-sectional geometries. When you set
**Pipe wall specification** to
`Flexible`

, the block assumes uniform expansion
along all directions and preserves the defined cross-sectional shape. This
setting may not result in physical results for noncircular cross-sectional areas
undergoing high pressure relative to atmospheric pressure. When you model
flexible walls, you can use the **Volumetric expansion
specification** parameter to control the method for specifying the
volumetric expansion of the pipe cross-sectional area.

When the **Volumetric expansion specification** parameter is
`Cross-sectional area vs. pressure`

, the change in
volume is modeled by

$$\dot{V}=L\left(\frac{A-S}{\tau}\right),$$

where:

$$A={S}_{N}+{K}_{ps}\left(p-{p}_{atm}\right).$$

*L*is the**Pipe length**parameter.*S*is the nominal pipe cross-sectional area defined for each shape._{N}*S*is the current pipe cross-sectional area.*p*is the internal pipe pressure.*p*is the atmospheric pressure._{atm}*K*_{ps}is the**Static gauge pressure to cross-sectional area gain**parameter.To calculate

*K*assuming uniform elastic deformation of a thin-walled, open-ended cylindrical pipe, use:_{ps}$${K}_{ps}=\frac{\Delta D}{\Delta p}=\frac{\pi {D}_{N}^{3}}{4tE},$$

where

*t*is the pipe wall thickness and*E*is Young's modulus.*τ*is the**Volumetric expansion time constant**.

When the **Volumetric expansion specification** parameter is
`Cross-sectional area vs. pressure - Tabulated`

,
the block uses the same equation for $$\dot{V}$$ as the ```
Cross-sectional area vs.
pressure
```

setting. The block calculates *A*
with the table lookup function

$$A={S}_{N}+tablelookup\left({p}_{ps},{A}_{ps},(p-{p}_{atm}),interpolation=linear,extrapolation=linear\right),$$

where *p _{ps}* is the

**Static gauge pressure vector**parameter and

*A*is the

_{ps}**Cross sectional area gain vector**parameter.

When the **Volumetric expansion specification** parameter is
`Hydraulic diameter vs. pressure`

, the change in
volume is modeled by

$$\dot{V}=\frac{\pi}{2}DL\left(\frac{{D}_{static}-D}{\tau}\right),$$

where:

$${D}_{static}={D}_{N}+{K}_{pd}\left(p-{p}_{atm}\right).$$

*D*is the nominal hydraulic diameter defined for each shape._{N}*D*is the current pipe hydraulic diameter.*K*_{pd}is the**Static gauge pressure to hydraulic diameter gain**parameter. To calculate*K*assuming uniform elastic deformation of a thin-walled, open-ended cylindrical pipe, use:_{ps}$${K}_{pd}=\frac{\Delta D}{\Delta p}=\frac{{D}_{N}^{2}}{2tE}.$$

When the **Volumetric expansion specification** parameter is
`Based on material properties`

, the block uses the
same equation for $$\dot{V}$$ as the ```
Hydraulic diameter vs.
pressure
```

setting but calculates
*D _{static}* depending on the value
of the

**Material behavior**parameter

$${\text{D}}_{static}={D}_{N}\left(1+{\u03f5}_{hoop}\right).$$

This parameterization assumes a cylindrical thin-walled pressure vessel where $${\sigma}_{radial}=0.$$

When the **Material behavior** parameter is ```
Linear
elastic
```

,

$${\u03f5}_{hoop}=\frac{1}{E}\left[{\sigma}_{hoop}-v{\sigma}_{longitudinal}\right],$$

where:

*E*is the value of the**Young's modulus**parameter.*v*is the value of the**Poisson's ratio**parameter.$${\sigma}_{hoop}=\frac{pD}{2t}$$ where

*t*is the value of the**Pipe wall thickness**parameter.$${\sigma}_{longitudinal}=\frac{pD}{4t}.$$

When the **Material behavior** parameter is ```
Multilinear
elastic
```

, the block calculates the von Mises stress,
*σ _{v}*, which simplifies to $${\sigma}_{v}=\sqrt{\frac{3}{4}}\frac{pD}{2t}$$, to determine the equivalent strain. The hoop strain is

$${\u03f5}_{hoop}={\u03f5}_{hoop}^{elastic}+{\u03f5}_{hoop}^{plastic}$$

$$\begin{array}{l}{\u03f5}_{hoop}^{elastic}=\frac{1}{E}\left[{\sigma}_{hoop}-v{\sigma}_{longitudinal}\right]\\ {\u03f5}_{hoo{p}_{i,j}}^{plastic}=\frac{3}{2}\left(\frac{1}{{E}_{s}}-\frac{1}{E}\right){S}_{i,j}\end{array}$$

where:

The block calculates the Young's Modulus,

*E*, from the first elements of the**Stress vector**and**Strain vector**parameters.$${E}_{S}=\frac{{\sigma}_{total}}{{\u03f5}_{total}}$$, where

*σ*and_{total}*ε*are the equivalent total stress and the equivalent total strain, respectively. The block calculates the equivalent total strain from the von Mises stress and the stress-strain curve._{total}$${\text{S}}_{i,j}={\sigma}_{i,j}-\left[\frac{{\sigma}_{hoop}+{\sigma}_{longitudinal}+{\sigma}_{radial}}{3}\right]{\delta}_{i,j},$$ where

*σ*are the elements of the Cauchy stress tensor._{i,j}

If you do not model flexible walls,
*S _{N}* =

*S*and

*D*=

_{N}*D*.

**Circular**

The nominal hydraulic diameter and the **Pipe diameter**,
*d*_{circle}, are the same. The pipe
cross sectional area is: $${S}_{N}=\frac{\pi}{4}{d}_{circle}^{2}.$$

**Annular**

The nominal hydraulic diameter,
*D*_{h,nom}, is the difference between
the **Pipe outer diameter** and **Pipe inner
diameter**, *d*_{o} –
*d*_{i}. The pipe cross sectional area
is $${S}_{N}=\frac{\pi}{4}\left({d}_{{}_{o}}^{2}-{d}_{{}_{i}}^{2}\right).$$

**Rectangular**

The nominal hydraulic diameter is:

$${D}_{N}=\frac{2hw}{h+w},$$

where:

*h*is the**Pipe height**.*w*is the**Pipe width**.

The pipe cross sectional area is $${S}_{N}=wh.$$

**Elliptical**

The nominal hydraulic diameter is:

$${D}_{N}=2{a}_{maj}{b}_{min}\frac{\left(64-16{\left(\frac{{a}_{maj}-{b}_{min}}{{a}_{maj}+{b}_{min}}\right)}^{2}\right)}{\left({a}_{maj}+{b}_{min}\right)\left(64-3{\left(\frac{{a}_{maj}-{b}_{min}}{{a}_{maj}+{b}_{min}}\right)}^{4}\right)},$$

where:

*a*_{maj}is the**Pipe major axis**.*b*_{min}is the**Pipe minor axis**.

The pipe cross sectional area is $${S}_{N}=\frac{\pi}{4}{a}_{maj}{b}_{min}.$$

**Isosceles Triangular**

The nominal hydraulic diameter is:

$${D}_{N}={l}_{side}\frac{\mathrm{sin}\left(\theta \right)}{1+\mathrm{sin}\left(\frac{\theta}{2}\right)}$$

where:

*l*_{side}is the**Pipe side length**.*θ*is the**Pipe vertex angle**.

The pipe cross sectional area is $${S}_{N}=\frac{{l}_{side}^{2}}{2}\mathrm{sin}\left(\theta \right).$$

### Pressure Loss Due to Friction

**Haaland Correlation**

The analytical Haaland correlation models losses due to wall friction either
by *aggregate equivalent length*, which accounts for
resistances due to nonuniformities as an added straight-pipe length that results
in equivalent losses, or by *local loss coefficient*, which
directly applies a loss coefficient for pipe nonuniformities.

When the **Local resistances specification** parameter is set
to `Aggregate equivalent length`

and the flow in the
pipe is lower than the **Laminar flow upper Reynolds number
limit**, the pressure loss over all pipe segments is:

$$\Delta {p}_{f,A}=\frac{\upsilon \lambda}{2{D}^{2}S}\frac{L+{L}_{add}}{2}{\dot{m}}_{A},$$

$$\Delta {p}_{f,B}=\frac{\upsilon \lambda}{2{D}^{2}S}\frac{L+{L}_{add}}{2}{\dot{m}}_{B},$$

where:

*ν*is the fluid kinematic viscosity.*λ*is the**Laminar friction constant for Darcy friction factor**, which you can define when**Cross-sectional geometry**is set to`Custom`

and is otherwise equal to 64.*D*is the pipe hydraulic diameter.*L*_{add}is the**Aggregate equivalent length of local resistances**.$$\dot{m}$$

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

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

When the Reynolds number is greater than the **Turbulent
flow lower Reynolds number limit**, the pressure loss in the pipe is:

$$\Delta {p}_{f,A}=\frac{f}{2{\rho}_{I}D{S}^{2}}\frac{L+{L}_{add}}{2}{\dot{m}}_{A}\left|{\dot{m}}_{A}\right|,$$

$$\Delta {p}_{f,B}=\frac{f}{2{\rho}_{I}D{S}^{2}}\frac{L+{L}_{add}}{2}{\dot{m}}_{B}\left|{\dot{m}}_{B}\right|,$$

where:

*f*is the Darcy friction factor. This is approximated by the empirical Haaland equation and is based on the**Surface roughness specification**,*ε*, and pipe hydraulic diameter:$$f={\left\{-1.8{\mathrm{log}}_{10}\left[\frac{6.9}{\mathrm{Re}}+{\left(\frac{\epsilon}{3.7{D}_{h}}\right)}^{1.11}\right]\right\}}^{-2},$$

Pipe roughness for brass, lead, copper, plastic, steel, wrought iron, and galvanized steel or iron are provided as ASHRAE standard values. You can also supply your own

**Internal surface absolute roughness**with the`Custom`

setting.*ρ*_{I}is the internal fluid density.

When the **Local resistances specification** parameter is set
to `Local loss coefficient`

and the flow in the pipe is
lower than the **Laminar flow upper Reynolds number limit**,
the pressure loss over all pipe segments is:

$$\Delta {p}_{f,A}=\frac{\upsilon \lambda}{2{D}^{2}S}\frac{L}{2}{\dot{m}}_{A}.$$

$$\Delta {p}_{f,B}=\frac{\upsilon \lambda}{2{D}^{2}S}\frac{L}{2}{\dot{m}}_{B}.$$

When the Reynolds number is greater than the
**Turbulent flow lower Reynolds number limit**, the
pressure loss in the pipe is:

$$\Delta {p}_{f,A}=\left(\frac{f\frac{L}{2}}{D}+{C}_{loss,total}\right)\frac{1}{2{\rho}_{I}{S}^{2}}{\dot{m}}_{A}\left|{\dot{m}}_{A}\right|,$$

$$\Delta {p}_{f,B}=\left(\frac{f\frac{L}{2}}{D}+{C}_{loss,total}\right)\frac{1}{2{\rho}_{I}{S}^{2}}{\dot{m}}_{B}\left|{\dot{m}}_{B}\right|,$$

where *C*_{loss,total}
is the loss coefficient, which can be defined in the **Total local loss
coefficient** parameter as either a single coefficient or the sum
of all loss coefficients along the pipe.

**Nominal Pressure Drop vs. Nominal Mass Flow Rate**

The Nominal Pressure Drop vs. Nominal Mass Flow Rate parameterization characterizes losses with a loss coefficient for rigid or flexible walls. When the fluid is incompressible, the pressure loss over the entire pipe due to wall friction is:

$$\Delta {p}_{f,A}={K}_{p}{\dot{m}}_{A}\sqrt{{\dot{m}}_{A}^{2}+{\dot{m}}_{th}^{2}},$$

where *K*_{p} is:

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

where:

*Δp*_{N}is the**Nominal pressure drop**, which can be defined either as a scalar or a vector.$${\dot{m}}_{N}$$ is the

**Nominal mass flow rate**, which can be defined either as a scalar or a vector.

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

**Tabulated Data – Darcy Friction Factor vs. Reynolds Number**

Pressure losses due to viscous friction can also be determined from
user-provided tabulated data of the **Darcy friction factor
vector** and the **Reynolds number vector for turbulent
Darcy friction factor** parameters. Linear interpolation is
employed between data points.

### Pipe Discretization

You can divide the pipe into multiple segments. If a pipe has more than one segment, the mass flow and momentum balance equations are calculated for each segment.

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.

### Momentum Balance

When you clear the **Fluid dynamic compressibility** parameter, the mass
flow into the pipe equals the mass flow out of the pipe:

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

When you select **Fluid dynamic
compressibility** and set **Pipe wall specification**
to `Rigid`

, the difference between the mass flow into and
out of the pipe depends on the fluid density change due to compressibility,

$${\dot{m}}_{A}+{\dot{m}}_{B}={\dot{p}}_{I}\frac{d{\rho}_{I}}{d{p}_{I}}V,$$

When you select **Fluid dynamic
compressibility** and set **Pipe wall specification**
to `Flexible`

, the difference between the mass flow into
and out of the pipe is based on the change in fluid density due to compressibility,
and the amount of fluid accumulated in the newly deformed regions of the pipe:

$${\dot{m}}_{A}+{\dot{m}}_{B}={\dot{p}}_{I}\frac{d{\rho}_{I}}{d{p}_{I}}V+{\rho}_{I}\dot{V}.$$

The changes in momentum between the pipe inlet and outlet
comprises the changes in pressure due to pipe wall friction, which is modeled
according to the **Viscous friction parameterization** and pipe
elevation.

When you clear the **Fluid inertia** checkbox, the momentum
balance is:

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

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

where:

*p*_{A}is the pressure at port**A**.*p*_{I}is the fluid volume internal pressure.*p*_{B}is the pressure at port**B**.*Δp*_{f}is the pressure loss due to wall friction, parameterized by the**Viscous friction losses**specification according to the respective port.*Δz*is the pipe elevation. In the case of constant-elevation pipes, this is the**Elevation gain from port A to port B**parameter; otherwise, it is received as a physical signal at port**EL**.*g*is the gravitational acceleration. In the case of a fixed gravitational constant, this is the**Gravitational acceleration**parameter; otherwise, it is received as a physical signal at port**G**.

When you select **Fluid inertia**, the momentum
balance is:

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

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

where:

$$\ddot{m}$$ is the fluid acceleration at its respective port.

*S*is the pipe cross-sectional area.

## Examples

## Ports

### Conserving

### Inputs

## Parameters

## References

[1] Budynas R. G. Nisbett J. K. & Shigley J. E. (2004). Shigley's mechanical engineering design (7th ed.). McGraw-Hill.

[2] Ju Frederick D., Butler Thomas A., Review of Proposed Failure Criteria for Ductile Materials (1984) Los Alamos National Laboratory.

[3] Hencky H (1924) Zur Theorie plastischer Deformationen und der hierdurch im Material hervorgerufenen Nachspannungen. Z Angew Math Mech 4:323–335

[4] Jahed H, “A Variable Material Property Approach for Elastic-Plastic Analysis of Proportional and Non-proportional Loading, (1997) University of Waterloo

## Extended Capabilities

## Version History

**Introduced in R2020a**

## See Also

Partially Filled Pipe (IL) | Pipe (TL) | Pipe (IL) | Elbow (IL) | T-Junction (IL) | Tank (IL)