P-H Diagram (2P)
Thermodynamic scope for two-phase fluid networks
Simscape / Fluids / Two-Phase Fluid / Utilities
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:
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.
Combine the converted pressure signals into a Mux block. Connect the output signal to the P-H Diagram (2P) p port.
Combine 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 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.
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 function supports limited code generation capability.