Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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.

Re: Thermoflow sample

Hello

I have tried both cases with +d=bltdump,tearingdump,dumpindxdae,dumpInlineSolver,bltdump and the dumps are identical but the 0-0.001 numbers.

I imagine that perhaps the issue is inside DASSL.

Bet regards
Koldo

There are 0 guests and 0 other users also viewing this topic