Page 1 of 1

Set axis range for plots

Posted: Wed Mar 11, 2020 5:12 pm
by ondrejch
Great work with Serpent Tools! I love it and recommend to everyone :-)

Is there an easy way to set axis range in the plot? For instance, how to set an arbitrary X and Y ranges in your example:

Code: Select all

res.plot('burnup', ['absKeff', 'colKeff'])
I tried some syntax from matplotlib, but to no avail. Thanks.

Re: Set axis range for plots

Posted: Wed Mar 11, 2020 6:28 pm
by ondrejch
It seems I figured it out. Either, while plotting, one can adjust one axis only:

Code: Select all

res.plot('burnup', ['absKeff', 'colKeff']).set_xlim([min,max])
res.plot('burnup', ['absKeff', 'colKeff']).set_ylim([min,max])
Or one can get the matplotlib.axes object, fix it up, and replot:

Code: Select all

fig=res.plot('burnup', ['absKeff', 'colKeff'])
fig.set_xlim([min,max])
fig.set_ylim([min,max])
fig.get_figure()

Material has no burnup

Posted: Wed Mar 11, 2020 7:20 pm
by ondrejch
For some reason when the material is selected, fuel=dep.materials['fuel0'], fuel.burnup is an array full of zeros, while fuel.days has the correct array of nonzero depletion steps.

This can be fixed by fuel.data['burnup'] = dep.metadata['burnup']

Re: Set axis range for plots

Posted: Wed Mar 11, 2020 8:53 pm
by drewejohnson
Ondrej,

Thank you for those nice words! I'm glad you find this a useful tool.

Per your first question, setting the axes limits is done through matplotlib, as you expressed. I think the second way,

Code: Select all

ax = r.plot('burnup', ['absKeff', 'colKeff'])
ax.set_ylim(...)
ax.set_xlim(...)
would be the best. It avoids redundant calls to the plot method.

Per the second item, this is most suspicious. Can you provide me with the following information:
  • serpentTools version from "serpentTools.__version__"
  • serpent version
  • python version
and I will take a look. I will need some more information to try and reproduce, as I don't encounter this issue on my end (using 0.9.2).

Best regards,

Andrew

Re: Set axis range for plots

Posted: Thu Mar 12, 2020 7:29 am
by ondrejch
Thanks Andrew for your reply.

Serpent tools:

Code: Select all

In [62]: serpentTools.__version__
Out[62]: '0.9.2'
Serpent is Version 2.1.31

Python (in spyder3)

Code: Select all

Python 3.7.5 (default, Nov 20 2019, 09:21:52)
IPython 5.8.0 -- An enhanced Interactive Python.

Re: Set axis range for plots

Posted: Thu Mar 12, 2020 3:30 pm
by ondrejch
Here is the example: https://msr.ne.utk.edu/~o/test_dep.m

Code: Select all

fd=serpentTools.read("test_dep.m")
s=fd.materials['salt']
s.plot('burnup','adens',names=['U235','Pu239'])

Re: Set axis range for plots

Posted: Fri Mar 13, 2020 1:08 pm
by drewejohnson
Thank you for providing the test file.
If you look at the salt's burnup with

Code: Select all

grep MAT_salt_BURNUP test_dep.m
you see an array of zeros present in the file. This is most curious.

My best guess as to why the salt has zero burnup would be that it's specific power (MW/kgHM) is zero. The fact that the salt contains fissile isotopes which should contribute to power production and heavy metal mass would go contrary to that. I wonder if it is due to some of the MSR refueling / material inventory mechanics (assuming this is indeed an MSR model)

Re: Set axis range for plots

Posted: Sat Mar 14, 2020 5:23 am
by ondrejch
Interesting. The salt is burned, its volume is set, and the only processing is an off-gas. I will email Jaakko.

Re: Set axis range for plots

Posted: Mon Mar 16, 2020 7:36 pm
by Jaakko Leppänen
Are these materials that are not part of the geometry? Could it just be that burnup is not passed with the mass flows (I can't think how it could even be calculated). Are the material densities reasonable?

Re: Set axis range for plots

Posted: Tue Mar 17, 2020 7:30 pm
by ondrejch
Jaakko, they are a part of geometry, everything is +- reasonable. I emailed you the input file.