On this page
Worked examples
A significant feature of Attila4MC is the ability to provide visualization of output from MCNP calculations. Providing meaningful data is important to gain understanding of phenomena, especially those that cannot be seen such as radiation. The unstructured mesh input in Attila4MC allows for complex geometries to be easily incorporated into MCNP models. Additionally, the program can be used to generate elemental edits or EEOUT files that can be interpreted by TecPlot or other software programs, such as Paraview. As presented in Example 9.3, the creation of the elemental edits simply involves the user creating the tally under the Custom Reports panel during the calculation setup. This process is the same whether it is an analog fixed-source, or CADIS problem. Once created, MCNP will write an EEOUT file that contains the data necessary for the plotting program to interpret and generate a variety of visualization products.
In Section 9.6, we introduced the basic visualization of the contour surface plot of the EEOUT file on our model. This process can be modified to adjust the response from the given dose per source particle to dose per hour. The calculation of the multiplier was described in Section 9.4 as it applied to a single tally. For the elemental edits, there is not an option to add a tally multiplier when setting up the report. However, the user can modify the results of the elemental edits in Tecplot. The standard output for our tank model for a contour plot is presented in Figure 9.11.

To add the tally multiplier, the user can open up the Data Set information window and see that the variable 7 is unused as shown in Figure 9.12.

Using the Data – Alter – Specify Equations option, the user can declare that variable 7 is equal to variable 4 times a multiplier using the annotation shown in Figure 9.13. After selecting, Compute, the values in variable 7 will now reflect the F4 tally multiplied by the tally multiplier in the equation. In this example, the multiplier was 3.6E10. The user will need to calculate the proper tally multiplier based on the actual source strength as described in Section 9.4.

After V7 is calculated, the plot can be adjusted by selecting V7 as the source for the data, changing the title for the data set from V7 to Dose (mrem/hour), and adjusting the contour levels as we did in the previous examples. The result is a plot of the dose rate shown in Figure 9.14.

Other useful visual outputs from TecPlot include the plotting of particle tracks, performing animation of contour slices, and creating iso-surface animations. Example 9.7 describes the steps for creating particle tracks, while Example 9.8 introduces the animation of contour slices and iso-surface animations from our tank and berm problem. More detailed examples are provided in the video tutorials linked at the end of the chapter.
Example 9.7
Using the tank example problem, plot the particle tracks from the source.
Solution: To start with the plotting of particle tracks, the original calculation will need to be edited and re-ran. Right-click on the initial model with the gamma source and select Duplicate.

Right-click the newly created calculation and select Edit and change the Input Name under General. The only other significant change will be under the MCNP Controls panel. Change the number of histories down to 1E4 to reduce the number of tracks presented. MCNP will run a PTRAC model only on a single processor so it will take too long at 1E6 and provide excess data. Check to select Write PTRAC File and have a maximum events of 10000 and check Write All Particle Parameters and Include Particle Tracks to Tecplot. Save model and select Run MCNP! Check on Continue when the warning message appears.

Once the run is complete, click on the arrow next to the name of the calculation to expand the names of the supporting files and then right-click on the Tecplot and select View. After you orient the plot by rotating it to the appropriate XYZ rotation, select Mesh and you will see the PTRAC data as all black lines.

To color the particles by energy, select the Details button next to the Contour option and pull down PTRAC_ ENERGY from the particle variables window, select 1 and close the menu.

Now select the Zone Style button and go to the Mesh tab. Select all the zones that start with PTRAC. You can click on the first and then hold the shift key while moving the mouse to the end Right-click under Mesh Color and select Multi 1 for color to get tracks associated with energy.


The final adjustment will be to turn on the shade for the various components in the model. This is accomplished by again selecting Zone Style and go to the Surfaces Tab. Highlight the non PTRAC surfaces and right-click under Surfaces to Plot and select Boundary Cell Faces.

This will include the air box which we don’t want so we can right-click on that surface and turn it off. Finally, select the Mesh tab and highlight the non-PTRAC zones and right-click under Show Mesh and select No. Finalize the format by arranging the format of the legend and turning off the bounding box. Use the File Export function to get an high-quality PNG picture of the output.

Example 9.8
Using the tank with berm example problem, animate contour slices and iso-surfaces.
Solution: For this problem, the number of cells produced in the mesh will exceed the default number allowed in the program. We can avoid issues by opening the Edit- Preferences window and select the User Interface Preferences tab. Once open change the Mesh Cell Rendering Threshold from 1000000 to 10000000 (add a zero).

Close the preferences and load the model by right-clicking on the solid geometry and selecting Generate Mesh. The load method we used for the original problem was MCNP. For this model, we need to load the problem using the Attila Non-Manifold Non-Imprint. The reason is because we want Attila to identify the empty regions so we can assign Air to the space from the air box down to the surfaces. Because of the size and complexity of the problem, the standard Attila Non-Manifold load won’t work. Once loaded, change the name of the Empty Region identified by Attila to Air-Inside.

Set the maximum edge length on the main menu as 1.5 meters (1/10th to 1/20th the maximum dimension of the problem). Add a smaller max edge length of 0.1 for the two shielding objects (tank and the berm). Change the Advanced options to include a Size Transition Factor of 0.00, include Curvature Refinement, a minimum edge length of 0.01 and Refine Anisotropically. Generating and importing the mesh can take quite some time due to the complexity of the problem. After importing the mesh, save the project. Duplicate the previous MCNP calculation of the model of the tank with berm and update it with the new mesh. Verify each of the menu options are still correct with the new geometry. Run the MCNP model. This may take 2 – 3 hours.

When the model is complete, expand the calculation and open the Tecplot. Turn on the Shade and right-click on the model, you can hide the air box and there will be an additional area of air just inside. Hide that area too. Select the Slices option and you will get a slice through the entire model not just the borders. Select the Contour settings button next to Contour and Set Levels and change to an Exponential distribution with a min of 5e-15 and a max of 5e-05 wit 20 levels.

Adjust the legend to clean up the graph area. There are two buttons to the right of the slices option. The first is an interactive slicing tool which allows the user to click anywhere on the model and the slice will move to that point. The second button gives a menu option to allow the user to change the slice location, position it exactly in the model and has an Animate tab.

In the Animate tab, we can change the speed, animation direction, frame rate etc. Press play, it moves through the model. Change the direction to Loop and it will continue to go through until you press pause. If we select the Export button, it will save the animation as a variety of formats.

Iso-surfaces can be useful for visualizing radiation transport, especially local hot spots or areas of leakages. Begin by opening our Tecplot for the model and selecting the shade for the zones that we want visible along with the animation. For this problem, use the same Tecplot we used for the slices – Tank with Berm using the Attila Non-Manifold Non-imprint load for the mesh.

To get a good plot, we will need to create a new variable that is the log of the flux Go to the top menu and select Data – Alter and Specify Equations. Now select data set info to see which is the next variable that is unused. In this case, Variable 6 is DENSITY and Variable 7 is unused.

Enter an equation that states variable 7 is the log of variable 4 (the flux). Enter V7=log(V4) and it returns an error because some of the V4 values are zero. To get around that, add a very small value to V4 to eliminate zero values in the log function, i.e. V7=log(V4 + 1E-20). Select Compute and the V7 shows in the Data Set Information window. Double-click that variable and rename it Flux Log. Close the Specify Equations and Data Set Info Windows.

Select the Iso-surfaces box and open the details by selecting the button next to the name Iso-surfaces. Select the button to the right of the Define Iso-Surfaces Using and you will get the Contour and Multi-Coloring Details window. Select the Log flux variable 7 from the drop-down menu. Close the window.

We can slowly toggle through the Value 1 variable to get a sense of how the Log Flux Iso-surfaces change in the model. Go to the animate tab and press play and the iso-surfaces will go in reverse. Change the direction to Backward and change the number of steps to 50 and the animation speed to 10. Save the animation as a video.

TecPlot is the integrated visualization platform distributed with the Attila license package. There are other programs available to view and manipulate the elemental edits output files from MCNP. Notably, ParaView is an open source post-processing visualization engine funded by Los Alamos National Laboratory. (ParaView; 2023) ParaView has more options and capabilities than TecPlot. For some applications, ParaView may be a better choice to visualize elemental edits from a model. For example, if the elemental edits file produces values listed as NaN or, not a number, TecPlot will not normally plot the results. This could occur for regions with negative values for flux. The user can modify the file and set the elemental edits file by replacing the NaN values with zero and attempting to load into TecPlot. However, another option is to use ParaView in conjunction with the python parser distributed by LANL. Example 9.9 details the use of a ParaView to generate a contour sketch of a complex model from an elemental edit file created by an Attila run.
Example 9.9
Use the elemental edits file generated in an Attila run to create a surface contour plot in ParaView.
Solution: The elemental edits file used for this problem is from a model where a person is standing approximately one meter from a subcrital assembly consisting of a hexagonal lattice of natural uranium fuel inside a tank of light water with five PuBe sources. The elemental edits file is stored in the same file folder location as the *.o, or output file. The elemental edits is saved with a *.EEOUT extension and is usually the largest file in the run folder.
To use ParaView, the elemental edits file will need to be parsed into a *.VTU file which is the format used for input. Los Alamos Laboratory provides instruction on developing a python script that will parse and format the elemental edits file correctly. (Kulesza and McClanahan; 2019) To use the script, ensure Python is loaded on the computer. The user can go to https://www.python.org/downloads/ and download and install the latest version for their operation system. Once installed, search for the executable in the root drive for example, C:\ Windows\ pyw.exe. Within the Windows file explorer, navigate to the folder location where the python script and the EEOUT file is located and type CMD to open a command prompt in that location. The user can either copy the python script into the run folder with the EEOUT file or create a new folder and copy both files into it. Upon opening the command prompt in the file location, the user will execute the script by giving the command >pyw Convert_ MCNP_ eeout_ to_ VTK.py filename.eeout. The script will then create a VTU file with the same name as the elemental edits file.
Microsoft Windows [Version 10.0.22621.2283]
(c) Microsoft Corporation. All rights reserved.
C:\Users\kenneth.allen\OneDrive - West Point\NE Program\NE461 AY24-1\Attila4MC\ParaView Ino>>
pyw Convert_MCNP_eeout_to_VTK.py subcrit.mcnp.eeoutOnce the VTU file is created, open ParaView and load the file. There are several options for variable to load visible in the lower left of the screen. Select either energy bins or the error whichever is desired for plotting and deselect the density, material, and volume.

Select Apply and a shade grey box will appear in the center of the plotting region which represents the overall boundary of the model. Under Coloring in the lower-left Properties region, change from Solid Color to the name for the tally result.

The Color Map Editor will appear on the right side of the model and the box will display as a solid blue. Turning down the Opacity will reveal the interior of the model, but the scaling will need to be adjusted to better represent the differences in the dose across a gradient.

Using the Color Map Editor, change the Mapping Data to Rainbow Uniform and select the option to Rescale to Visible Range which is the third fourth button option on the right side of the mapping data scale. This option will result in an image that is more representative of the change in flux.

The user can then move the model about for different views and adjust lighting and camera angles to best represent the results. Additionally, a tally multiplier can be added to convert from dose per source particle to dose per hour as was done in TecPlot. To do so in ParaView, the user will select the Calculator. Select the calculator button on the menu to the far left above the file tree. When the calculator opens, select Scalars and choose the tally data. The name for the data will appear in the space above the calculator buttons inside quotes. Navigate to the end of the name and include *(value of tally multiplier). The example below shows the use of 3.6E10 as a multiplier. Change the Result Array Name to reflect the appropriate name, in this case Dose Rate (mrem/hr).

Select Apply and the model will update with the new data and revert to the original settings for color and shading. Once again, change the opacity, set the color mapping, and scaling. The user can then change the angle and lighting to view from various orientations. ParaView also allows the user to export the images to a high-quality PNG or JPG format using the Save Extracts option to see rendered views.

References
Full bibliography- ParaView (2023). Paraview, about. URL: https://www.paraview.org/about/
- Kulesza, J. A. and McClanahan, T. C. (2019). A python script to convert mcnp unstructured mesh elemental edit output files to xml-based vtk files. URL: https://doi.org/10.2172/1574726
