P-H Diagram (2P)
Thermodynamic scope for two-phase fluid networks
Simscape / Fluids / Two-Phase Fluid / Utilities
The P-H Diagram (2P) block plots a p-h diagram of the pressure with respect to the specific enthalpy of a thermodynamic, two-phase fluid. A p-h diagram indicates the fluid state at key points during a thermodynamic cycle.
The plot units are MPa for pressure, kJ/kg for specific enthalpy, and K for the temperature contours.
Each numbered point on the diagram indicates the fluid state after a dynamic process in the refrigeration cycle:
Cool vapor at low pressure
Hot vapor at high pressure
Hot liquid at high pressure
Mixed vapor and liquid at low pressure
To use the P-H Diagram (2P) block:
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.
Convert the Simscape physical signals to Simulink signals with a PS-Simulink Converter block.
Use a Mux block to combine the pressure signals. Connect the output signal to the P-H Diagram (2P) p port.
Use a Mux block to combine the converted specific enthalpy signals and connect the output signal 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 block uses the default two-phase network fluid, which is water.
P-H Diagram Playback
You can also replay the animation from the most recent simulation. After running the model, double-click the block and use the buttons at the top of the window to control the animation. Use the drop-down menu to the right of the Time field to control the rate of the playback. The replay controls are disabled before you run a simulation, when the model is loaded, and when the simulation is running.
Use the playback slider or Time field to control the simulation cycle. If you enter a time that is not a model time step, the block displays the next closest time step.
To save the current iteration of the plot, point to the plot area. From the icons in the top-right corner of the plot, click the Export icon and select the Save As button to save the plot.
p — Pressure, MPa
Vector of pressures. The vector must have same number of elements as the enthalpy signal at port h
h — Specific enthalpy, kJ/kg
Vector of specific enthalpies. The vector must have same number of elements as the pressure signal at port p.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
This block can be used for simulation visibility in systems that generate code, but is not included in the generated code.
Version HistoryIntroduced in R2021a
R2022b: Access playback capabilities
Use the controls at the top of the figure window to control and replay the animation from the most recent simulation.