hi
I am a beginner in OpenMC, I work with on example in this code, i’m plotting the geometry, but I don’t know how to plot the neutron spectrum.?
thanks
Hi Josh, welcome to OpenMC,
you have two ways:
- Export data from OpenMC for NumPy format, More info @ http://mit-crpg.github.io/openmc/usersguide/processing.html
- Data Processing and Visualization; 4.2. Tally Visualization
But I could not manage to use it. (more on this thread: https://groups.google.com/forum/#!searchin/openmc-users/python/openmc-users/yWxhsJonLpA/NcQ6WSMvokUJ “Statepoint.py problem - OverflowError: Python int too large to convert to C long” )
- Setting-up tallies.xml. In the zip file in this thread there is such a file, in which I get the spectrum then in tallies.out https://groups.google.com/forum/#!topic/openmc-users/FCXN6alHcEY “source fixed”
Not so elegant, but it works. It is for a 69-energy group.
Have fun
Matheus
hi again
Can you give me any example in which you areplotting the geometry and the neutron spectrum. I can’t plotting the neutron spectrum but the geometry its ok
tank you
Hi Josh,
Matheus basically answered your question but I guess I will try to give a little more background where I can:
Since there are many different ways in which a user could want to interrogate the flux (and different reaction rates) in a problem, OpenMC tries not to make any assumptions about what the user wants. Therefore, to get out the flux, you have to set up your own tallies.xml file which essentially tells OpenMC what you want to know about the problem besides its eigenvalue. To learn how to set up your tallies.xml file, read over this portion of the documentation: http://mit-crpg.github.io/openmc/usersguide/input.html#tallies-specification-tallies-xml
Now, once you have successfully set up your tallies and run the problem to a sufficient number of histories to get the variance low enough, the most direct way for you to observe what you tallied is to either look at the tallies.out file, which is a text output file listing the tally scores in each bin. You can then manually input this data in to Excel, Gnumeric, GnuPlot, etc., to create plots. A more efficient way, however, is to use the statepoint file that was written at the end of your run and the statepoint.py python class to access the data. As Matheus said, a description of this can be found here: http://mit-crpg.github.io/openmc/usersguide/processing.html#tally-visualization
Finally, and this doesn’t really answer the question you asked but is still useful, take a look at using mesh-tallies (in the tallies documentation link i sent above). If you set up a mesh flux tally, you can most easily get a plottable flux over a spatial mesh by using the plot_mesh_tally.py GUI program provided in openmc/src/utils.
I hope this helps, let us know if you have any more questions,
Adam
Josh,
sorry, I was not clear. In the tallies.xml you specify which quantity - and how - they will be stored in the output file tallies.out. From there you get the result and you can plot them in excel, openoffice, matlab, python.
The neutron spectrum plotting is done after running the simulation and getting this data from tallies.out (or statepoint.py, which will be better, but I did not get into it)
Matheus