SERPENT Guide
Surface Types & Operations
Advanced surface definitions, transformations, and cloning
Beyond Basic Surfaces
Beyond planes, cylinders, and spheres, Serpent supports specialized surface types for more complex geometries: truncated cones for tapered components, tori for pipe bends and toroidal fusion devices, and hexagonal prisms for VVER-type lattices. Note that Serpent does not have a general quadratic surface type — complex shapes must be built from the available specialized surface types.
Complex Surfaces
Unlike MCNP, Serpent does not support a general quadratic (GQ) surface type. All second-order surfaces must be constructed from the specialized types: spheres (sph), cylinders (cylx, cyly, cylz), cones (cone), and tori (torx, tory, torz). For geometries that MCNP would model with a GQ surface (ellipsoids, paraboloids, hyperboloids), Serpent requires approximation using intersections and unions of the available surface types.
% General quadratic: Ax² + By² + Cz² + Dxy + Eyz + Fzx + Gx + Hy + Iz + J = 0
% Serpent does not have a general quadratic surface type.
% Use the specialized types (sph, cyl, cone, torz, etc.) instead.
% For example, a sphere of radius 5 at the origin:
surf s1 sph 0.0 0.0 0.0 5.0
% An infinite cylinder of radius 2 along the z-axis:
surf c1 cylz 0.0 0.0 2.0Specialized Surface Types
Truncated cones model tapered geometries such as nozzle components or conical fuel regions. The surface is defined by two endpoints along an axis and the radius at each endpoint. Tori are relevant for fusion reactor blanket modeling and certain piping configurations; they are defined by a major radius (distance from the axis of revolution to the center of the tube) and a minor radius (the tube cross-section radius).
Cones and Tori
% Truncated cone along z-axis
surf cone1 trcz 0.0 0.0 -5.0 15.0 2.0 3.0
% X0 Y0 Z0 H R1 R2: base at (0,0,-5), height 15, radii 2.0 and 3.0
% Torus around z-axis
surf torus1 torz 0.0 0.0 0.0 5.0 1.0 1.0
% X0 Y0 Z0 A B C: center at origin, major radius 5.0, semi-axes 1.0 1.0Rectangular and hexagonal prisms are essential for lattice-based reactor geometries. In Serpent 2, a rectangular box uses the cuboid surface type (not rect), with coordinate limits on all three axes. Hexagonal prisms come in two orientations: hexxc (vertex-to-vertex along x, flat-to-flat along y) and hexyc (Y-type hexagonal prism), corresponding to the two standard orientations of hexagonal fuel assemblies in reactor designs like the VVER.
Prisms for Lattice Geometries
% Rectangular prism (cuboid)
surf rect1 cuboid -10.5 10.5 -10.5 10.5 -50.0 50.0
% xmin xmax ymin ymax zmin zmax
% Hexagonal prism (flat-to-flat orientation)
surf hex1 hexxc 0.0 0.0 10.5
% Centered at (0,0), half flat-to-flat distance 10.5Surface Transformations
Surfaces can be translated and rotated using the trans s card, which handles both operations and avoids redefining geometry at each new position (this is Serpent's surface-transform mechanism — not an MCNP-style trcl block).
When both rotation and translation are applied, rotation happens first, followed by translation — reversing the order produces a different result. For complex transformation sequences, defining intermediate surfaces is often clearer than stacking multiple transformations on a single surface.
Translation and Rotation
% Define a sphere at the origin and translate a copy
surf s1 sph 0.0 0.0 0.0 5.0
surf s2 sph 0.0 0.0 0.0 5.0
trans s s2 10.0 0.0 0.0 % Move s2 to (10, 0, 0)
% Define a z-axis cylinder and rotate it to align with x-axis
surf c1 cylz 0.0 0.0 2.0
surf c2 cylz 0.0 0.0 2.0
trans s c2 0.0 0.0 0.0 0.0 90.0 0.0 % Translate (0,0,0), rotate 90° around y-axisRepeated Structures with Transformations
For repeated structures, define surfaces of the same type at the origin and use the trans s card to position each copy independently.
Positioning Example: Control Rod Fingers
% Define five identical control rod fingers
surf rod0 cylz 0.0 0.0 0.5
surf rod1 cylz 0.0 0.0 0.5
surf rod2 cylz 0.0 0.0 0.5
surf rod3 cylz 0.0 0.0 0.5
surf rod4 cylz 0.0 0.0 0.5
% Position the four outer fingers with trans s
trans s rod1 2.0 0.0 0.0
trans s rod2 -2.0 0.0 0.0
trans s rod3 0.0 2.0 0.0
trans s rod4 0.0 -2.0 0.0This creates a five-finger control rod cluster. The center finger (rod0) stays at the origin, while the four outer fingers are translated to their positions.
Boolean Operations in Detail
Complex geometries require combining multiple surfaces with Boolean logic. A space between surface references creates an intersection — the cell occupies the region where all conditions are simultaneously true. A colon creates a union — the cell occupies the region where at least one condition is true. Parentheses group operations to override the default precedence.
% Surfaces
surf s1 sph 0.0 0.0 0.0 5.0 % Sphere
surf c1 cylz 2.0 0.0 2.0 % Off-center cylinder
surf p1 pz 0.0 % Horizontal plane
% Intersection: inside the sphere AND outside the cylinder
cell 1 0 fuel -s1 c1
% Union: inside sphere AND above plane OR inside cylinder
cell 2 0 water (-s1 p1) : (-c1)
% Complex nested: inside sphere AND below plane OR outside cylinder AND above plane
cell 3 0 clad (-s1 -p1) : (c1 p1)For complex geometries, it is often simpler and more debuggable to break the model into multiple cells with straightforward Boolean expressions rather than constructing a single cell with deeply nested operations.
Practical Example: Guide Tube with Flow Holes
A control rod guide tube has inner and outer cylindrical surfaces with small cylindrical flow holes cut through the tube wall for coolant circulation.
% Guide tube surfaces
surf tube_in cylz 0.0 0.0 0.57 % Inner tube radius
surf tube_out cylz 0.0 0.0 0.62 % Outer tube radius
surf top pz 200.0
surf bot pz -200.0
% Flow holes through the tube wall
surf hole1 cylx 0.0 0.58 0.15
surf hole2 cylx 0.0 -0.58 0.15
% Guide tube body (excluding flow holes)
cell guide 0 zirc tube_in -tube_out -top bot hole1 hole2
% Water inside guide tube
cell g_water 0 water -tube_in -top bot
% Water in flow holes
cell fh1 0 water -hole1 tube_in -tube_out -top bot
cell fh2 0 water -hole2 tube_in -tube_out -top botThe guide tube cell is the intersection of being inside tube_out, outside tube_in, between the top and bottom planes, and outside both flow holes. The flow hole cells are each confined to the annular region of the tube wall.
Performance Considerations
The choice of surface types affects simulation performance because Serpent must compute ray-surface intersections for every particle step. Axis-aligned surfaces (planes perpendicular to coordinate axes, cylinders along coordinate axes) have the simplest intersection algorithms and should be used whenever the geometry permits. Tori require more computation per intersection.
When defining cells, listing the most likely bounding surface first in the Boolean expression can improve tracking speed, since Serpent evaluates conditions left to right and can short-circuit the evaluation as soon as one condition fails. For the outer boundary of a large model, adding a bounding box or bounding sphere as the first surface in the boundary cell's definition helps Serpent quickly identify particles that have left the problem domain.