Simcape two phase fluid custom component

7 ビュー (過去 30 日間)
Tech Logg Ding
Tech Logg Ding 2021 年 4 月 19 日
コメント済み: Tech Logg Ding 2021 年 4 月 27 日
I am trying to write a custom component for a non-isentropic compressor in Simscape. However, I saw a convection term that I don't understand. A snippet of the source code from the controlled_mass_flow_rate_source is shown below:
% Specific total enthalpy for outflow
ht_out_A == convection_A.ht_I;
ht_out_B == convection_B.ht_I;
% Equate variables for internal components that calculate energy convection at ports A and B
convection_A.mdot == mdot_A;
convection_A.Phi == Phi_A;
convection_B.mdot == mdot_B;
convection_B.Phi == Phi_B;
convection_A.ht_I == convection_B.ht_I;
What is the convection_A, convection_B, and the ht_I term?
Thank you!
  1 件のコメント
Tech Logg Ding
Tech Logg Ding 2021 年 4 月 19 日
I will also include a snippet of my code:
% 1 is the input and 2 is the output of the block
% NI is the isentropic efficiency
% _isen indicates the case for the isentropic efficiency
% isentropic relationship
s_1 == s_2_isen;
% isentropic efficiency balance
NI*(ht_2-ht_1) == (ht_2_isen-ht_1);
% power calculation
power == mdot_A*(ht_2-ht_1);
% Specific total enthalpy for outflow
% not sure which one to use to balance the equations
(ht_2+ht_1)/2 == convection_B.ht_I;
%ht_2 == convection_B.ht_I;
%ht_1 == convection_A.ht_I;
% Equate variables for internal components that calculate energy convection at ports A and B
convection_A.mdot == mdot_A;
convection_A.Phi == Phi_A;
convection_B.mdot == mdot_B;
convection_B.Phi == Phi_B;
convection_A.ht_I == convection_B.ht_I;
As shown above, I am not sure what the ht_I, convection_A, and convection_B terms do.

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

採用された回答

Yifeng Tang
Yifeng Tang 2021 年 4 月 26 日
The convection_A & convection_B are two components that defines the behavior at the "port" or boundary of this block. If you look further down the source code, you should find something like:
% Internal components that calculate energy convection at ports A and B
components (ExternalAccess=none)
convection_A = foundation.two_phase_fluid.port_convection(flow_area = area_A, length_scale = sqrt(4*area_A/pi));
convection_B = foundation.two_phase_fluid.port_convection(flow_area = area_B, length_scale = sqrt(4*area_B/pi));
end
That "foundation.two_phase_fluid.port_convection" is a 2P module that defines the upwind scheme at the ports. All fluids domains have a similar component. You can select "foundation.two_phase_fluid.port_convection" and do a Ctrl+D to read its source code. The idea behind the upwind scheme maybe found on this Documentation page:
  1 件のコメント
Tech Logg Ding
Tech Logg Ding 2021 年 4 月 27 日
Got it, thanks for the reply! I'll look into them.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTwo-Phase Fluid Library についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by