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

Issue with ReferenceMoistAir Beyond 500°C #4512

Open
aci31 opened this issue Dec 12, 2024 · 0 comments
Open

Issue with ReferenceMoistAir Beyond 500°C #4512

aci31 opened this issue Dec 12, 2024 · 0 comments
Assignees
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media

Comments

@aci31
Copy link

aci31 commented Dec 12, 2024

Hi,

I recently faced an issue when using Modelica.Media.Air.ReferenceMoistAir.
When using the BaseProperties (so all volume based components, like the boundary or vessel), there is a "Index out of bound" issue happening only when the temperature is beyond 500°C.

I used Dymola 25x and MSL 4.0.0 (I have the same issue in Dymola 2020x with MSL 3.2.4).

Please find below a very simple example reproducing the error:

model BugReferenceMoistAir
  //The model just bug (Index out of bounds) when temperature reaches 500°C
  package Medium=Modelica.Media.Air.ReferenceMoistAir;
  Medium.BaseProperties medium;
equation 
  medium.p=1e5;
  medium.T=273.15+time*1000;
  medium.Xi=Medium.reference_X[1:Medium.nXi];

  annotation (uses(Modelica(version="4.0.0")));
end BugReferenceMoistAir;

And the error message given by Dymola:

Error: The following error was detected at time: 0.5
Index out of bounds
Failed condition: (j >= 1) && (j <= a.dims[0])
The stack of functions is:
Modelica.Media.Air.ReferenceMoistAir.Utilities.h_dis_pTX
Modelica.Media.Air.ReferenceMoistAir.Utilities.h_pTX
Modelica.Media.Air.ReferenceMoistAir.Utilities.u_pTX(100000.0, medium.T, medium.Xi)

The error triggered by Modelica.Media.Air.ReferenceMoistAir.Utilities.h_dis_pTX() comes from the fact that the functions (like Modelica.Media.Air.ReferenceMoistAir.Utilities.u_pTX()) in BaseProperties are called using Xi instead of X. Indeed, the function Modelica.Media.Air.ReferenceMoistAir.Utilities.h_dis_pTX() that is triggering the error is using X[1] and X[2] (obviously not available when using only Xi).
I duplicated the package Modelica.Media.Air.ReferenceMoistAir, and I modified all calls in BaseProperties to use X instead of Xi and it solved the error.

I looked in different Medium.BaseProperties, and all calls to functions using Xi... maybe we should correct that ?

@beutlich beutlich added bug Critical/severe issue L: Media Issue addresses Modelica.Media labels Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media
Projects
None yet
Development

No branches or pull requests

3 participants