This repo contains python modules and scripts that help managing MCNP simulations and outputs.
To easily plot MCNP data the script scripts > TallyRead.py reads MCTAL files, and generates the directory mOut containing a file for each implemented MCNP tally. These files are called by their tally name and contain the results separated in 6 columns:
- cell number
- segment number
- cosine value
- energy value
- tally output
- tally error
These files are easily imported with numpy into a python script and subsequently plotted with matplotlib or other plotting libraries.
The script generates the output directory in the same directory of the MCTAL file, to execute the script type:
./TallyRead.py ~/PATH/TO/MCTAL
NOTE: it is necessary to define the path of the input starting from the home (~) directory.
To install jupyter notebook please refer to the installation guide.
The Jupyter notebook example is in example > JupyterNotebook, in that directory there is an MCNP input file mcnp.inp and the MCTAL output file mcnp.inpm. This latter file was read by ./TallyRead.py into the example > JupyterNotebook > mOut > f2 file which can be easily used to plot data through the notebook. for more detail open the notebook.
- WriteTally.py -> An example script that uses Gen.Tally module to write a surface current tally
- WriteSDEF.py -> An example script that uses Gen.SDEF modulte to write an MCNP SDEF source
- readMCTAL.sh -> Bash script that uses the python module mc-tools to extract tally data into separate files.
- Python versione > 3.0
- numpy
- matplotlib
- mc-tools