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

CDL.Utilities.SunRiseSet has NaN in OpenModelica #2835

Closed
mwetter opened this issue Jan 4, 2022 · 0 comments · Fixed by #2836
Closed

CDL.Utilities.SunRiseSet has NaN in OpenModelica #2835

mwetter opened this issue Jan 4, 2022 · 0 comments · Fixed by #2836
Assignees
Milestone

Comments

@mwetter
Copy link
Member

mwetter commented Jan 4, 2022

The block CDL.Utilities.SunRiseSet produces NaN in OpenModelica.
The reason is that it uses a variable timDif at

which is declared inside a function but never initialized. This function is declared inside a block that also has a variable of the same type and name. Dymola picks the value of the outer definition and hence produces the right result, while OpenModelica -- probably correctly -- assumes this is a local variable, but then has NaN because it is never initialized.

This issue is to propagate this variable as an input argument.

Moreover, the function sunSet and sunRise have variables of the same name (sunSet and sunRise). While legal in Modelica, this is confusing. Therefore, these functions will be renamed.

As all code changes is in protected functions and variables, this change is backwards compatible.

@mwetter mwetter added this to the Release 9.0 milestone Jan 4, 2022
@mwetter mwetter self-assigned this Jan 4, 2022
mwetter added a commit that referenced this issue Jan 7, 2022
* Changed implementation to avoid NaN in OpenModelica.

For #2835

* Set BuildingsPy hash to same version as in .travis.yml

* Updated reference results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
OpenBuildingControl
  
Awaiting triage
Development

Successfully merging a pull request may close this issue.

1 participant