Creating custom Simscape components in two-phase fluid domain
Show older comments
Flow resistance simscape component in two-phase fluid domain uses function <foundation.two_phase_fluid.normalized_internal_energy> - see below. Where I can find this and other two-phase fluid domain functions for building custom simscape blocks?
Thank you in advance,
% Normalized internal energy for inflow
unorm_A_in = foundation.two_phase_fluid.normalized_internal_energy(A.u, p_A, ...
A.u_min, A.u_max, A.p_TLU, A.u_sat_liq_TLU, A.u_sat_vap_TLU);
unorm_B_in = foundation.two_phase_fluid.normalized_internal_energy(B.u, p_B, ...
A.u_min, A.u_max, A.p_TLU, A.u_sat_liq_TLU, A.u_sat_vap_TLU);
Answers (1)
Yifeng Tang
on 29 Apr 2026 at 15:37
0 votes
This only works for the functions in the Simscape foundation library.
Select the full name of the function, right click and select "Open xxxxx" or Ctrl+D

Now you opened that code, you can open the folder where the code is located:

In that folder, if you see any .ssc file that doesn't look like a Simscape block, well, it's probably an internal function used by other Simscape blocks. You can also search for .ssc and .m files in that folder, look for ones that are not a Simscape block in the library.
Please note that these functions you may find, they are intended to be "internal". Documentation is minimal. No guarantee that future versions will have the same functions or the same inputs/outputs. So, proceed with caution.
Categories
Find more on Simscape Fluids in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!