# Pipe (2P)

Rigid conduit for fluid flow in two-phase fluid systems

Libraries:
Simscape / Foundation Library / Two-Phase Fluid / Elements

## Description

The Pipe (2P) block models the flow dynamics of a two-phase fluid inside a rigid pipe. The dynamic compressibility and thermal capacity of the fluid are assumed non-negligible. The two-phase fluid conserving ports A and B represent the pipe inlets. The thermal conserving port H represents the pipe wall, through which heat transfer with the pipe surroundings occurs.

### Fluid Inertia

The block provides an option to model fluid inertia, the resistance to sudden changes in mass flow rate. By default, fluid inertia modeling is turned off. This setting is appropriate when the pressure forces driving the flow far exceed the inertial forces acting on the flow.

The default setting reduces computational costs and is recommended for most models. However, fluid inertia can become important if the mass flow rate changes rapidly. In such cases, turning fluid inertia modeling on can help improve simulation accuracy.

### Energy Balance

Energy conservation in the pipe is observed through the equation:

`$M{\stackrel{˙}{u}}_{I}+\left({\stackrel{˙}{m}}_{A}+{\stackrel{˙}{m}}_{B}\right){u}_{I}={\varphi }_{A}+{\varphi }_{B}+{Q}_{H},$`

where:

• M is the fluid mass inside the pipe.

• uI is the specific internal energy of the fluid inside the pipe.

• ϕA is the energy flow rate into the pipe through port A.

• ϕB is the energy flow rate into the pipe through port B.

• QH is the heat flow rate into the pipe through the pipe wall, represented by port H.

Heat Flow Rate

Heat transfer between the pipe wall and the internal fluid volume is modeled as a convective process, with the heat flow rate computed as:

`${Q}_{H}={h}_{\text{coeff}}{S}_{\text{surf}}\left({T}_{\text{H}}-{T}_{\text{I}}\right),$`

where:

• hcoeff is the average heat transfer coefficient in the pipe.

• SSurf is the pipe surface area.

• TH is the pipe wall temperature.

• TI is the temperature of the fluid in the pipe.

The calculation of the heat transfer coefficient depends on the fluid phase. In the subcooled liquid and superheated vapor phases, the coefficient is:

`${h}^{*}{}_{\text{coeff}}=\frac{{k}^{*}{}_{\text{I}}{\text{Nu}}^{*}}{{D}_{\text{h}}},$`

where the asterisk denotes a value specific to the phase considered (liquid or vapor) and:

• `Nu` is the average Nusselt number in the pipe.

• `k`I is the average thermal conductivity in the pipe.

• Dh is the hydraulic diameter of the pipe (that which a cross section of general shape would have if it were made circular).

In a two-phase mixture, the same coefficient is:

`${h}^{M}{}_{\text{coeff}}=\frac{{k}^{M}{}_{\text{I,SL}}{\text{Nu}}^{M}}{{D}_{\text{h}}},$`

where the subscript `M` denotes a value specific to the two-phase mixture and the `SL` subscript indicates a value obtained for the saturated liquid.

Nusselt Number

In laminar flows, the Nusselt number is assumed constant and equal to the value specified in the block dialog box. The laminar flow Nusselt number applies when the Reynolds number is smaller than the value entered for the Laminar flow upper Reynolds number limit parameter.

The turbulent flow Nusselt number applies when the Reynolds number is greater than the value entered for the Laminar flow upper Reynolds number limit parameter. In the transitional region between laminar and turbulent flow, a cubic polynomial function blends the two Nusselt numbers. This blending ensures a smooth transition between flow regimes.

In the liquid and vapor phases, the Nusselt number for turbulent flow follows from the Gnielinski correlation:

`${\text{Nu}}^{*}=\frac{\frac{f}{8}\left({\text{Re}}^{*}-1000\right){\text{Pr}}^{*}{}_{\text{I}}}{1+12.7\sqrt{\frac{f}{8}}\left({\text{Pr}}^{*}{}_{\text{I}}^{2/3}-1\right)},$`

where, as before, the asterisk denotes the phase considered and:

• f is the friction factor of the pipe.

• `Re` is the Reynolds number.

• PrI is the Prandtl number.

The friction factor is calculated as:

`$f={\left\{-1.8{\text{log}}_{\text{10}}\left[\frac{6.9}{{\text{Re}}^{*}}+{\left(\frac{{ϵ}_{\text{r}}}{3.7}\right)}^{1.11}\right]\right\}}^{\text{-2}},$`

where εr is the roughness of the pipe. The Reynolds number is calculated as:

`${\text{Re}}^{*}=\frac{|{\stackrel{˙}{m}}_{\text{Avg}}|{D}_{\text{h}}{v}_{\text{I}}^{*}}{S{\nu }_{\text{I}}^{*}},$`

where the subscript `Avg` denotes an average value between the ports and:

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

• vI is the specific volume.

• νI is the kinematic viscosity.

In the two-phase mixture, the Nusselt number for turbulent flow follows from the Cavallini and Zecchin correlation:

`${\text{Nu}}^{\text{M}}=0.05{\left[\left(1-{x}_{\text{I}}+{x}_{\text{I}}\sqrt{\frac{{v}_{\text{SV}}}{{v}_{\text{SL}}}}\right){\text{Re}}_{\text{SL}}\right]}^{0.8}{\text{Pr}}_{\text{SL}}^{0.33},$`

where the subscript `SL` denotes a value for saturated liquid, the `SV` subscript a value for saturated vapor, and:

• xI is the vapor quality.

• v is the specific volume.

The Reynolds number of the saturated liquid is calculated as:

`${\text{Re}}_{\text{SL}}=\frac{|{\stackrel{˙}{m}}_{\text{Avg}}|{D}_{\text{h}}{v}_{\text{SL}}}{S{\nu }_{\text{SL}}},$`

### Mass Balance

Mass conservation in the pipe is observed through the equation:

`$\left[{\left(\frac{\partial \rho }{\partial p}\right)}_{u}{\stackrel{˙}{p}}_{I}+{\left(\frac{\partial \rho }{\partial u}\right)}_{p}{\stackrel{˙}{u}}_{I}\right]V={\stackrel{˙}{m}}_{A}+{\stackrel{˙}{m}}_{B}+{ϵ}_{M},$`

where:

• ρ is the fluid density.

• pI is the pressure inside the pipe.

• V is the volume of fluid in the pipe.

• ${\stackrel{˙}{m}}_{A}$ is the mass flow rate into the pipe through port A.

• ${\stackrel{˙}{m}}_{B}$ is the mass flow rate into the pipe through port B.

• M is a correction term that accounts for the smoothing of the density partial derivatives across phase transition boundaries.

The block blends the density partial derivatives of the various domains using a cubic polynomial function. At a vapor quality of 0–0.1, this function blends the derivatives of the subcooled liquid and two-phase mixture domains. At a vapor quality of 0.9–1, it blends those of the two-phase mixture and superheated vapor domains. The correction term in the mass conservation equation,

`${ϵ}_{M}=\frac{M-V/{v}_{I}}{\tau },$`

is added to correct for the numerical errors introduced by the cubic polynomial function, with:

• M as the fluid mass in the pipe, computed from the equation:

`$\stackrel{˙}{M}={\stackrel{˙}{m}}_{A}+{\stackrel{˙}{m}}_{B},$`

• vI as the specific volume of the fluid in the pipe.

• τ as the phase-change time constant—the characteristic duration of a phase-change event. This constant ensures that phase changes do not occur instantaneously, effectively introducing a time lag whenever they occur.

### Momentum Balance

The momentum balance equations are defined separately for each half pipe section. In the half pipe adjacent to port A:

`${p}_{A}-{p}_{I}=\frac{{\stackrel{˙}{m}}_{A}}{S}|\frac{{\stackrel{˙}{m}}_{A}}{S}\left({\nu }_{I}-{\nu }_{A}\right)|+{F}_{visc,A}+{I}_{A},$`

where:

• pA is the pressure at port A.

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

• νA is the specific volume of the fluid at port A.

• Fvisc,A is the viscous friction force in the half pipe adjacent to port A.

• IA is the fluid inertia at port A:

`${I}_{A}={\stackrel{¨}{m}}_{A}\frac{L}{2S}$`

The parameter L is the pipe length.

In the half pipe adjacent to port B:

`${p}_{B}-{p}_{I}=\frac{{\stackrel{˙}{m}}_{B}}{S}|\frac{{\stackrel{˙}{m}}_{B}}{S}\left({\nu }_{I}-{\nu }_{B}\right)|+{F}_{visc,B}+{I}_{B},$`

where:

• pB is the pressure at port B.

• νB is the specific volume of the fluid at port B.

• Fvisc,B is the viscous friction force in the half pipe adjacent to port B.

• IB is the fluid inertia at port B:

`${I}_{B}={\stackrel{¨}{m}}_{B}\frac{L}{2S}$`

The fluid inertia terms, IA and IB, are zero when the Fluid inertia check box is cleared, that is, when fluid inertia modeling is off. The calculation of the viscous friction forces, Fvisc,A and Fvisc,B depends on the flow regime, laminar or turbulent.

Viscous Friction Force in Laminar Flows

In the laminar regime—that is, when the Reynolds number is smaller than the Laminar flow upper Reynolds number limit value specified in the block dialog box—the viscous friction force in the half pipe adjacent to port A is

`${F}_{visc,A}^{laminar}=\frac{{f}_{shape}{L}_{eff}{\nu }_{I}{\stackrel{˙}{m}}_{A}}{4{D}_{h}^{2}S},$`

while in the half pipe adjacent to port B it is

`${F}_{visc,B}^{laminar}=\frac{{f}_{shape}{L}_{eff}{\nu }_{I}{\stackrel{˙}{m}}_{B}}{4{D}_{h}^{2}S},$`

where:

• fshape is the pipe shape factor.

• Leff is the effective pipe length—the sum of the pipe length and the aggregate equivalent length of local resistances.

• Dh is the hydraulic diameter of the pipe.

Viscous Friction Force in Turbulent Flows

In the turbulent regime—that is, when the Reynolds number is greater than the Turbulent flow lower Reynolds number limit value specified in the block dialog box—the viscous friction force in the half pipe adjacent to port A is

`${F}_{visc,A}^{turbulent}=\frac{{\stackrel{˙}{m}}_{A}|{\stackrel{˙}{m}}_{A}|{f}_{A}{L}_{eff}{\nu }_{I}}{4{D}_{H}{S}^{2}},$`

while in the half pipe adjacent to port B it is

`${F}_{visc,B}^{turbulent}=\frac{{\stackrel{˙}{m}}_{B}|{\stackrel{˙}{m}}_{B}|{f}_{B}{L}_{eff}{\nu }_{I}}{4{D}_{H}{S}^{2}},$`

where:

• fA is the Darcy friction factor for turbulent flow in the half pipe adjacent to port A.

• fB is the Darcy friction factor for turbulent flow in the half pipe adjacent to port B.

The Darcy friction factor for turbulent flow in the half pipe adjacent to port A follows from the Haaland equation as

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

and in the half pipe adjacent to port B as

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

where:

• r is the relative roughness of the pipe.

• ReA is the Reynolds number in the half pipe adjacent to port A,

`$R{e}_{A}=\frac{|{\stackrel{˙}{m}}_{A}|{D}_{h}{v}_{I}}{S{\nu }_{I}}.$`

• ReB is the Reynolds number in the half pipe adjacent to port B,

`$R{e}_{B}=\frac{|{\stackrel{˙}{m}}_{B}|{D}_{h}{v}_{I}}{S{\nu }_{I}}.$`

A cubic polynomial function is used to blend the friction losses in the transition region between laminar flow and turbulent flow.

### Assumptions and Limitations

• The pipe wall is rigid.

• The flow is fully developed.

• The effect of gravity is negligible.

• Heat transfer is calculated with respect to the temperature of the fluid volume in the pipe. To model temperature gradient due to heat transfer along a long pipe, connect multiple Pipe (2P) blocks in series.

## Ports

### Conserving

expand all

Two-phase fluid conserving port associated with the inlet or outlet of the pipe. The block has no intrinsic directionality.

Two-phase fluid conserving port associated with the inlet or outlet of the pipe. The block has no intrinsic directionality.

Thermal conserving port representing the temperature of the pipe wall.

## Parameters

expand all

### Geometry

The length of the pipe along the direction of flow.

The internal area of the pipe normal to the direction of the flow. This area is constant along the length of the pipe.

Diameter of an equivalent pipe with a circular cross section. In a cylindrical pipe, the hydraulic diameter is the same as its actual diameter.

### Friction and Heat Transfer

The combined length of all local resistances present in the pipe. Local resistances include bends, fittings, armatures, and pipe inlets and outlets. The effect of the local resistances is to increase the effective length of the pipe segment. This length is added to the geometrical pipe length only for pressure loss calculations. The fluid volume inside the pipe depends only on the pipe geometrical length, defined by the Pipe length parameter.

Average depth of all surface defects on the internal surface of the pipe, which affects the pressure loss in the turbulent flow regime.

The Reynolds number above which flow begins to transition from laminar to turbulent. This number equals the maximum Reynolds number corresponding to fully developed laminar flow.

The Reynolds number below which flow begins to transition from turbulent to laminar. This number equals to the minimum Reynolds number corresponding to fully developed turbulent flow.

Dimensionless factor that encodes the effect of pipe cross-sectional geometry on the viscous friction losses in the laminar flow regime. Typical values are 64 for a circular cross section, 57 for a square cross section, 62 for a rectangular cross section with an aspect ratio of 2, and 96 for a thin annular cross section [1].

Ratio of convective to conductive heat transfer in the laminar flow regime. Its value depends on the pipe cross-sectional geometry and pipe wall thermal boundary conditions, such as constant temperature or constant heat flux. Typical value is 3.66, for a circular pipe cross section with constant wall temperature [2].

### Effects and Initial Conditions

Select this check box to model fluid inertia, the resistance of the fluid to rapid acceleration.

Thermodynamic variable in terms of which to define the initial conditions of the block.

The value for the Initial fluid energy specification parameter limits the available initial states for the two-phase fluid. When Initial fluid energy specification is:

• `Temperature` — Specify an initial state that is a subcooled liquid or superheated vapor. You cannot specify a liquid-vapor mixture because the temperature is constant across the liquid-vapor mixture region.

• `Vapor quality` — Specify an initial state that is a liquid-vapor mixture. You cannot specify a subcooled liquid or a superheated vapor because the liquid mass fraction is 0 and 1, respectively, across the whole region. Additionally, the block limits the pressure to below the critical pressure.

• `Vapor void fraction` — Specify an initial state that is a liquid-vapor mixture. You cannot specify a subcooled liquid or a superheated vapor because the liquid mass fraction is 0 and 1, respectively, across the whole region. Additionally, the block limits the pressure to below the critical pressure.

• `Specific enthalpy` — Specify the specific enthalpy of the fluid. The block does not limit the initial state.

• `Specific internal energy` — Specify the specific internal energy of the fluid. The block does not limit the initial state.

Pressure in the pipe at the start of simulation, specified against absolute zero.

Temperature in the pipe at the start of simulation, specified against absolute zero.

#### Dependencies

To enable this parameter, set Initial fluid energy specification to `Temperature`.

Mass fraction of vapor in the pipe at the start of simulation.

#### Dependencies

To enable this parameter, set Initial fluid energy specification to `Vapor quality`.

Volume fraction of vapor in the pipe at the start of simulation.

#### Dependencies

To enable this parameter, set Initial fluid energy specification to `Vapor void fraction`.

Specific enthalpy of the fluid in the pipe at the start of simulation.

#### Dependencies

To enable this parameter, set Initial fluid energy specification to `Specific enthalpy`.

Specific internal energy of the fluid in the pipe at the start of simulation.

#### Dependencies

To enable this parameter, set Initial fluid energy specification to ```Specific internal energy```.

Characteristic time to equilibrium of a phase-change event taking place in the pipe. This constant introduces a time lag into the transition between phases. Increase this parameter value to slow the rate of phase change or decrease it to speed the rate.

## References

[1] White, F. M., Viscous Fluid Flow. McGraw-Hill, 1991.

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

## Version History

Introduced in R2015b

expand all