Visualizing the results
Serpent produces graphical output to visualize the geometry and the results of the simulation. The output is produced in the widely-supported png-format. In order to produce graphical output, Serpent must be compiled with graphics options and linked with the GD Graphics Library (see instructions on compiling the source code).
The geometry plotter produces two-dimensional plots of the geometry with respect to a give coordinate axis. The plotter is invoked by the plot input card. The card reads the orientation of the plane:
and the size of the produced image in pixels. Additional input cards provide the position of the plot plane on the coordinate axis perpendicular to it and the width and height of the plot with respect to the geometry (in cm). The last four parameters can be used to zoom into the details of the geometry.
The geometry plotter plots materials in different colors, which by default are randomly selected. The colors can also be defined using the rgb-entry of the material card.
Material boundaries are plotted with black lines. The plotter has also options to leave boundaries out, plot cell boundaries instead or plot both cell and material boundaries. These options are invoked by adding another number after the plot plane option:
|0||: no boundaries are plotted|
|1||: material boundaries are plotted (default)|
|2||: cell boundaries are plotted|
|3||: both cell and material boundaries are plotted|
So type 12 refers an YZ-plot with cell boundaries, type 30 refers to an XY-plot without any boundaries, and so on.
The plotter also has a special mode for plotting importance maps read using the wwin-card. This mode is invoked by setting the second number in the type parameter to 4 (linear color scheme) or 5 (logarithmic color scheme). So type 14 means that the importances are plotted on top of an YZ-plot using a linear color scheme, type 35 menas that the importances are plotted on top of an XY-plot using a logarithmic color scheme, and so on. The color scheme used in the plot runs from blue to red, with white for the mid-point value. The plot card also reads the minimum and maximum importance corresponding the end-point values, as well as the energy which is used to select the appropriate mesh when the importances are divided into multiple energy bins.
Track plots are used to visualize particle histories drawn on top of geometry plots. The track plotter is invoked by a command line option
sss2 -tracks N INPUT
which means that N particles are started from the source distribution, and their tracks plotted on the geometry. It should be noted that the particle tracks are actually 2D projections on the plot plane, which in some cases may not be the visualization of the three-dimensional transport process.
Serpent also provides the option to produce track plot animations, which means that the motion of particles is captured on multiple frames taken at different times. The track plot animation is invoked by the -tracks command line option, when the set tpa input option is defined. This option reads a number of parameters, including the beginning and end points of the time interval and number of frames. The particles are plotted with "tail" that helps visualize their movement through the geometry. The length of this tail is given relative to the geometry dimensions (in cm). Neutrons are plotted with purple and photons with green tail.
Since producing the track plot requires storing various events, the tpa option also requires defining an event buffer, which is basically the maximum number of events that may occur during the history. Insufficient buffer size results in an error message.
The frames are written in a number of files [input]_trck[n]_frame[m].png, where n is the plot index and m is the frame number (between 000 and 999). The frames can be combined into an animation, for example, using Imagemagick:
convert *frame*.png anim.gif
Producing neutron track plot animations may be tricky if the speed of the particles changes dramatically during the simulation. This is in particular the case for thermal systems, in which thermalized neutrons appear to remain still if the time interval is set to visualize the movement of fast neutrons. For better visualization the particle speeds can be set equal using the set spd option. This option does not affect the energy, so the interaction physics is preserved.
The track plot animation works with all geometry plot types, including importance map plots. Producing the frames may require a lot of memory if a large number of tracks are simulated. In multiplying systems or when variance reduction (splitting) is used the calculation may run out of particle buffer. In such case the buffer must be adjusted using the set nbuf or set gbuf option.