open-ideas / IDEAS

Modelica library allowing simultaneous transient simulation of thermal and electrical systems at both building and feeder level.
133 stars 58 forks source link

OpenModelica support IDEAS master #1328

Open b-mare opened 1 year ago

b-mare commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

The same error still occurs.

Mathadon commented 1 year ago

I think this is an OM issue. I created an issue here: https://github.com/OpenModelica/OpenModelica/issues/11373

jelgerjansen commented 1 year ago

@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 commented 1 year ago

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

f-beerlage commented 1 year ago

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 commented 1 year ago

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

jelgerjansen commented 11 months ago

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.