필터 지우기
필터 지우기

Simcape two phase fluid custom component

조회 수: 23 (최근 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 CenterFile Exchange에서 Gas Models에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by