# Partially Filled Pipe (TL)

Pipe with variable liquid volume in an thermal liquid system

**Library:**Simscape / Fluids / Isothermal Liquid / Pipes & Fittings

## Description

The Partially Filled Pipe (TL) block represents a pipe with the capacity for varying internal liquid levels. The pipe may also become completely dry during simulation.

In addition to liquid connections at ports **A** and
**B**, port **AL** receives the inlet liquid level
from connected blocks as a physical signal. If the value at **AL** is
greater than zero, **A** is submerged. If the value at
**AL** is less than or equal to zero, the port is exposed. The pipe
liquid level is transmitted as a physical signal to connecting blocks at port
**L**.

Port **A** is always higher than port **B**. If port
**A** becomes exposed, the pipe can be filled through port
**B**. When fluid enters the pipe through port
**B**, the mass flow rate through port **A** is 0
until the pipe is fully filled, at which point $${\dot{m}}_{A}=-{\dot{m}}_{B}.$$

### When to Use the Partially Filled Pipe (TL) Block

This block can be used in conjunction with the Tank
(TL) block when fluid levels are expected to fall below the tank
inlet. Multiple Partially Filled Pipe (TL) blocks can
also be connected in series or parallel. However, because the block can only be
filled at port **B**, if port **A** of one block
in a parallel configuration becomes exposed, it may not be possible to refill this
pipe if its connection at port **B** cannot refill the pipe.

### Pressure Loss Over the Pipe

The pressure differential over the pipe,
*p*_{A} –
*p*_{B}, comprises losses due to wall
friction and hydrostatic pressure differences between the liquid surface height and
the liquid height at port **A**:

$${p}_{A}-{p}_{B}=\Delta {p}_{loss}+\Delta {p}_{elev}.$$

Friction losses depend on the fluid regime in the pipe. If the flow is laminar, the friction losses are:

$$\Delta {p}_{loss}=\frac{-{\dot{m}}_{B}\upsilon {f}_{s}\widehat{L}}{2{D}_{h}^{2}{A}^{2}},$$

where:

*ν*is the fluid kinematic viscosity.*f*_{S}is the**Laminar friction constant for Darcy friction factor**.$$\widehat{L}$$ is the sum of the pipe length and its

**Aggregate equivalent length of local resistances**, in proportion to the pipe fill level: $$\widehat{L}=\left(L+{L}_{add}\right)\frac{l}{{l}_{\mathrm{max}}}.$$*l*,*l*are the liquid level and the_{max}**Elevation drop from port A to port B**, respectively.*D*_{h}is the pipe hydraulic diameter. If the pipe cross-section is not circular, the hydraulic diameter is the equivalent circular diameter.

If the flow is turbulent, the friction losses are:

$$\Delta {p}_{loss}=\frac{-{\dot{m}}_{B}\left|{\dot{m}}_{B}\right|f\widehat{L}}{2\rho {D}_{h}^{2}{A}^{2}}.$$

*f* is the Darcy friction factor for turbulent flows, which is determined
by the empirical Haaland correlation:

$$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},$$

where *ε* is the **Internal surface
absolute roughness** parameter. The Reynolds number is based on the
mass flow rate at port **B** and the pipe hydraulic
diameter.

The hydrostatic pressure difference is $$\Delta {p}_{elev}=\rho gl.$$

### Mass Flow Rate

The flow in the pipe is dictated by the internal fluid level and the conditions at port
**B**. The pipe can be filled or drained at
**B** if the pipe is partially empty. If the pipe is fully
filled, $${\dot{m}}_{A}={\dot{m}}_{B}.$$, and mass is conserved:

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

The block determines the mass of fluid in the pipe by the relative fill level of the pipe:

$$M=\rho AL\frac{l}{{l}_{\mathrm{max}}}.$$

### Energy Balance

The block balances energy flow such that when port **A** is submerged,

$$M{c}_{v}\frac{dT}{dt}={\varphi}_{A}+{\varphi}_{B}-{\dot{m}}_{B}gl.$$

When port **A** is exposed,

$$M{c}_{v}\frac{dT}{dt}={\varphi}_{A}+{\varphi}_{B}-{\dot{m}}_{B}h-{\dot{m}}_{B}gl,$$

where *c _{v}* is the
specific heat at constant volume,

*T*is the fluid temperature, and

*h*is the specific enthalpy.

### Assumptions and Limitations

This block does not account for dynamic compressibility or fluid inertia, and does not model the dynamics of air (or second liquid) in the pipe.

## Ports

### Conserving

### Input

### Output

## Parameters

## Model Examples

## Extended Capabilities

## Version History

**Introduced in R2022a**