How to create a mixer block in Simscape that mixes two fluids and leaves as one?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Foundation and Custom Domains finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!