openmc-dev / plotter

Native plotting GUI for model design and verification
MIT License
46 stars 18 forks source link

error when material density < 1 #95

Closed LukeLabrie closed 3 months ago

LukeLabrie commented 2 years ago

when I run openmc-plotter, if any material in my materials.xml file has a density < 1.0 g/cm3, I get

 ERROR: Need to specify a positive density on material [material_id]

I first noticed on a helium material (density on the order of 1e-4 g/cm3), but while debugging I noticed that I still get it even at 0.99 g/cm3, but not at 1.0 g/cm3. Not sure if this is by design perhaps.

pshriwise commented 2 years ago

Hi @LukeLabrie,

Thanks for reporting this! It's definitely not intended behavior. I tried changing a couple of material densities in my model, but I didn't see this error show up. Could you let us know what version of the plotter you're using when you have a chance?

LukeLabrie commented 2 years ago

Hi @pshriwise , apologies for the late response. I'm actually having a hard time figuring that out. Tried openmc-plotter --version, and tried clicking around the GUI a little bit. Where can I see the version?

To install initially I just used pip install openmc-plotter

pshriwise commented 2 years ago

Hrmmm you're right @LukeLabrie. There isn't an easy way to get that info once you've installed the tool. I've just added an option for that in #98. That might not help us here though. I think you'll need to reinstall and look through the output of the pip install command to find the version number of the package. Sorry about that.

pshriwise commented 2 years ago

@LukeLabrie are you still having problems with this?

LukeLabrie commented 2 years ago

Hi @pshriwise, I uninstalled and reinstalled. Looks like I have version 0.2.0

Installing collected packages: openmc-plotter
Successfully installed openmc-plotter-0.2.0

I still run into the same issue:

 Reading settings XML file...
 Reading cross sections XML file...
 Reading materials XML file...
 ERROR: Need to specify a positive density on material 7.
QObject::~QObject: Timers cannot be stopped from another thread

Here is the .xml entry for reference:

  </material>
  <material id="7" name="helium" temperature="911.15">
    <density units="g/cm3" value="0.00103" />
    <nuclide ao="2e-06" name="He3" />
    <nuclide ao="0.999998" name="He4" />
pshriwise commented 2 years ago

I'm still having trouble reproducing this... The type of error you're seeing looks like it's coming from the OpenMC executable itself. Is it the case that you can run this model, but you cannot view it in the plotter?

LukeLabrie commented 2 years ago

Yes and no. I can run the model but it fails due to lost neutrons. Was hoping to use the plotter to identify overlaps, which I can as long as I go in and raise the densities where needed.

letibdesneiges commented 1 year ago

Hi,

I encountered the same problem with a model containing air with a density of 1.293e-3 g/cm3. It request a density >0. Changing the density in the xml file to >=1 g/cm3 fixed it and openmc-plotter launched without error.

Attached the model.xml file causing the problem on my side. model.xml.zip

openmc-plotter 0.3.1 installed via conda on Debian 11.

paulromano commented 1 year ago

@letibdesneiges Very strange -- when I throw your model into the plotter on my end, I don't get any such error :confused: I also tried installing the plotter through conda-forge and still no problems.

letibdesneiges commented 1 year ago

@paulromano Yes, I tried again with a fresh conda install using python 3.10 (the previous one was with python 3.9). Still the same problem with the xml file linked above. Here is a screenshot of the error while loading. The same file can be used by openmc. Could it be encoding or locale related ?

Screenshot 2023-04-11 at 21 50 33
paulromano commented 1 year ago

@letibdesneiges That's an interesting hypothesis and could explain why you are seeing it but not me. If you try to run OpenMC using this model, do you get the same error about positive density, or does this only occur when you load the model in the plotter?

shimwell commented 1 year ago

I sat in the adjacent seat at the NEA and can confirm this bug only occurred when plotting with the plotter. The model ran fine with openmc and produced nice mesh tally plots. I also saw the changes to the XML file and the plotter working afterwards

paulromano commented 3 months ago

This same issue was discussed in #124 and already resolved