MCNP Guide
Your First MCNP Input File
Three sections, one blank line between each, and a deck that actually runs
What you'll learn
- Lay out an input file as a title line, then cells, surfaces, and data, separated by blank lines.
- Build a nested sphere model that ends in an outside void cell with
imp:n=0. - Write the
m1,m2,mt2,kcode, andksrccards the model needs. - Run
mcnp6 i=… o=…and find the final combined k-effective in the output.
Before you start
What an input file is
An MCNP deck is three blocks of cards in a fixed order, separated by a blank line. The first non-comment line is the title. After that come cell cards (regions and what fills them), then surface cards (the boundaries those cells name by number), then data cards (materials, source, tallies, and everything else). Leave a section blank and MCNP still expects the blank line that marks where it would have been.
Comments start with c in column 1, or with $ anywhere on a line after the card text. Card images are read to a fixed width — 80 columns through MCNP 6.1, 128 from 6.2 on — and anything past the limit is dropped without a warning. Decks are still written to 80 because that width runs everywhere, and because truncating a parameter fails silently.
A complete criticality deck
The smallest useful criticality model is a fissile sphere with a reflector and a graveyard. Hover the deck below for a field-by-field walkthrough; the paragraphs after it name the three places this deck is easy to get wrong.
Enriched Uranium Sphere with Water Reflectorc ---- Cell Cards ----c cell mat density surfaces params1 1 -18.74 -1 imp:n=1 $ Uranium sphere2 2 -1.0 1 -2 imp:n=1 $ Water reflector3 0 2 imp:n=0 $ Outside world (graveyard)c ---- Surface Cards ----1 so 8.741 $ Inner sphere radius (cm)2 so 18.741 $ Outer sphere radius (cm)c ---- Data Cards ----c Material fractions: positive = atom fractionm1 92235.70c 0.95 $ U-235 (95% enriched)92238.70c 0.05 $ U-238 (5%)m2 1001.70c 2 $ H in H2O (atom ratio)8016.70c 1 $ O in H2Omt2 lwtr.10t $ S(a,b) thermal neutron scatteringkcode 10000 1.0 50 250 $ 10k/cycle, k-guess, skip, totalksrc 0 0 0 $ Initial fission source point
Uranium Sphere Model
Hover any highlighted line to see a field-by-field explanation.
Cell 1 is HEU metal at 18.74 g/cm³, entered as -18.74. The minus on the density means g/cm³; a positive density would mean atoms/barn·cm. That sign is unrelated to the minus on -1, which is geometry sense — inside surface 1. The density convention is covered properly on Cell Cards; the point here is only that the two minus signs answer different questions.
Cell 2 is the water shell: outside surface 1 and inside surface 2. Cell 3 is material 0 (void) with imp:n=0. Every deck needs at least one such graveyard; without it MCNP has no place to kill particles that leave the geometry, and the run never finishes for the reason you expect.
The two so surfaces are spheres at the origin. Radii 8.741 cm and 18.741 cm give a 10 cm water reflector. Material m1 is 95 at% U-235 on the .70c library; m2 is light water with mt2 lwtr.10t for the thermal kernel. kcode runs 10,000 particles per cycle, skips 50 inactive cycles, and tallies over 200 active ones; ksrc 0 0 0 seeds the fission source at the centre. The source point has to sit inside a cell, never on a surface.
How this relates to the pin cell
This path accumulates toward a PWR pin cell on Example: Pin Cell. The sphere deck is not that pin — it exists to show the three-section layout and a working kcode / ksrc pair before the geometry gets harder. The pin keeps the same section order and the same graveyard rule; it swaps the two spheres for concentric cz cylinders and axial pz planes, and it adds the four materials you will write later on Material Cards.
Running the deck
Save the input as something like uranium_sphere.i and run it with o= naming the output file. The flag n= is a different thing — a filename prefix — and is covered on Running MCNP.
mcnp6 i=uranium_sphere.i o=uranium_sphere.oIn the output, find the line that reports the final estimated combined collision/absorption/track-length keff. For this HEU sphere that number should sit well above 1. If MCNP stops with a fatal error, the message almost always names a line: a missing blank between sections, a surface number the cells do not use, or a ksrc point that landed on a surface rather than inside a cell.
Try it: line length
The failure mode from earlier, made concrete. Anything past the column limit is dropped with no warning, so a truncated parameter looks like a valid shorter card.
c comment line above the card, and leave a short comment after the $.The danger is not the comment — it is what happens when the truncated text is a parameter. A cell card whose imp:n=1 falls past column 80 is a cell with no importance, and the run kills every particle that enters it.
Card semantics on this page follow MCNP6.3.1 Theory & User Manual (LA-UR-24-24602 Rev. 1), §4.1 MCNP Units, §4.4.5 Cell, Surface, and Data Cards and §4.4.6 Continuation Lines.
Full reference list on the attribution page.
Check yourself
- Lay out an input file as title, cells, surfaces, and data, with blank lines between sections?
- Build a nested sphere model that ends in an outside void cell at
imp:n=0? - Write the
m1,m2,mt2,kcode, andksrccards this model needs? - Run the deck and find the final combined k-effective in the output?