SERPENT Guide
The Universe Concept in Serpent
Universe Fundamentals
The universe concept is one of the most powerful features in Serpent for creating complex geometric models in a modular and efficient way. In this section, we'll dive deeper into universes and their applications.
What is a Universe?
A universe in Serpent is a self-contained geometric domain with its own cells and surfaces. It allows you to:
- Build geometry in a modular, hierarchical manner
- Reuse geometric components multiple times
- Create nested structures with different coordinate systems
- Implement repeating patterns through lattices
Key Concept: Think of universes as "geometry containers" that can be placed inside cells of other universes. Each universe has its own local coordinate system, which makes transformations and placement flexible.
Universe Hierarchy
Serpent uses a hierarchical structure of universes:
- Base Universe (0): The top-level universe that contains everything
- Nested Universes: Universes placed inside cells of other universes
- Fill Universes: Universes used to fill cells in other universes
- Lattice Universes: Universes organized in regular patterns
Creating and Using Universes
Universe Definition
Universes are defined implicitly through cell definitions:
% Cells in the base universe (0)
cell outside_world 0 outside 1000 % Outside world in universe 0
cell water_reflector 0 water -1000 100 % Water reflector in universe 0
cell core_region 0 fill 10 -100 % Core region filled with universe 10
% Cells in universe 1 (fuel pin)
cell fuel 1 fuel -10 % Fuel region in universe 1
cell clad 1 zirc -20 10 % Cladding in universe 1
cell water1 1 water -30 20 % Water in universe 1In the example above:
- The first three cells are defined in universe 0 (the base universe)
- The next three cells are defined in universe 1 (a fuel pin universe)
- Universe 10 is referenced but not yet defined
The 'fill' Operator
The fill operator is used to place a universe inside a cell:
% Define a boundary for a fuel pin cell
surf pin_cell_bound rect -0.63 0.63 -0.63 0.63 -10 10
% Fill a cell with universe 1
cell fuel_pin_cell 10 fill 1 -pin_cell_bound % Cell in universe 10, filled with universe 1
cell outside_pin 10 outside pin_cell_bound % Outside region in universe 10Important Note: When a universe is placed inside a cell using the filloperator, the contents of the filled universe are clipped to the boundaries of the cell. Any part of the filled universe that extends beyond the cell boundaries is cut off.
Universe Nesting
One of the most powerful aspects of universes is the ability to nest them:
Basic Nesting
You can create hierarchical structures by nesting universes within each other:
% Universe 1: Fuel pin
cell fuel 1 fuel -10 % Fuel
cell clad 1 zirc -20 10 % Cladding
cell mod1 1 water -30 20 % Moderator
% Universe 2: Guide tube
cell guide 2 zirc -40 35 % Guide tube
cell mod2 2 water -35 % Water inside
cell mod3 2 water -50 40 % Water outside
% Universe 10: Assembly with pins and guide tubes
surf assy rect -10.5 10.5 -10.5 10.5 -100 100
cell fuel_pin_loc 10 fill 1 -p1 % Location for fuel pin (universe 1)
cell guide_tube_loc 10 fill 2 -p2 % Location for guide tube (universe 2)
cell assy_water 10 water -assy p1 p2 % Assembly water
% Universe 0: Core with assemblies
surf core rect -100 100 -100 100 -150 150
cell core_region 0 fill 10 -core % Core filled with assembly (universe 10)
cell reflector 0 water -refl core % Reflector
cell outside 0 outside refl % Outside worldCoordinate Systems in Nested Universes
Each universe has its own local coordinate system:
% Define pin in universe 1 (centered at origin of universe 1)
surf fuel_rad cylz 0.0 0.0 0.4 % Notice coordinates are (0,0) in universe 1
cell fuel1 1 fuel -fuel_rad
% Place universe 1 at different locations in universe 0
cell pin1 0 fill 1 -pin_bound1 % Places universe 1 at one location
trcl pin1 -10.0 0.0 0.0 % Translates universe 1 to position (-10,0,0)
cell pin2 0 fill 1 -pin_bound2 % Places universe 1 at another location
trcl pin2 10.0 0.0 0.0 % Translates universe 1 to position (10,0,0)Design Approach: When creating nested universes, define each component at its own local origin (0,0,0). This makes it easier to place the universe at different positions, rotate it, or use it in lattices, since all transformations are applied relative to the universe's local origin.
Universe Transformations
Universes can be transformed when placed in cells:
Translation
Move a universe from its original position:
% Define a pin universe
cell pin_fuel 1 fuel -10
cell pin_clad 1 clad -20 10
% Place this universe at different positions
cell pin_loc1 0 fill 1 -c1 % First instance of the pin
trcl pin_loc1 0.0 0.0 0.0 % No translation (at origin)
cell pin_loc2 0 fill 1 -c2 % Second instance of the pin
trcl pin_loc2 5.0 0.0 0.0 % Translated to (5,0,0)
cell pin_loc3 0 fill 1 -c3 % Third instance of the pin
trcl pin_loc3 0.0 5.0 0.0 % Translated to (0,5,0)Rotation
Rotate a universe from its original orientation:
% Define a non-symmetric component
cell asym_comp 2 steel -30
cell asym_void 2 void -40 30
% Place with different rotations
cell comp_loc1 0 fill 2 -c4
trcl comp_loc1 10.0 0.0 0.0 0.0 0.0 0.0 % No rotation, just translation
cell comp_loc2 0 fill 2 -c5
trcl comp_loc2 10.0 10.0 0.0 0.0 0.0 90.0 % Rotated 90° around z-axisThe trcl operator has two forms:
% Format 1: Translation only
trcl CELL x y z
% Format 2: Translation and rotation (Euler angles in degrees)
trcl CELL x y z α β γ
% Format 3: Full transformation matrix (advanced usage)
trcl CELL m11 m12 m13 m21 m22 m23 m31 m32 m33 x y zComplex Transformations
Combine translations and rotations for complex geometries:
% Define a control rod
surf rod_cyl cylz 0.0 0.0 2.5
cell rod_body 3 boron -rod_cyl
% Place control rods at different angles around a circle
cell rod1 0 fill 3 -c10
trcl rod1 20.0 0.0 0.0 0.0 90.0 0.0 % Horizontal rod along x-axis
cell rod2 0 fill 3 -c11
trcl rod2 14.14 14.14 0.0 0.0 90.0 45.0 % Rotated 45° around z-axis
cell rod3 0 fill 3 -c12
trcl rod3 0.0 20.0 0.0 0.0 90.0 90.0 % Horizontal rod along y-axisImportant: In Serpent, rotations follow a specific order: first around x-axis, then y-axis, then z-axis. This is different from some other Monte Carlo codes, so be careful when transferring models between different codes.
Advanced Universe Techniques
Reusing Universes with Different Materials
You can use the same geometric structure with different materials:
% Define a generic pin geometry
surf pin_fuel cylz 0.0 0.0 0.41
surf pin_clad cylz 0.0 0.0 0.47
% Fuel pin with 3.1% enrichment
cell fuel1_1 101 fuel3 -pin_fuel % "fuel3" material (3.1%)
cell clad1_1 101 zirc -pin_clad pin_fuel
cell water1_1 101 water pin_clad
% Identical geometry with 4.5% enrichment
cell fuel1_2 102 fuel4 -pin_fuel % "fuel4" material (4.5%)
cell clad1_2 102 zirc -pin_clad pin_fuel
cell water1_2 102 water pin_clad
% Use both universes in an assembly
lat mixed_assy 10 0.0 0.0 17 17 1.26
101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101
101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101
101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101 101
101 101 101 102 102 102 102 102 102 102 102 102 102 102 101 101 101
...Transformation References
Define transformations once and reuse them:
% Define transformation matrices
trans ref1 10.0 0.0 0.0
trans ref2 0.0 10.0 0.0 0.0 0.0 90.0
trans ref3 -10.0 0.0 0.0 180.0 0.0 0.0
% Use references in cell definitions
cell c1 0 fill 1 -s1
trcl c1 ref1 % Reference first transformation
cell c2 0 fill 1 -s2
trcl c2 ref2 % Reference second transformation
cell c3 0 fill 1 -s3
trcl c3 ref3 % Reference third transformationMultiple Levels of Nesting
Create complex hierarchies with multiple levels:
% Level 1: Fuel pin (universe 1)
surf f_rad cylz 0.0 0.0 0.41
surf c_rad cylz 0.0 0.0 0.47
cell fuel 1 uo2 -f_rad
cell clad 1 zirc -c_rad f_rad
cell cool 1 water c_rad
% Level 2: 3x3 pin array (universe 10)
lat small 10 0.0 0.0 3 3 1.26
1 1 1
1 2 1
1 1 1
% Level 3: Assembly with multiple 3x3 arrays (universe 20)
surf assy_bound rect -10.5 10.5 -10.5 10.5 -150 150
cell c_small1 20 fill 10 -small_bound1
trcl c_small1 -5.0 -5.0 0.0
cell c_small2 20 fill 10 -small_bound2
trcl c_small2 5.0 -5.0 0.0
cell c_small3 20 fill 10 -small_bound3
trcl c_small3 -5.0 5.0 0.0
cell c_small4 20 fill 10 -small_bound4
trcl c_small4 5.0 5.0 0.0
cell assy_water 20 water -assy_bound small_bound1 small_bound2 small_bound3 small_bound4
% Level 4: Core with multiple assemblies (universe 0)
surf core_bound rect -50 50 -50 50 -170 170
cell core 0 fill 20 -core_bound
cell outside 0 outside core_boundModeling Strategy: For complex reactor models, a typical hierarchy might be:
- Level 1: Pin-level universes (fuel pins, guide tubes)
- Level 2: Assembly-level universes (collections of pins in lattices)
- Level 3: Core-level universe (arrangement of assemblies)
- Level 4: Full model with core, reflector, and surroundings
Practical Applications
Example 1: Pincell with Axial Zones
Use universes to model a fuel pin with different axial regions:
% Define fuel pin universes with different materials
% Bottom plenum (universe 1)
surf p_rad cylz 0.0 0.0 0.47
cell plenum1 1 ss -p_rad
cell water1 1 water p_rad
% Fuel region (universe 2)
surf f_rad cylz 0.0 0.0 0.41
surf c_rad cylz 0.0 0.0 0.47
cell fuel2 2 uo2 -f_rad
cell clad2 2 zirc -c_rad f_rad
cell water2 2 water c_rad
% Top plenum (universe 3)
cell plenum3 3 ss -p_rad
cell water3 3 water p_rad
% Assemble axial regions into a complete pin (universe 0)
surf bot_bound pz -150
surf fuel_bot pz -100
surf fuel_top pz 100
surf top_bound pz 150
cell bot_region 0 fill 1 -fuel_bot bot_bound % Bottom plenum
cell fuel_region 0 fill 2 -fuel_top fuel_bot % Fuel region
cell top_region 0 fill 3 -top_bound fuel_top % Top plenum
cell outside 0 outside top_bound : -bot_bound % Outside regionExample 2: Reflective Model with Partial Core
Use universes and symmetry to model a quarter-core:
% Define all pin and assembly universes as before...
% Quarter-core model with reflective boundaries
surf quarter_core rect 0.0 107.1 0.0 107.1 -150 150
surf refl_bound rect -20 127.1 -20 127.1 -170 170
% Place quarter-core with reflective boundaries on x and y axes
cell core_region 0 fill 20 -quarter_core
cell reflector 0 water -refl_bound quarter_core
cell outside 0 outside refl_bound
% Set reflective boundary conditions
set bc 2 2 1 1 1 1 % Reflective on xmin and ymin boundariesExample 3: Modeling Control Rod Movement
Use universes to model control rod insertion at different heights:
% Define control rod (universe 10)
surf rod_rad cylz 0.0 0.0 0.4
cell rod_abs 10 boron -rod_rad
cell rod_out 10 outside rod_rad
% Define guide tube with water (universe 11)
surf guide_in cylz 0.0 0.0 0.54
surf guide_out cylz 0.0 0.0 0.60
cell guide_tube 11 zirc -guide_out guide_in
cell guide_water_in 11 water -guide_in
cell guide_water_out 11 outside guide_out
% Different insertion levels (universe 0)
surf rod_bottom pz -100.0
surf rod_25pct pz -50.0
surf rod_50pct pz 0.0
surf rod_75pct pz 50.0
surf rod_top pz 100.0
% Fully inserted (universe 20)
cell rod_full 20 fill 10 -rod_top rod_bottom -guide_in % Control rod
cell guide_full 20 fill 11 -guide_out % Guide tube (universe gets clipped by rod)
% 75% inserted (universe 21)
cell rod_75 21 fill 10 -rod_75pct rod_bottom -guide_in
cell water_75 21 fill 11 -rod_top rod_75pct
cell guide_75 21 fill 11 -guide_out
% 50% inserted (universe 22)
cell rod_50 22 fill 10 -rod_50pct rod_bottom -guide_in
cell water_50 22 fill 11 -rod_top rod_50pct
cell guide_50 22 fill 11 -guide_out
% 25% inserted (universe 23)
cell rod_25 23 fill 10 -rod_25pct rod_bottom -guide_in
cell water_25 23 fill 11 -rod_top rod_25pct
cell guide_25 23 fill 11 -guide_out
% Fully withdrawn (universe 24)
cell water_out 24 fill 11 -rod_top rod_bottom
cell guide_out 24 fill 11 -guide_outControl Rod Tip: For simulating control rod movement, another approach is to use transformations. You can define the control rod once and use trcl to position it at different insertion depths. This can be more efficient than creating separate universes for each position if you have many control rods.
Common Universe Pitfalls
Working with universes can introduce some challenges:
Overlapping Universe Definitions
- Defining cells with the same universe ID but different geometries can lead to conflicts
- Ensure that all cells with the same universe ID form a consistent geometric model
- Use unique universe IDs for distinct geometric configurations
Universe Transformation Issues
- Remember that rotations follow a specific order (x, then y, then z)
- Verify that transformations don't place universes in unintended positions
- Test complex transformations with simplified models first
Material Definition Confusion
- Remember that material assignments happen at the cell level, not the universe level
- When reusing universe geometries with different materials, create separate universes
- Avoid using the same cell ID in different universes (can be confusing)
Debugging Tip: When working with complex nested universes, use the set gcucommand to generate plots at specific universe levels. For example, set gcu 10 will plot universe 10, which can help identify issues with cell definitions or transformations within that universe.
Universe vs. Lattice
Universes and lattices are closely related concepts in Serpent:
When to Use Universes
- For creating modular, reusable geometry components
- When you need to place the same structure at different locations with transformations
- For hierarchical organization of complex models
- When components don't follow a regular pattern
When to Use Lattices
- For regular repeating patterns (like fuel pins in an assembly)
- When you need to arrange many instances of universes in a grid
- For efficient modeling of reactor core components
- When the arrangement follows a specific pattern (rectangular, hexagonal, etc.)
Combined Approach
The most effective modeling strategy often combines both:
- Define basic components as universes (pins, guide tubes)
- Arrange these universes in lattices (for assemblies)
- Define assemblies as universes containing lattices
- Arrange assembly universes in the core (either directly or in a core lattice)
Best Practice: Develop a consistent naming and numbering convention for universes and lattices. For example, use universe IDs 1-99 for pins, 100-199 for assemblies, and 200+ for core structures. This makes your input file more organized and easier to maintain.
Summary
Universes are a fundamental concept in Serpent for creating complex geometries:
- Universes are self-contained geometric domains with their own cells and coordinate systems
- The
filloperator places universes inside cells of other universes - Transformations allow universes to be positioned and oriented as needed
- Nesting universes creates hierarchical structures for complex models
- Combining universes with lattices provides powerful and efficient modeling capabilities
- Multiple levels of universe nesting match the physical structure of nuclear systems
In the next section, we'll explore visualization tools in Serpent, which are essential for verifying the complex geometries created using universes and lattices.