Tutorial – Serpent in a nutshell

Serpent is a Monte Carlo code for neutron transport. The goal of this page is to give a small amount of information in order to be able to write an imput file containing simualtion options.

*Note that this page is under construction.


Index:


Preliminary informations

In Serpent input file we have to insert materials contained in our reactor and we need to define the surfaces containing these materials. Then some command will allow us to create more complex geometries, for example the creation of an array of fuel rods (lattice)

First step is the definition of the name of our simulation, the command is:

set title "Simulation name"

Second step is to define the path in which cross section files are stored. The command is:

set acelib "/path/of/cross/section/file.xsdata"

Now we are ready for the material definition.

Material definitions

To define the material the code structure is the following:

mat <name> <densities> <additional options>
<ZA>.<lib>  <percentage>

mat is the code which permit us to define a material, each material require a name that chan be chosen by user, moreover we need o insert a density and if we want we can insert other options.

the second line identify the material library for cross section, for example, let’s assume we want to define natural Uranium, then the code will be:

mat fuel     -6.3
92235.03c    -0.0071
92238.03c    -0.9829 

This mean that our material is called fuel, have a density of 6.3 g/cm3 and is made of U-235 for 0.71% and U-238 for 98.29%. “.03c” identify the library for the scattering associated to these material, in particular the number “03” tell us that temperature is near to 300K. Each material’s cross section is mesured at different temperatures and you have to search for these data on Serpent tutorial.

The minus sign before the density tell the program that our density is in g/cm3, if we avoid to insert “-” density is considered as an atom density (at/cm3)

An equivalent way do define the material consist in inserting the elemnt letter instead of the number of protons, for example 92235.03c become U-235.03c

As you see also the percentage have a minus sign, in this case if we neglect it, Serpent will consider the number as the stoichiometry number. For example in the definition of water (H2O) we shall insert:

mat water -1
H-1.03c    2
O-16.03c   1
Additional options

Addinal options ar not mandatory, we can insert the color (in rgb form) for the plot and the libraries for thermal scattering (see serpent tutorial).

Surface definitions

In order to build our geometry we need to define surfaces which constitute it.

The syntax is: surf surfUniverse surfType coordinates.

Example: cylinder

surf srfCyl cyl 0 0 1

sfrCyl is surface name, cyl is the type of surface, 0 0 are x and y central coordinates and 1 is the radius in centimeters

Example: plane orthogonal to z axis

surf srfPlaneTop pz 40

It’s a plane named “srfPlaneTop” with z coordinate 40 cm

For the next chapter we will need another plane:

surf srfPlaneBot pz 0

Cell Definition

Now let’s say that we want to create a finite cylinder containing our fuel, to do so we can use “cell” command, the idea is to define a cell delimited by some surfaces in a user defined universe. Syntax:

cell cellName1 u1 fuel -srfCyl -srfPlaneTop srfPlaneBot

We are saying that the cell is inside universe “u1” and is filled with “fuel” material. Moreover this cell is confined inside cylinder “srfCyl” (minus sign) under the plane “srfPlaneTop” (minus sign) and over the plane “srfPlaneBot” (no minus sign).

Now, Generally around fuel pin there is coolant, so we need to create another cell containing it:

cell cellName2 u1 water srfCyl -srfPlaneTop srfPlaneBot

Note that this cell is defined outside srfCyl. Since we are building the same fuel channel both the elements have to be in the same universe.

Lattice creation

Nuclear reactor are often an ordered repetition of elemnts of same geometry (a lattice). To create such a geometry we need the lat command. Serpent offers a wide number of type of lattice, in this example we will see just square lattice. Let’s say we want to create a lattice 4×4 of fuel pin + water. Syntax is:

lat u2 1 0.0 0.0 4 4 2.5
u1 u1 u1 u1 
u1 u1 u1 u1
u1 u1 u1 u1
u1 u1 u1 u1

In order: u2 as usual is another universe, 1 is lattice type (1 = square, 2 and 3 = hexagonal…) 0.0 0.0 are x and y central coordinates, 4 4 mean 4 rows and 4 columns and finally 2.5 is the distance between 2 elements (pin pitch). Below this line you see the arrangement, in this case all the components are universe “u1”.

Now that you have an assembly you can use again command lat to repeat your assembly, for example, let’s made a 2×2 assembly:

lat u3 1 0.0 0.0 2 2 10
u2 u2
u2 u2

Final step for geometry

For some reason our geometry must be in universe “0” so we need to create some cells in this universe, containing our lattice and defining a particular type of cell called “outside”.

First let’s create a box (named sbox, type: sqc) containing our core, this is useful in order to avoid errors.

surf sbox sqc 0.0 0.0 10 

(please note that box dimensions must be coherent with your lattice width, in my case there could be errors!)

cell definition:

cell clat 0 fill u3 -sbox -surfPlaneTop surfPlaneBot
cell cout 0 outside sbox
cell cout 0 outside -sbox surfPlaneTop -surfPlaneBot

And we are done for the geometry.

Example

Boundary conditions

The basic command to add boundary conditions is:

set bc 1

where you can change the number:

  • 1: black bc (neutrons are lost)
  • 2: reflective bc
  • 3: periodic bc

Note that reflective and periodic bcs cannot be used for all geometries, check in manual.

Also note that this kind of definition of bc concerns surfaces labeled as “outside”.

Final note: is possible to define more complex bcs for different directions or surface, check on serpent wiki.

Iterated fission source method

This is probably the easiest part, you need just one string that is:

set pop 5000 200 100

“5000” is the number of neutron per cycle, “200” is the number of active cycles and finally “100” is the number of inactive cycles. (of course you can change these numbers)

Energy detector

Detectors are needed to save data of our simulation. For instance, if we want to save the energy dependence of the flux we can do as follow:

det EnergyDetector de MyEnergyGrid
ene MyEnergyGrid 3 500 1e-11 2e1

“EnergyDetector” is the name of our detector, output file will have a variable with this name. de tells the program that we are interested in a specific range of energy, and our grid is called “MyEnergyGrid”. Finally we create the grid in the second line, type 3 (uniform lethargy width) of 500 intervals, from 1e-11 MeV to 2e1 MeV.

No other specifications are added, so serpent will measure the flux. you can also define the response function, for example if you want to obtain the collision density you can add after “det Name” the string “dr -1”. With “dr” you can insert the response you desire, “-1” represent the total cross section.

Other detectors

Matlab/Octave scripts for plots