Main Content

Pipe (IL)

Pipe segment in an isothermal liquid network

Since R2020a

  • Pipe (IL) block

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

V˙=L(ASτ),

where:

  • A=SN+Kps(ppatm).

  • L is the Pipe length parameter.

  • SN is the nominal pipe cross-sectional area defined for each shape.

  • S is the current pipe cross-sectional area.

  • p is the internal pipe pressure.

  • patm is the atmospheric pressure.

  • Kps is the Static gauge pressure to cross-sectional area gain parameter.

    To calculate Kps assuming uniform elastic deformation of a thin-walled, open-ended cylindrical pipe, use:

    Kps=ΔDΔp=πDN34tE,

    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 V˙ as the Cross-sectional area vs. pressure setting. The block calculates A with the table lookup function

A=SN+tablelookup(pps,Aps,(ppatm),interpolation=linear,extrapolation=linear),

where pps is the Static gauge pressure vector parameter and Aps is the Cross sectional area gain vector parameter.

When the Volumetric expansion specification parameter is Hydraulic diameter vs. pressure, the change in volume is modeled by

V˙=π2DL(DstaticDτ),

where:

  • Dstatic=DN+Kpd(ppatm).

  • DN is the nominal hydraulic diameter defined for each shape.

  • D is the current pipe hydraulic diameter.

  • Kpd is the Static gauge pressure to hydraulic diameter gain parameter. To calculate Kps assuming uniform elastic deformation of a thin-walled, open-ended cylindrical pipe, use:

    Kpd=ΔDΔp=DN22tE.

When the Volumetric expansion specification parameter is Based on material properties, the block uses the same equation for V˙ as the Hydraulic diameter vs. pressure setting but calculates Dstatic depending on the value of the Material behavior parameter

Dstatic=DN(1+ϵhoop).

This parameterization assumes a cylindrical thin-walled pressure vessel where σradial=0.

When the Material behavior parameter is Linear elastic,

ϵhoop=1E[σhoopvσlongitudinal],

where:

  • E is the value of the Young's modulus parameter.

  • v is the value of the Poisson's ratio parameter.

  • σhoop=pD2t where t is the value of the Pipe wall thickness parameter.

  • σlongitudinal=pD4t.

When the Material behavior parameter is Multilinear elastic, the block calculates the von Mises stress, σv, which simplifies to σv=34pD2t, to determine the equivalent strain. The hoop strain is

ϵhoop=ϵhoopelastic+ϵhoopplastic

ϵhoopelastic=1E[σhoopvσlongitudinal]ϵhoopi,jplastic=32(1Es1E)Si,j

where:

  • The block calculates the Young's Modulus, E, from the first elements of the Stress vector and Strain vector parameters.

  • ES=σtotalϵtotal, where σtotal 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.

  • Si,j=σi,j[σhoop+σlongitudinal+σradial3]δi,j, where σi,j are the elements of the Cauchy stress tensor.

If you do not model flexible walls, SN = S and DN = D.

Circular

The nominal hydraulic diameter and the Pipe diameter, dcircle, are the same. The pipe cross sectional area is: SN=π4dcircle2.

Annular

The nominal hydraulic diameter, Dh,nom, is the difference between the Pipe outer diameter and Pipe inner diameter, dodi. The pipe cross sectional area is SN=π4(do2di2).

Rectangular

The nominal hydraulic diameter is:

DN=2hwh+w,

where:

  • h is the Pipe height.

  • w is the Pipe width.

The pipe cross sectional area is SN=wh.

Elliptical

The nominal hydraulic diameter is:

DN=2amajbmin(64-16(amaj-bminamaj+bmin)2)(amaj+bmin)(64-3(amaj-bminamaj+bmin)4),

where:

  • amaj is the Pipe major axis.

  • bmin is the Pipe minor axis.

The pipe cross sectional area is SN=π4amajbmin.

Isosceles Triangular

The nominal hydraulic diameter is:

DN=lsidesin(θ)1+sin(θ2)

where:

  • lside is the Pipe side length.

  • θ is the Pipe vertex angle.

The pipe cross sectional area is SN=lside22sin(θ).

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:

Δpf,A=υλ2D2SL+Ladd2m˙A,

Δpf,B=υλ2D2SL+Ladd2m˙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.

  • Ladd is the Aggregate equivalent length of local resistances.

  • m˙A is the mass flow rate at port A.

  • 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:

Δpf,A=f2ρIDS2L+Ladd2m˙A|m˙A|,

Δpf,B=f2ρIDS2L+Ladd2m˙B|m˙B|,

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={1.8log10[6.9Re+(ε3.7Dh)1.11]}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:

Δpf,A=υλ2D2SL2m˙A.

Δpf,B=υλ2D2SL2m˙B.

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

Δpf,A=(fL2D+Closs,total)12ρIS2m˙A|m˙A|,

Δpf,B=(fL2D+Closs,total)12ρIS2m˙B|m˙B|,

where Closs,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:

Δpf,A=Kpm˙Am˙A2+m˙th2,

where Kp is:

Kp=ΔpNm˙N2,

where:

  • ΔpN is the Nominal pressure drop, which can be defined either as a scalar or a vector.

  • 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 Kp 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=2Lfc,

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:

m˙A+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,

m˙A+m˙B=p˙IdρIdpIV,

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:

m˙A+m˙B=p˙IdρIdpIV+ρIV˙.

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:

pApI=Δpf,A+ρIΔz2g,

pBpI=Δpf,BρIΔz2g,

where:

  • pA is the pressure at port A.

  • pI is the fluid volume internal pressure.

  • pB is the pressure at port B.

  • Δpf 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:

pApI=Δpf,A+ρIΔz2g+m¨AL2S,

pBpI=Δpf,BρIΔz2g+m¨BL2S,

where:

  • m¨ is the fluid acceleration at its respective port.

  • S is the pipe cross-sectional area.

Examples

Ports

Conserving

expand all

Liquid entry or exit port.

Liquid entry or exit port.

Inputs

expand all

Variable elevation from port A to port B, specified as a physical signal. The block bounds the signal value at EL between -L and L, where L is the value of the Pipe length parameter.

Dependencies

To enable this port, set Elevation gain specification to Variable.

Variable gravitational acceleration, specified as a physical signal.

Dependencies

To enable this port, set Gravitational acceleration specification to Variable.

Parameters

expand all

Configuration

Total pipe length across all pipe segments.

Number of pipe divisions. Each division represents an individual segment for which pressure is calculated, depending on the pipe inlet pressure, fluid compressibility, and wall flexibility, if applicable. The fluid volume in each segment remains fixed.

Cross-sectional pipe geometry. A nominal hydraulic diameter and nominal cross-sectional area is calculated based on the cross-sectional geometry.

Diameter for circular cross-sectional pipes.

Dependencies

To enable this parameter, set Cross-sectional geometry to Circular.

Inner diameter for annular pipe flow, or flow between two concentric pipes.

Dependencies

To enable this parameter, set Cross-sectional geometry to Annular.

Outer diameter for annular pipe flow, or flow between two concentric pipes.

Dependencies

To enable this parameter, set Cross-sectional geometry to Annular.

Width of rectangular pipe.

Dependencies

To enable this parameter, set Cross-sectional geometry to Rectangular.

Height of rectangular pipe.

Dependencies

To enable this parameter, set Cross-sectional geometry to Rectangular.

Major axis for ellipsoidal pipes.

Dependencies

To enable this parameter, set Cross-sectional geometry to Elliptical.

Minor axis for ellipsoidal pipes.

Dependencies

To enable this parameter, set Cross-sectional geometry to Elliptical.

Length of the two equal sides of isosceles-triangular pipes.

Dependencies

To enable this parameter, set Cross-sectional geometry to Isosceles triangular.

Vertex angle for triangular pipes. The value must be less than 180 degrees.

Dependencies

To enable this parameter, set Cross-sectional geometry to Isosceles triangular.

Hydraulic diameter used in calculations of the pipe Reynolds number. For noncircular pipes, the hydraulic diameter is the effective diameter of the fluid in the pipe. For circular pipes, the hydraulic diameter and pipe diameter are the same.

Dependencies

To enable this parameter, set Cross-sectional geometry to Custom.

Pipe cross-sectional area for a custom pipe geometry.

Dependencies

To enable this parameter, set Cross-sectional geometry to Custom.

Whether to model any change in fluid density due to fluid compressibility. When you select Fluid dynamic compressibility, changes due to the mass flow rate into the block are calculated in addition to density changes due to changes in pressure. In the Isothermal Liquid Library, all blocks calculate density as a function of pressure.

Whether to account for resistance to changes in the flow rate due to the fluid mass.

Dependencies

To enable this parameter, select Fluid dynamic compressibility.

Whether the pipe elevation remains constant or variable from port A to B.

Elevation differential for constant-elevation pipes.

Dependencies

To enable this parameter, set Elevation gain specification to Constant.

Whether the gravitational constant is constant or variable.

Gravitational acceleration for environments with constant gravitational acceleration.

Dependencies

To enable this parameter, set Gravitational acceleration specification to Constant.

Viscous Friction

Parameterization of pressure losses due to wall friction. Both analytical and tabular formulations are available.

Method for quantifying pressure losses due to pipe nonuniformities.

Dependencies

To enable this parameter, set Viscous friction parameterization to Haaland correlation.

Loss coefficient associated with each pipe nonuniformity. You can input a single loss coefficient or the sum of all loss coefficients along the pipe.

Dependencies

To enable this parameter, set Viscous friction parameterization to Haaland correlation and Local resistance specifications to Local loss coefficient.

Length of pipe that would produce the equivalent hydraulic losses as would a pipe with bends, area changes, or other nonuniform attributes. The effective length of the pipe is the sum of the Pipe length and the Aggregate equivalent length of local resistances.

Dependencies

To enable this parameter, set Viscous friction parameterization to Haaland correlation and Local resistance specifications to Aggregate equivalent length.

Absolute surface roughness based on pipe material. The provided values are ASHRAE standard roughness values. You can also input your own value by setting Surface roughness specification to Custom.

Dependencies

To enable this parameter, set Viscous friction parameterization to Haaland correlation.

Pipe wall absolute roughness. This parameter is used to determine the Darcy friction factor, which contributes to pressure loss in the pipe.

Dependencies

To enable this parameter, set Viscous friction parameterization to Haaland correlation and Surface roughness specification to Custom.

Upper Reynolds number limit to laminar flow. Beyond this number, the fluid regime is transitional, approaches the turbulent regime, and becomes fully turbulent at the Turbulent flow lower Reynolds number limit.

Dependencies

To enable this parameter, set Viscous friction parameterization to either:

  • Haaland correlation

  • Tabulated data - Darcy friction factor vs. Reynolds number

Lower Reynolds number limit for turbulent flow. Below this number, the flow regime is transitional, approaches laminar flow, and becomes fully laminar at the Laminar flow upper Reynolds number limit.

Dependencies

To enable this parameter, set Viscous friction parameterization to either:

  • Haaland correlation

  • Tabulated data - Darcy friction factor vs. Reynolds number

Nominal mass flow rate used for calculating the pressure loss coefficient for rigid and flexible pipes, specified as a scalar or a vector. All nominal values must be greater than 0 and have the same number of elements as the Nominal pressure drop parameter. When this parameter is supplied as a vector, the scalar value Kloss is determined as a least-squares fit of the vector elements.

Dependencies

To enable this parameter, set Viscous friction parameterization to Nominal pressure drop vs. nominal mass flow rate.

Nominal pressure drop used for calculating the pressure loss coefficient for rigid and flexible pipes, specified as a scalar or vector. All nominal values must be greater than 0 and must have the same number of elements as the Nominal mass flow rate parameter. When this parameter is supplied as a vector, the scalar value Kloss is determined as a least-squares fit of the vector elements.

Dependencies

To enable this parameter, set Viscous friction parameterization to Nominal pressure drop vs. nominal mass flow rate.

Mass flow rate threshold for reversed flow. A transition region is defined around 0 kg/s between the positive and negative values of the mass flow rate threshold. Within this transition region, numerical smoothing is applied to the flow response. The threshold value must be greater than 0.

Dependencies

To enable this parameter, set Viscous friction parameterization to Nominal pressure drop vs. nominal mass flow rate.

Vector of Reynolds numbers for the tabular parameterization of the Darcy friction factor. The vector elements form an independent axis with the Darcy friction factor vector parameter. The vector elements must be listed in ascending order. A positive Reynolds number corresponds to flow from port A to port B.

Dependencies

To enable this parameter, set Viscous friction parameterization to Tabulated data - Darcy friction factor vs. Reynolds number.

Vector of Darcy friction factors for the tabular parameterization of the Darcy friction factor. The vector elements must correspond one-to-one with the elements in the Reynolds number vector for turbulent Darcy friction factor parameter, and must be unique and greater than or equal to 0.

Dependencies

To enable this parameter, set Viscous friction parameterization to Tabulated data - Darcy friction factor vs. Reynolds number.

Friction constant for laminar flows. The Darcy friction factor captures the contribution of wall friction in pressure loss calculations. If Cross-sectional geometry is not set to Custom, this parameter is internally set to 64.

Dependencies

To enable this parameter, set Viscous friction parameterization to either:

  • Haaland correlation

  • Tabulated data - Darcy friction factor vs. Reynolds number

and Cross-sectional geometry to Custom.

Pipe Wall

Specifies wall flexibility. This parameter is independent of pipe cross-sectional geometry. The Flexible setting preserves the initial pipe shape and applies equal expansion of the cross-sectional area. It may not be accurate for non-circular cross-sectional geometry under high deformation.

Dependencies

To enable this parameter, select Fluid dynamic compressibility.

Linear expansion correlation. The settings correlate the new cross-sectional area or hydraulic diameter to the pipe pressure.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible.

Coefficient for calculating pipe deformation for the Cross-sectional area vs. pressure setting. The gain is multiplied by the pressure differential between the segment pressure and atmospheric pressure.

Dependencies

To enable this parameter, select Fluid dynamic compressibility, and set Pipe wall specification to Flexible and Volumetric expansion specification to Cross-sectional area vs. pressure.

Vector that contains the gauge pressures. The block uses this vector in a table lookup to calculate the pipe cross-sectional area. The vector entries must be strictly positive and monotonically increasing and the vector must be the same length as the Cross sectional area gain vector parameter.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible and Volumetric expansion specification to Cross-sectional area vs. pressure - Tabulated.

Vector that contains the pipe cross-sectional areas. The block uses this vector in a table lookup to calculate the pipe cross sectional-area at other pressures. The vector entries must be strictly positive and monotonically increasing and the vector must be the same length as the Static gauge pressure vector parameter.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible and Volumetric expansion specification to Cross-sectional area vs. pressure - Tabulated.

Coefficient for calculating pipe deformation for the Hydraulic diameter vs. pressure setting. The gain is multiplied by the pressure differential between the segment pressure and atmospheric pressure.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible and Volumetric expansion specification to Hydraulic diameter vs. pressure.

Method the block uses to calculate the material behavior.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible and Volumetric expansion specification to Based on material properties.

Thickness of the pipe wall. The block uses this value to calculate stress.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible and Volumetric expansion specification to Based on material properties.

Young's modulus of the material that makes up the pipe wall.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible, Volumetric expansion specification to Based on material properties, and Material behavior to Linear Elastic.

Poisson's ratio of the material that makes up the pipe wall.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible and Volumetric expansion specification to Based on material properties.

Vector containing the stress values for the material that makes up the pipe wall.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible, Volumetric expansion specification to Based on material properties, and Material behavior to Multilinear Elastic.

Vector containing the strain values for the material that makes up the pipe wall.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible, Volumetric expansion specification to Based on material properties, and Material behavior to Multilinear Elastic.

Whether the block does nothing, generates a warning, or generates an error when the stress is above the maximum stress specified by the Maximum allowable stress parameter.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible, Volumetric expansion specification to Based on material properties, and Material behavior to Multilinear Elastic.

Maximum stress the block allows on the pipe wall. Control what the block does if the stress exceeds this value with the Check if stress exceeds specified allowable level parameter.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible, Volumetric expansion specification to Based on material properties, Material behavior to Multilinear Elastic and Check if stress exceeds specified allowable level to Warning or Error.

Time required for the wall to reach steady-state after pipe deformation. This parameter impacts the dynamic change in pipe volume.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and set Pipe wall specification to Flexible.

Initial Conditions

Initial liquid pressure, specified as a scalar or vector. A vector n elements long defines the liquid pressure for each of n pipe segments. If the vector is two elements long, the pressure along the pipe is linearly distributed between the two element values. If the vector is three or more elements long, the initial pressure in the nth segment is set by the nth element of the vector.

Dependencies

To enable this parameter, select Fluid dynamic compressibility.

Initial mass flow rate for pipes with simulated fluid inertia.

Dependencies

To enable this parameter, select Fluid dynamic compressibility and Fluid inertia.

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

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2020a

expand all