# Local Resistance (MA)

**Libraries:**

Simscape /
Fluids /
Moist Air /
Pipes & Fittings

## Description

The Local Resistance (MA) block models the pressure loss due to user-defined pipe resistance in a moist air network. You can specify different loss coefficients for forward and reversed flows through the pipe segment.

You can parameterize the loss factor as either a constant relationship based on the pipe pressure or by specifying tabular data for loss coefficients based on the Reynolds number.

### Constant Loss Factor

When you set **Local loss parameterization** to
`Constant`

, the losses remain constant over the range of flow
velocities. The loss factor is

$${k}_{loss}={k}_{loss,BA}+\frac{\left({k}_{loss,AB}-{k}_{loss,BA}\right)}{2}\left[\mathrm{tanh}\left(\frac{3\Delta p}{\Delta {p}_{crit}}\right)+1\right],$$

where:

*k*and_{loss,AB}*k*are the values of the_{loss,BA}**Forward flow loss coefficient (from A to B)**and**Reverse flow loss coefficient (from B to A)**parameters, respectively.*Δp*is the pressure difference, which is*p*–_{A}*p*._{B}

The critical pressure difference, *Δp _{crit}*, is
the pressure differential associated with the

**Critical Reynolds number**parameter,

*Re*, which is the flow regime transition point between laminar and turbulent flow,

_{crit}$$\Delta {p}_{crit}=\frac{\overline{\rho}}{2}{k}_{loss,crit}{\left(\frac{\nu {\mathrm{Re}}_{crit}}{{D}_{h}}\right)}^{2},$$

where:

*k*is the loss factor associated with the critical pressure. The value is based on an average of the forward and reverse loss coefficients._{loss,crit}*ν*is the fluid kinematic viscosity.$$\overline{\rho}$$ is the average fluid density.

*D*is the segment hydraulic diameter, which is the equivalent diameter of a pipe with a non-circular cross-section, $${D}_{h}=\sqrt{\frac{4}{\pi {A}_{flow}}}.$$, where_{h}*A*is the value of the_{flow}**Flow area**parameter.

### Tabulated Loss Coefficient

When you set **Local loss parameterization** to ```
Tabulated
data - loss coefficient vs. Reynolds number
```

, you can interpolate the loss
coefficient from the Reynolds number and the loss coefficient data. The vector of Reynolds
numbers can have both positive and negative values, which indicate forward and reverse flow,
respectively: $${k}_{loss}=TLU(\mathrm{Re}).$$

### Mass Flow Rate

The block conserves mass such that

$$\begin{array}{l}{\dot{m}}_{A}+{\dot{m}}_{B}=0\\ {\dot{m}}_{wA}+{\dot{m}}_{wB}=0\\ {\dot{m}}_{gA}+{\dot{m}}_{gB}=0\end{array}$$

where:

$$\dot{m}$$

is the mixture mass flow rate at port_{B}**B**.$$\dot{m}$$

and $$\dot{m}$$_{wA}are the water vapor mass flow rates at ports_{wB}**A**and**B**, respectively.$$\dot{m}$$

and $$\dot{m}$$_{gA}are the trace gas mass flow rates at ports_{gB}**A**and**B**, respectively.

The mass flow rate through the valve is

$$\dot{m}={A}_{flow}\frac{\sqrt{2\overline{\rho}}}{\sqrt{{k}_{loss}}}\frac{\Delta p}{{\left[\Delta {p}^{2}+\Delta {p}_{crit}^{2}\right]}^{1/4}},$$

where *k _{loss}* is the flow loss
coefficient.

### Energy Balance

The block balances energy such that

$${\Phi}_{A}+{\Phi}_{B}=0,$$

where:

*ϕ*is the energy flow rate at port_{A}**A**.*ϕ*is the energy flow rate at port_{B}**B**.

## Ports

### Conserving

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2024a**