필터 지우기
필터 지우기

How to create a mixer block in Simscape that mixes two fluids and leaves as one?

조회 수: 2 (최근 30일)
component mixer
nodes
A = mysimscape.thermohydraulic.thermohydraulics; % A:right
B = mysimscape.thermohydraulic.thermohydraulics; % B:right
C = mysimscape.thermohydraulic.thermohydraulics; % C:left
end
parameters
density = {1000, 'kg/m^3'};
cp = {4.19, 'kJ/(kg*K)'};
end
variables(Access = protected)
qf1 = { 0 ,'m^3/s' }; % Flow rate 1
qf2 = { 0 ,'m^3/s' }; % Flow rate 2
qf3 = { 0 ,'m^3/s' }; % Flow rate 3
Phi1 = { 0, 'kW'};
Phi2 = { 0, 'kW'};
Phi3 = { 0, 'kW'};
end
branches
qf1 : A.qf -> *;
qf2 : B.qf -> *;
qf3 : C.qf -> *;
end
equations
% No pressure drop
A.p == C.p;
% B.p == C.p;
% Energy flow equations
Phi1 == qf1 * density * cp * A.t;
Phi2 == qf2 * density * cp * B.t;
Phi3 == qf3 * density * cp * C.t;
% Energy conservation
Phi1 + Phi2 + Phi3 == 0;
% Mass conservation
qf1 + qf2 + qf3 == 0;
end
end
Is this code correct? My domain is a customised thermohydraulic domain that includes variables p, t and q.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Foundation and Custom Domains에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by