use of fluid property tables generated with twoPhaseFluidTables directly in Matlab

12 ビュー (過去 30 日間)
JSH
JSH 2022 年 6 月 23 日
コメント済み: JSH 2022 年 7 月 12 日
Hi, is it possible to use the two-phase fluid properties table directly in matlab?
For example given a pressure and a temperature find the corresponding internal energy. For this it should be possible to interpolate the values into the temperature/pressure matrix and then interpolate into the internal energy vector.
My goal is to be able to configure a heat pump that I am designing in Simscape fluids.
The properties of the two-phase fluid table are stored in a structure, as shown in the following link:

採用された回答

Yifeng Tang
Yifeng Tang 2022 年 6 月 29 日
Yes, it's possible. The properties you get in the data struct are either functions of pressure, or functions of pressure and normalized energy (unorm). You may find the information about the dimensions of each property matrix here:
Now, you'll need a way to find unorm for the given P & T, and then look up u for the given P & unorm. Try this code:
load r134aPropertyTables;
% specified temperature and pressure
T = 60 + 273.15; % K
P = 0.300; % MPa
% build a p-unorm mesh for 2D lookup
[Xv,Yv] = meshgrid(r134aPropertyTables.p,r134aPropertyTables.vapor.unorm);
% look up temperature at each unorm point at the given pressure
Tvec = interp2(Xv,Yv,r134aPropertyTables.vapor.T,P,r134aPropertyTables.vapor.unorm); % K
% look up unorm at the given T
unorm = interp1(Tvec,r134aPropertyTables.vapor.unorm,T);
% look up u at the given P and the looked-up unorm (for given T)
u = interp2(Xv,Yv,r134aPropertyTables.vapor.u,P,unorm) % kJ/kg
u = 426.5096
This works for vapor. The code for liquid would be very similar. It'll be a good idea to write something to tell if the given P,T is vapor or liquid first. Mixture would be a bit different.
You can first find the saturation properties (unorm=0 and unorm=1) at given pressure, then use the vapor quality to calculate the mixture property.
  2 件のコメント
JSH
JSH 2022 年 7 月 5 日
Thank you very much for the reply. This is a starting point to get the other properties. So far I have managed to get the saturation pressure for a given temperature.
JSH
JSH 2022 年 7 月 12 日
Your answer provides the basis for the different variables I needed. I will therefore accept your answer to close the subject.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeThermal Liquid Library についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by