Simple Geometries in Serpent

Surface and Cell Definition Basics

Geometric modeling in Serpent is based on constructive solid geometry (CSG), where complex shapes are built by combining simpler ones through boolean operations. The two main components of Serpent geometry are:

  • Surfaces: Mathematical boundaries that divide space
  • Cells: Regions defined by combinations of surfaces

Unlike some other Monte Carlo codes (like MCNP), Serpent's geometry definition is more streamlined and uses a syntax that is generally easier to read and write.

Surface Types

Serpent supports various surface types, each defined with the surf card:

text
surf NAME TYPE [PARAMETERS]

Here are the most common surface types:

Planes

Planes are defined by their normal vector and distance from the origin:

text
% Planes perpendicular to axes
surf px1 px 10.0     % Plane perpendicular to x-axis at x=10.0
surf py1 py -5.0     % Plane perpendicular to y-axis at y=-5.0
surf pz1 pz 0.0      % Plane perpendicular to z-axis at z=0.0

% General plane: ax + by + cz = d
surf p1 plane 1.0 1.0 1.0 5.0  % Plane with normal (1,1,1) at distance 5

Cylinders

Cylinders are commonly used for modeling fuel pins, control rods, and pipes:

text
% Cylinders along coordinate axes
surf cyl1 cylx 0.0 0.0 5.0  % Cylinder along x-axis, centered at y=0, z=0, radius=5.0
surf cyl2 cyly 0.0 0.0 2.5  % Cylinder along y-axis
surf cyl3 cylz 0.0 0.0 3.75 % Cylinder along z-axis (most common in reactor models)

Spheres

Spheres are defined by their center coordinates and radius:

text
surf sph1 sph 0.0 0.0 0.0 10.0  % Sphere at origin with radius 10.0
surf sph2 sph 5.0 5.0 5.0 2.0   % Sphere at (5,5,5) with radius 2.0

Note: By convention in Serpent, the positive side of a surface is the side in the direction of the surface normal. For example, for a plane perpendicular to the x-axis (px), points with x-values greater than the plane's position are considered "outside" or "positive."

Cell Definitions

Cells are regions of space defined by boolean combinations of surfaces. In Serpent, cells are defined using the cell card:

text
cell ID MAT [FILL] [UNIVERSE] SURFACE_DEFINITION

Where:

  • ID: Integer identifier for the cell
  • MAT: Material assigned to the cell (or 0 for void)
  • FILL: Universe that fills the cell (optional)
  • UNIVERSE: Universe the cell belongs to (optional)
  • SURFACE_DEFINITION: Boolean combination of surfaces

The surface definition uses the following operators:

  • Space: Intersection of regions
  • : Union of regions
  • - before surface: Negative half-space
  • ( ): Grouping of operations

Here's a simple example of cell definitions:

text
% Define a fuel pin with cladding
surf fuel_rad cylz 0.0 0.0 0.4
surf clad_rad cylz 0.0 0.0 0.5
surf top pz 10.0
surf bottom pz -10.0

% Fuel region (cell NAME UNIVERSE MATERIAL SURFACES)
cell 10 0 fuel -fuel_rad bottom -top

% Cladding region
cell 20 0 clad fuel_rad -clad_rad bottom -top

% Outside region (implicit complement)
cell 30 0 outside

Pro Tip: It's a good practice to define your surfaces with descriptive names that indicate their function (e.g., fuel_rad, core_boundary). This makes your input file much easier to read and maintain, especially for complex geometries.

Simple Example: Fuel Pin Cell

Let's create a complete example of a simple fuel pin cell with UO₂ fuel, zircaloy cladding, and water moderator:

text
% --- Surface definitions ---
surf fuel_surf cylz 0.0 0.0 0.41 % Fuel pellet radius
surf gap_surf cylz 0.0 0.0 0.42  % Gap radius
surf clad_surf cylz 0.0 0.0 0.48 % Cladding outer radius
surf cell_surf sqc 0.0 0.0 0.63  % Square cell boundary

% --- Material definitions ---
mat fuel -10.4
92235.09c  0.04
92238.09c  0.96
8016.09c   2.0

mat zircaloy -6.56
40000.09c -0.9816
50000.09c -0.015
26000.09c -0.0024
24000.09c -0.001

mat water -1.0 moder lwtr 1001
1001.09c 2
8016.09c 1

therm lwtr lwj3.11t

% --- Cell definitions ---
cell 10 0 fuel      -fuel_surf                  % Fuel region
cell 20 0 void       fuel_surf -gap_surf        % Gap (void)
cell 30 0 zircaloy   gap_surf -clad_surf        % Cladding
cell 40 0 water      clad_surf -cell_surf        % Moderator
cell 50 0 outside                               % Outside

% --- Boundary conditions ---
set bc 2    % Reflective boundary on all sides

% --- Options ---
set gcu 2   % Generate geometry plots (2 = png files)

This example defines a 2D fuel pin cell with reflective boundary conditions, suitable for neutronic calculations.

Geometry Visualization: Use set gcu 2 to generate PNG plots when running the simulation. These plots verify your geometry before full calculations and help identify modeling errors early.

Practical Tips

Testing Geometry

When creating new geometries, it's a good practice to:

  • Start with a small number of particles and iterations
  • Use the geometry plotting feature (set gcu)
  • Check for "Lost particles" in the output, which indicate geometry errors
  • Use the set overlap option to detect overlapping regions

Common Pitfalls

  • Not covering all space (every point must belong to exactly one cell)
  • Incorrect surface orientations (mixing up inside and outside)
  • Missing unions (:) or using them incorrectly
  • Not assigning materials to cells

Critical Requirement: Every point in space must belong to exactly one cell. Overlapping cells or undefined regions will cause fatal errors during simulation startup.