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

Simple Fluid model with a pump and 2 tanks

Simple Fluid model with a pump and 2 tanks

Hi all,

I'm working on a very simple Fluid model to learn Modelica (with Dymola) and the MSL.

First I have connected a full OpenTank pouring water in an empty OpenTank thanks to a ControlledPump (see Fig 1). I used a ControlledPump because I wanted a constant flow of 0.1kg/min. My example on fig 1 works well and the DestTanks progressively collects water from the SourceTank.

Now I'd like to be able to switch on and switch off the pump during simulation, controlling it with a Pulse block. I changed the parameter of the pump "use_m_flow_set" to true in order to add a "m_flow" input pin. I plugged on this pin a pulse sending infinitely 0.1 between 10sec and 0.0 then (fig 2). I set "flow reversal" to false in order to avoid problems. By this way I thought that my pump would be on during 10 sec, then off during 10 sec, and so on...

The new model compiles well but unfortunately during simulation the simulator says that the jacobian is too hard to solve because of a zero pivot.

I think I'm not using the right way to switch on and off the pump. How would you do to do that?
Thanks

http://cjoint.com/data/0GFqQmmxE4m_pumps.png

Re: Simple Fluid model with a pump and 2 tanks

Hello courrier,

I used to face a similar problem like this. My solution was to use a trapezoid source instead of a pulse source coz fluid media, unlike electricity, is continuous  media. A too sudden jump of the status may cause trouble when the system tries to solve the equations.
you may try trapezoid source, and just set the rising and failing time to be a neglectfully small number, if putting it as 0 does not work, and see if this way solves the problem.

Thanks,
Lingchong

Re: Simple Fluid model with a pump and 2 tanks

Hello,

Thanks it seems to be part of the issue, but replacing the pulse by a trapezoid is not enough. Apparently we cannot set a flow to zero. The minimum flow seems to be defined by a property in the system component. What I did is adding an offset of 0.02 so that the flox never reaches zero (see picture below). Same thing for pressure drop.

But by this way the pump is not completely stopped. Thus how can I stop a pump with another way? current/sad

http://cjoint.com/13au/CHuqrSSwADy_trapezoid.png

Thanks again...

There are 0 guests and 0 other users also viewing this topic
You are here: