FastHVAC in OpenModelica - add "each" to unit definition
Created by: jwalbrunn
Hi,
Describe the bug There is a - hopefully - small bug in AixLib using OpenModelica. If you try to simulate different examples like CHP an error appears: _[AixLib.FastHVAC.Components.HeatGenerators.CHP.CHP_PT1: 82:5-88:28]: Non-array modification ‘"J"‘ for array component ‘unit‘, possibly due to missing ‘each‘.
[AixLib.FastHVAC.Components.HeatGenerators.CHP.CHP_PT1: 91:5-96:27]: Non-array modification ‘"W"‘ for array component ‘unit‘, possibly due to missing ‘each‘._
A similar one at BufferStorageVariablePorts: [AixLib.FastHVAC.Components.Storage.HeatStorageVariablePorts: 162:3-169:26]: Non-array modification ‘"K"‘ for array component ‘unit‘, possibly due to missing ‘each‘.
To Reproduce Steps to reproduce the behavior:
- Open OMEdit
- Go to 'AixLib.FastHVAC.Examples.HeatGenerators.CHP' or 'AixLib.FastHVAC.Examples.Storage'
- Click on 'CHP' or 'BufferStorgaeVariablePorts'
- Try to check the model
- See error
Expected behavior The check should be successful.
Bugfix First I just deleted the declaration in the code (unit = "K"), (unit = "W") and (unit = "J") but that is not the way it should go! If you put an 'each' into the declaration the error disapears.
(unit = "K") ---> (each unit = "K") (unit = "W") ---> (each unit = "W") (unit = "J") ---> (each unit = "J")
I hope that this solution has no effect on the behaviour in Dymola.
Desktop: I am using the following specifications
- OpenModelica OMEdit 1.16.1
- AixLib 0.10.7
- Linux and Windows
Additional context If you change the code in CHP and Storage could you please check if there are other components I did not check?
I hope my issue is useful.
Thanks for your effort!