-
Notifications
You must be signed in to change notification settings - Fork 169
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
Wrong input type in specificEnthalpy_pTX, temperature_phX, and density_phX #4389
Comments
SimulationX also reports the dimension error
I wonder why OMC deduced type |
OMC would normally convert it to |
OK, there also is #4393 now which is independent of the dimension error. |
This issue is causing regressons in OMC, so I would put it in MSL 4.1.0, I don't see any reason to postpone it to 4.2.0. The proposed modification is actually less restrictive, so there should be no backwards compatibility problems. |
We need to cherry pick #4390 to maint/4.1.x so we get this fixed in the forthcoming release. |
@Esther-Devakirubai can you please take care of that? Thanks! |
@casella Yes Sure! Thanks |
Consider this simple MWE:
This model compiles in Dymola 2024X and produces the expected result. However, when I try to compile it with OpenModelica, I get this error:
This output looks a bit odd at first sight, what's wrong in calling
specificEnthalpy_pT(1e5, 300)
? I thought it was an OMC bug, but in fact it turns out to be an MSL issue.specificEnthalpy_pT
, as defined in PartialPureSubstance, callsspecificEnthalpy_pTX(p, T, fill(0, 0))
, which is defined in PartialMedium asspecificEnthalpy(setState_pTX(p, T, X))
, so it callssetState_pTX
with a third argumentX = fill(0, 0)
.Unfortunately, setState_pTX for SimpleAir is defined in PartialSimpleIdealGasMedium as:
with input
MassFraction X[nX]
instead ofMassFraction X[:]
. Since by defaultnX = size(substanceNames, 1) = 1
, it then expects an array of dimension one, but instead gets an array of dimension zero, coming fromfill(0,0)
.I'm not sure why Dymola does not complain about this issue, but for sure it needs to be fixed. This holds for functions
specificEnthalpy_pTX
,temperature_phX
, anddensity_phX
in bothPartialSimpleMedium
andPartialSimpleIdealGasMedium
.The text was updated successfully, but these errors were encountered: