{"action":"created","issue":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/393","repository_url":"https://api.github.com/repos/tbeu/Modelica","labels_url":"https://api.github.com/repos/tbeu/Modelica/issues/393/labels{/name}","comments_url":"https://api.github.com/repos/tbeu/Modelica/issues/393/comments","events_url":"https://api.github.com/repos/tbeu/Modelica/issues/393/events","html_url":"https://github.com/tbeu/Modelica/issues/393","id":196850243,"number":393,"title":"Provide C_nominal in Modelica.Media to allow propagating value and avoid wrong numerical results","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":504445352,"url":"https://api.github.com/repos/tbeu/Modelica/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":504452047,"url":"https://api.github.com/repos/tbeu/Modelica/labels/Media","name":"Media","color":"0000aa","default":false}],"state":"open","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":null,"comments":2,"created_at":"2016-12-21T05:35:10Z","updated_at":"2016-12-21T05:35:29Z","closed_at":null,"body":"**Reported by mwetter on 30 Jul 2010 22:27 UTC**\nI recommend a change in Modelica.Media to avoid problems in computing trace substances: The problem occurred in the following situation: When modeling the attached system, mC is of the order of 1E-5 to 1E-8. This is typical for trace substances, such as a CO2 concentration in a room or in a junction volume. For the ODE solver to provide reliable solutions, the nominal attribute of mC (=m\\*C) needs to be set. For example, the attached total model shows a case where Dymola's DASPK computes a wrong trajectory forvolWes.mC and volEas.mC after t=3600, unless mC(nominal={1E-7}) is set. (See attached png's and fixmeCTotal.mo)\n\nUnfortunately, there is no easy way to change C at the top-level of a model, since Modelica.Media.Interfaces.[wiki:PartialMedium] does not contain a parameter such as C_nominal that could be used to propagate a nominal value for C to PartialLumpedVolume. I recommend that such a parameter be added since it is impractical to do this change in models with hundreds of instances that extend from PartialLumpedVolume.\n\nOnce this parameter is added, I recommend that in the model ClosedVolume, the section\n```\n  extends Modelica.Fluid.Vessels.[wiki:BaseClasses].[wiki:PartialLumpedVessel](\n    final fluidVolume = V,vesselArea = pi*(3/4*V)^(2/3),heatTransfer(surfaceAreas={4*pi*(3/4*V/pi)^(2/3)}));\n```\n\nwill be changed to\n```\n  extends Modelica.Fluid.Vessels.[wiki:BaseClasses].[wiki:PartialLumpedVessel](\n    final fluidVolume = V,vesselArea = pi*(3/4*V)^(2/3),heatTransfer(surfaceAreas={4*pi*(3/4*V/pi)^(2/3)}),mC(nominal=V*rho_nominal*C_nominal));\n\nprotected\n\n  parameter Modelica.SIunits.Density rho_nominal=Medium.density(\n    Medium.setState_pTX(\n      T=T_start,p=p_start,X=X_start[1:Medium.nXi])) \"Density, used to compute fluid mass\"\n        annotation (Evaluate=true);\n```\n\nThis will set the nominal value for mC based on the volume V (which can change in our applications between 0.1 m3 to 100 m3), based on the fluid density and based on C_nominal.\n\n----\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/393"},"comment":{"url":"https://api.github.com/repos/tbeu/Modelica/issues/comments/268439769","html_url":"https://github.com/tbeu/Modelica/issues/393#issuecomment-268439769","issue_url":"https://api.github.com/repos/tbeu/Modelica/issues/393","id":268439769,"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},"created_at":"2016-12-21T05:35:29Z","updated_at":"2016-12-21T05:35:29Z","body":"**Modified by otter on 10 Aug 2010 21:09 UTC**"}}
{"actor":{"display_login":"modelica-trac-importer"}}