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

Special rule for protected connectors? #3347

Closed
eshmoylova opened this issue Mar 13, 2023 · 2 comments · Fixed by #3356
Closed

Special rule for protected connectors? #3347

eshmoylova opened this issue Mar 13, 2023 · 2 comments · Fixed by #3356
Labels
bug Something isn't working

Comments

@eshmoylova
Copy link
Member

I found this model in the Buildings library. In the protected section it has the following connector:

  Buildings.Fluid.FMI.Interfaces.FluidProperties bacPro_internal(
    redeclare final package Medium = Medium)...;

[FluidProperties](https://github.com/lbl-srg/modelica-buildings/blob/master/Buildings/Fluid/FMI/Interfaces/FluidProperties.mo) is a connector containing another connector:

  Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w...;

MassFractionConnector is in turn defined as:

connector MassFractionConnector =
  Modelica.Units.SI.MassFraction...;

This connector is then used as:

  connect(bacPro_internal.X_w, X_wZon_internal);

where X_wZon_internal is declared as an output (also protected):

  Modelica.Blocks.Interfaces.RealOutput X_wZon_internal(
    final unit="kg/kg")

So, we have non-causal connector connected to an output. MapleSim rejects this model (and any model containing it as component) for that reason. One of the models that uses it, for example, is Buildings.Fluid.FMI.Conversion.Validation.AirToOutlet. It is marked as a simulation model and has a Dymola script. So, I'm assuming it works in Dymola.

I wonder if that means that connector restrictions do not apply to protected connectors?

@eshmoylova eshmoylova added bug Something isn't working CI Issue that addresses continuous integration labels Mar 15, 2023
@HansOlsson HansOlsson removed the CI Issue that addresses continuous integration label Mar 15, 2023
@HansOlsson
Copy link
Collaborator

Design meeting.

There seems to be two solutions:

  • Update the library
  • Change the rules to make an exception for some connectors:
    • If neither have causal parts nor flow we allow the connector class (for balancing), and require that we add input/output when using it
    • Additionally for protected connector component we allow it without input/output

@HansOlsson
Copy link
Collaborator

Seems that some tools (e.g., Dymola 2023) have such a special rule for protected connectors.

HansOlsson added a commit to HansOlsson/ModelicaSpecification that referenced this issue Apr 5, 2023
HansOlsson added a commit that referenced this issue Apr 18, 2023
* Describe a new concept "simple connector" that is not balanced.
Proposal to resolve #3347
Closes #3347

Co-authored-by: Elena Shmoylova <eshmoylova@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants