CoolProp to the Rescue
Specifying fluid properties is an important part of creating an accurate simulation model. The industry standard REFPROP database from NIST contains many fluid properties. There is a demo on MATLAB Central showing how it can be used to parametrize a Simscape model.
Obviously, not all fluids in the universe are present in the REFPROP database. One notable omission is common antifreeze, also known as Ethylene Glycol (or the more environmentally friendly Propylene Glycol).
This is where CoolProp comes in...
CoolProp is an open source fluid property database very similar to REFPROP, and it provides wrappers so it can be called from MATLAB.
To get started, go to their sourgeforge project page and download those four files: +CoolProp.7z, CoolPropsetup.m, SwigRef.m, and the wrapper MEX-file for your operating system.
With that on your path, you can obtain properties, for example the density, of a Propylene Glycol (PG) mixture using code like:
The main function call CoolProp.PropsSI can only operate on scalar quantities (single temperature and pressure values), so the next step is to wrap the calls to CoolProp.PropsSI in for loops to create the 2D tables needed for the Simscape Thermal Liquid domain.
We can then call this function for the range of pressures and temperature of interest, and obtain the different properties needed by the Thermal Liquid domain.
And use the output in the Thermal Liquid Settings block:
Now it's your turn
Do you simulate exotic fluids with the Simscape Thermal Liquid domain? How do you get you fluid properties data? Let us know by leaving a comment here
要发表评论，请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。