thorade / HelmholtzMedia

Modelica library for the calculation of fluid properties from a Helmholtz energy equation of state (EoS).
BSD 3-Clause "New" or "Revised" License
35 stars 16 forks source link

Use of uninitialized variable in expression #38

Closed casella closed 4 years ago

casella commented 4 years ago

In this line

https://github.com/thorade/HelmholtzMedia/blob/7b867a59b0556b443b2ad463bf3d21d9e1d5537d/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/dynamicViscosity_residual.mo#L113

partial values are accumulated into eta_r while executing a for loop. Unfortunately eta_r is uninitialized, so according to Section 12.4.4 this model seems to be invalid.

I would recommend to add an initialization statement eta_r :=0 before entering the for loop.