# Cross-Junction (IL)

**Libraries:**

Simscape /
Fluids /
Isothermal Liquid /
Pipes & Fittings

## Description

The Cross-Junction (IL) block represents a four-way
junction in an isothermal liquid network. The block abstracts the fluid interactions
depending on the direction of flow at each port, where ports **A** and
**C** are the main line and ports **B** and
**D** are the branch line.

### Mass and Momentum Balance

The block conserves mass such that

$${\dot{m}}_{A}+{\dot{m}}_{B}+{\dot{m}}_{C}+{\dot{m}}_{D}=0,$$

where *ṁ _{i}* is the mass
flow rate for a given port,

*i*.

The block determines which coefficient and vector element to use, then computes the pressure difference to conserve momentum such that

$${p}_{i}-{p}_{1}={I}_{i}+\frac{\raisebox{1ex}{${k}_{i}$}\!\left/ \!\raisebox{-1ex}{$2$}\right.{\dot{m}}_{i}\sqrt{{\dot{m}}_{i}^{2}+{\dot{m}}_{threshold}^{2}}}{\overline{\rho}{A}_{i}^{2}},$$

where:

$$\overline{\rho}$$ is the average fluid density.

*p*is the pressure for a given port,_{i}*i*.*p*is the pressure at node 1._{1}*k*is the flow coefficient that the block assigns to a given port,_{i}*i*. The**Loss coefficient model**parameter specifies the block method used to calculate*k*._{i}*I*is the fluid inertia for a given port,_{i}*i*.

The block calculates the inertia for each port as

$$\begin{array}{l}{I}_{A}={\ddot{m}}_{A}\frac{\sqrt{\pi {A}_{side}}}{{A}_{main}}\\ {I}_{B}={\ddot{m}}_{B}\frac{\sqrt{\pi {A}_{main}}}{{A}_{side}}\\ {I}_{C}={\ddot{m}}_{C}\frac{\sqrt{\pi {A}_{side}}}{{A}_{main}}\\ {I}_{D}={\ddot{m}}_{D}\frac{\sqrt{\pi {A}_{main}}}{{A}_{side}}\end{array}$$

where *A _{main}* is the
value of the

**Main line area (A,C)**parameter and

*A*is the value of the

_{side}**Branch line area (B,D)**parameter.

### Idel'chik Correlation Coefficient Model

When you set the **Loss coefficient model** parameter to
`Idel'chik correlation`

, the block calculates the pipe
loss coefficients according to [1].
The Idel'chik model only supports flow converging to port **C** or
flow diverging from port **C**. To achieve expected results, orient
the block appropriately to the expected flow configuration of the model fluid
network.

The block treats the junction as symmetrical about both the horizontal and
vertical planes such that *A _{A}* =

*A*is the value of the

_{C}**Main line area (A,C)**parameter, and

*A*=

_{B}*A*is the value of the

_{D}**Branch line area (B,D)**parameter, where

*A*is the area of the corresponding port.

_{A,B,C,D}In the case of a prohibited flow geometry, you can control the block behavior by
using the **Report when flow configuration is invalid** parameter.
If the **Report when flow configuration is invalid** parameter is
`None`

or `Warning`

, the model
continues to run in the prohibited flow configuration, but the results may not be
correct.

**Converging Flow to Port C**

When the flow is converging to port **C**, the loss
coefficients for ports **A** and **C** are

$$\begin{array}{l}{k}_{A}=\left(1+{\left(\frac{{\dot{m}}_{A}}{{\dot{m}}_{C}}\right)}^{2}-{\left(\frac{{\dot{m}}_{A}}{{\dot{m}}_{C}}\right)}^{2}\frac{1+\frac{{\dot{m}}_{A}}{{\dot{m}}_{C}}}{{\left(0.75+0.25\frac{{\dot{m}}_{A}}{{\dot{m}}_{C}}\right)}^{2}}\right){\left(\frac{{\dot{m}}_{A}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{A}}\right)}^{-2}\\ {k}_{C}=0\end{array}$$

The converging flow loss coefficients for ports **B** and
**D** are

$$\begin{array}{l}{k}_{B}=\left(1+{\left(\frac{{\dot{m}}_{B}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{B}}\right)}^{2}-8{\left(\frac{{\dot{m}}_{B}}{{\dot{m}}_{C}}\right)}^{2}\frac{{\left[\frac{{\dot{m}}_{C}}{{\dot{m}}_{B}}-\left(1+\frac{{\dot{m}}_{D}}{{\dot{m}}_{B}}\right)\right]}^{2}}{4-\left(1+\frac{{\dot{m}}_{D}}{{\dot{m}}_{B}}\right)\frac{{\dot{m}}_{B}}{{\dot{m}}_{C}}}\right){\left(\frac{{\dot{m}}_{B}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{B}}\right)}^{-2}\\ {k}_{D}=\left(1+{\left(\frac{{\dot{m}}_{D}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{D}}\right)}^{2}-8{\left(\frac{{\dot{m}}_{D}}{{\dot{m}}_{C}}\right)}^{2}\frac{{\left[\frac{{\dot{m}}_{C}}{{\dot{m}}_{D}}-\left(1+\frac{{\dot{m}}_{B}}{{\dot{m}}_{D}}\right)\right]}^{2}}{4-\left(1+\frac{{\dot{m}}_{B}}{{\dot{m}}_{D}}\right)\frac{{\dot{m}}_{D}}{{\dot{m}}_{C}}}\right){\left(\frac{{\dot{m}}_{D}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{D}}\right)}^{-2}\end{array}$$

**Diverging Flow From Port C**

When the flow diverges from port **C**, the loss coefficients
for ports **A** and **C** are

$$\begin{array}{l}{k}_{A}=0.4{\left(\frac{{\dot{m}}_{C}}{{\dot{m}}_{A}}-1\right)}^{2}\\ {k}_{C}=0\end{array}$$

The diverging flow loss coefficients for ports **B** and
**D** are

$$\begin{array}{l}{k}_{B}=A\text{'}{\left(\frac{{\dot{m}}_{C}}{{\dot{m}}_{B}}\frac{{A}_{B}}{{A}_{C}}+1\right)}^{2}\\ {k}_{D}=A\text{'}{\left(\frac{{\dot{m}}_{C}}{{\dot{m}}_{D}}\frac{{A}_{D}}{{A}_{C}}+1\right)}^{2}\end{array}$$

where *A'=1* when $$\frac{{\dot{m}}_{B}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{B}}\le 0.8\text{or}\frac{{\dot{m}}_{D}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{D}}\le 0.8$$ and *A'≈0.9* when $$\frac{{\dot{m}}_{B}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{B}}>0.8\text{or}\frac{{\dot{m}}_{D}}{{\dot{m}}_{C}}\frac{{A}_{C}}{{A}_{D}}0.8$$. The block smooths the transition between *A' =
1* and *A' = 0.9* using a hyperbolic tangent
function.

According to [1], these loss coefficients are only applicable for diverging
flow when the ratio of the side branch diameter to the main branch diameter is
less than or equal to `2/3`

. However, the expected error for
ratios above `2/3`

is generally low enough that the block
continues to use the above loss coefficients.

### Custom Cross-Junction

When you set the **Loss coefficient model** parameter to
`Custom`

, the block uses the user-defined loss
parameters to describe the pipe loss coefficient at each port.

For a custom cross-junction, the block allows four configurations diverging flow, converging flow, perpendicular flow, and colliding flow:

Diverging flow — Flow enters at node 1 and exits at nodes 2, 3, and 4.

Converging flow — Flow enters at nodes 1, 2, and 4 and exits at node 3.

Perpendicular flow — Flow enters at nodes 1 and 2 and exits at nodes 3 and 4.

Colliding flow — Flow enters at nodes 1 and 3 and exits at nodes 2 and 4.

This figure demonstrates these configurations.

The block treats the junction as symmetrical about both the horizontal and
vertical planes such that *A _{1}* =

*A*and

_{3}*A*=

_{2}*A*, where

_{4}*A*is the area of the corresponding port in the figure. Using this symmetry, the block assumes the loss coefficients from 1 to 2 and from 1 to 4 are identical during diverging, converging, and colliding flow.

_{1,2,3,4}During simulation, the block continually checks the direction of flow at each port
and compares the result to the four possible flow configurations. When the block
determines the flow configuration, it adjusts the node that each port corresponds
to. For example, when the block experiences diverging flow where the fluid enters at
port **A** and exits at ports **B**,
**C**, and **D**, it assigns node 1 to port
**A** as in the first panel of the figure. The other panels
show the assigned nodes for diverging flow entering at ports other than
**A**.

For the custom cross-junction, all four flow configurations can occur in the same
block during a simulation. You only need to supply parameters for each condition
that the block experiences. If you use two-element vectors to specify the flow
coefficients, the block uses the first or second element depending on whether node 1
aligns with the main line or the branch line. The first element corresponds to node
1 at port **A** or **C**, and the second element
corresponds to node 1 at port **B** or
**D**.

This table describes the conditions and coefficients for each operational mode used to determine the loss coefficients.

Flow Scenario | ṁ_{A} | ṁ_{B} | ṁ_{C} | ṁ_{D} | k_{A} | k_{B} | k_{C} | k_{D} |
---|---|---|---|---|---|---|---|---|

Diverging from node A | >ṁ_{thresh} | <-ṁ_{thresh} | <-ṁ_{thresh} | <-ṁ_{thresh} | 0 | k_{div,turning,main} | k_{div,straight,main} | k_{div,turning,main} |

Diverging from node B | <-ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | <-ṁ_{thresh} | k_{div,turning,side} | 0 | k_{div,turning,side} | k_{div,straight,side} |

Diverging from node C | <-ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | k_{div,straight,main} | k_{div,turning,main} | 0 | k_{div,turning,main} |

Diverging from node D | <-ṁ_{thresh} | <-ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | k_{div,turning,side} | k_{div,straight,side} | k_{div,turning,side} | 0 |

Converging to node A | <-ṁ_{thresh} | >ṁ_{thresh} | >ṁ_{thresh} | >ṁ_{thresh} | 0 | k_{conv,turning,main} | k_{conv,straight,main} | k_{conv,turning,main} |

Converging to node B | >ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | >ṁ_{thresh} | k_{conv,turing,side} | 0 | k_{conv,turing,side} | k_{conv,straight,side} |

Converging to node C | >ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | k_{conv,straight,main} | k_{conv,turning,main} | 0 | k_{conv,turning,main} |

Converging to node D | >ṁ_{thresh} | >ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | k_{conv,turing,side} | k_{conv,straight,side} | k_{conv,turing,side} | 0 |

Perpendicular with main entry A | >ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | <-ṁ_{thresh} | 0 | k_{perp,turning
in,main} | k_{perp,straight,main} | k_{perp,turning
out,main} |

Perpendicular with main entry B | <-ṁ_{thresh} | >ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | k_{perp,turning
out,side} | 0 | k_{perp,turning
in,side} | k_{perp,turning
straight,side} |

Perpendicular with main entry C | <-ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | >ṁ_{thresh} | k_{perp,straight,main} | k_{perp,turning
out,main} | 0 | k_{perp,turning
in,main} |

Perpendicular with main entry D | >ṁ_{thresh} | <-ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | k_{perp,turning
in,side} | k_{perp,turning
straight,side} | k_{perp,turning
out,side} | 0 |

Colliding from main to branch | >ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | 0 | k_{coll,turning,main} | k_{coll,straight,main} | k_{coll,turning,main} |

Colliding from branch to main | <-ṁ_{thresh} | >ṁ_{thresh} | <-ṁ_{thresh} | >ṁ_{thresh} | k_{coll,turning,side} | 0 | k_{coll,turning,side} | k_{coll,straight,side} |

Stagnant | – | – | – | – | 1 or last valid | 1 or last valid | 1 or last valid | 1 or last valid |

The flow is stagnant when the mass flow rate conditions do not match any defined flow scenario. The block uses these parameters to calculate the flow coefficients:

*k*and_{div,straight,main}*k*are the first and second elements of the_{div,straight,side}**Diverging flow straight loss coefficient**parameter, respectively.*k*and_{div,turning,main}*k*are the first and second elements of the_{div,turning,side}**Diverging flow turning loss coefficient**parameter, respectively.*k*and_{conv,straight,main}*k*are the first and second elements of the_{conv,straight,side}**Converging flow straight loss coefficient**parameter, respectively.*k*and_{conv,turning,main}*k*are the first and second elements of the_{conv,turning,side}**Converging flow turning loss coefficient**parameter, respectively.*k*and_{perp,straight,main}*k*are the first and second elements of the_{perp,straight,side}**Perpendicular flow straight loss coefficient**parameter, respectively.*k*and_{perp,turning in,main}*k*are the first and second elements of the_{perp,turning in,side}**Perpendicular flow straight loss coefficient**parameter, respectively.*k*and_{perp,turning out,main}*k*are the first and second elements of the_{perp,turning out,side}**Perpendicular flow straight loss coefficient**parameter, respectively.*k*and_{coll,straight,main}*k*are the first and second elements of the_{coll,straight,side}**Colliding flow straight loss coefficient**parameter, respectively.*k*and_{coll,turning,main}*k*are the first and second elements of the_{coll,turning,side}**Colliding flow turning loss coefficient**parameter, respectively.

### Variables

To set the priority and initial target values for the block variables prior to simulation, use
the **Initial Targets** section in the block dialog box or
Property Inspector. For more information, see Set Priority and Initial Target for Block Variables.

Nominal values provide a way to specify the expected magnitude of a variable in a model.
Using system scaling based on nominal values increases the simulation robustness. Nominal
values can come from different sources, one of which is the **Nominal
Values** section in the block dialog box or Property Inspector. For more
information, see Modify Nominal Values for a Block Variable.

## Ports

### Conserving

## Parameters

## References

[1] Idel’chik, I. E. *Handbook of hydraulic resistance: Coefficients of local resistance and
of friction*. Jerusalem: Israel Program for Scientific Translations,
1966.

## Extended Capabilities

## Version History

**Introduced in R2022b**