Your First Serpent Simulation

Building and running a simple PWR pin cell from scratch

The Pin Cell Model

The simplest meaningful reactor physics model is a single fuel pin cell with reflective boundary conditions, which approximates an infinite lattice of identical fuel pins. This model captures the essential neutronics of a pressurized water reactor — neutron moderation in water, resonance absorption in uranium, and the competition between fission and parasitic capture that determines the multiplication factor.

The model consists of a UO2 fuel pellet (radius 0.4096 cm) surrounded by a Zircaloy cladding shell (inner radius 0.4178 cm, outer radius 0.4750 cm) immersed in light water. The square unit cell has a half-pitch of 0.63 cm, corresponding to a standard 1.26 cm PWR lattice pitch. The fuel is enriched to 3.1 atom percent U-235, and the materials are set to representative operating temperatures: 900 K for fuel, 600 K for cladding, and 574 K for the moderator.

Writing the Input File

Create a new text file called pin_cell.inp. The input file begins with material definitions, which specify the isotopic composition, density, and temperature of each material in the model.

Material Definitions

text
% Simple PWR pin cell example
% Dimensions in cm, temperatures in Kelvin

% UO2 fuel (3.1% enriched)
mat fuel -10.4 tmp 900
92235.09c  0.031
92238.09c  0.969
8016.09c   2.0

% Zircaloy-4 cladding
mat clad -6.56 tmp 600
40090.09c  -0.9845
50120.09c  -0.0155

% Light water moderator with thermal scattering
mat water -0.7 tmp 574 moder lwtr 1001
1001.09c   2
8016.09c   1

therm lwtr lwj3.11t

The negative density values indicate mass density in g/cm3. The tmpkeyword sets the material temperature for cross-section interpolation. The moder keyword on the water material links hydrogen to thermal scattering data, which is essential for correctly modeling neutron thermalization in the moderator.

Next, define the geometric surfaces and the cells they bound. Serpent uses a Constructive Solid Geometry approach where cells are defined as regions of space bounded by surfaces, and each cell is filled with a material.

Geometry and Cell Definitions

text
% Surface definitions
surf 1  cyl 0.0 0.0 0.4096   % Fuel outer radius
surf 2  cyl 0.0 0.0 0.4178   % Clad inner radius
surf 3  cyl 0.0 0.0 0.4750   % Clad outer radius
surf 4  sqc 0.0 0.0 0.63     % Square cell boundary (half pitch)

% Cell definitions
cell 1  0  fuel   -1          % Fuel pellet (inside surface 1)
cell 2  0  void    1 -2       % Gap (helium, simplified as void)
cell 3  0  clad    2 -3       % Cladding (between surfaces 2 and 3)
cell 4  0  water   3 -4       % Moderator (between surfaces 3 and 4)
cell 5  0  outside 4          % Outside boundary

The cyl surface type defines infinite cylinders centered at (0, 0) with the specified radius. The sqc type defines a square prism, which serves as the unit cell boundary. In the cell definitions, a negative surface number means "inside" that surface, and a positive number means "outside." Cell 4, for example, is the region outside surface 3 (outside the cladding) and inside surface 4 (inside the square boundary).

Finally, add the simulation settings. These control the cross-section library path, boundary conditions, and the neutron population parameters that determine the statistical precision of the results.

Simulation Settings

text
% Cross section library
set acelib "sss_endfb7u.xsdata"

% Reflective boundary conditions (infinite lattice approximation)
set bc 2

% Neutron population: 10000 per cycle, 100 active, 20 inactive
set pop 10000 100 20

Boundary condition type 2 applies reflective boundaries on all faces, simulating an infinite lattice of identical pin cells. The set pop card specifies 10,000 neutrons per cycle with 100 active cycles for tallying and 20 inactive cycles for source convergence. This population is modest but sufficient for a quick test run — production calculations typically use 50,000 to 100,000 neutrons per cycle.

Running the Simulation

Open a terminal, navigate to the directory containing your input file, and execute Serpent. The -omp flag specifies the number of OpenMP threads to use for parallel execution; set it to the number of CPU cores available on your machine.

bash
sss2 -omp 4 pin_cell.inp

Serpent will read the input file, load cross-section data, check the geometry for errors, and begin the transport calculation. Progress information appears in the terminal as each cycle completes, showing the running estimate of k-effective and its statistical uncertainty. This simple problem should complete in under a minute on a modern desktop.

Understanding the Results

After the calculation finishes, Serpent produces several output files. The most important for this first run is pin_cell_res.m, which contains the final k-effective estimate and other integral quantities. Open it with a text editor or load it into MATLAB or Python to examine the results.

For this pin cell model with 3.1% enriched fuel, you should see a k-infinity value of approximately 1.2 to 1.3. This is well above critical (1.0) because the reflective boundaries eliminate neutron leakage, and there are no control poisons present. The statistical uncertainty should be around 50-100 pcm (0.0005 to 0.001), which is adequate for a test calculation but would need to be reduced for publication-quality results.

The log file pin_cell.out records the full history of the calculation, including any warning messages and timing statistics. Always review this file, particularly for your first runs with a new model, to ensure that Serpent did not encounter geometry errors or other issues that could compromise the results.

Troubleshooting Common Issues

If Serpent exits immediately with a message about missing cross-section data, the SERPENT_DATA environment variable is either unset or pointing to the wrong directory. Verify it with echo $SERPENT_DATA and ensure the path contains the .xsdata index file and the corresponding ACE data files.

Geometry errors such as "undefined cell" or "lost particle" messages indicate that some region of space is not assigned to any cell. Check that your cell definitions cover the entire problem domain without gaps or overlaps. The most common mistake is forgetting the outer boundary cell that catches everything outside the model.

If the statistical uncertainties are larger than expected, increase the neutron population or the number of active cycles. Doubling the total number of active histories (neutrons per cycle times active cycles) reduces the statistical uncertainty by a factor of approximately the square root of two.

Next Steps

With your first successful simulation complete, experiment with modifications to build intuition about reactor physics. Try changing the fuel enrichment and observe how k-effective responds — increasing the U-235 fraction from 3.1% to 4.5% should produce a noticeable increase. Modify the moderator temperature to see the negative temperature coefficient in action, or add soluble boron to the water to study chemical shim control.

The following chapters explain each component of the input file in detail.