Ideal Check Valve (Thermal Liquid, Simscape)
9 views (last 30 days)
I do have a forked Thermal Liquid Network in simscape. I use Check Valves to stop backflow. But when the mass flow through my Mass Flow Rate is low, the leakage area allows backward flow as aspected. But then, the solver makes no progress anymore. Now I want a Check Valve with no leakage area - but the source code of the valve is protected. I cannot change the code.
Is there a solution to stop backflow entirely, even so its not realistic?
I wanted to change the code of the Local Restriction in the Foundation Library, to stop backward flow. But what to write where there?
Thanks alot for help.
Yifeng Tang on 30 Jul 2021
Having a check value (or any closed valve) with absolutely zero leakage is in general a bad idea. It basically changes the set of equations the solver needs to solve. If you are trying to resolve the issue of slow simulation by "fully" closing the valve, well, I suspect you may want to try the opposite, i.e. increase the minimal/leakage area. Let me explain.
First of all, use the solver profiler and make sure the check valve is the one causing the solver hanging problem. See more details on the Solver Profiler here: https://www.mathworks.com/help/simulink/ug/examine-solver-behavior-using-solver-profiler.html . You don't need to wait for the simulation to finish and you may stop the simulation after it hangs for a few seconds. You will get information on what blocks are causing the extremely small time steps.
Now the leakage. If it's set too small, what may happen is that the solver has to be able to resolve from a tiny flow, say 1e-10, to fully open (say 1e3). The difference in the order of magnitude (1) may not play well with your tolerance settings and (2) make the matrix to be solved really "stiff". I would suggest you increase the leakage area and see if the simulation speed improves, while keeping an eye on the leakage flow rate. A few orders of magnitude difference between open flow and closed is usually sufficient and realistic, but don't try too hard getting "zero" flow.
Hope this helps. If you could provide more info after you run the solver profiler or if you could share your model, we can take a closer look.