{"action":"closed","issue":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/482","repository_url":"https://api.github.com/repos/tbeu/Modelica","labels_url":"https://api.github.com/repos/tbeu/Modelica/issues/482/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/Modelica/issues/482/comments","events_url":"https://api.github.com/repos/tbeu/Modelica/issues/482/events","html_url":"https://github.com/tbeu/Modelica/issues/482","id":197515921,"number":482,"title":"Modelica.Media.Air.MoistAir leads to illegal Modelica lookup!","user":{"login":"modelica-trac-importer","id":22202507,"avatar_url":"https://avatars.githubusercontent.com/u/22202507?v=3","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"labels":[{"id":506762997,"url":"https://api.github.com/repos/tbeu/Modelica/labels/bug","name":"bug","color":"ee0701","default":true},{"id":506769720,"url":"https://api.github.com/repos/tbeu/Modelica/labels/L:Media","name":"L:Media","color":"0000aa","default":false}],"state":"closed","locked":false,"assignee":{"login":"beutlich","id":14896695,"avatar_url":"https://avatars.githubusercontent.com/u/14896695?v=3","gravatar_id":"","url":"https://api.github.com/users/beutlich","html_url":"https://github.com/beutlich","followers_url":"https://api.github.com/users/beutlich/followers","following_url":"https://api.github.com/users/beutlich/following{/other_user}","gists_url":"https://api.github.com/users/beutlich/gists{/gist_id}","starred_url":"https://api.github.com/users/beutlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beutlich/subscriptions","organizations_url":"https://api.github.com/users/beutlich/orgs","repos_url":"https://api.github.com/users/beutlich/repos","events_url":"https://api.github.com/users/beutlich/events{/privacy}","received_events_url":"https://api.github.com/users/beutlich/received_events","type":"User","site_admin":false},"assignees":[{"login":"beutlich","id":14896695,"avatar_url":"https://avatars.githubusercontent.com/u/14896695?v=3","gravatar_id":"","url":"https://api.github.com/users/beutlich","html_url":"https://github.com/beutlich","followers_url":"https://api.github.com/users/beutlich/followers","following_url":"https://api.github.com/users/beutlich/following{/other_user}","gists_url":"https://api.github.com/users/beutlich/gists{/gist_id}","starred_url":"https://api.github.com/users/beutlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beutlich/subscriptions","organizations_url":"https://api.github.com/users/beutlich/orgs","repos_url":"https://api.github.com/users/beutlich/repos","events_url":"https://api.github.com/users/beutlich/events{/privacy}","received_events_url":"https://api.github.com/users/beutlich/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/tbeu/Modelica/milestones/47","html_url":"https://github.com/tbeu/Modelica/milestone/47","labels_url":"https://api.github.com/repos/tbeu/Modelica/milestones/47/labels","id":2214850,"number":47,"title":"MSL3.2.1","description":"Backward compatible bug-fix release.","creator":{"login":"modelica-trac-importer","id":22202507,"avatar_url":"https://avatars.githubusercontent.com/u/22202507?v=3","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":20,"state":"closed","created_at":"2016-12-25T13:00:27Z","updated_at":"2016-12-25T21:36:43Z","due_on":"2013-03-31T07:00:00Z","closed_at":"2016-12-25T13:00:27Z"},"comments":5,"created_at":"2016-12-25T21:35:13Z","updated_at":"2016-12-25T21:36:43Z","closed_at":"2016-12-25T21:36:43Z","body":"**Reported by adrpo on 19 Jan 2011 06:28 UTC**\nWe start from definition of MoistAir:\n```\npackage MoistAir \"Air: Moist air model (240 ... 400 K)\"\n  extends Interfaces.PartialCondensingGases(\n    mediumName=\"Moist air\",\n    substanceNames={\"water\", \"air\"},\n    final reducedX=true,\n    final singleState=false,\n    reference_X={0.01,0.99},\n    fluidConstants = {IdealGases.Common.FluidData.H2O,IdealGases.Common.FluidData.N2});\n   ....\n  end MoistAir;\n```\n\nSo, in MoistAir we have constant:\n```\nIdealGases.Common.FluidData.H2O\n```\n\nThe constant is defined in Modelica.Media.IdealGases.Common as:\n```\nconstant SingleGasNasa.FluidConstants H2O(\n  chemicalFormula =        \"H2O\",\n  iupacName =              \"unknown\",\n  structureFormula =       \"unknown\",\n  casRegistryNumber =      \"7732-18-5\",\n  meltingPoint =           273.15,\n  normalBoilingPoint =     373.15,\n  criticalTemperature =    647.14,\n  criticalPressure =       220.64e5,\n  criticalMolarVolume =     55.95e-6,\n  acentricFactor =           0.344,\n  dipoleMoment =             1.8,\n  molarMass =              SingleGasesData.H2O.MM,\n  hasDipoleMoment =       true,\n  hasIdealGasHeatCapacity=true,\n  hasCriticalData =       true,\n  hasAcentricFactor =     true);\n```\n\nSo far so good, but now the problems begin: SingleGasNasa is a partial package!\nIn Modelica Specification 3.2, section 5.3.2 Composite Name Lookup is said:\n\"The class we look inside may not be partial in a simulation model.\"\nSo, accessing SingleGasNasa.FluidConstants is illegal because SingleGasNasa is partial!\n\nBesides this (to be even weirder) the record SingleGasNasa.FluidConstants is a record declared as:\n```\n redeclare record extends FluidConstants\n   ...\n end FluidConstants;\n```\nso you actually need to instantiate SingleGasNasa, apply the extends in it,\nbut you can't do that because it uses data.name which has no binding!\n```\npartial package SingleGasNasa\n  \"Medium model of an ideal gas based on NASA source\"\n  extends Interfaces.PartialPureSubstance(\n     ThermoStates = Choices.IndependentVariables.pT,\n     mediumName=data.name,\n     substanceNames={data.name},\n     singleState=false,\n     Temperature(min=200, max=6000, start=500, nominal=500),\n     SpecificEnthalpy(start=if referenceChoice==ReferenceEnthalpy.ZeroAt0K then data.H0 else\n        if referenceChoice==ReferenceEnthalpy.UserDefined then h_offset else 0, nominal=1.0e5),\n     Density(start=10, nominal=10),\n     AbsolutePressure(start=10e5, nominal=10e5));\n \n   constant IdealGases.Common.DataRecord data \"Data record of ideal gas substance\";\nend SingleGasNasa;\n```\n\nSo, how does Modelica.Media works in Dymola if is not legal Modelica?\n\nOf course, I might be wrong and if I am please enlighten me!\n\nCheers,\nAdrian Pop/\n\n----\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/482"}}
{"actor":{"display_login":"modelica-trac-importer"}}