Add fluids to Simscape model using twoPhaseFluidTables()
Show older comments
In my Heat-pump Simscape model, i want to test several refrigerants.
One solution I saw is to use twoPhaseFluidTables() with CoolProp to import properties of your fluid, and use the bloc Two-Phase Fluid Properties (2P) where you can add this properties.
The function works like this (see : https://www.mathworks.com/help/simscape/ref/twophasefluidtables.html#d126e116310 )
However, since I would like to test several fluids, I want to automate the process bu calculating uRange and pRange with CoolProp.
I have tried several things by calling Tmax/Tmin and Pmax/Tmin to calculate the U range and the P range, but I have always issues.
Do you have any solution to determine uRange and pRange ?
1 Comment
Yifeng Tang
on 29 Sep 2023
I've never tried to do this for many cases such that it requires a script to automate things, but finding the right U range and P range can be a headache even for one fluid. The most common error message is that Coolprop or RefProp can't return a value for some corner values, usually at high pressure.
I'm wondering if you can write a script to query individual points first in the corner regions, using the wrapper function for Coolprop. If it returns an error, reduce the P & U and try again. If it runs OK, expand the P & U. Basically iteratively finding a big rectangular region where the P & U ranges are large and valid.
Just a thought. Hope it helps.
Accepted Answer
More Answers (0)
Categories
Find more on Upgrading Hydraulic Models to Use Isothermal Liquid Blocks 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!