フィルターのクリア

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

2 ビュー (過去 30 日間)
David Furtado
David Furtado 2015 年 11 月 21 日
編集済み: Walter Roberson 2015 年 11 月 21 日
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 Center および File ExchangeFoundation and Custom Domains についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by