Closed shimwell closed 2 years ago
I'll look into it
When running these tests I am using the latest version of openmc. This could be the difference so I've made PR #65
Is it failing in the CI too? cause the config.yml file for circleci has openmc 0.12.2 https://github.com/fusion-energy/openmc-plasma-source/blob/15c2194c1f386bf60514dde6797545f6615a1605/.circleci/config.yml#L6
@shimwell it cannot be the openmc version cause the same behaviour was observed here https://github.com/fusion-energy/openmc-plasma-source/pull/63 and the openmc version was still 0.12.2
This is something else
I confirm that I reproduced the bug in the openmc/openmc:v0.12.2 docker image!
Little progress on the issue: the test fail when the densities
attribute of the TokamakSource
object is full of zero values.
Therefore, the neutron_source_density
attribute is also full of zeros, therefore it's sum is zero.
There's then a division by zero https://github.com/fusion-energy/openmc-plasma-source/blob/f5a24b6e320d4f9b1952bbd5b828507415a42348/openmc_plasma_source/tokamak_source.py#L241 which produces nan.
The bug only occurs with mode "H" sources
Just running the tests on the main or develop branch and I am seeing this error and getting one failing test