- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Thermoflow sample
Thermoflow sample
Thermoflow sample
Hello all
I wanted to do a simulation of a heated and presurized air flow through some tanks (volume controls) and non return valves. I have implemented the model and it works well. However, it runs terribly slow. I have tried to include all the advices to improve the results, but the results are not better.
I have seen that it exists a library called Thermoflow that could fit. Does anybody knows it or another libraries to solve these kind of models?
Thank you very much in advance.
Koldo
Re: Thermoflow sample
Hello all
Finally I got the problem. When modeling a variable section check valve, this code is very slow:
Code:
if noEvent(p_in > p_out) then
area = area0*(press_in - press_out)*press_factor;
else
area = 0;
end if;
And this is about 100 times faster:
Code:
if noEvent(p_in > p_out) then
area = area0*(press_in - press_out)*press_factor;
else
area = 0.001; // The only change
end if;
In fact the last is better because it is expected to have some leakage in the valve (^_^).
Do you know the reason of it?
Best regards
Koldo
Re: Thermoflow sample
I would not be able to tell the reason without seeing the full model (and even then it would possibly be a guess). You could try the measureTime=true flag to get a little report. Quite possibly tearing works on a nonlinear system only if area is non-zero.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Thermoflow sample