MCNP Guide
Complex Geometries
Building realistic models from basic shapes
Boolean Operations
Real nuclear systems require combining basic shapes using Boolean logic. MCNP uses three operations to create complex geometries from simple surfaces.
The Three Operations
Intersection (AND)
Space between surfaces
-1 2 -3
Union (OR)
Multiple separate regions
-1:-2:-3
Complement (NOT)
Exclude specific cells
#10 #20
Intersection: Bounded Regions
Intersection creates regions that satisfy multiple conditions simultaneously. This is how you build finite volumes from infinite surfaces.
Simple Fuel Pellet
c Basic cylindrical pellet
1 cz 0.4095 $ Pellet radius
2 pz 0.0 $ Bottom face
3 pz 1.0 $ Top face
c Fuel pellet cell
10 1 -10.4 -1 2 -3 imp:n=1 $ UO2 pelletCell 10 is inside cylinder 1 (-1) AND above plane 2 (2) AND below plane 3 (-3). All three conditions must be true.
Complete Fuel Pin
c PWR fuel pin surfaces
1 cz 0.4095 $ Fuel radius
2 cz 0.4178 $ Gap radius
3 cz 0.4750 $ Clad radius
4 pz 0.0 $ Pin bottom
5 pz 366.0 $ Pin top
c Pin regions
10 1 -10.4 -1 4 -5 $ UO2 fuel
11 0 1 -2 4 -5 $ Helium gap
12 2 -6.56 2 -3 4 -5 $ Zircaloy clad
13 3 -0.714 3 4 -5 $ Water around pinEach region uses intersection to define bounded volumes. The fuel is inside the fuel cylinder and between the axial planes.
Union: Multiple Regions
Union operations (using colons) combine separate regions into single cells. This simplifies input files for discontinuous structures.
Guide Tube Array
c Four guide tubes in assembly
1 c/z 5.4 5.4 0.612 $ Guide tube 1
2 c/z 5.4 16.2 0.612 $ Guide tube 2
3 c/z 16.2 5.4 0.612 $ Guide tube 3
4 c/z 16.2 16.2 0.612 $ Guide tube 4
5 pz 0.0 $ Assembly bottom
6 pz 366.0 $ Assembly top
c Guide tube steel (single cell for all four)
20 1 -7.8 (-1:-2:-3:-4) 5 -6 $ Steel tubes
21 2 -0.7 (1 2 3 4) 5 -6 $ Water insideCell 20 combines four separate cylindrical regions with union. Cell 21 uses intersection of all cylinders for the water inside.
Detector Array
c 2x2 detector crystals
1 rcc 0 0 0 0 0 5 2.5 $ Crystal 1
2 rcc 6 0 0 0 0 5 2.5 $ Crystal 2
3 rcc 0 6 0 0 0 5 2.5 $ Crystal 3
4 rcc 6 6 0 0 0 5 2.5 $ Crystal 4
5 rpp -3 9 -3 9 -1 6 $ Housing box
c Detector assembly
30 1 -3.67 (-1:-2:-3:-4) $ NaI crystals
31 2 -2.7 -5 1 2 3 4 $ Aluminum housing
32 0 5 $ Outside airUnion combines four crystals into one material region. The housing is inside the box but outside all crystals.
Complement: Excluding Regions
Complement operations use the # symbol to exclude specific cells. This is useful for defining void spaces around complex objects.
Room with Equipment
c Room and equipment
1 so 2.0 $ Source sphere
2 so 12.0 $ Shield sphere
3 rpp -50 50 -50 50 -30 30 $ Room boundary
c Definitions
10 1 -19.3 -1 $ Source
20 2 -11.3 -2 1 $ Lead shield
30 0 -3 2 #40 #50 $ Air (excluding equipment)
40 3 -7.8 -4 $ Steel table
50 4 -2.7 -5 $ Detector
c Equipment surfaces
4 rpp -10 10 -5 5 -25 -20 $ Table
5 rcc 30 0 0 0 0 10 5 $ DetectorCell 30 defines air in the room but excludes the table (#40) and detector (#50). This is simpler than complex Boolean operations.
Practical Assembly Example
Let's build a realistic fuel assembly step by step, showing how to combine operations systematically.
Step 1: Define Components
c Assembly components
1 cz 0.4095 $ Fuel radius
2 cz 0.4178 $ Gap radius
3 cz 0.4750 $ Clad radius
4 cz 0.612 $ Guide tube radius
5 px -10.71 $ Assembly boundaries
6 px 10.71
7 py -10.71
8 py 10.71
9 pz 0.0 $ Bottom
10 pz 366.0 $ TopStep 2: Create Pin Cells
c Fuel pin at origin
20 1 -10.4 -1 9 -10 $ UO2 fuel
21 0 1 -2 9 -10 $ Helium gap
22 2 -6.56 2 -3 9 -10 $ Zircaloy clad
c Guide tube at (5.4, 5.4)
23 2 -6.56 -4 9 -10 trcl=1 $ Guide tube steel
24 3 -0.714 4 9 -10 trcl=1 $ Water inside
c Transformation
tr1 5.4 5.4 0 $ Translation to positionStep 3: Assembly Water
c Water around all pins
25 3 -0.714 -5 6 -7 8 9 -10 #20 #21 #22 #23 #24 $ Water
26 0 5:-6:7:-8:-9:10 $ OutsideCell 25 fills the assembly box but excludes all pin cells. This creates the water moderator around the fuel pins.
Advanced Techniques
Parentheses Grouping
Use parentheses to group complex Boolean operations and control evaluation order.
c Complex grouping
1 1 -2.7 (-1 2):(-3 4) $ Two separate regionsTransformation Cards
Use TR cards to rotate and translate surfaces, enabling repeated placement of identical components.
c Rotated component
tr1 0 0 0 90 90 0 $ 90° rotation about zCommon Mistakes
- • Forgetting parentheses in complex Boolean expressions
- • Creating overlapping cells (undefined geometry)
- • Missing void regions (particles get lost)
- • Inconsistent surface orientations
- • Over-complicated Boolean logic
Geometry Checking
Always verify complex geometries before running transport calculations. MCNP provides tools to check for common problems.
Verification Steps
- Use VOID card: Check geometry without transport
- Plot geometry: Visualize with MCPLOT or external tools
- Check volumes: Use VOL card to calculate cell volumes
- Test particle tracking: Run short calculations to find errors
- Review lost particles: Check output for tracking problems
Best Practices
Design Guidelines
- Start simple: Build complex geometries incrementally from basic shapes
- Use consistent numbering: Organize surface and cell numbers logically
- Document your logic: Add comments explaining complex Boolean operations
- Test frequently: Check geometry at each step of construction
- Consider alternatives: Sometimes universes are simpler than Boolean operations