# Flow Rate Source (G)

Generate constant or time-varying mass flow rate or volumetric flow rate in gas network

Since R2023b

Libraries:
Simscape / Foundation Library / Gas / Sources

## Description

The Flow Rate Source (G) block represents an ideal mechanical energy source in a gas network. The source can maintain the specified mass flow rate or volumetric flow rate regardless of the pressure differential. There is no flow resistance and no heat exchange with the environment. You specify the flow rate type by using the Flow rate type parameter.

The block icon changes depending on the values of the Source type and Flow rate type parameters.

Ports A and B represent the source inlet and outlet. The input physical signal at port M or V, depending on the flow rate type, specifies the flow rate. Alternatively, you can specify a fixed flow rate as a block parameter. A positive flow rate causes gas to flow from port A to port B.

The volumetric flow rate and mass flow rate are related through the expression

where:

• $\stackrel{˙}{m}$ is the mass flow rate from port A to port B.

• ρA and ρB are densities at ports A and B, respectively.

• $\stackrel{˙}{V}$ is the volumetric flow rate.

You can choose whether the source performs work on the gas flow:

• If the source is isentropic (Power added parameter is set to `Isentropic`), then the isentropic relation depends on the gas property model.

Gas ModelEquations
Perfect gas$\frac{{\left({p}_{A}\right)}^{Z\cdot R/{c}_{p}}}{{T}_{A}}=\frac{{\left({p}_{B}\right)}^{Z\cdot R/{c}_{p}}}{{T}_{B}}$
Semiperfect gas${\int }_{0}^{{T}_{A}}\frac{{c}_{p}\left(T\right)}{T}dT-Z\cdot R\cdot \mathrm{ln}\left({p}_{A}\right)={\int }_{0}^{{T}_{B}}\frac{{c}_{p}\left(T\right)}{T}dT-Z\cdot R\cdot \mathrm{ln}\left({p}_{B}\right)$
Real gas$s\left({T}_{A},{p}_{A}\right)=s\left({T}_{B},{p}_{B}\right)$

The power delivered to the gas flow is based on the specific total enthalpy associated with the isentropic process.

`${\Phi }_{work}=-{\stackrel{˙}{m}}_{A}\left({h}_{A}+\frac{{w}_{A}^{2}}{2}\right)-{\stackrel{˙}{m}}_{B}\left({h}_{B}+\frac{{w}_{B}^{2}}{2}\right)$`
• If the source performs no work (Power added parameter is set to `None`), then the defining equation states that the specific total enthalpy is equal on both sides of the source. It is the same for all three gas property models.

`${h}_{A}+\frac{{w}_{A}^{2}}{2}={h}_{B}+\frac{{w}_{B}^{2}}{2}$`

The power delivered to the gas flow Φwork = 0.

The equations use these symbols:

 cp Specific heat at constant pressure h Specific enthalpy $\stackrel{˙}{m}$ Mass flow rate (flow rate associated with a port is positive when it flows into the block) p Pressure R Specific gas constant s Specific entropy T Temperature w Flow velocity Z Compressibility factor Φwork Power delivered to the gas flow through the source

Subscripts A and B indicate the appropriate port.

### Assumptions and Limitations

• There are no irreversible losses.

• There is no heat exchange with the environment.

## Ports

### Input

expand all

Input physical signal that specifies the mass flow rate of the gas through the source.

#### Dependencies

To enable this port, set the Source type parameter to `Controlled` and Flow rate type to `Mass flow rate`.

Input physical signal that specifies the volumetric flow rate of gas through the source.

#### Dependencies

To enable this port, set the Source type parameter to `Controlled` and Flow rate type to `Volumetric flow rate`.

### Conserving

expand all

Gas conserving port. A positive flow rate causes gas to flow from port A to port B.

Gas conserving port. A positive flow rate causes gas to flow from port A to port B.

## Parameters

expand all

Select whether the flow rate generated by the source can change during simulation:

• `Controlled` — The flow rate is variable, controlled by an input physical signal. Selecting this option exposes the input port M or V, depending on the value of the Flow rate type parameter.

• `Constant` — The flow rate is constant during simulation, specified by a block parameter. Selecting this option enables the Mass flow rate or Volumetric flow rate parameter, depending on the value of the Flow rate type parameter.

Select the type of flow rate, `Mass flow rate` or `Volumetric flow rate`.

Desired mass flow rate of gas through the source.

#### Dependencies

To enable this parameter, set Source type to `Constant` and Flow rate type to `Mass flow rate`.

Desired volumetric flow rate of gas through the source.

#### Dependencies

To enable this parameter, set Source type to `Constant` and Flow rate type to `Volumetric flow rate`.

Select whether the source calculates flow rate at actual working conditions or at a standard pressure and temperature:

• `Actual conditions` — The source calculates the volumetric flow rate by using the gas density at the actual working conditions of the system.

• `Standard conditions` — The source calculates the volumetric flow rate by using the gas density at standard conditions. When you select this option, additional parameters become available to let you specify the standard pressure and temperature.

#### Dependencies

To enable this parameter, set Flow rate type to `Volumetric flow rate`.

Gas pressure at standard conditions.

#### Dependencies

To enable this parameter, set Specified flow rate conditions to `Standard conditions`.

Gas temperature at standard conditions.

#### Dependencies

To enable this parameter, set Specified flow rate conditions to `Standard conditions`.

Select whether the source performs work on the gas flow:

• `Isentropic` — The source performs isentropic work on the gas to maintain the specified mass flow rate. Use this option to represent an idealized pump or compressor and properly account for the energy input and output, especially in closed-loop systems.

• `None` — The source performs no work on the flow, neither adding nor removing power, regardless of the mass flow rate produced by the source. Use this option to set up the desired flow condition upstream of the system, without affecting the temperature of the flow.

Area normal to flow path at port A.

Area normal to flow path at port B.

## Version History

Introduced in R2023b

expand all