フィルターのクリア

How to make a 'Controlled mass flow rate source' act like an 'Infinite flow resistance' while mass flow = 0? Simscape two-phase

2 ビュー (過去 30 日間)
I want a pump to allow no energy flow while there is no mass flow. This simulates one end being disconnected from the system except when fluid is being pumped into it, more specifically vehicles refueling at a liquefied methane fuel station, represented by a Reservoir. Currently, the reservoir, being infinite, leaks heat into the tank of liquid methane at the station constantly, instead of only when a vehicle is actually refueling.
In the source code of the Controlled mass flow rate source, the equations section looks like this:
equations
% Assertions
assert(area_A > 0)
assert(area_B > 0)
% Commanded mass flow rate
mdot_A == M;
mdot_B == -M;
% Energy balance
Phi_A + Phi_B + power == 0;
end
I'm hoping I can add an if-statement to make the energy flow through the component be 0 while the mass flow through it is 0. Something like this:
equations
% Assertions
assert(area_A > 0)
assert(area_B > 0)
% Commanded mass flow rate
mdot_A == M;
mdot_B == -M;
% Energy balance
if M == 0
(Phi_A == Phi_B) == 0; %WRONG
else
Phi_A + Phi_B + power == 0;
end
end
The above code does not work. What could I write in place of (Phi_A == Phi_B) == 0; to stop the energy flow through the component while there is no mass flow?
The Infinite flow resistance component does constantly what I want to happen on command, but it has no branches, which is not an option for a pump.
If it were possible to create a switch component, conditionally connecting different pipes at different times (the pump A to a cap C, and the reservoir D to a cap B, OR the pump to the reservoir, A -> D, and the caps to each other, B->C, depending the input signal) that would work to.
I'll be very grateful for all and any help I can get!

回答 (0 件)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by