# Pressure Source (2P)

Generate constant or time-varying pressure differential

**Libraries:**

Simscape /
Foundation Library /
Two-Phase Fluid /
Sources

## Description

The Pressure Source (2P) block represents an ideal mechanical energy source in a two-phase fluid network. The source can maintain a constant pressure differential across its ports regardless of the flow rate through the source. There is no flow resistance and no heat exchange with the environment.

Ports **A** and **B** represent the source inlet and
outlet. The input physical signal at port **P** specifies the pressure
differential. Alternatively, you can specify a constant pressure differential as a block
parameter. A positive pressure differential causes the pressure at port **B**
to be greater than the pressure at port **A**.

### Mass Balance

The volume of fluid in the source is considered negligible and is ignored in a model. There is no fluid accumulation between the ports and the sum of all mass flow rates into the source must therefore equal zero:

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

where $$\dot{m}$$ denotes the mass flow rate into the source through a port. The block
accepts as input the mass flow rate at port **A**. The flow is
directed from port **A** to port **B** when the specified value is positive.

### Energy Balance

By default, the source maintains the specified flow rate by performing isentropic work on the incoming fluid, though the block provides the option to ignore this term. The rate at which the source does work, if considered in the model, must equal the sum of the energy flow rates through the ports:

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

where *ϕ* denotes the energy flow rate into the source
through a port or by means of work. The energy flow rate due to work is equal to the power
generated by the source. Its value is calculated from the specific total enthalpies at the ports:

$${\varphi}_{\text{Work}}={\dot{m}}_{\text{A}}\left({h}_{\text{A}}-{h}_{\text{B}}\right).$$

The specific total enthalpy *h* is defined as:

$${h}_{*}={u}_{*}+{p}_{*}{v}_{*}+\frac{1}{2}{\left(\frac{{\dot{m}}_{*}{v}_{*}}{S}\right)}^{2},$$

where the asterisk denotes a port (**A** or
**B**) and:

*u*is specific internal energy.*p*is pressure.*S*is flow area.

The specific internal energy in the equation is obtained from the tabulated
data of the Two-Phase Fluid Properties (2P)
block. Its value is uniquely determined from the constraint that the work done by the source
is isentropic. The specific entropy, a function of specific internal energy, must then have
the same value at ports **A** and **B**:

$${s}_{\text{A}}\left({p}_{\text{A}},{u}_{\text{A}}\right)={s}_{\text{B}}\left({p}_{\text{B}},{u}_{\text{B}}\right),$$

where *s* is specific entropy. If the **Power
added** parameter is set to `None`

, the specific total
enthalpies at the ports have the same value ($${h}_{\text{A}}={h}_{\text{B}}$$) and the work done by the source reduces to zero ($${\varphi}_{\text{Work}}=0$$).

### Assumptions and Limitations

There are no irreversible losses.

There is no heat exchange with the environment.

## Examples

## Ports

### Input

### Conserving

## Parameters

## Extended Capabilities

## Version History

**Introduced in R2015b**