Rigid conduit for fluid flow in two-phase fluid systems

Two-Phase Fluid/Elements

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.

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 conservation in the pipe is observed through the equation:

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

*M*is the fluid mass inside the pipe.*u*_{I}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.*Q*_{H}is the heat flow rate into the pipe through the pipe wall, represented by port H.

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}=\frac{{h}_{A}^{coef}+{h}_{B}^{coef}}{2}{S}_{surf}\left({T}_{H}-{T}_{I}\right),$$

*h*_{A}^{coef}is the heat transfer coefficient for the half pipe adjacent to port A.*h*_{B}^{coef}is the heat transfer coefficient for the half pipe adjacent to port B.*S*_{Surf}is the pipe surface area.*T*_{H}is the pipe wall temperature.*T*_{I}is the temperature of the fluid in the pipe.

The heat transfer coefficient in the half pipe adjacent to port A is computed as

$${h}_{A}^{coef}=\frac{N{u}_{A}{k}_{I}}{{D}_{h}},$$

$${h}_{B}^{coef}=\frac{N{u}_{B}{k}_{I}}{{D}_{h}},$$

*Nu*_{A}is the Nusselt number in the half pipe adjacent to port A.*Nu*_{B}is the Nusselt number in the half pipe adjacent to port B.*k*_{I}is the thermal conductivity of the fluid inside the pipe.

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 turbulent flows, the Nusselt number in the half pipe adjacent to port A is

$$N{u}_{A}^{turbulent}=\frac{\frac{{f}_{A}}{8}\left(R{e}_{A}-1000\right)P{r}_{I}}{1+12.7\sqrt{\frac{{f}_{A}}{8}}\left(P{r}_{I}^{2/3}-1\right)},$$

$$N{u}_{B}^{turbulent}=\frac{\frac{{f}_{A}}{8}\left(R{e}_{B}-1000\right)P{r}_{I}}{1+12.7\sqrt{\frac{{f}_{B}}{8}}\left(P{r}_{I}^{2/3}-1\right)},$$

*Pr*_{I}is the Prandtl number inside the pipe.

Mass conservation in the pipe is observed through the equation:

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

*ρ*is the fluid density.*p*_{I}is the pressure inside the pipe.*V*is the volume of fluid in the pipe.$${\dot{m}}_{A}$$ is the mass flow rate into the pipe through port A.

$${\dot{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,

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

*M*as the fluid mass in the pipe, computed from the equation:$$\dot{M}={\dot{m}}_{A}+{\dot{m}}_{B},$$

*v*_{I}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.

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{{\dot{m}}_{A}}{S}\left|\frac{{\dot{m}}_{A}}{S}\left({\nu}_{I}-{\nu}_{A}\right)\right|+{F}_{visc,A}+{I}_{A},$$

*p*_{A}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.*F*_{visc,A}is the viscous friction force in the half pipe adjacent to port A.*I*_{A}is the fluid inertia at port A:The parameter$${I}_{A}={\ddot{m}}_{A}\frac{L}{2S}$$

*L*is the pipe length.

In the half pipe adjacent to port B:

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

*p*_{B}is the pressure at port B.*ν*_{B}is the specific volume of the fluid at port B.*F*_{visc,B}is the viscous friction force in the half pipe adjacent to port B.*I*_{B}is the fluid inertia at port B:$${I}_{B}={\ddot{m}}_{B}\frac{L}{2S}$$

The fluid inertia terms, *I*_{A} and *I*_{B},
are zero when the **Fluid inertia** parameter is
set to `Off`

. The calculation of the viscous
friction forces, *F*_{visc,A} and *F*_{visc,B} depends
on the flow regime, laminar or turbulent.

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}{\dot{m}}_{A}}{4{D}_{h}^{2}S},$$

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

*f*_{shape}is the pipe shape factor.*L*_{eff}is the effective pipe length—the sum of the pipe length and the aggregate equivalent length of local resistances.*D*_{h}is the hydraulic diameter of the pipe.

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{{\dot{m}}_{A}\left|{\dot{m}}_{A}\right|{f}_{A}{L}_{eff}{\nu}_{I}}{4{D}_{H}{S}^{2}},$$

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

*f*_{A}is the Darcy friction factor for turbulent flow in the half pipe adjacent to port A.*f*_{B}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{{\u03f5}_{r}}{3.7}\right)}^{1.11}\right]\right\}}^{2}},$$

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

where:

*∊*_{r}is the relative roughness of the pipe.*Re*_{A}is the Reynolds number in the half pipe adjacent to port A,$$R{e}_{A}=\frac{\left|{\dot{m}}_{A}\right|{D}_{h}{v}_{I}}{S{\nu}_{I}}.$$

*Re*_{B}is the Reynolds number in the half pipe adjacent to port B,$$R{e}_{B}=\frac{\left|{\dot{m}}_{B}\right|{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.

The block dialog box does not have a **Source code** link.
To view the source code for the various block configurations, open
the following files in the MATLAB^{®} editor:

Pipe with losses and dynamic compressibility (fluid inertia

`Off`

) —`pipe_resistive_dynamic.ssc`

Pipe with losses, dynamic compressibility, and fluid inertia (fluid inertia

`On`

) —`pipe_resistive_dynamic_inertia.ssc`

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.

**Pipe length**Distance between the pipe inlet and outlet. The default value is

`5`

m.**Cross-sectional area**Internal pipe area normal to the direction of flow. This area is constant along the length of the pipe. The default value is

`0.01`

m^2.**Hydraulic diameter**Diameter of an equivalent pipe with a circular cross section. In a cylindrical pipe, the hydraulic diameter is the same as its actual diameter. The default value is

`0.1`

m.

**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

`0.1`

m.**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.**Laminar flow upper Reynolds number limit**Largest value of the Reynolds number corresponding to fully developed laminar flow. As the Reynolds number rises above this limit, the flow gradually transitions from laminar to turbulent. The default value is

`2000`

.**Turbulent flow lower Reynolds number limit**Smallest value of the Reynolds number corresponding to fully developed turbulent flow. As the Reynolds number falls below this limit, flow gradually transitions from turbulent to laminar. The default value is

`4000`

.**Shape factor for laminar flow viscous friction**Semi-empirical parameter encoding the effect of pipe geometry on the viscous friction losses incurred in the laminar regime. The appropriate value to use depends on the cross-sectional shape of the pipe.

Typical values include

`56`

for a square cross section,`62`

for a rectangular cross section, and`96`

for a concentric annulus cross section [1]. The default value, corresponding to a circular cross section, is`64`

.**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. Its 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`

.

**Fluid inertia**Option to model fluid inertia, the resistance of the fluid to rapid acceleration. The default is

`Off`

.**Initial fluid regime**Fluid regime at the start of simulation. The fluid can be a subcooled liquid, a two-phase mixture, or a superheated vapor. The default setting is

`Subcooled liquid`

.**Initial fluid pressure**Pressure in the pipe at the start of simulation. The default value is

`0.101325`

MPa.**Initial fluid temperature**Temperature in the pipe at the start of simulation. This parameter appears only when

**Initial fluid regime**is set to`Subcooled liquid`

or`Superheated vapor`

. The default value is`293.15`

K.**Phase change time constant**Characteristic duration of a phase-change event. This constant introduces a time lag into the transition between phases. The default value is

`0.1`

s.

The block has two two-phase fluid conserving ports, A and B. Port H is a thermal conserving port representing the pipe wall through which heat exchange occurs.

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

Was this topic helpful?