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

FastHVAC in OpenModelica - add "each" to unit definition #1055

Closed
jwalbrunn opened this issue Nov 26, 2020 · 3 comments · Fixed by #1168
Closed

FastHVAC in OpenModelica - add "each" to unit definition #1055

jwalbrunn opened this issue Nov 26, 2020 · 3 comments · Fixed by #1168
Assignees
Labels
FastHVAC All FastHVAC package related issues hackday Stale Won't be solved in the next time, e.g. because the assignee left the Institute

Comments

@jwalbrunn
Copy link

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:

  1. Open OMEdit
  2. Go to 'AixLib.FastHVAC.Examples.HeatGenerators.CHP' or 'AixLib.FastHVAC.Examples.Storage'
  3. Click on 'CHP' or 'BufferStorgaeVariablePorts'
  4. Try to check the model
  5. 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!

@DaJansenGit
Copy link
Member

Thanks for your detailed issue.
I just tested this and adding an each statement to the unit decleration is working fine in dymola also.

Could you please provide a pull request, where you added the each statements for the units and add me as reviewer? Thank you again!

@DaJansenGit DaJansenGit self-assigned this Nov 27, 2020
@MartinRaetz MartinRaetz added FastHVAC All FastHVAC package related issues Stale Won't be solved in the next time, e.g. because the assignee left the Institute labels Feb 4, 2021
@jnettels
Copy link
Contributor

jnettels commented Feb 17, 2021

I had already raised this errors in #938 and my solution 422e0f0 got merged into master with pr #939.
The only problem seems to be that the issue persists in the development branch. Would you be able to merge 422e0f0 into the development branch? Or is that not possible due to declaring FastHVAC obsolete?
Thanks for your time.

@DaJansenGit
Copy link
Member

@Maghnie thanks for having a look tomorrow.

@DaJansenGit DaJansenGit added this to the Hackday 10.2021 milestone Oct 20, 2021
@Maghnie Maghnie self-assigned this Oct 21, 2021
Maghnie added a commit that referenced this issue Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FastHVAC All FastHVAC package related issues hackday Stale Won't be solved in the next time, e.g. because the assignee left the Institute
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants