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

OpenModelica support IDEAS master #1328

Open
b-mare opened this issue Oct 10, 2023 · 9 comments
Open

OpenModelica support IDEAS master #1328

b-mare opened this issue Oct 10, 2023 · 9 comments

Comments

@b-mare
Copy link

b-mare commented Oct 10, 2023

Hi,

I tried IDEAS with OpenModelica but ran into errors with the current master version of IDEAS.

I am using OpenModelica 1.23.0~dev-56-g74cc85c on WSL2 and am trying to simulate IDEAS.Examples.Tutorial.Example1

IDEAS release 3.0.0
Loading model

Warnings [3] 08:28:39 Translation Warning [IDEAS.BoundaryConditions.Interfaces.PartialSimInfoManager: 151:3-154:55]: Connector weaBus is not balanced: The number of potential variables (20) is not equal to the number of flow variables (0).

[4] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.Interfaces.PartialZone: 195:3-207:27]: Connector propsBusInt is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[5] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.Zone: 6:3-18:28]: Connector propsBus is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[6] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.Interfaces.PartialSurface: 55:3-69:26]: Connector propsBus_a is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[7] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator: 8:3-16:27]: Connector propsBus_a is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[8] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator: 18:3-26:26]: Connector propsBus_b is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[9] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.Interfaces.PartialSurface: 145:3-157:26]: Connector propsBusInt is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[10] 08:28:39 Translation Warning
[IDEAS.Buildings.Components.InternalWall: 69:3-82:27]: Connector propsBus_b is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

Errors

[11] 08:28:39 Translation Error
[IDEAS.BoundaryConditions.WeatherData.ReaderTMY3: 880:29-947:86]: Variable weaBus.TDryBul not found in scope ReaderTMY3.

[12] 08:28:39 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS 3.0.0/Buildings/Components/InterzonalAirFlow/BaseClasses/PartialInterzonalAirFlow.mo:68:65-118:24:writable] Error: Variable allowFlowReversal not found in scope PartialInterzonalAirFlow.

[13] 08:28:39 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS 3.0.0/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/ExteriorConvection.mo:9:24-9:40:writable] Error: Variable linearize not found in scope ExteriorConvection.

[14] 08:28:39 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS 3.0.0/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/ExteriorConvection.mo:9:24-9:40:writable] Error: Variable linearize not found in scope ExteriorConvection.

[15] 08:28:39 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS 3.0.0/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/ExteriorConvection.mo:9:24-9:40:writable] Error: Variable linearize not found in scope ExteriorConvection.

[16] 08:28:39 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS 3.0.0/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/ExteriorConvection.mo:9:24-9:40:writable] Error: Variable linearize not found in scope ExteriorConvection.

[17] 08:28:40 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS 3.0.0/Buildings/Components/BaseClasses/ConvectiveHeatTransfer/ExteriorConvection.mo:9:24-9:40:writable] Error: Variable linearize not found in scope ExteriorConvection.

Simulating model

Warnings

[4] 08:40:19 Translation Warning
[IDEAS.BoundaryConditions.Interfaces.PartialSimInfoManager: 151:3-154:55]: Connector weaBus is not balanced: The number of potential variables (20) is not equal to the number of flow variables (0).

[5] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.InterzonalAirFlow.BaseClasses.PartialInterzonalAirFlowBoundary: 21:3-22:72]: Connector weaBus is not balanced: The number of potential variables (20) is not equal to the number of flow variables (0).

[6] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.Interfaces.PartialZone: 195:3-207:27]: Connector propsBusInt is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[7] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.Zone: 6:3-18:28]: Connector propsBus is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[8] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.Interfaces.PartialSurface: 55:3-69:26]: Connector propsBus_a is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[9] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator: 8:3-16:27]: Connector propsBus_a is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[10] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator: 18:3-26:26]: Connector propsBus_b is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[11] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.Interfaces.PartialSurface: 145:3-157:26]: Connector propsBusInt is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[12] 08:40:19 Translation Warning
[IDEAS.Buildings.Components.InternalWall: 69:3-82:27]: Connector propsBus_b is not balanced: The number of potential variables (10) is not equal to the number of flow variables (0).

[13] 08:40:19 Symbolic Warning
The model contains alias variables with redundant start and/or conflicting nominal values. It is recommended to resolve the conflicts, because otherwise the system could be hard to solve. To print the conflicting alias sets and the chosen candidates please use -d=aliasConflicts.

Errors [14] 08:40:23 Scripting Error Error parsing unit degree: Unit not found

Despite the warnings and errors, I can still simulate the model. However, I haven't verified whether the results are correct.

IDEAS master version
Loading model

Warnings

[15] 08:43:37 Translation Warning
[Modelica.Thermal.HeatTransfer.Interfaces.HeatPort: 3:3-3:38]: Connector T is not balanced: The number of potential variables (1) is not equal to the number of flow variables (0).

[16] 08:43:37 Translation Warning
[Modelica.Thermal.HeatTransfer.Interfaces.HeatPort: 4:3-5:75]: Connector Q_flow is not balanced: The number of potential variables (0) is not equal to the number of flow variables (1).

Errors

[17] 08:43:37 Translation Error
[IDEAS.BoundaryConditions.WeatherData.ReaderTMY3: 880:29-947:86]: Variable weaBus.TDryBul not found in scope ReaderTMY3.

[18] 08:43:37 Scripting Error
[/home/bmare/.openmodelica/libraries/IDEAS/IDEAS/Buildings/Components/InterzonalAirFlow/BaseClasses/PartialInterzonalAirFlow.mo:68:65-118:24:writable] Error: Variable allowFlowReversal not found in scope PartialInterzonalAirFlow.

Simulating model

Warnings

[3] 08:44:29 Translation Warning
[Modelica.Thermal.HeatTransfer.Interfaces.HeatPort: 3:3-3:38]: Connector T is not balanced: The number of potential variables (1) is not equal to the number of flow variables (0).

[4] 08:44:29 Translation Warning
[Modelica.Thermal.HeatTransfer.Interfaces.HeatPort: 4:3-5:75]: Connector Q_flow is not balanced: The number of potential variables (0) is not equal to the number of flow variables (1).

Errors

[1] 08:44:29 Translation Error
[/var/lib/jenkins/ws/LINUX_BUILDS/tmp.build/openmodelica-1.23.0~dev-56-g74cc85c/OMCompiler/Compiler/NFFrontEnd/NFConnection.mo: 134:7-136:109]: Internal error NFConnection.checkBalance got unbalanced connection connect(sim.weaBus, zone.ligCtr.weaBus):
lhs: {sim.weaBus.CEnv, sim.weaBus.F1, sim.weaBus.F2, sim.weaBus.TGroundDes, sim.weaBus.Tdes, sim.weaBus.Te, sim.weaBus.TePow4, sim.weaBus.TskyPow4, sim.weaBus.Va, sim.weaBus.Vdir, sim.weaBus.X_wEnv, sim.weaBus.angDec, sim.weaBus.angHou, sim.weaBus.angZen, sim.weaBus.dummy, sim.weaBus.phi, sim.weaBus.solBus.HDirTil, sim.weaBus.solBus.HGroDifTil, sim.weaBus.solBus.HSkyDifTil, sim.weaBus.solBus.Tenv, sim.weaBus.solBus.angAzi, sim.weaBus.solBus.angInc, sim.weaBus.solBus.angZen, sim.weaBus.solBus.hForcedConExt, sim.weaBus.solDifHor, sim.weaBus.solDirPer, sim.weaBus.solGloHor, sim.weaBus.solTim}
rhs: {zone.ligCtr.weaBus.CEnv, zone.ligCtr.weaBus.F1, zone.ligCtr.weaBus.F2, zone.ligCtr.weaBus.TGroundDes, zone.ligCtr.weaBus.Tdes, zone.ligCtr.weaBus.Te, zone.ligCtr.weaBus.TePow4, zone.ligCtr.weaBus.TskyPow4, zone.ligCtr.weaBus.Va, zone.ligCtr.weaBus.Vdir, zone.ligCtr.weaBus.X_wEnv, zone.ligCtr.weaBus.angDec, zone.ligCtr.weaBus.angHou, zone.ligCtr.weaBus.angZen, zone.ligCtr.weaBus.dummy, zone.ligCtr.weaBus.phi, zone.ligCtr.weaBus.solDifHor, zone.ligCtr.weaBus.solDirPer, zone.ligCtr.weaBus.solGloHor, zone.ligCtr.weaBus.solTim}

The bottom line is that the 'solBus' is not present in the 'zone.ligCtr.weaBus'. I've taken a look at it myself, but at first glance, I can't pinpoint exactly where it's going wrong. Can you investigate where it's going wrong so that support for OpenModelica can be restored.

Kind regards

@icupeiro
Copy link
Member

icupeiro commented Oct 12, 2023

The following error appears when trying to simulate IDEAS.Buildings.Components.Examples.RectangularZoneEmbedded using OpenModelica 1.23.0-dev-57-ga4768e8 and OMSimulator 2.1.1~241-g54ebbdc-linux-notlm-debug

[6] 13:28:05 Translation Warning
[Modelica.Thermal.HeatTransfer.Interfaces.HeatPort: 3:3-3:38]: [Connector T is not balanced: The number of potential variables (1) is not equal to the number of flow variables (0).](omeditmessagesbrowser:///Modelica.Thermal.HeatTransfer.Interfaces.HeatPort?lineNumber=3)

[7] 13:28:05 Translation Warning
[Modelica.Thermal.HeatTransfer.Interfaces.HeatPort: 4:3-5:75]: [Connector Q_flow is not balanced: The number of potential variables (0) is not equal to the number of flow variables (1).](omeditmessagesbrowser:///Modelica.Thermal.HeatTransfer.Interfaces.HeatPort?lineNumber=4)

[8] 13:28:05 Translation Error
[/var/lib/jenkins3/ws/LINUX_BUILDS/tmp.build/openmodelica-1.23.0~dev-57-ga4768e8/OMCompiler/Compiler/NFFrontEnd/NFConnection.mo: 134:7-136:109]: Internal error NFConnection.checkBalance got unbalanced connection connect(sim.weaBus, zone.ligCtr.weaBus):
  lhs: {sim.weaBus.CEnv, sim.weaBus.F1, sim.weaBus.F2, sim.weaBus.TGroundDes, sim.weaBus.Tdes, sim.weaBus.Te, sim.weaBus.TePow4, sim.weaBus.TskyPow4, sim.weaBus.Va, sim.weaBus.Vdir, sim.weaBus.X_wEnv, sim.weaBus.angDec, sim.weaBus.angHou, sim.weaBus.angZen, sim.weaBus.dummy, sim.weaBus.phi, sim.weaBus.solBus.HDirTil, sim.weaBus.solBus.HGroDifTil, sim.weaBus.solBus.HSkyDifTil, sim.weaBus.solBus.Tenv, sim.weaBus.solBus.angAzi, sim.weaBus.solBus.angInc, sim.weaBus.solBus.angZen, sim.weaBus.solBus.hForcedConExt, sim.weaBus.solDifHor, sim.weaBus.solDirPer, sim.weaBus.solGloHor, sim.weaBus.solTim}
  rhs: {zone.ligCtr.weaBus.CEnv, zone.ligCtr.weaBus.F1, zone.ligCtr.weaBus.F2, zone.ligCtr.weaBus.TGroundDes, zone.ligCtr.weaBus.Tdes, zone.ligCtr.weaBus.Te, zone.ligCtr.weaBus.TePow4, zone.ligCtr.weaBus.TskyPow4, zone.ligCtr.weaBus.Va, zone.ligCtr.weaBus.Vdir, zone.ligCtr.weaBus.X_wEnv, zone.ligCtr.weaBus.angDec, zone.ligCtr.weaBus.angHou, zone.ligCtr.weaBus.angZen, zone.ligCtr.weaBus.dummy, zone.ligCtr.weaBus.phi, zone.ligCtr.weaBus.solDifHor, zone.ligCtr.weaBus.solDirPer, zone.ligCtr.weaBus.solGloHor, zone.ligCtr.weaBus.solTim}

@Mathadon
Copy link
Member

Francesco Casella (from the OpenModelica consortium) mentioned yesterday that OMEdit version 1.22beta3 will be released soon and that we should give that version a try. I see that in the meantime even a beta4 version exists: https://github.com/OpenModelica/OpenModelica/releases/tag/v1.22.0-dev.beta.4
I'll have a look whether I can compile that on my machine.

@Mathadon
Copy link
Member

The same error still occurs.

@Mathadon
Copy link
Member

Mathadon commented Oct 13, 2023

I think this is an OM issue. I created an issue here: OpenModelica/OpenModelica#11373

@jelgerjansen
Copy link
Contributor

@icupeiro the fact that you get this error now is due to the changes in PR #1318, which was implemented to comply with the Modelica language.
@Mathadon I thought it was an IDEAS issue because the pedantic check in Dymola also triggers errors, so I was thinking again of a violation of the Modelica language, but it might indeed be an OM problem. Thank you for creating the issue!

@b-mare, @icupeiro the error should disappear if you remove the expendable which was added in PR #1318, so this could be an intermediate solution.

@b-mare
Copy link
Author

b-mare commented Oct 17, 2023

Indeed removing the expandable bus connectors fixes the issue for now.
Hopefully the issue can be resolved at OM.

@f-beerlage
Copy link

I would like to add one more point. The examples do not currently work in OpenModelica. I haven't tried them all but example 1, 8, 9 and Heating don't work. Maybe more. I do use OM version 1.21

Number of classes checked / failed: 1/1 (After checking)

Errors:
[1] 09:39:55 Translation Error
[C:/OM121/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFConnection.mo: 134:7-136:109]: Internal error NFConnection.checkBalance got unbalanced connection connect(sim.weaBus, zone.ligCtr.weaBus):
lhs: {sim.weaBus.CEnv, sim.weaBus.F1, sim.weaBus.F2, sim.weaBus.TGroundDes, sim.weaBus.Tdes, sim.weaBus.Te, sim.weaBus.TePow4, sim.weaBus.TskyPow4, sim.weaBus.Va, sim.weaBus.Vdir, sim.weaBus.X_wEnv, sim.weaBus.angDec, sim.weaBus.angHou, sim.weaBus.angZen, sim.weaBus.dummy, sim.weaBus.phi, sim.weaBus.solBus.HDirTil, sim.weaBus.solBus.HGroDifTil, sim.weaBus.solBus.HSkyDifTil, sim.weaBus.solBus.Tenv, sim.weaBus.solBus.angAzi, sim.weaBus.solBus.angInc, sim.weaBus.solBus.angZen, sim.weaBus.solBus.hForcedConExt, sim.weaBus.solDifHor, sim.weaBus.solDirPer, sim.weaBus.solGloHor, sim.weaBus.solTim}
rhs: {zone.ligCtr.weaBus.CEnv, zone.ligCtr.weaBus.F1, zone.ligCtr.weaBus.F2, zone.ligCtr.weaBus.TGroundDes, zone.ligCtr.weaBus.Tdes, zone.ligCtr.weaBus.Te, zone.ligCtr.weaBus.TePow4, zone.ligCtr.weaBus.TskyPow4, zone.ligCtr.weaBus.Va, zone.ligCtr.weaBus.Vdir, zone.ligCtr.weaBus.X_wEnv, zone.ligCtr.weaBus.angDec, zone.ligCtr.weaBus.angHou, zone.ligCtr.weaBus.angZen, zone.ligCtr.weaBus.dummy, zone.ligCtr.weaBus.phi, zone.ligCtr.weaBus.solDifHor, zone.ligCtr.weaBus.solDirPer, zone.ligCtr.weaBus.solGloHor, zone.ligCtr.weaBus.solTim}

@jelgerjansen
Copy link
Contributor

jelgerjansen commented Oct 25, 2023

@f-beerlage this is an OM problem for which we created an issue: OpenModelica/OpenModelica#11373.
Using an older IDEAS version (commit a75d2b0 to be precise) should solve the problem for now. Please let me know if that didn't solve your errors.

jelgerjansen added a commit that referenced this issue Dec 7, 2023
@jelgerjansen
Copy link
Contributor

While waiting for a fix from OM to solve this issue, I created a temporary branch BOPTEST that I will keep up to date with the latest changes in the master branch.

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

No branches or pull requests

5 participants