-
Notifications
You must be signed in to change notification settings - Fork 42
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Clarification for usage of actualStream and semiLinear #112
Comments
Comment by HansOlsson on 20 Nov 2008 11:42 UTC |
Comment by rfranke on 24 Nov 2008 13:47 UTC Proposal part b) has not been accepted. The replacement of actualStream with semiLineaer in energy balances simplifies tool support. However, it makes models harder to read. It was decided to put priority on easier understanding of models when using the actualStream operator in energy balances. |
Comment by dietmarw on 5 Jun 2009 08:24 UTC
|
Comment by HansOlsson on 24 Sep 2009 10:08 UTC |
Comment by hansolsson on 29 Mar 2016 12:47 UTC |
Changelog removed by hansolsson on 29 Mar 2016 12:47 UTC |
Modified by hansolsson on 30 Mar 2016 07:51 UTC |
Reported by rfranke on 10 Oct 2008 08:27 UTC
This point came up when investigating the definition of distributed flow models with stream variables in Modelica_Fluid.
The current Modelica specification proposes to use the operator actualStream in energy balances of the form:
der(U) = H_flow;
H_flow = port.m_flow*actualStream(port.h_outflow);
This has several drawbacks:
(1) it does not help in distributed flow models, like Modelica_Fluid.Pipes.BaseClasses.PartialDistributedFlow, where one needs to obtain H_flow's between internal energy states, for which no stream variables exist.
(2) it requires symbolic analysis to avoid events for products of the form port.m_flow*actualStream(port.h_outflow), which imposes requirements on a tool and might give unexpected results if an arbitrary m_flow variable is used, which is equal to port.m_flow through other equations or function evaluations.
(3) it complicates the understanding and diagnosis if actualStream(port.h_outflow) is used without port.m_flow in an equation like:
h_port = actualSteam(port.h_outflow);
For instance Dymola 7.1 generates event logs saying "port.m_flow>0 became true, ... false, ... true, ... etc.". There finds no hint that this event is related to the usage of actualStream (the mo and mof files only contain actualStream; the dsmodel.c file contains anonymous variables).
Proposal, part a:
Change the definition of
semiLinear(x, positiveSlope, negativeSlope).
The current Modelica specification says
Returns: if x>=0 then positiveSlope*x else negativeSlope*x
Change this to:
Returns: smooth(0, if x>=0 then positiveSlope*x else negativeSlope*x)
Proposal, part b:
Change the definition of enthalpy flow rates from:
H_flow = port.m_flow*actualStream(port.h_outflow);
to
H_flow = semiLinear(port.m_flow, inStream(port.h_outflow), port.h_outflow);
This shall avoid the drawbacks given above.
Section 9.4.5: Update the discussion about automatic introduction of smooth(0, ...) by clarifying that the model behaviour is more reliable when using semiLinear, which contains smooth(0, ...) per definition.
Migrated-From: https://trac.modelica.org/Modelica/ticket/112
The text was updated successfully, but these errors were encountered: