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

Incorrect initialization of mix_out in networks #130

Closed
MassimoCimmino opened this issue Jul 15, 2021 · 0 comments · Fixed by #131
Closed

Incorrect initialization of mix_out in networks #130

MassimoCimmino opened this issue Jul 15, 2021 · 0 comments · Fixed by #131
Assignees
Labels

Comments

@MassimoCimmino
Copy link
Owner

The initialization of _mix_out in Network._initialize_stored_coefficients() has incorrect shapes:

self._mixing_m_flow = np.empty(self.nInlets)
self._mix_out = np.empty((self.nBoreholes, 1))

The correct shape is (1, self.nBoreholes).

Also, using numpy.empty() can create problems since stored values are compared to check if calculation is necessary. numpy.empty() does not overwrite memory for the creation of the array and in some cases may present a realistic value for _mixing_m_flow at initialization while the _mix_out coefficient is incorrect. Their values should be overwritten with numpy.nan:

        self._mixing_m_flow = np.empty(self.nInlets)
        self._mixing_m_flow[:] = np.nan
        self._mix_out = np.empty((1, self.nBoreholes))
        self._mix_out[:] = np.nan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant