-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty tank error in Modelica.Fluid.Vessels.BaseClasses.PartialLumpedVessel #4548
Comments
Especially the example Modelica.Fluid.Examples.Tanks.EmptyTanks, which should |
The simplest would be to change the assert to |
I tested it and it would solve all failures except for Modelica.Fluid.Examples.Tanks.EmptyTanks. But i am not sure if exactly zero means a singularity in the energy balance equations again |
I'm afraid I misunderstood the scope of the partial classes involved in the making of the OpenTank model when I fixed #4526 via PR #4527. The ModelicaStandardLibrary/Modelica/Fluid/Vessels.mo Lines 269 to 270 in b4a4b03
and is meant to be used to deal correctly with ports at different heights that may be shut off by the automatic check valve behaviour if the level gets below their height. However, this base class is also used for models such as Notice that assert(fluidLevel > -1e-6*fluidLevel_max, "Fluid level (= " + String(fluidLevel) + ") is below zero meaning that the solution failed."); (that was changed in #4527) was unnecessarily restrictive and should have actually been removed. Also notice that the height field of the VesselPortData record
has no min = 0 attribute, so it could legitimately be assigned a below-zero value. Again, nothing wrong in general with negative levels, it really depends how you define the level in the first place. So, the assertion on the level always being positive should not be have been put on
BTW, this is not the only possible choice of semantics of level. Another tank model could not have such a cylindrical shape, and not necessarily level = 0 implies volume = 0. This is just a feature of Additionally, the I will follow up with a PR that fixes all these issue. |
Thanks @MatthiasBSchaefer for pointing this out! |
In
3434527
we changed the assert statement to fluidLevel > 0
but the default is defined:
input SI.Height fluidLevel = 0
So all examples, which do not modify this input fail (e.g. Modelica.Fluid.Examples.TraceSubstances.RoomCO2 ,see https://www.ltx.de/download/MA/Compare_MSL_v4.1.0/Testruns/Dymola/Modelica/_report/Modelica.Fluid.Examples.TraceSubstances.RoomCO2/testcase_report.html#)
The text was updated successfully, but these errors were encountered: