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

MolarMass instantiated from a partial package #924

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 8 comments
Closed

MolarMass instantiated from a partial package #924

modelica-trac-importer opened this issue Jan 14, 2017 · 8 comments
Assignees
Labels
bug Critical/severe issue L: Media Issue addresses Modelica.Media P: high High priority issue
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by otter on 8 Dec 2012 22:10 UTC
Translating model "Modelica.Fluid.Examples.[wiki:PumpingSystem]" in Dymola with option "Advanced.PedanticModelica:=true" results in the error message:

Component type specifier MolarMass is from a partial package. That is not correct.
File: Modelica/trunk/Modelica/Media/package.mo, line 4054
Component context: Modelica.Media.Water.simpleWaterConstants.molarMass
Component declared as MolarMass molarMass in Modelica.Media.Interfaces.PartialMedium

The error message is correct: simpleWaterConstants is an instance of a record from the partial package partialMedium and this is not allowed.


Migrated-From: https://trac.modelica.org/Modelica/ticket/924

@modelica-trac-importer modelica-trac-importer added this to the MSL3.2.1 milestone Jan 14, 2017
@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Media Issue addresses Modelica.Media P: high High priority issue labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Comment by hubertus on 8 Dec 2012 23:30 UTC
Fixing this needed a number of changes:

  • Type definitions are moved from partialMedium to a non-partial package Types
  • use of record types from partial packages (FluidConstants) removed for water by some restructuring
  • removed the commpletely non-sensical est of TemplateMedium that built on partial types

The result is that Modelica.Media.Examples checks now in Dymola with the pedantic flag set to true.

@modelica-trac-importer
Copy link
Author

Comment by dietmarw on 8 Dec 2012 23:41 UTC
DONE in 3071d98
(unhiding since now fixed and part of the release)

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 10 Dec 2012 16:14 UTC
Reopening because the change is backwards-incompatible (Modelica.Media.Water.simpleWaterConstants no longer exists).

I recommend the following patch:

diff -u -x .svn -r libraries/Modelica 3.2.1/Modelica/Media/Water/package.mo build/lib/omlibrary/Modelica 3.2.1/Media/Water/package.mo
--- libraries/Modelica 3.2.1/Modelica/Media/Water/package.mo	2012-12-10 12:27:02.858268693 +0100
+++ build/lib/omlibrary/Modelica 3.2.1/Media/Water/package.mo	2012-12-10 16:57:47.477790519 +0100
@@ -1,9 +1,9 @@
 within Modelica.Media;
 package Water "Medium models for water"
 
\-
   extends Modelica.Icons.MaterialPropertiesPackage;
 
+  import Modelica.Media.Water.ConstantPropertyLiquidWater.simpleWaterConstants;
 
 package IdealSteam "Water: Steam as ideal gas from NASA source"
 

@modelica-trac-importer
Copy link
Author

Comment by dietmarw on 14 Dec 2012 17:02 UTC
Since this is something that would break backward-compatibility it ought to be a blocker.

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 14 Dec 2012 17:16 UTC
Just to be clear here: users have instantiated types from partial packages, which means we have to choose between backwards compatibility and specification compliance in some sense, there is no way. I would decide in favor of specification compliance, if there is no way to get both. The above compatibility issue is easy to fix, and fixed in my working copy.

@modelica-trac-importer
Copy link
Author

Comment by sjoelund.se on 14 Dec 2012 17:23 UTC
Yes and no, they have used Modelica.Media.Water.simpleWaterConstants, which (being a constant in a non-partial package) should be non-partial. Moving this constant to me seems to be an incompatibility. But one that is rather easy to fix. Give a default renaming import, mark it obsolete.

@modelica-trac-importer
Copy link
Author

Comment by hubertus on 25 Mar 2013 21:48 UTC
Fixed in 1e40f35.

@modelica-trac-importer
Copy link
Author

Modified by hubertus on 25 Mar 2013 21:48 UTC

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 P: high High priority issue
Projects
None yet
Development

No branches or pull requests

2 participants