Opened 4 years ago

Last modified 3 years ago

#6088 new defect

Remaining issues with HelmholtzMedia

Reported by: Francesco Casella Owned by: Francesco Casella
Priority: high Milestone:
Component: Third-Party Libraries Version:
Keywords: Cc: matthis.thorade@…, Karim Adbdelhak

Description (last modified by Francesco Casella)

As of 25 Aug 2020, we have 42 runnable models in the library, which all go through all phases of code generation.

One fails during C-code compilation, see #6087.

Another five fail at runtime

@matthis, feel free to further investigate and comment or ask for clarifications here.

Attachments (2)

HelmholtzMedia.Examples.Validation.Derivatives_SaturationBoundary_res.mat (493.6 KB ) - added by Karim Adbdelhak 4 years ago.
created with -d=newInst and --daeMode
Derivatives_SaturationBoundary.mat (434.1 KB ) - added by matthis.thorade@… 4 years ago.
results from Dymola simulation

Download all attachments as: .zip

Change History (14)

comment:1 by Francesco Casella, 4 years ago

Description: modified (diff)

comment:2 by Karim Adbdelhak, 4 years ago

I looked at HelmholtzMedia.Examples.Validation.Derivatives_SaturationBoundary and it looks like it has the same problem as HelmholtzMedia.Examples.ConvergenceTest.setSat because it is that very function that fails.

When running the compiled code multiple times and looking at the values i realized that this function always returns different values (with same setup!), so there is some uninitialized stuff happening. That lead me to think that there is something wrong with matching, the order does not seem to be correct and i tried DAEMode (--daeMode) which simulates without causalization and a wrong matching would only mess event handling up a little. And indeed it works with that setting.

Could someone try and verify the results? (see attached file) If you want to reproduce the results please update to the newest development version because some of my latest commits could have major impact here.

I will look into the function and its ordering and try to come up with a minimal model. Is there something special about this function in particular that differs from other functions?

comment:3 by Karim Adbdelhak, 4 years ago

The failing function is HelmholtzMedia.Interfaces.PartialHelmholtzMedium.setSat_T, the name of the function test confused me sorry!

Also i am on the train currently and the upload of the result file does not work. I will add that later.

by Karim Adbdelhak, 4 years ago

created with -d=newInst and --daeMode

comment:4 by matthis.thorade@…, 4 years ago

I tried loading the _res.mat file in Dymola, but it gives me the error message:

Error when reading matrix "data_2 (1001,62)" from file "C:/Users/matthis.thorade/Downloads/HelmholtzMedia.Examples.Validation.Derivatives_SaturationBoundary_res.mat",
because abscissa values are not strict monotonically increasing
((7,1) = -2147483648 < (8,1) = 1073741824).

by matthis.thorade@…, 4 years ago

results from Dymola simulation

in reply to:  4 comment:5 by Karim Adbdelhak, 4 years ago

Replying to matthis.thorade@…:

I tried loading the _res.mat file in Dymola, but it gives me the error message:

Error when reading matrix "data_2 (1001,62)" from file "C:/Users/matthis.thorade/Downloads/HelmholtzMedia.Examples.Validation.Derivatives_SaturationBoundary_res.mat",
because abscissa values are not strict monotonically increasing
((7,1) = -2147483648 < (8,1) = 1073741824).

I don't know if our result files are 100% compatible with Dymola. Opening it with OpenModelica works. But i compared it with your results and there are major differences, it looks like DAEMode just does not complain about the uninitialized values and just uses them.

Good for debugging though... i try to figure it out!

comment:6 by Francesco Casella, 4 years ago

Description: modified (diff)

comment:7 by Francesco Casella, 4 years ago

Description: modified (diff)

comment:8 by matthis.thorade@…, 4 years ago

in reply to:  8 comment:9 by Francesco Casella, 4 years ago

Replying to matthis.thorade@…:

IsopentaneTestModel is now also simulating, started to work with
https://libraries.openmodelica.org/branches/history/newInst/2020-11-09%2011:30:51..2020-11-09%2020:32:27.html

Thanks for reporting! Karim improved the solveSimpleEquations backend method in PR 6877 and that had some beneficial effects on several models.

comment:10 by Francesco Casella, 4 years ago

@matthis, I see there are still 4 models failing at runtime. Three fail in the middle of the simulation, one fails immediately after initialization.

Do you have any clue why this still happens?

comment:11 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:12 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.