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
Modelica.Media conformance to the specification #1106
Comments
Modified by sjoelund.se on 16 May 2013 19:53 UTC |
Comment by otter on 17 May 2013 15:09 UTC
Now, the issue is that
refers to FluidData.N2 which is instantiated from a type in a partial package:
What is unclear to me is the difference of a "partial package" to a "package"? Another fix would be (but seems to be unnecessarily complicated to:
If the computer science group agrees that there is no actual difference between a partial package and a package, I would prefer to clarify the specification by allowing name lookup in a partial package in a simulation model (but NOT in other partial classes). |
Comment by anonymous on 17 May 2013 15:44 UTC |
Comment by hubertus on 17 May 2013 15:49 UTC |
Comment by fcasella on 17 May 2013 15:56 UTC Partial packages such as PartialMedium or PartialMixtureMedium provide the interface, and possibly an incomplete implementation, of a medium model. As such, they cannot be used directly in a simulation model, so they are marked as partial in order to get meaningful error reports if a user forgets to redeclare the medium package to be a complete implementation. It is much better to get a message such as: hey, your model declares a partial package, please redeclare it, than to get errors about some obscure implementation details being missing from the medium package. From this point of view, removing the "partial" keyword would imply a loss of possibly useful static debugging information. When the usable (thus not partial) package is derived from the partial one, some of its classes might be modified or redeclared, but not necessarily all of them. If some of them (e.g., the FluidConstants record) are only declared in the base partial package, and they are not partial themselves, they should be usable. I cannot see any obvious reasons to forbid this, though I might be naive here. If there is a way to fix the specification in order to allow this, without causing problems such as, e.g., substantially more involved lookup algorithms, I would definitely recommend to go for it. |
Comment by hubertus on 17 May 2013 16:02 UTC
From my point of view it is fine to discuss htis down the road in the language group. This can be achieved without defining the type in a partial pacakge, and I updated Modelica.Media so that this is possible. This remaining problem was simply an oversight, which I just fixed. |
Comment by hubertus on 17 May 2013 16:04 UTC |
Comment by adrpo on 17 May 2013 16:47 UTC You are right, I will create a ticket about this for the Modelica Specification. Cheers, |
Comment by adrpo on 17 May 2013 17:38 UTC Models:
and
Here both: Cheers, |
Comment by hubertus on 17 May 2013 17:51 UTC
Which is non-partial. If you use basic types and composite ones like FluidConstants from there, everything will be conformant to the specification. Please look at the issues reported by Adrian above. |
Comment by adrpo on 17 May 2013 17:57 UTC Cheers, |
Comment by otter on 18 May 2013 14:32 UTC
Fixed in 7e19343: Moved all FluidConstants xxxConstants definition from partial packages to the top level part of the medium (as in all the other media now) and instanciated from Types.xxx.FluidConstants instead of the type in the partial package. I hope that now all these issues are fixed (did this for ReferenceAir, RealGasAir, IAPWS95, IAPWS09.
|
Modified by otter on 18 May 2013 14:38 UTC |
Reported by adrpo on 16 May 2013 06:16 UTC
Hi,
Just wondering if Modelica.Media is conform to the specification.
Spec says:
Now IdealGases.Common.FluidData looks like:
Which uses PartialMixtureMedium.FluidConstants from a partial package.
I know that fluidConstants is not used in MoistAir at all, but that doesn't matter.
The question is *what* can you use from a partial package and *how*.
The specification is rather vague on this point.
Cheers,
Adrian Pop/
Migrated-From: https://trac.modelica.org/Modelica/ticket/1106
The text was updated successfully, but these errors were encountered: