Main Content

P-H Diagram (2P)

Thermodynamic scope for two-phase fluid networks

  • Library:
  • Simscape / Fluids / Two-Phase Fluid / Utilities

  • P-H Diagram (2P) block


The P-H Diagram (2P) block plots pressure with respect to the specific enthalpy of a thermodynamic, two-phase fluid in a typical p-h diagram. A p-h diagram indicates the fluid state at key points during a thermodynamic cycle.

The plot units are MPa for pressure and kJ/kg for specific enthalpy.

Each numbered point on the diagram indicates the fluid state after a dynamic process in the refrigeration cycle:

  1. Cool vapor at low pressure

  2. Hot vapor at high pressure

  3. Hot liquid at high pressure

  4. Mixed vapor and liquid at low pressure

To use the P-H Diagram (2P) block:

  1. Place a Thermodynamic Properties Sensor (2P) and a Pressure & Internal Energy Sensor (2P) block at each location you want to monitor.


    The Pressure & Internal Energy Sensor (2P) block measures a differential pressure. Connect port A to the monitor point and port B to an Absolute Reference (2P) block.

  2. Convert the Simscape physical signals to Simulink signals with a PS-Simulink Converter block.

  3. Combine the converted pressure signals into a Mux block. Connect the output signal to the P-H Diagram (2P) p port.

  4. Combine the converted specific enthalpy signals into a Mux block and connect this output to the h port.

  5. Before running the simulation, double-click the P-H Diagram (2P) block, then click the Select fluid properties button to set the network fluid properties.

    If you do not select the fluid properties, the block will use the default two-phase network fluid, which is water.

You can monitor the progress in the cycle by opening the block before starting the simulation.

Viewing a p-h Plot

If the process occurs too quickly to see cycle development, you can use simulation pacing to slow the visualization. In Simulink®, click Run > Simulation Pacing to slow down the simulation time.

You can pause, stop, or step through a simulation, to pause at that time step. To save the current iteration of the plot, point to the plot area. From the icons that appear in the top-right corner of the plot, click the Export icon and select Save As to save the plot.



expand all

Vector of pressures. The vector must have same number of elements as the enthalpy signal at port h

Vector of specific enthalpies. The vector must have same number of elements as the pressure signal at port p.

Extended Capabilities

Version History

Introduced in R2021a