You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.BasePropertieshere, 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.
The text was updated successfully, but these errors were encountered:
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
=> 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 havewhich 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 theirAbsolutePressure
with a nominal value different fromSI.AbsolutePressure
.Proposed resolution
I think the connector definition in
PartialMedium
should use theAbsolutePressure
type already available within it (via theextends Modelica.Media.Interfaces.Types;
) instead of the one fromSI
:The same approach is probably valid for other
SI.
-prefixed types used, likeInputSpecificEnthalpy
. I suspect that could solve a lot of the other present alias conflicts, but I have not done any investigation on that.The text was updated successfully, but these errors were encountered: