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

Conservation of mass for Xi

Conservation of mass for Xi

Hello,

I am trying to make a simple model where water with a small fraction of dry matter is diluted with pure water. With some effort I am now able to run simulations. The only problem is that the mass fractions of water and dry matter do not make sense. They even vary across single components, for example for a mass flow meter:

port_a.m_flow=-1 kg/s; port_a.Xi_outflow[1] = 1kg/kg
port_b.m_flow=1kg/s; port_b.Xi_outflow[1]=0.5kg/kg

I find it strange that the simulation runs without error messages even though for e.g. the mass flow meter I find the following equation
  port_a.Xi_outflow = inStream(port_b.Xi_outflow);
  port_b.Xi_outflow = inStream(port_a.Xi_outflow);

What is wrong in my model? It may well be a simple mistake because I am new to modelica - but I just don't see it.
Twan2.mo

Kind regards,
Twan.

Attachments:

Re: Conservation of mass for Xi

Hello Twan,

First, I can't run your model since the component "IdealSource" is missing from the package so I can't reproduce your results.

However, looking at your results for the mass flow meter, the signs of the mass flow show that fluid is entering through port_b and leaving from port_a. That means that only port_a.Xi_outflow is valid for the component. If you want to see the mass fractions entering the mass flow meter you must look at the Xi_outflow value of the component connected in the upstream direction of the mass flow meter (or insert a mass fraction meter).

In other words, in terms of the "stream connectors" there is nothing wrong with your model. The value of port_b.Xi_outflow will be valid if you reverse the flow direction.

Best regards,
Rene Just Nielsen

Re: Conservation of mass for Xi

Dear Rene,
thank you so much for the fast and useful feedback!
Twan.

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