Main Content

P-H Diagram (2P)

Thermodynamic scope in a two-phase fluid network

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


The P-H Diagram (2P) block plots the pressure-enthalpy diagram of a thermodynamic two-phase fluid model. A p-h diagram indicates the fluid state at key points during a thermodynamic cycle.

Each corner of the cycle in this example refrigeration cycle system indicates the fluid state after a dynamic process:

  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

Using the Thermodynamic Scope

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

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

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

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

  • Combine the output of all of the converted pressure signals into a Mux block. Connect this output to the P-H Diagram (2P) p port.

    • To reduce the number of connecting lines in your model, you can use the Goto and From blocks.

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

  • 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 scope will use the default two-phase network fluid, which is water.

Opening the block before running the model allows you to monitor the cycle throughout the simulation.

Example Configuration in Two-Phase Fluid Refrigeration

Viewing a p-h Plot

If your simulation runs quickly and you are not able to see cycle development, you can use simulation pacing to slow down the cycle plotting. Click Run > Simulation Pacing to slow down the simulation time.

Additionally, when you adjust the simulation time by pausing, stopping, or stepping through a simulation, the plot pauses at that time step in the simulation. To save the current iteration of the plot, hoover on the plot area. From the icons that appear in the top right, click the Export icon and select Save As to save the plot.

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



expand all

Vector of pressures at simulation time steps. The vector size can vary, but must have same number of elements as the enthalpy signal at port h. Pressure is plotted in units of MPa.

Vector of specific enthalpies at simulation time steps. The vector size can vary, but must have same number of elements as the pressure signal at port p. Specific enthalpy is plotted in units of kJ/kg.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2021a