Skip to content
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

MixingVolumeZeroFlow tests for accuracy of 1E-60 #441

Closed
mwetter opened this issue Mar 20, 2016 · 3 comments · Fixed by #565
Closed

MixingVolumeZeroFlow tests for accuracy of 1E-60 #441

mwetter opened this issue Mar 20, 2016 · 3 comments · Fixed by #565
Labels

Comments

@mwetter
Copy link
Contributor

mwetter commented Mar 20, 2016

The model Annex60.Fluid.MixingVolumes.Validation.MixingVolumeZeroFlow fails to simulate in OpenModelica because the asserts

  assert(abs(volNonLinSys.heatPort.Q_flow)<Modelica.Constants.small or time<1,
    "Heat flow leakage around zero flow.");
  assert(abs(volLinSys.heatPort.Q_flow)<Modelica.Constants.small or time<1,
    "Heat flow leakage around zero flow.");

are too strict. The message is

assert            | warning | The following assertion has been violated at time 1.000400
|                 | |       | abs(theRes.Q_flow) < 1e-60 or time < 1.0
assert            | error   | Heat flow leakage around zero flow.

This test needs to be less strict to allow for rounding errors or numerical approximation to solutions (assuming that there is no closed solution, which I did not verify).

@Mathadon
Copy link
Member

I guess this is similar to #439 where the algebraic system solver is also unable to find the exact solution of the algebraic loop. It makes sense that 1E-60 is then too small since the accuracy of the algebraic loop solver (in Dymola) seems +- half the machine accuracy, resulting in errors of ~1e-7. Are these also the kinds of values you get?

@mwetter
Copy link
Contributor Author

mwetter commented Mar 21, 2016

@Mathadon To be able to also simulate these tests with other tools than Dymola, we should relax the assert to have an accuracy that is one -- or probably better two -- orders of magnitude less than the solver tolerance.
Alternatively, we could remove the assert and plot the expected solution (or the difference of two alternate calculations if they should be equal) which then becomes part of the reference test.

@agnesramle
Copy link

We do also see the same problem when simulated with JModelica.

mwetter added a commit that referenced this issue Nov 2, 2016
mlauster added a commit that referenced this issue Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants