HelmholtzMedia icon indicating copy to clipboard operation
HelmholtzMedia copied to clipboard

Remaining issues with HelmholtzMedia in OpenModelica

Open thorade opened this issue 5 years ago • 18 comments

newInst Library report, Library coverage, last 7 runs


This is a follow-up ticket for #34, to track the few issues that are left after the release of OpenModelica 1.16. There is a corresponding ticket in OM Trac: https://trac.openmodelica.org/OpenModelica/ticket/6088


  1. Examples.ConvergenceTest.Ancillary_Saturation This goes into a branch of an if-else that I thought is unreachable (this should also not happen)??? After updating the assert message, it is seen that h=nan

  2. Examples.ConvergenceTest.setSat An iteration written by me does not converge, close to the critical point, but it works in Dymola. There is a warning about abs value being negative.

  3. Examples.MediaTestModels.IsopentaneTestModel (during initialization) Failing assert

  4. Examples.Validation.Derivatives_SaturationBoundary (during initialization) fails during initialization, with liq.s and vap.s having same value

  5. Examples.Validation.idealGasLimit this should converge to a certain value, but starts to oscillate because of numerical noise, also with other tools, but at a later point. Might be solved by changing some tolerance or other setting?

thorade avatar Oct 24 '20 19:10 thorade

Number 3 Isopentane 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 https://github.com/OpenModelica/OpenModelica/pull/6877

thorade avatar Nov 11 '20 08:11 thorade

Division by zero check: https://github.com/OpenModelica/OpenModelica/pull/7023

thorade avatar Dec 10 '20 18:12 thorade

OM master switched to newInst on 2020-12-14: https://libraries.openmodelica.org/branches/history/master/00_history.html https://libraries.openmodelica.org/branches/history/master/2020-12-14%2003:04:35..2020-12-14%2022:49:53.html

master Library report, Library coverage, last 7 runs

newInst Library report, Library coverage, last 7 runs

thorade avatar Dec 21 '20 11:12 thorade

  • https://libraries.openmodelica.org/branches/history/master/2021-01-12%2022:58:17..2021-01-14%2001:15:22.html
  • https://libraries.openmodelica.org/branches/history/master/2021-01-14%2001:15:22..2021-01-15%2000:56:20.html

thorade avatar Mar 07 '21 14:03 thorade

Some models broken due to #45, will be addressed through #33

thorade avatar Sep 17 '21 10:09 thorade

With the fix for #48, we are now at 36/41 models simulating: https://libraries.openmodelica.org/branches/master/HelmholtzMedia/HelmholtzMedia.html

A fresh case not yet mentioned is Examples.ConvergenceTest.SinglePhase_setState_pramp_Tsine , which tells about setSat_p not converging.

bilderbuchi avatar Nov 25 '21 14:11 bilderbuchi

Examples.Validation.idealGasLimit this should converge to a certain value, but starts to oscillate because of numerical noise, also with other tools, but at a later point. Might be solved by changing some tolerance or other setting?

Some of the problems stem from density being prescribed to go below its lower limit (Modelica.Constants.small). I guess something like

  when d < 2*Modelica.Constants.small then
    terminate("Stopping before hitting the density limit");
  end when;

could help with that at least.

bilderbuchi avatar Nov 25 '21 15:11 bilderbuchi

I have change the stop time of that example in https://github.com/thorade/HelmholtzMedia/commit/224effca7609908e66ef175d9e6fc933f5d559d0

thorade avatar Nov 27 '21 16:11 thorade

also see #40 for the convergence criterion

thorade avatar Nov 27 '21 16:11 thorade

It would be interesting to see where this NaN during initialization is coming from: https://libraries.openmodelica.org/branches/master/HelmholtzMedia/files/HelmholtzMedia_HelmholtzMedia.Examples.Validation.Derivatives_SaturationBoundary.sim

thorade avatar Nov 29 '21 07:11 thorade

Funny, when I simulate that model locally with current HH master, OM 1.18, MSL 3.2.3, Win10, I get another error:

Model error: Argument of log(1.0 - exp(e[i,2] * tau)) was 0 should be > 0
simulation terminated by an assertion at initialization
Simulation process failed. Exited with code 0xffffffffffffffff.

Possibly connected? Sadly, I did not manage to trace where this error comes from, either.

bilderbuchi avatar Nov 29 '21 10:11 bilderbuchi