Your First MCNP Input File

Building your first working simulation from the ground up

The Three-Section Structure

Every MCNP input file follows the same logical structure, divided into three distinct sections separated by blank lines. This organization helps both you and MCNP understand what each part of your model represents.

Cell Cards

Define the physical volumes and what materials fill them

Surface Cards

Create the geometric boundaries that shape your model

Data Cards

Specify materials, physics settings, and what to measure

MCNP reads your input line by line with an 80-character limit. Comments start with 'c' at the beginning of a line or '$' anywhere in the line. These comments are essential for documenting your choices and making your input file understandable.

Building a Complete Model

Let's create a practical model: an enriched uranium sphere surrounded by water. This example demonstrates all the essential components while remaining simple enough to understand completely.

mcnp
Enriched Uranium Sphere with Water Reflector
c Cell Cards
1  1  -18.74  -1      imp:n=1  $ Uranium sphere
2  2  -1.0     1 -2   imp:n=1  $ Water reflector
3  0           2      imp:n=0  $ Outside world

c Surface Cards
1  so  8.741    $ Inner sphere radius (cm)
2  so  18.741   $ Outer sphere radius (cm)

c Data Cards
m1   92235.70c  0.95   $ U-235 (95% enriched)
     92238.70c  0.05   $ U-238 (5%)
m2   1001.70c   2      $ H in H2O
     8016.70c   1      $ O in H2O
mt2  lwtr.01t          $ Thermal neutron treatment
kcode 10000 1.0 50 250 $ Criticality settings
ksrc  0 0 0            $ Initial source point

Understanding the Cell Definitions

The cell cards create three distinct regions in our model. Cell 1 defines the uranium sphere using material 1 with a density of 18.74 g/cm³. The negative surface number (-1) means "inside surface 1," creating the uranium core. The importance parameter imp:n=1 tells MCNP to track neutrons normally in this region.

Cell 2 creates the water reflector between the two spheres. The geometry "1 -2" means "outside surface 1 AND inside surface 2," creating the shell of water around our uranium. Again, we track neutrons normally with imp:n=1.

Cell 3 represents everything outside our model. Material number 0 indicates void, and imp:n=0 kills any neutron that reaches this region, effectively defining our problem boundary.

Creating the Geometry

Our geometry uses two spherical surfaces, both centered at the origin. The "so" keyword creates a sphere at (0,0,0) with the specified radius. Surface 1 has a radius of 8.741 cm, containing our uranium. Surface 2 extends to 18.741 cm, creating a 10-cm thick water reflector around the uranium core.

This nested sphere arrangement is common in nuclear modeling because it creates well-defined regions without complex geometry calculations. The surfaces work together to ensure complete coverage of our problem space.

Defining Materials and Physics

Material 1 represents highly enriched uranium using ZAID identifiers. The numbers 92235.70c and 92238.70c specify uranium isotopes with continuous-energy cross sections at room temperature. The fractions 0.95 and 0.05 create 95% enrichment, typical for weapons-grade material.

Material 2 defines water using hydrogen and oxygen in their natural 2:1 ratio. The mt2 card adds thermal neutron scattering physics, crucial for accurate neutron behavior in water at low energies.

The kcode card sets up our criticality calculation with 10,000 neutrons per generation, 50 inactive cycles for source convergence, and 250 total cycles (giving 200 active cycles for statistics). The ksrc card places our initial neutron source at the center of the geometry.

Running Your First Simulation

Save your input file with a descriptive name and .i extension (such as uranium_sphere.i). Run the simulation using the command line:

bash
mcnp6 i=uranium_sphere.i o=uranium_sphere.o

MCNP will create an output file (uranium_sphere.o) containing your results. The most important result is k-effective, which tells you whether your system is subcritical (k < 1), critical (k = 1), or supercritical (k > 1). For this highly enriched uranium sphere, you should expect k-effective significantly greater than 1.

What to Look For

In the output file, find the "final estimated combined collision/absorption/track-length keff" value. This represents your system's multiplication factor with its statistical uncertainty. MCNP also provides several statistical checks to verify the quality of your calculation.

If MCNP reports errors, check your input file for typos, missing blank lines between sections, or geometry problems. The error messages usually point to the specific line causing trouble.