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

PartialMedium.Input* connectors should use Medium. types, not SI. #4005

Open
bilderbuchi opened this issue Jun 28, 2022 · 0 comments
Open

PartialMedium.Input* connectors should use Medium. types, not SI. #4005

bilderbuchi opened this issue Jun 28, 2022 · 0 comments
Assignees
Labels
L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation)

Comments

@bilderbuchi
Copy link

bilderbuchi commented Jun 28, 2022

Observed problem

I tried to trace a puzzling inconsistency in nominal pressure values in a model.

To demonstrate, e.g. simulate Modelica.Fluid.Examples.PumpingSystem (MSL 4.0.0) with warnings for aliases with conflicting values activated (e.g. OpenModelica -d=aliasConflicts)
I am seeing, among other warnings, this:

Translation Warning
Alias set with conflicting nominal values

  • Candidate: pumps.medium.sat.psat(nominal = 1000000.0, confidence number = 9)
  • Candidate: pumps.heatTransfer.states[1].p(nominal = 1000000.0, confidence number = 9)
  • Candidate: pumps.monitoring.state.p(nominal = 1000000.0, confidence number = 9)
  • Candidate: pumps.medium.state.p(nominal = 1000000.0, confidence number = 9)
  • Candidate: pipe.flowModel.states[1].p(nominal = 1000000.0, confidence number = 9)
  • Candidate: pipe.port_a.p(nominal = 1000000.0, confidence number = 8)
  • Candidate: pumps.port_b.p(nominal = 1000000.0, confidence number = 8)
  • Candidate: pumps.medium.p(nominal = 100000.0, confidence number = 8)
    => Select value from pumps.medium.p(nominal = 100000.0) for variable: pumps.medium.p

I emphasized the only nominal value that is in disagreement, for pumps.medium.p.

Expected behaviour

Avoid conflicting values that need resolution when using MSL models.

Analysis

I traced this back (I think) to the fact that in Modelica.Media.Interfaces.PartialMedium.BaseProperties here, we have

connector InputAbsolutePressure = input SI.AbsolutePressure
      "Pressure as input signal connector";

which is used to define p for a medium: InputAbsolutePressure p "Absolute pressure of medium";

The difference becomes visible when concrete Medium models (in this case Modelica.Media.Water.StandardWaterOnePhase) define their AbsolutePressure with a nominal value different from SI.AbsolutePressure.

Proposed resolution

I think the connector definition in PartialMedium should use the AbsolutePressure type already available within it (via the extends Modelica.Media.Interfaces.Types;) instead of the one from SI:

connector InputAbsolutePressure = input AbsolutePressure
      "Pressure as input signal connector";

The same approach is probably valid for other SI.-prefixed types used, like InputSpecificEnthalpy. I suspect that could solve a lot of the other present alias conflicts, but I have not done any investigation on that.

@beutlich beutlich added the L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation) label Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Fluid Issue addresses Modelica.Fluid (excl. Dissipation)
Projects
None yet
Development

No branches or pull requests

4 participants