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

include model name in Media asserts #1045

Closed
Mathadon opened this issue Oct 26, 2018 · 2 comments · Fixed by #1046 or #1047
Closed

include model name in Media asserts #1045

Mathadon opened this issue Oct 26, 2018 · 2 comments · Fixed by #1046 or #1047
Assignees

Comments

@Mathadon
Copy link
Member

The BaseProperties temperature check does not report in what model the temperature limits are exceeded. This can be improved for easier debugging.

@mwetter
Copy link
Contributor

mwetter commented Oct 28, 2018

@Mathadon : While testing your pull request, I get

In MixingVolumeHeatConduction.vol.dynBal.medium: Temperature T is not in the allowed range
200.0 K <= (T =423.15 K) <= 423.15 K
required from medium model "Air".
  Failed condition: vol.dynBal.medium.T >= 200.0 and vol.dynBal.medium.T <= 423.15

What does getInstanceName() add, as the message already said vol.dynBal.medium.T.

Also, I would prefer the following error message that directly tells the user which limit is exceeded, and does so in degC which are more intuitive:

Temperature T exceeded its maximum allowed value of 150 degC (423.15 Kelvin)
as required from medium model "Air".
  Failed condition: vol.dynBal.medium.T <= 423.15

and similarly

Temperature T exceeded its minimum allowed value of -73.15 degC (200 Kelvin)
as required from medium model "Air".
  Failed condition: vol.dynBal.medium.T >= 200.0

I implemented these message on branch issue1045_mediaAssert_separateMinMax and made a new pull request.

The two tests are not more expensive as the and also requires monitoring two zero crossing functions.

@Mathadon
Copy link
Member Author

JModelica doesn't add the variable name, so then it does make a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants