Mechanical apparatus for powering flow in gas systems

**Library:**Simscape / Fluids / Gas / Turbomachinery

The Fan (G) block models a mechanical apparatus for powering flow in gas systems: a rotor mounted on a drive shaft (often) enclosed in a case. The fan is parameterized in terms of performance metrics commonly reported in technical data sheets (and specified here in tabulated form). The metrics used depend on the parameterization chosen but can include measures of pressure rise, flow rate, rotor speed, and fan efficiency. The parameterizations are valid solely in the normal operating region (for which data is reported).

Normally, an electrical motor, though sometimes another power source, spins the rotor
(port **R**) against its case (**C**). The rotor
transfers the power drawn to the gas stream, causing it to move (and its pressure to
rise) from inlet (**A**) to outlet (**B**). The
direction of the flow depends on the blades of the rotor and it can, in a real fan, be
radial, axial, crossed, or mixed. Such effects are assumed to reflect entirely in the
performance data specified for the fan.

The mechanical ports belong to the Simscape Rotational domain. To turn the rotor, they must connect to ports of the same domain. Rotational source blocks from the Simscape Foundation library are a simple way to apply the necessary torque. These are idealized models, without friction or other real-world effects. Simscape Driveline blocks are another option, richer in detail for more accurate simulations, among it the effects ignored in their idealized counterparts (when relevant to the model).

Two directions play into the block computations: those of the turning of the rotor and of the movement of the gas stream.

The shaft of the rotor can technically turn forward or backward. For the rotor to
generate flow, however, only the direction indicated in the **Mechanical
orientation** parameter will do. That direction can be
`Positive`

or `Negative`

. (In
other words, the fan is *unidirectional* in operation.) If the
rotor shaft should turn in the counter direction, the fan goes into idle and power
is no longer supplied to the stream. You can think of the rotor as having disengaged
from the shaft (for example, by use of a one-way clutch).

The stream, on the other hand, when powered by the fan, must flow from inlet (port
**A**) to outlet (**B**). This direction is
designated as positive in the block calculations. It is possible for the flow to
reverse, but not by the action of the rotor. Instead, an event must occur to flip
the pressure gradient across the fan and so force the flow back toward the inlet.
Such occurrences are considered abnormal and, when they take place, are generally
transient and short-lived.

Note that the direction of the flow is independent of the **Mechanical
orientation** setting of the block. This setting serves merely as a
means to reverse the sweep of the rotor blades. Clockwise and counterclockwise
rotors can both generate positive flow—and in fact must if the remainder of the fan
requires it—but the way they must turn will differ. (One will generate positive flow
when spun in the positive direction; the other, when spun in the negative
direction.)

The saturation has the effect of splitting the rotor speed domain into two regions: below the saturation threshold, the rotor speed is fixed at the threshold value; above the saturation threshold, it is a variable determined by calculation. The transition between the regions has one drawback: without modification, it is sharp and its slope discontinuous.

Slope discontinuities pose a challenge to variable-step solvers (the sort commonly used in Simscape models). To precisely capture a sharp transition, the solver must reduce its time step, pausing briefly at the time of the transition in order to recompute the Jacobian matrix for the model (a representation of the dependencies between state variables and their time derivatives).

This solver strategy is efficient and robust when discontinuities are present—it makes the solver less prone to convergence errors—but it can considerably extend the time needed to finish a simulation. An alternative approach, used here, is to remove the slope discontinuities altogether, by smoothing them over a small range of motor speeds.

The smoothing, which adds a slight distortion to the transition, ensures that the fan eases into its saturated state rather than snap abruptly to it. The shape and scale of the smoothing derive from the cubic polynomial expression:

$$\lambda =3{\left(\frac{\omega}{{\omega}_{\text{Th}}}\right)}^{2}-2{\left(\frac{\omega}{{\omega}_{\text{Th}}}\right)}^{3},$$

where *ƛ* is the smoothing polynomial. The
subscript `Th`

denotes the threshold value at which to saturate
the rotor speed (specified in the **Shaft speed threshold for flow
reversal** block parameter). The smoothing adds a third,
transitional, region between the saturated and variable regions of the rotor
speed domain:

$${\omega}^{*}=\{\begin{array}{ll}{w}_{\text{Th}},\hfill & \omega <0\hfill \\ \left(1-\lambda \right){\omega}_{\text{Th}}+\lambda \omega ,\hfill & \omega <{\omega}_{\text{Th}}\hfill \\ \omega ,\hfill & \omega \ge {\omega}_{\text{Th}}\hfill \end{array},$$

where the asterisk (*) denotes the smoothed value.

The figure shows the effect of smoothing on the speed of the rotor. The plot
to the left corresponds to a fan with positive mechanical orientation; the plot
to the right, to one with negative mechanical orientation. Region
**I** is the saturated state, region
**II** the transition state, and region
**III** the original state (with neither smoothing nor saturation).

The fan, which creates flow but neither stores nor carries its contents, is a relatively compact device. The gas column that surrounds its rotor is thin and, on the scale of the larger components—the pipes, chambers, and reservoirs that often abut the fan—of negligible volume. This volume and its mass are ignored in this block. (While the stream can pass through the fan, its contents cannot accumulate there, as they might in a pipe, say, if it is dilated, heated, or compressed.)

Conservation of mass then requires only that the mass flow rates through the inlet and outlet be of the same magnitude:

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

where $$\dot{m}$$ is the mass flow rate *into* the valve through
the port indicated by the subscript. Port **A** is always the inlet
and port **B** always the outlet.

The smaller the gas volume, the faster its transient response to pressure and
temperature disturbances, and the shorter its time spent between steady states. If
that volume is trivially small, as it is here, at least in proportion to the volumes
of neighboring components, the transient response can be considered instantaneous.
The fan then behaves as if it were always at a steady state (one given by the
instantaneous conditions at the ports). Such components are known as
*quasi-steady*.

A quasi-steady fan, having no gas volume, has also no energy contents to vary over time. Energy can flow through its ports, and, as mechanical work, from the rotor, but it cannot accumulate inside. In other words, what comes in must simultaneously go out. Conservation of energy then reduces to a sum of energy flow rates:

$${\varphi}_{\text{A}}+{\varphi}_{\text{B}}+{W}_{\text{F}}=0,$$

where *ϕ* is the total energy flow rate
*into* the fan through the port indicated by the subscript,
and *W*_{F} is the rate of work done on—and the
power supplied to—the stream by the rotor.

This is not to say that the fan is lossless. Energy can dissipate between the ports by interactions involving mechanical components, the gas stream, or both. The rotor shaft, for example, is subject to friction; the stream must pass through restrictions, elbows, and fittings. In this block, the losses due to all such factors are assumed to reflect in the total efficiency of the fan—the ratio of the (pneumatic) power output to the (mechanical) power input:

$${\eta}_{\text{T}}=\frac{{W}_{\text{F}}}{{W}_{\text{M}}},$$

where
*η*_{T} is the total
efficiency and *W* is the power delivered, in the term denoted
by subscript `M`

, by the drive shaft to the fan rotor (before
any portion of that power can dissipate in the fan).

(The total efficiency is obtained during simulation from the tabulated data of the block. See "Fan Parameterizations" for the block calculations.)

The mechanical power input is defined in terms of the domain variables at the mechanical ports:

$${W}_{\text{M}}=\tau {\omega}^{*},$$

where *τ* is the torque delivered to the
drive shaft (port **R**) relative to the case
(**C**) and
*ɷ*^{*} is the smoothed shaft
velocity, also relative to the case, as defined in "Numerical Smoothing".

The power supplied to the stream, always a fraction
*η*_{T} of that
delivered by the drive shaft, acts to raise the total enthalpy of the gas from
the inlet to the outlet. This power is defined here for ideal and nonideal gases
alike as:

$${W}_{\text{F}}=\dot{m}\left({h}_{\text{T,B}}-{h}_{\text{T,A}}\right),$$

where *h*_{T} is the
specific total enthalpy at the outlet (subscript **B**) and at
the inlet (subscript **A**). The specific total enthalpy is
calculated from the specific enthalpy (the sum of specific internal energy with
the product of pressure and specific volume):

$${h}_{\text{T}}=h+\frac{{v}^{2}}{2},$$

where the fraction on the right is the specific kinetic
energy of the stream and *v* is the velocity of the same, both
at the gas port being considered (**A** or
**B**).

(The power *W*_{F} is frequently
calculated in incompressible fluids as the product of the volumetric flow rate
through and the pressure rise across the fan; the use of a compressibility
factor allows a variant of the same expression to be used in ideal gases but,
for nonideal gases, especially those subjected to large pressure rises, neither
expression will give accurate results).

The fan parameterizations rely partly on the so-called fan affinity laws. These are expressions of proportionality used to relate fans of the same type but of different size and at different operating conditions—reflected partly in the density of the gas.

As the fan is modeled without gas volume, that density is obtained from the
nearest upstream computational node. That node is port **A** during
normal operation and port **B** if the stream should be forced in
the reverse direction:

$$\rho =\{\begin{array}{ll}{\rho}_{\text{A}},\hfill & \dot{m}>0\hfill \\ {\rho}_{\text{B}},\hfill & \dot{m}>0\hfill \end{array},$$

where *ρ* is the gas density at the port
indicated by the subscript.

For numerical robustness, when the mass flow rate drops below a small threshold, the gas density is artificially smoothed between the values at the ports. The smoothing is based on the transcendental function:

$$\alpha =\text{tanh}\left(\frac{4\dot{m}}{{\dot{m}}_{\text{Th}}}\right),$$

where *α* is the smoothing factor and
`tanh`

is the hyperbolic tangent function. The subscript
`Th`

denotes a threshold value (a very small number
hardcoded in the block). In terms of the smoothing factor, in the transitional
region below the mass flow rate threshold, the gas density becomes:

$$\rho ={\rho}_{\text{A}}\left(\frac{1+\alpha}{2}\right)+{\rho}_{\text{B}}\left(\frac{1-\alpha}{2}\right).$$

This expression adds a third row to the piecewise definition of gas density, which is finally defined as:

$$\rho *=\{\begin{array}{ll}{\rho}_{\text{A}},\hfill & \dot{m}>{\dot{m}}_{\text{Th}}\hfill \\ {\rho}_{\text{A}}\left(\frac{1+\alpha}{2}\right)+{\rho}_{\text{B}}\left(\frac{1-\alpha}{2}\right),\hfill & \left|\dot{m}\right|\le {\dot{m}}_{\text{Th}}\hfill \\ {\rho}_{\text{B}}\hfill & \dot{m}<-{\dot{m}}_{\text{Th}}\hfill \end{array}.$$

The asterisk denotes a smoothed value. The mass flow rate is the same at port
**A** and port **B**. The value used in
the conditions of the gas density expression can refer to either port.

The relationships between pressure rise, flow rate, fan efficiency, and rotor speed derive from the tabulated data specified in the block. The form of this data and the calculations that it supports depend on the fan parameterization chosen. Of parameterization options there are four. One is simple and based on one-dimensional tables; three are more complete and based on two-dimensional tables. All are restricted to the normal operating region (given in the technical data sheets of the fan).

`1D tabulated data - static pressure and total efficiency table vs. flow rate`

The pressure rise is calculated from the second fan affinity law, which, modified for fans of the same size, states:

$${p}_{\text{SF}}={\left(\frac{\omega *}{{\omega}_{\text{R}}}\right)}^{2}\left(\frac{\rho *}{{\rho}_{\text{R}}}\right){p}_{\text{SF,R}}.$$

The subscript `R`

denotes a reference value (and the asterisk
a smoothed quantity, as described previously). The reference density and the
reference shaft speed are each obtained from a block parameter (of the same
name). The static pressure rise at reference conditions is obtained from the
tabulated data of the block:

$${p}_{\text{SF,R}}={p}_{\text{SF}}({q}_{\text{R}}),$$

where *q*_{R} is the
volumetric flow rate at reference conditions (and the independent variable in
the tabulated data). Its value is calculated from the first fan affinity law:

$${q}_{\text{R}}=\left(\frac{{\omega}_{\text{R}}}{{\omega}^{*}}\right)q,$$

where *q* is the volumetric flow rate
through the fan, calculated from the mass flow rate at the ports as:

$$q=\frac{\dot{m}}{{\rho}^{*}}.$$

(The first fan law is used here to capture the effect of shaft speed on
volumetric flow rate (and therefore also static pressure rise). This calculation
is omitted in the ```
2D tabulated data - static pressure and total
efficiency vs. shaft speed and flow rate
```

parameterization,
where the effect of shaft speed is taken into account directly in the tabulated
data of the block.)

The total fan efficiency, described in "Total Efficiency", is likewise obtained from the tabulated data:

$${\eta}_{\text{T}}={\eta}_{\text{T}}({q}_{\text{R}}).$$

`2D tabulated data - static pressure and total efficiency vs. shaft speed and flow rate`

With the rotor shaft speed now specified in the tabulated data, its reference
value can be set to its instantaneous (and smoothed) value. The ratio of actual
to reference shaft speeds reduces to `1`

and the second
affinity law gives:

$${p}_{\text{S,F}}=\left(\frac{{\rho}^{*}}{{\rho}_{\text{R}}}\right){p}_{\text{SF,R}},$$

where *p*_{SF,R} is
obtained from the tabulated data as a bivariate function of the (smoothed) rotor
shaft speed and of the volumetric flow rate through the fan:

$${p}_{\text{SF,R}}={p}_{\text{SF}}(\omega ,q).$$

The total fan efficiency is obtained in a similar manner from the tabulated data:

$${\eta}_{\text{T}}={\eta}_{\text{T}}(\omega ,q).$$

`2D tabulated data - flow rate and total efficiency vs. shaft speed and static pressure`

The mass flow rate through the fan is obtained from the tabulated data of the block as:

$$\dot{m}={\rho}_{\text{R}}{q}_{\text{R}},$$

where *q*_{R} is the
volumetric flow rate through the fan at reference density:

$${q}_{\text{R}}=q(\omega ,{p}_{\text{SF,R}}),$$

The static pressure rise at the same reference condition is calculated as:

$${p}_{\text{SF,R}}=\left(\frac{{\rho}_{\text{R}}}{{\rho}^{*}}\right){p}_{\text{SF}}.$$

The total fan efficiency is defined as before:

$${\eta}_{\text{T}}={\eta}_{\text{T}}(\omega ,{p}_{\text{SF,R}}).$$

`2D tabulated data - flow rate and total efficiency vs. shaft speed and static pressure ratio`

The mass flow rate is obtained from the tabulated data of the block as:

$$\dot{m}={\rho}_{\text{R}}{q}_{\text{R}},$$

where the volumetric flow rate at reference density is computed no longer from the static pressure rise but from its ratio to its maximum rated value:

$${q}_{\text{R}}=q(\omega ,{r}_{\text{p,R}}).$$

The static pressure rise ratio, *r*_{p},
is specified in the tabulated data of the block. It is defined at reference
density as:

$${r}_{\text{p,R}}=\frac{{p}_{\text{SF,R}}}{{p}_{\text{SF,Max}}},$$

which, using the first fan affinity law, becomes:

$${r}_{\text{p,R}}=\left(\frac{{\rho}_{\text{R}}}{{\rho}^{*}}\right)\left(\frac{{p}_{\text{SF}}}{{p}_{\text{SF,Max}}}\right),$$

The maximum static pressure rise, *p*_{SF,Max}, can
vary with the rotor shaft speed. The relationship between the two is specified
in a separate, one-dimensional lookup table. A plot of flow rate against static
pressure rise need not be rectangular in shape, giving this parameterization a
versatility not found in its alternatives.

The total fan efficiency is defined in terms of the same variables as:

$${\eta}_{\text{T}}={\eta}_{\text{T}}(\omega ,{r}_{\text{p}}).$$