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

Errors using derived PartialMixtureMedium

Errors using derived PartialMixtureMedium

Hi!
I a created a LiBr-H2O mixture medium to use in absorption cycles. When doing some basic test with the medium I get some errors I do not know how to deal with. The test is pretty simple, it is two closed vessels connected by a pump and valve forming a closed circuit. When running the simulation I get these errors:

The following assertion has been violated at time 0.000000
valveLinear.port_a_T >= 1.0 and valveLinear.port_a_T <= 10000.0
Variable violating min/max constraint: 1.0 <= valveLinear.port_a_T <= 10000.0, has value: 2.9203e-316

and

The following assertion has been violated at time 0.400000
valveLinear.state_a.X[2] >= 0.0 and valveLinear.state_a.X[2] <= 1.0
Variable violating min/max constraint: 0.0 <= valveLinear.state_a.X[2] <= 1.0, has value: -500

The simulation terminates though and the result seems to be reasonable. Maybe something is not properly initialized? I am using OpenModelica 1.16.1 as the newer version had issues with the connection of components. I would like to understand / solve these errors before moving to more complex scenarios. The according files are attached.
Cheers
Christian


ClosedVessel.mo

Two-Vessels-Pump-Valve.mo

LiBrH2O-5.mo

Re: Errors using derived PartialMixtureMedium

Hi Chris,

Seems to simulate fine anyway except that the fluid is at the absolute zero temperature in valve.
You have make your own closed tank.
Why not use closed tank object of Modelica's Fluid  library ?

I am going to study your script, it's very interesting to understand how to use/create mixture medium.


/Bruno

Re: Errors using derived PartialMixtureMedium

Sorry I can help too  much, but I would not worry about the violations of  limits along initialization. As the connection between elements is done using enthalpy, and not temperature, the port_a_T and port_b_T values are only informative in this case. As they are calculated from state_a and state_b, its initialization will come from pressure, enthalpy and composition at the ports, but it is difficult to follow the origin. The easy way is to change your difinition of Temperature in the Medium to: Temperature(start = T_default, min=0.0). Of course you solve nothing with this, only not to have warning, but the fact is that there is nothing to solve.
For the initialization of X[2] at -500 at the valve and the pump (interesting that not at your tank) I do not see the reason.

Re: Errors using derived PartialMixtureMedium

Hi!
Thanks for the replies. From other tools (E+) I am used to worry about warning but in case I think it is not a problem they appear. Maybe someone can still comment on the warning concerning the concentration.
Cheers
Christian

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