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

Clarification for usage of actualStream and semiLinear #112

Closed
modelica-trac-importer opened this issue Nov 3, 2018 · 8 comments
Closed
Labels

Comments

@modelica-trac-importer
Copy link
Collaborator

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

@modelica-trac-importer
Copy link
Collaborator Author

Comment by HansOlsson on 20 Nov 2008 11:42 UTC
Sent to fluid-group (with another trac-system) and thus closed here.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by rfranke on 24 Nov 2008 13:47 UTC
The issue was discussed at the 59th Modelica design meeting. Proposal part a) was accepted. It was decided to change the definition of the semiLinear operator accordingly. Has this been done?

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.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by dietmarw on 5 Jun 2009 08:24 UTC
from [milestone:Design62 62nd Modelica Design Meeting]:

  • Status: Solution unclear
  • Responsible: Rüdiger, Francesco, Hans

@modelica-trac-importer
Copy link
Collaborator Author

Comment by HansOlsson on 24 Sep 2009 10:08 UTC
Change (a) has not been performed in Modelica 3.1 as far as I can see.

@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 29 Mar 2016 12:47 UTC
Resolved (a) in r9235 (it basically only states that a continuous expression is continuous) - the other part was not accepted.

@modelica-trac-importer
Copy link
Collaborator Author

Changelog removed by hansolsson on 29 Mar 2016 12:47 UTC

@modelica-trac-importer
Copy link
Collaborator Author

Modified by hansolsson on 30 Mar 2016 07:51 UTC

@modelica-trac-importer modelica-trac-importer added this to the ModelicaSpec3.4 milestone Nov 3, 2018
@modelica-trac-importer
Copy link
Collaborator Author

Comment by hansolsson on 25 Oct 2018 15:32 UTC
Unhide tickets in preparation for move to GitHub.
(Examined tickets before; these are closed tickets that influenced specification or related documents and additionally relevant ones #52 #260 #2226 #101 #651.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests