ExternalMedia icon indicating copy to clipboard operation
ExternalMedia copied to clipboard

Incompressible CoolProp tests do not compile

Open bilderbuchi opened this issue 1 year ago • 3 comments

On the OM test suite, the tests Test.CoolProp.Incompressible.IncompressibleCoolPropMedium and Test.CoolProp.Incompressible.IncompressibleCoolPropMixture does not compile with

[/home/hudson/saved_omc/libraries/.openmodelica/libraries/ExternalMedia 4.0.0/Media/IncompressibleCoolPropMedium.mo:49:5-49:76:writable] Error: Variable R not found in scope BaseProperties.

Because IncompressibleCoolPropMedium extends from Modelica.Media.Interfaces.PartialMedium (and not from ExternalMedia.BaseClasses.ExternalTwoPhaseMedium), I'm pretty sure https://github.com/modelica-3rdparty/ExternalMedia/blob/8f5df11cd9544fecaf1141fea5fd9f6a013408e1/Modelica/ExternalMedia/Media/IncompressibleCoolPropMedium.mo#L49 should be R_s, not R. Possibly this was overlooked in the MSL 3->4 transition? I dont know if this needs further fixes elsewhere.

bilderbuchi avatar Sep 27 '23 09:09 bilderbuchi

If line 49 is corrected to R_s then the next error is:

Translation Error [ExternalMedia.Media.IncompressibleCoolPropMedium: 60:7-60:44]: Type mismatch for positional argument 3 in ExternalMedia.Test.CoolProp.Incompressible.IncompressibleCoolPropMixture.Fluid.density_pTX(X=varProps.Xi). The argument has type: Real[1] / expected type: Real[2]

https://github.com/modelica-3rdparty/ExternalMedia/blob/8f5df11cd9544fecaf1141fea5fd9f6a013408e1/Modelica/ExternalMedia/Media/IncompressibleCoolPropMedium.mo#L60

carowjp avatar Dec 12 '23 16:12 carowjp

Exchanging X[xN] for X[:] in every mass fraction input resolved this for me.

so in every function of ExternalMedia.Media.IncompressibleCoolPropMedium I changed the line to: input MassFraction X[:] "Mass fractions";

ibeyers avatar Jun 05 '24 16:06 ibeyers

That is weird though, as that test has substanceNames={"LiBr|calc_transport=1|debug=1000","dummyToMakeBasePropertiesWork"}, so that has size 2, so Modelica.Media.Interfaces.PartialMedium.nS should be 2, so the nX beside that should also be 2, but seems to be 1 for some reason?

@casella do you know what could be going on here?

bilderbuchi avatar Jun 06 '24 06:06 bilderbuchi