You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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°Cpackage 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 ?
The text was updated successfully, but these errors were encountered:
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:
And the error message given by Dymola:
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 ?
The text was updated successfully, but these errors were encountered: