-
Notifications
You must be signed in to change notification settings - Fork 41
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
Non optional connector #3129
Non optional connector #3129
Conversation
@casella Do you agree that this makes sense for stream-connectors? In particular this would generate diagnostics for the upper two variants in Modelica.Fluid.Examples.Explanatory.MeasuringTemperature (but not for the bottom one). |
Add spaces Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
Agreement - but change to error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting some changes, but would also like this raise the question of where to present these annotations. In what way are they related to Graphical User Interface? Wouldn't Symbolic Processing make more sense, or to combine the new annotations with Single Use of Class (renaming the section title to something like Usage Restrictions)?
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
The latter seems the best. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only important thing I see missing is an explanation of what "flow variable may be negative" means here.
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
This has now been added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from minor details regarding the example, the only real question concerns how to – if at all – deal with the fact that the min
attribute isn't ensured to be constant.
The idea is to deal with that part of streams-connectors in exactly the same way as other simplifications for them: |
…ing. Also reduce to one flange-connector.
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, this looks good now. However, think it would be reassuring to also get a review from someone more on the application side of things, Modelica.Mechanics as
well as Modelica.Fluid
…
@HansOlsson I'm sorry but I missed the original request for review, and then many things happened in the meantime. What should I review at this point, exactly? |
If the rules for the annotation to restrict maximum number of connections makes sense, as potential replacement for the cardinality-assertions in Modelica.Fluid. (The minimum number of connectors is a separate issue - I might split it into two if this discussion gets too complicated.) Thinking more I'm a bit unsure. On one hand the new rules make sense, and on the other hand it would mean that an example in MSL is misleading. It's a sort of trade-off: how much effort do we want to spend on avoiding potential pit-falls? The basic idea with the restriction is to replace cardinality-checks. And since Modelica mostly deal with connection-sets instead of connections the idea was instead of restricting the number of connections to the connector it restricts the number of connectors in its connection set (excluding sensors for fluid, since otherwise it would break more). That implies that the top-two variants in Modelica.Fluid.Examples.Explanatory.MeasuringTemperature would trigger it (if using the annotation instead of the current cardinality-assert). The bottom one would not - since the junction makes the intention clear. The MeasuringTemperature example is a bit special: since there is no other dynamics we never get flow directly from one tank to the next - but only from/to the mass-flow. I can see the following possibilities for the check in OpenTank (well, its base-class):
On one hand using connector-sets seem more correct but:
|
Closes #3117 (see that ticket for more information).
This needs to be discussed in the group, but the main idea is to revert #178 and instead have annotations for indicating restrictions on connections.
For MSL (and other libraries) the change has two main benefits: