{"action":"created","issue":{"url":"https://api.github.com/repos/ibpsa/modelica-ibpsa/issues/1048","repository_url":"https://api.github.com/repos/ibpsa/modelica-ibpsa","labels_url":"https://api.github.com/repos/ibpsa/modelica-ibpsa/issues/1048/labels{/name}","comments_url":"https://api.github.com/repos/ibpsa/modelica-ibpsa/issues/1048/comments","events_url":"https://api.github.com/repos/ibpsa/modelica-ibpsa/issues/1048/events","html_url":"https://github.com/ibpsa/modelica-ibpsa/issues/1048","id":374706636,"node_id":"MDU6SXNzdWUzNzQ3MDY2MzY=","number":1048,"title":"In StaticTwoPortConservationEquation, trigger a warning rather than an error in energy balance check","user":{"login":"mwetter","id":1329080,"node_id":"MDQ6VXNlcjEzMjkwODA=","avatar_url":"https://avatars0.githubusercontent.com/u/1329080?v=4","gravatar_id":"","url":"https://api.github.com/users/mwetter","html_url":"https://github.com/mwetter","followers_url":"https://api.github.com/users/mwetter/followers","following_url":"https://api.github.com/users/mwetter/following{/other_user}","gists_url":"https://api.github.com/users/mwetter/gists{/gist_id}","starred_url":"https://api.github.com/users/mwetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwetter/subscriptions","organizations_url":"https://api.github.com/users/mwetter/orgs","repos_url":"https://api.github.com/users/mwetter/repos","events_url":"https://api.github.com/users/mwetter/events{/privacy}","received_events_url":"https://api.github.com/users/mwetter/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-28T01:23:47Z","updated_at":"2018-12-24T08:55:52Z","closed_at":"2018-12-21T22:01:18Z","author_association":"CONTRIBUTOR","body":"In `StaticTwoPortConservationEquation`, the check for the energy balance\r\n```modelica\r\n  if prescribedHeatFlowRate then\r\n    assert(noEvent( abs(Q_flow) < dTMax*cp_default*max(m_flow_small/1E3, abs(m_flow))),\r\n   \"In \" + getInstanceName() + \":\r\n   The heat flow rate equals \" + String(Q_flow) +\r\n   \" W and the mass flow rate equals \" + String(m_flow) + \" kg/s,\r\n   which results in a temperature difference \" +\r\n   String(abs(Q_flow)/ (dTMax*cp_default*max(m_flow_small/1E3, abs(m_flow)))) +\r\n   \" K > dTMax=\" +String(dTMax) + \" K.\r\n   This may indicate that energy is not conserved for small mass flow rates.\r\n   The implementation may require prescribedHeatFlowRate = false.\");\r\n  end if;\r\n```\r\nis heuristic and hence should trigger a warning rather than an error that stops the simulation."},"comment":{"url":"https://api.github.com/repos/ibpsa/modelica-ibpsa/issues/comments/449705127","html_url":"https://github.com/ibpsa/modelica-ibpsa/issues/1048#issuecomment-449705127","issue_url":"https://api.github.com/repos/ibpsa/modelica-ibpsa/issues/1048","id":449705127,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTcwNTEyNw==","user":{"login":"Mathadon","id":5970879,"node_id":"MDQ6VXNlcjU5NzA4Nzk=","avatar_url":"https://avatars0.githubusercontent.com/u/5970879?v=4","gravatar_id":"","url":"https://api.github.com/users/Mathadon","html_url":"https://github.com/Mathadon","followers_url":"https://api.github.com/users/Mathadon/followers","following_url":"https://api.github.com/users/Mathadon/following{/other_user}","gists_url":"https://api.github.com/users/Mathadon/gists{/gist_id}","starred_url":"https://api.github.com/users/Mathadon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mathadon/subscriptions","organizations_url":"https://api.github.com/users/Mathadon/orgs","repos_url":"https://api.github.com/users/Mathadon/repos","events_url":"https://api.github.com/users/Mathadon/events{/privacy}","received_events_url":"https://api.github.com/users/Mathadon/received_events","type":"User","site_admin":false},"created_at":"2018-12-24T08:55:52Z","updated_at":"2018-12-24T08:55:52Z","author_association":"MEMBER","body":"Should be possible to do something like:\r\n\r\n```\r\ndiscrete Boolean errorThrown;\r\n\r\ninitial equation\r\nerrorThrown=false;\r\n\r\nequation\r\nwhen Q_flow>thresHold and not pre(errorThrown) then\r\n  errorThrown=true;\r\n  assert(false, \"error message\")\r\nend when;\r\n```\r\nOr something similar if asserts cannot be within a when statement."}}
{"actor":{"display_login":"Mathadon"}}