13
30 Los Alamos Science Number 22 1994 C A S I N O ITALY 11 M . N I C E 14 M . PORT DE MONAC O L E S A L P E S M A R I T I M E S A Monte Carlo Code for Particle Transport an algorithm for all seasons John S. Hendricks E É N A R R E T I D É M R E M P O R T D E F O N T V I E I L L E P L A G E S D U L A R V O T T O C A S I N O ITALY 11 M . N I C E 14 M . L E S A L P E S M A R I T I M E S MONTE CARLO, home to the famous casino, is also the name of a technique that uses games of chance to arrive at correct predictions. This method takes advantage of the speed of electronic computers to make statistical sampling a practical technique for solving complicated problems. Los Alamos Science Number 22 1994 31

A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

  • Upload
    others

  • View
    4

  • Download
    1

Embed Size (px)

Citation preview

Page 1: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

30

Los Alamos Science Number 22 1994

CASINO

ITALY 11 M.

NICE 14 M.

PORT DE MONACO

LES ALPES MARITIMES

A Monte Carlo Code for Particle Transport

an algorithm for all seasons John S. Hendricks

EÉNARRETIDÉMREM

PORT

DE

FO

NTVIEILLE

PL

AG

ES

DU

LARVOTTO

CASINO

ITALY 11 M.

NICE 14 M.

LES ALPES MARITIMES

MONTE CARLO, home to thefamous casino, is also the name of a technique that uses games of chance to arrive at correct predictions. This method takes advantage of the speed of electronic computers to make statistical sampling a practical technique for solving complicated problems.

Los Alamos Science Number 22 1994 31

Page 2: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

Fast computers and sophisticatedcomputational techniques havelaunched a revolution in scientific

research. No longer does that endeavordepend only on physical experimenta-tion as a basis for developing and refin-ing theory. Instead, scientific theoriescan now be based on numerical experi-ments, which, compared with physicalexperiments, not only are less expen-sive, considerably safer, and more flexi-ble but also provide more information,a better understanding of physical phe-nomena, and access to a wider range ofexperimental conditions. In addition,analysis of the results of numerical ex-periments can guide the selection anddesign of the physical experiments bestsuited to validating theories. Thus nu-merical experimentation (also referredto as numerical modeling or numericalsimulation) has added a new dimensionto scientific research.

Two general approaches to numeri-cal modeling are available—determinis-tic methods and the Monte Carlomethod. Deterministic methods involvesolution of an integral or a differentialequation that describes the dependenceon spatial coordinates or time of somebehavioral characteristic of the systemin question. The equation is cast in anapproximate form that permits calcula-tion of the incremental change in thecharacteristic caused by an incrementalchange in the variable(s). The value ofthe characteristic itself is then calculat-ed at each of successive points on aspatial or temporal grid. The accuracyof deterministic methods is limited byhow well the equation approximatesphysical reality and by the practical ne-cessity of making the spatial or tempo-ral difference between grid points finiterather than infinitesimal. Well-knowndeterministic methods include the finite-difference and finite-element methods.

The Monte Carlo method involvescalculating the average or probable be-

havior of a system by observing theoutcomes of a large number of trials ata game of chance that simulates thephysical events responsible for the be-havior. Each trial of the game ofchance is played out on a computer ac-cording to the values of a sequence ofrandom numbers. For that reason aMonte Carlo calculation has been de-fined in general as one that makes ex-plicit use of random numbers. TheMonte Carlo method is eminently suit-ed to the study of stochastic processes,particularly the process called radiationtransport—the motion of radiation, suchas photons and neutrons, through mat-ter. Another well-known use of theMonte Carlo method is the Metropolistechnique for finding the equilibriumenergy, at a given temperature, of asystem of many interacting particles.The method also has a more strictlymathematical application, namely, esti-mating the value of complicated, many-dimensional integrals.

The principle behind the MonteCarlo method—statistical sampling—dates back to the late eighteenth centu-ry, but it was seldom applied becauseof the labor and time required. Howev-er, the mathematician Stanislaw Ulam,after returning to the Los Alamos labo-ratory in mid 1946, realized that theelectronic computer, which had only re-cently become a reality, could turn sta-tistical sampling into a practical tool.Ulam discussed his idea with the math-ematician John von Neumann, a consul-tant to Los Alamos, who proceeded tooutline a computerized statistical ap-proach to a problem of immense interestto designers of nuclear weapons—neu-tron diffusion and multiplication (by fis-sion) in an assembly containing a fissilematerial. Von Neumann sent his outlineto the head of the Los Alamos Theoreti-cal Division, and the idea was pursuedenthusiastically. Among the Laboratoryscientists who pioneered development of

A Monte Carlo Code for Particle Transport

32 Los Alamos Science Number 22 1994

The Monte Carlomethod was first applied

on the MANIACcomputer at the

Laboratory to predictthe rate of neutron chain

reactions in fissiondevices. Now, half a

century later, its recentincarnation as the

MCNP code has becomea significant technology-

transfer success.

Page 3: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

the Monte Carlo method at Los Alamos,Nicholas C. Metropolis was the one whogave it its entirely appropriate andslightly racy name. Continuous effort atLos Alamos National Laboratory sincethose early times has culminated todayin the computer code called MCNP (forMonte Carlo N-particle), perhaps theworld’s most highly regarded MonteCarlo radiation-transport code.

This article is of necessity too shortto do justice to the Monte Carlomethod. It cannot properly acknowl-edge the scientists who have devotedtheir careers to developing it or thosewho have successfully applied it in avariety of fields. All that will be at-tempted here is to describe the method,showcase a few of the many applica-tions of MCNP, and to explain what isinvolved in developing and maintaininga modern Monte Carlo radiation-trans-port code such as MCNP.

The Monte Carlo Method

Portraying the essence of the MonteCarlo method is perhaps best accom-plished by focusing on its application toradiation transport. For concreteness,let us focus in particular on the problemof estimating the probability that a neu-tron emanating from some source pass-es through some radiation shield. Forsimplicity assume that the source is anisotropic point source, that it emitsmonoenergetic neutrons, and that it islocated at the center of the shield,which is a relatively thick sphericalshell made up of matter containing onlyone isotopic species. The physics ofthe problem is well known: Each neu-tron emitted by the source follows atrajectory within the shield that consistsof a succession of straight-line pathswhose lengths and directions appear tobe random relative to each other (Fig-ure 1). That “random walk” is the

A Monte Carlo Code for Particle Transport

Number 22 1994 Los Alamos Science 33

Radiation shield

Neutron trajectories in the shield

Neutron path

Neutron interaction with nucleus

monte1.adb 7/26/94

Monoenergetic source of neutrons

Figure 1. A Simple Monte Carlo transport ProblemIn the problem discussed in the main text, a source of mono-energetic neutrons is at

the center of a thin, spherical radiation shield. The object is to determine the probabili-

ty that any given neutron emanating from the source will pass through the shield. As

shown above, after entering the shield wall, each neutron will follow a succession of

straight-line paths whose lengths and directions are in many respects random relative

to each other. In other words, the neutron’s trajectory resembles a "random walk".

Both changes in direction and terminations of a given trajectory result from the neu-

tron’s interaction with the nuclei in the shield. The possible interactions with the nu-

clei in the shield are: elastic scattering, which changes the neutron's direction of mo-

tion but not its energy; inelastic scattering, which changes both the direction of motion

and the energy of the neutron; absorption, which terminates the neutron's trajectory as

the neutron is absorbed into the nucleus; and fission, which produces additional neu-

trons but occurs only if the shield contains certain isotopes. The length of the path be-

tween one interaction and the next as well as the outcome of each interaction are de-

scribed by probability distributions that have been determined experimentally. The

Monte Carlo method is used to construct a large set of possible trajectories of a neutron

as it travels through the shield; the experimental probability distributions are sampled

during the construction of each trajectory. The neutron’s probability of escape is then de-

termined based on the outcomes in that set of trajectories. The figure shows some pos-

sible neutron histories in the enlarged view of the shield wall. Most of them scatter a

number of times before being absorbed and one escapes through the shield.

Page 4: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

A Monte Carlo Code for Particle Transport

34 Los Alamos Science Number 22 1994

Figure 2. Geometry Modeling in MCNPShown here are examples of the geometry-modeling capability that can be accessed

for MCNP calculations. The geometries were created and visualized with the graphics

software known as Sabrina, which was developed by James T. West and Kenneth

Van Riper. Each example is depicted in a different visualization format. Unlike the

other examples, the example in color, a model of the SDC detector for the Supercon-

ducting Super Collider, was constructed not simply to demonstrate the capabilities of

Sabrina but for use in an MCNP simulation. The detector, shown here in cutaway view,

contains dozens of components and is very large (the outer cylindrical surface shown

has a diameter of nearly 22 meters). The accelerator was designed to produce two

counter-propagating beams of extremely energetic (20-TeV) protons that travel along

the axis of the detector and collide at its midpoint. The detector model was used in

MCNP simulations to track the products of the collisions and to calculate the levels of

the radiation induced in the detector components by the collision products. The radia-

tion levels are necessary to assess component damage and background signals in the

detector.

Page 5: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

result of interactions of the neutronwith nuclei within the shield. The pos-sible types of interactions of a neutronwith a nucleus include elastic scatter-ing, inelastic scattering, absorption, andfission. For simplicity, assume that theonly interactions that occur are elasticscattering, which changes the directionbut not the speed (and hence energy) ofa neutron, and absorption, a nuclear re-action that swallows up, or “kills,” aneutron. Whether an interaction resultsin a neutron’s being absorbed or scat-tered can be predicted only probabilisti-cally, as can the scattering angle if theneutron is scattered. The probabilitiesof a neutron’s being absorbed by vari-ous isotopes have been measured, andso have the probabilities of its beingscattered through various angles, all asfunctions of neutron energy. Thoseprobabilities, or cross sections, for theshield nuclei are necessary input tosolving the problem at hand. Alsoneeded is the probability density func-tion for the distance a neutron travels inthe shield without undergoing an inter-action with a nucleus (in other words,the probability density function for thelengths of the straight-line paths com-posing the neutron’s trajectory). It isknown that the probability density func-tion for the “free-path” length in anymaterial decreases exponentially. Inparticular, the probability density that aneutron will travel a distance x beforeundergoing an interaction is given by

rse2rsxdx, where r is the density ofnuclei and s is the total cross section(here the sum of the scattering crosssection integrated over scattering angleand the absorption cross section).

Application of the Monte Carlomethod to the problem above involvesusing a sequence of numbers uniformlydistributed on the interval (0, 1) to con-struct a hypothetical (but realistic) his-tory for each of many neutrons as ittravels through the shield. (To say that

a sequence of numbers is uniformlydistributed on (0, 1) means that anynumber between 0 and 1 has an equalprobability of occurring in the se-quence. Such numbers, when generatedby a computer, are called pseudoran-dom numbers.) The ratio of the num-ber of neutrons that escape from theshield to the number of neutrons whosehistories have been constructed is anestimate of the answer to the problem,an estimate whose statistical accuracyincreases as the number of neutron his-tories increases. Details of the processcan be illustrated by following the con-struction of a single neutron history.

Constructing the first step of a neu-tron history involves deciding on avalue for its first free-path length x1.As pointed out above, the sequence ofpseudorandom numbers generated bythe computer is uniformly distributedon (0, 1), whereas the free-path lengthsare distributed according to e2rsx on(0,

∞). How can the sequence of uni-formly distributed numbers ji be usedto produce a sequence of numbers xiwhose distribution mirrors the experi-mentally observed distribution of free-path lengths? It can be shown that thetransformation xi = 2(1/rs)ln(1 2 ji)yields a sequence of numbers that havethe desired inverse exponential distribu-tion. So the first free-path length is ob-tained by setting x1 5 2(1/rs)ln(1 2 j1). The second step in the neu-tron history involves deciding whetherthe neutron’s first interaction with a nu-cleus scatters or kills the neutron. Sup-pose it is known from the cross sectionsfor the shield nuclei that scattering isnine times more likely than absorption.The interval (0, 1) is then divided intotwo intervals, (0, 0.1) and [0.1, 1). As-sume that x2, the second pseudorandomnumber generated by the computer, is0.2. Because 0.2 lies within the largersubinterval, the neutron is scatteredrather than absorbed. The third step in

the neutron history involves decidingthrough what angle it is scattered.Again some transformation must beperformed on the third pseudorandomnumber, a transformation that changesthe uniform distribution of the ji into adistribution that mirrors the observeddistribution of scattering angles (thescattering cross section as a function ofscattering angle). Further steps in thehistory are generated until the neutronis absorbed or until the radial distanceit has traveled within the shield exceedsthe thickness of the shield. The histo-ries of many more neutrons are generat-ed in the same manner.

Assume that N neutron histories aregenerated and that n of the histories ter-minate in escape of the neutron fromthe shield. To calculate an estimate forthe probability that any single neutronescapes, assign a “score” si to each neu-tron as follows: si 5 0 if the neutron isabsorbed within the shield, and si 5 1 ifthe neutron escapes. Then the estimat-ed probability of escape is given by themean score s

w, that is, by (1/N)Ssi 5 n/N.The relative error (relative statisticaluncertainty) in that probability estimateis related to the so-called variance ofthe si, Var(si), which can be approxi-mated, when N is large, by the differ-ence between the mean of the squaresof the scores and the square of themean score:

Var(si) < ^n

i

si2 2 1 ^

n

i

si 22

5

The relative error in the probability es-timate is then given by

5 Ï(Nw 2w nw)/wNwnwÏVwarw(swi)w/Nw}}

sw

n(N 2 n)}

N2

1}N

1}N

A Monte Carlo Code for Particle Transport

Number 22 1994 Los Alamos Science 35

Page 6: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

A Monte Carlo Code for Particle Transport

36 Los Alamos Science Number 22 1994

With form factors (appropriate at room temperature)

With form factors (appropriate at

plasma temperatures)

(b) 10-keV photons and helium(a) Neutrons and iron-56

102

101

100

10-1

Tot

al c

ross

sec

tion

(bar

ns)

Com

pton

sca

tterin

g cr

oss

sect

ion

(arb

itrar

y un

its)

Cosine of scattering angle0 0.5 1-1

Neutron energy (MeV)10-12 10-10 10-8 10-6 10-4 10-2 100

03/03/90

ZAID = 26000.55C

Fe - NAT

from RMCCS

MT = 1

TOTAL

monte 3.adb 7/26/94

-0.5

103

102

101

100

10-1

10-2

10-3

10-4

10-5

10-810-9 10-7 10-6 10-5 10-4 10-3 10-2 10-1 100 101

Neutron energy (MeV)

Cro

ss s

ectio

n (b

arns

)

Total

Elastic

Total inelastic

n, 2n

n, 3n

Total fission

Capture (n, γ)

05/31/89

ZAID = 92235.50C 235U

From RMCCS

(c) Neutron cross sections of 235U

Figure 3. A Few Selections fromthe MCNP Data LibraryThe MCNP data library contains a vast

amount of information about the interac-

tion of radiation with matter. Shown here

are three items included in that library:

(a) the continuous-energy representation

of the total cross section, as a function of

neutron energy, for the interaction of

neutrons with the most abundant stable

isotope of iron, iron-56; (b) the “differen-

tial” cross section (cross section as a

function of scattering angle), with and

without the form factors that account for

electron binding, for Compton scattering

of 10-keV photons off helium; (c) the

cross sections, as functions of neutron

energy, for various interactions of neu-

trons with uranium-235. Total, elastic,

and inelastic cross sections are shown,

as well as cross sections for capture of

the incoming neutron accompanied by

the emission of a photon and for reac-

tions in which one incoming neutron re-

sults in two or three outgoing neutrons,

(n, 2n) and (n, 3n).

Page 7: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

For example, if N 5 100 and n 5 47,the probability of escape is estimated as0.47 and the relative error is a little lessthan 11 percent.

Now is a good time to point out amajor difference between a MonteCarlo calculation and one based on adeterministic method. If the calculationoutlined above is repeated, the secondcalculation is highly unlikely to showthat exactly 47 of the 100 histories re-sult in escape. In other words, repeti-tions of a Monte Carlo calculation yieldonly approximately the same answer,whereas repetitions of a calculationbased on a deterministic method yieldexactly the same answer. That differ-ence is due to the element of chance in-herent in a Monte Carlo calculation.Thus deterministic methods providemore exact solutions of approximatemodels, whereas Monte Carlo methodsprovide approximate solutions of moreexact models.

The simplifying assumptions in-voked in the above example of a MonteCarlo radiation-transport calculation donot of course hold in general. The radi-ation may consist of particles other thanneutrons (or of more than one type ofparticle), and other types of interactionsmay be involved (neutron-induced fis-sion of fissile nuclei, for example). Theradiation may not be monoenergetic,and it may emanate from a source thatis neither point-like nor isotropic. Thematerial through which the radiationtravels may be nonuniform in composi-tion and intricate in geometry. Allthose additional complexities can behandled provided the necessary inputdata are available.

Perhaps the greatest advantage ofusing the Monte Carlo method to simu-late radiation transport is its ability tohandle complicated geometries. Thatability rests on the fact that, eventhough the geometry in question maybe complicated in its entirety, only the

geometry in the vicinity of the particlefor which a random walk is being con-structed need be considered at anypoint in the construction. A givengeometry can be modeled in its entiretyin two ways: as a “combinatorial” ob-ject or as a “surface-sense” object. Asits name implies, a combinatorial objectis constructed by combining relativelysimple geometric entities, such as rec-tangular parallelepipeds, ellipsoids,cylinders, cones, and so on. Combina-torial objects are easy to construct butare less general than the surface-senseobjects provided by MCNP. A surface-sense object is constructed by combin-ing bounding surfaces, each of which isassigned one of two sense values to in-dicate on which side of the boundingsurface the object lies. Any combina-tion of linear, quadratic, or toroidal sur-faces in any orientation or even skewcan be accessed by users of MCNP.Figure 2 shows examples of the intri-cate geometries that can be constructedfor MCNP calculations.

It is worth noting that a Monte Carloradiation-transport code is more than alist of instructions for executing a cer-tain set of arithmetic and logic opera-tions. It is also a repository of experi-mental data about and theoreticalunderstanding of radiation transport ac-cumulated over the years. That knowl-edge is accessed unwittingly by userswhose expertise may lie in areas far re-moved from radiation transport. Thedata are not built into modern MonteCarlo radiation transport codes butrather are available as separate data li-braries. That stratagem permits thedata libraries to be upgraded indepen-dently of the operational portion of thecode. Many older Monte Carlo codesinclude “multigroup” data, which areaveraged over ranges of energy or ofsome other parameter. That practicesaves considerable data-storage spacebut introduces approximations into the

calculations. MCNP and other modernMonte Carlo radiation-transport codesoffer libraries of unaveraged, or“continuous-energy” data. Shown inFigure 3 are a few specific examplesof the data contained in the MCNP datalibrary.

The example of neutron transportthrough a spherical-shell shield showsthat a Monte Carlo radiation-transportcalculation is similar to an opinion poll,such as a Gallup poll. Both use thetechnique of statistical sampling to ob-tain a probabilistic answer to somequestion. Just as a Gallup poll attemptsto predict the outcome of, say, an elec-tion by questioning only a small portionof the voting population, so also does aMonte Carlo radiation-transport calcula-tion attempt to simulate the outcome ofthe interaction of 1015 to 1025 neutronswith some material by constructing his-tories for 105 to 108 neutrons. And justas the voters questioned during aGallup poll are not chosen randomlybut are carefully selected to mirror de-mographic characteristics of the entirevoting population, so also are the neu-tron histories not truly random walksbut histories that mirror the observedphenomenology of neutron interactionswith matter. The analogy between aGallup poll and a Monte Carlo radiation-transport calculation will be continuedin the following discussion of variancereduction.

Variance Reduction

As pointed out above, the result of aMonte Carlo calculation has associatedwith it a statistical uncertainty. Howcan that uncertainty be reduced and theresult thereby be made more accurate?One obvious way to do so is to increasethe number of neutron histories generat-ed (or voters questioned). But that“brute-force” approach is costly in

A Monte Carlo Code for Particle Transport

Number 22 1994 Los Alamos Science 37

Page 8: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

terms of computer time (or pollstertime). Fortunately, more sophisticatedtechniques are available to achieve alower uncertainty without increasing thenumber of histories (voters questioned)or to achieve the same uncertainty froma smaller number of histories. Fourtypes of such “variance-reduction” tech-niques are available: truncation, popu-lation control, probability modification,and pseudodeterministic methods.

Truncation involves ignoring aspectsof the problem that are irrelevant or in-consequential. For example, thesource-and-shield assembly describedabove may include structural elementsthat position the source at the center ofthe shield. Because the nuclei in thestructural elements, like the nuclei inthe shield, interact with the neutrons,the structural elements should be in-cluded in the simulation. Suppose,however, that the structural elementsare very fine rods and hence are consid-erably less massive than the shield it-self. Then truncating the problem byignoring the existence of the structuralelements would have little effect on theresults. An example of truncation in aGallup poll is to not include among thesampled population those who liveabroad and yet are eligible to vote be-cause such persons are unlikely to af-fect the outcome of an election.

Population control involves samplingmore important portions of the sampledpopulation more often or less importantportions less often. For example, sup-pose the neutrons that escape from theleft half of the spherical-shell shield areof greater interest (say, because some-one’s office is located there, whereas alittle-used stairwell is located to theright) and that the left half of the spher-ical shell is composed of a materialmore effective at absorbing neutrons.Each neutron that has a possibility ofreaching the region of greater interest(any neutron that is emitted toward the

left) is “split” into m neutrons (m > 1)and assigned a “weight” of 1/m. Thescores of the histories of the split neu-trons are multiplied by their weight sothat the splitting stratagem does notalter the physical situation but doesallow the sampling of more of the moreimportant neutrons. The correspondingtechnique for sampling fewer of theless important neutrons is referred to asRussian roulette. Applied to the sameexample, Russian roulette involvesspecifying that the neutrons emitted tothe right have a probability of (1 21/m) of being terminated immediatelyupon entering the shield. A neutronwhose history begins with immediatedeath is of course tracked no further.Those neutrons that do not suffer im-mediate death, (1/m) of the neutronsemitted to the right (in the limit oflarge N), are assigned a weight of m.Thus the simulation of the real physicalsituation is unaltered. An applicationof population control in a Gallup pollmight be as follows. Suppose 40 per-cent of the voters are Democrats, 40percent are Republicans, and 20 percentare independents. Then the outcome ofthe vote on an issue such that Democ-rats and Republicans are likely to votethe party line is determined primarilyby the independent vote. Therefore agood polling strategy would be to ques-tion a sample consisting of 20 percentDemocrats, 20 percent Republicans, and60 percent independents (such a samplecould be achieved by including everyindependent on a list of 300 registeredvoters but including each party memberonly if the roll of a die yielded a cho-sen one of the six possible outcomes)and weight the opinions of the 20 De-mocrats and the 20 Republicans by afactor of 2 and the opinions of the 60independents by a factor of 1/3. Thediscarding of 100 Democrats and 100Republicans corresponds to their deathby Russian roulette.

Probability modification involvessampling from a fictitious but conve-nient distribution rather than the truedistribution and weighting the resultsaccordingly. For example, instead ofapplying splitting and Russian rouletteto the neutrons emitted to the left andright, respectively, by the isotropic neu-tron source, the spatially uniform neu-tron distribution is replaced, for thepurpose of constructing histories, by adistribution such that more neutrons areemitted to the left. The “bias” thatsuch a strategy would introduce into theresult is removed by appropriatelyweighting the scores of the neutron his-tories. An example of probability mod-ification in the Gallup-poll analogymight be the following. Suppose only40 percent of the voters questioned by apollster happened to be women. In-stead of questioning sufficiently morewomen to bring the sexual distributionof the sampled population to a 50-50distribution, the response of eachwoman could be weighted by a factorof 5/4 and that of each man by 5/6.

Pseudodeterministic methods areamong the most complicated variance-reduction techniques. They involve re-placing a portion (or portions) of therandom walk by deterministic or ex-pected-value results. Suppose, for ex-ample, that the spherical shell is sur-rounded by further shielding materialwith complex geometry. Instead oftransporting each neutron via a randomwalk through the spherical shell to themore complex region of the shield, theneutron may simply be put at the inter-face between the two shield compo-nents and assigned a weight equal tothe (presumably known) probability ofits arriving there. Similarly, it is knownthat not all those eligible to vote areequally likely to carry out their civicduty. So the response of each personpolled may be assigned a weight equalto the probability, based on factors such

A Monte Carlo Code for Particle Transport

38 Los Alamos Science Number 22 1994

Page 9: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

as gender, race, age, and place of resi-dence, that he or she will indeed vote.The difficulties encountered when usingpseudodeterministic methods arise in as-signing the probabilities.

The use of modern variance-reduc-tion methods has allowed Monte Carlocalculations to be carried out many or-ders of magnitude faster and yet main-tain the same statistical accuracy. Infact, many calculations that once wouldhave required prohibitive amounts ofcomputer time are now routine.

Applications of Monte CarloRadiation-Transport Codes

The many applications of the MonteCarlo method in radiation transport re-flect the pervasiveness of radiation innature and in established and emergingtechnologies. A few of the applicationsof the Laboratory’s MCNP code arediscussed below.

Criticality safety. Preventing theinadvertent assembly of critical massesof fissile material is a grave concern atfacilities that process fissile materials,such as the laboratories of the DOE’snuclear-weapons complex and facilitiesassociated with the generation of nu-clear power, including not only thepower plants themselves but also waste-storage sites and fuel-fabrication plants.An MCNP simulation is a safe, reliableway to assess, for example, whether agiven amount of fissile material assem-bled in a given geometry constitutes acritical mass or whether a chemical re-action involving a fissile material or achange in physical state of a fissile ma-terial can lead to the assembly of a crit-ical mass. Answering such questionsby physical experimentation is so dan-gerous as to be out of the question inmany instances.

A Monte Carlo Code for Particle Transport

Number 22 1994 Los Alamos Science 39

Figure 4. Nuclear Tool for Oil-Well LoggingThis three-dimensional view of a generic nuclear tool for oil-well logging was gener-

ated with the graphics software Sabrina, which is linked to MCNP. The cutout dis-

plays a helium-3 neutron-detector assembly (yellow) encased in iron (green) and im-

mersed in a water-filled borehole (blue), which is surrounded by a limestone

formation (brown). Neutrons emanating from a source are scattered from the rock

formation into the detector assembly. The red lines are neutron paths, as simulated

by MCNP.

Page 10: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

Oil-well logging. Surprising as itmay be, radiation and hence MCNPplay important roles in the search foroil. (Gone are the days when “findingoil” was equated with the gushing of oilfrom an exploratory hole.) The patternof scattering of neutrons and gammarays from rock formations can indicatethe presence or absence of oil. MCNPcan predict the scattering pattern char-acteristic of an oil-bearing rock forma-tion, which is then compared with thescattering pattern obtained with a “log-ging” tool inserted into an exploratorybore hole drilled in the rock formation.As shown in Figure 4, the logging toolcontains a source of neutrons and a de-tector assembly for observing the radia-tion scattered from the rock. Such anuclear logging tool is particularly ef-fective when used in conjunction withother logging tools that contain asource of radio waves or sound waves,

whose scattering provides additional in-formation. MCNP is used by manycompanies around the world in thesearch for oil. The Gas Research Insti-tute and Schlumberger-Doll Research, amajor oil-service company, have con-tracts with the Laboratory for continueddevelopment of MCNP.

Nuclear energy. MCNP serves avariety of purposes in the hundreds ofnuclear power plants around the world.It is used, for example, to designshielding and spent-fuel storage pondsand to estimate the radiation dose re-ceived by operating personnel. GeneralElectric Nuclear Energy of San Jose,California, and other fuel-assemblymanufacturers use MCNP to design as-semblies so that the fuel is “burned”more efficiently. More efficient burn-ing implies cheaper electricity and lessnuclear waste.

A Monte Carlo Code for Particle Transport

40 Los Alamos Science Number 22 1994

The MCNP code is usedworldwide to predict thetransport of radiation in

a dazzling array ofapplications from

oil-well logging andfusion research to the

most advanced medicaldiagnostics andtreatments. It is

adapted to run onsupercomputers, buteven more important,

it can be used bynonspecialists onordinary personal

computers. With overa thousand users at ahundred institutions

around the world, theMCNP code is one ofthe most successful in

the history ofscientific computing.

Figure 5. Example of a Particle-History PlotShown here are the MCNP-simulated histories of neutrons as they travel from a source,

pass through a lead brick, and interact with helium-3 within two neutron detectors (thin

cylinders). The neutron tracks are color-coded according to energy. The plot was gen-

erated with the graphics software Sabrina.

Page 11: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

Nuclear safeguards. The signingof the Treaty on the Nonproliferationof Nuclear Weapons in 1968 was oneof the most important political accom-plishments of this century. Those sig-natory nations that had not yet devel-oped their own nuclear weaponsagreed to forego such development inreturn for access to peaceful nucleartechnology. A cornerstone of thetreaty is inspection of nuclear facilitiesby the International Atomic EnergyAgency to ensure that no “special” nu-clear materials are stolen from the fa-cilities. The inspectors use nonde-structive techniques based on radiationdetection to assay the uranium-235 orplutonium-239 content of, say, fuel as-semblies, barrels of nuclear waste, andworkers’ lunch boxes. The nonde-structive assay techniques are based ondetecting either the radiation emittedby those isotopes themselves in thecourse of radioactive decay or the ra-diation emitted by the products of nu-clear reactions induced in the isotopesby irradiation with neutrons or gammarays. Many of the detectors used bythe inspectors were designed with thehelp of MCNP.

Fusion research. For years scien-tists have been investigating the possi-bility of producing energy by nuclearfusion, the mechanism that powers oursun. Nuclear fusion offers two advan-tages over nuclear fission as an energysource: It does not produce hazardousfission products, and it consumes a nat-urally abundant fuel—deuterium, anisotope of hydrogen that can be extract-ed from sea water. The most advancedstrategy for fusing deuterium nuclei in-volves containment and compression ofa plasma of deuterium ions by atoroidal magnetic field. Since MCNP isone of the few Monte Carlo radiation-transport codes capable of handling thechallenging fourth-order toroidal geom-

etry, it has long been the premier codefor studying the transport of the neu-trons and photons produced by the fu-sion reaction. Another use of MCNP infusion research is studying ways to pre-vent damage to personnel and equip-ment by the fusion-produced radiation.

Medical technology. Few peoplerealize that medicine is the third largestapplication of nuclear reactions, rankingbehind only energy and defense.Among the nuclear medical technolo-gies are boron neutron-capture therapyand positron-emission tomography.Boron neutron-capture therapy involvesinjecting a cancer patient with the sta-ble isotope boron-10 and then irradiat-ing the patient with neutrons. Becauseboron-10 collects preferentially intumor cells and has an exceptionallyhigh cross section for capturing (ab-sorbing) neutrons, the therapy selective-ly kills tumor cells. MCNP is used todetermine the neutron dose and energyspectrum that will kill the tumor andnot the patient. Positron emission to-mography is a nondestructive techniquefor observing metabolism in situ. It in-volves ingestion by the patient of watercontaining the radioactive isotope oxy-gen-15 rather than the usual, nonra-dioactive isotope oxygen-16. As thewater is used by the body, a scannerdetects the gamma rays resulting frominteraction of the positrons emitted bythe oxygen-15 with electrons in cells.For example, a PET scan may revealthat part of a heart is dead and that thusthe heart requires replacement ratherthan repair. MCNP is used to properlyinterpret PET-scan images, which areblurred by the effects of electron andphoton scattering. MCNP benefitsmany other medical technologies, in-cluding computer-assisted tomography,radiation therapies for cancer, and pro-tection of medical personnel from nu-clear radiation and x rays.

Space exploration. Among theharsh features of space are intensebursts of radiation. Simulating the ef-fects of that radiation on equipment andpersonnel is a crucial preliminary to theexploration of space, particularly inlight of its high cost. Calculations withMCNP and other codes have helped de-sign shielding of minimum weight toprotect astronauts from cosmic rays. Inone case a “storm shelter” had been de-signed to protect astronauts from solarflares, but calculations with MCNPshowed that although the proposedshielding would block most of the inci-dent protons, so many gamma rayswould be generated in the shield thatthe astronauts were safer outside thestorm shelter than inside it! MCNPcalculations have also shown that nu-clear power will be essential to extend-ed space exploration. The extra radia-tion astronauts would receive from anuclear reactor is far less than the addi-tional cosmic-ray radiation they wouldbe exposed to during a slower, longerjourney. Of course, MCNP plays a rolealso in designing nuclear-power sys-tems for use in space and in assessingthe survivability of sensitive electroniccomponents and means to protect themfrom damage.

Applications at the Laboratory

Since MCNP was developed here tohelp carry out the Laboratory's primarymission, it is not surprising that thenumber of MCNP users here constitutesa large fraction of the total worldwide.Some of the applications at the Labora-tory have already been mentioned: crit-icality-safety studies and the design ofdetectors for implementation of theNonproliferation Treaty and for spaceexploration. The long list of other Lab-oratory uses of MCNP includes designof the neutron-producing target at the

A Monte Carlo Code for Particle Transport

Number 22 1994 Los Alamos Science 41

Page 12: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

Manuel Lujan, Jr. Neutron ScatteringCenter (LANSCE); design and evalua-tion of apparatus to carry out the pro-posed ATW (accelerator transmutationof waste) scheme for burning surplusplutonium and transmuting long-livedfission products into stable or short-lived isotopes by irradiation with accel-erator-produced neutrons; design of thedual-axis radiographic hydrodynamictest (DARHT) facility for x-ray imagingof explosions; and evaluation of the radi-ation hazard posed by the plutonium-preparation line at the Laboratory’s plu-tonium-processing facility.

Challenges ofMCNP Development

The maturity of the Monte Carlomethod and the high satisfaction levelof MCNP users might imply that alarge investment in future developmentis unnecessary. After having gone onlya few years ago through the formidableprocess of certifying that version 4 sat-isfied rigid quality-assurance standards,why should we now be willing to gothrough the same process for version4A? Or why should a user alreadyhappy with MCNP version 4 bother toobtain and implement version 4A?And finally why should the sponsors ofMCNP continue to spend money on acode that is already “good enough”?The answers to those questions lie inthe challenges presented by the shiftingcomputer hardware and software envi-ronments, by the many users of MCNP,and by the demand for a code of in-creasing versatility and sophistication.

The MCNP of ten years ago wouldnot run on today’s computers becausethe architectures have changed. MCNPmust constantly be adapted to new ar-chitectures and other new aspects of thecomputer world. But care must takennot to squander limited development

funds on inappropriate adaptations. Forexample, we have deliberately avoidedadapting MCNP to massively parallelcomputers that do not use UNIX, stan-dard FORTRAN 77, and MIMD (multi-ple-instruction, multiple-data) architec-tures. If massively parallel machinesare to become the computers of the fu-ture, they will have to accommodate toUNIX and FORTRAN 77, most likelyin a MIMD architecture. For similarreasons we have also avoided adaptingto systems with immature software andcompilers. However, MCNP is usuallyamong the first production physicscodes to become available on any com-mercially viable, state-of-the-art com-puter architecture. For example, thelatest version of MCNP (version 4A)takes full advantage of parallel process-ing on a cluster of workstations, an ar-chitecture that offers many times thecomputing performance of a single-processor Cray supercomputer.

Strange as it may seem, adaptingMCNP to avant-garde architectures iscurrently of lesser interest than adaptingit to the most primitive of computers,the IBM-PC and its clones, which usean operating system, MS-DOS, not de-signed for scientific computing. Theperformance of MCNP on such a ma-chine, equipped with a larger memoryand a faster processor (such as the 486chip) and costing less than $3000, ap-proaches its performance on today’s su-percomputers. In fact, the perfor-mance-to-cost ratio is about 10,000times better than that available on thesupercomputers of just a few years ago!

Updating the graphics package in-cluded in MCNP also requires consider-able effort because graphics packagesare not as standardized as operatingsystems and languages. A major en-hancement to the latest version ofMCNP is the addition of color graphicsand an X-windows-based graphicspackage. Additional links have also

been made to an auxiliary code, Sabri-na, which allows geometries to besketched (see Figure 2) and publication-quality plots of particle histories to begenerated. Figure 5 shows an exampleof such a particle-history plot.

Of all the physics computer codesthat have been developed over theyears, MCNP is among the leaders innumber of users—over a thousand atabout a hundred institutions. The Lab-oratory is obligated, for scientific, ethi-cal, and regulatory reasons, to makeMCNP generally available. But meet-ing the challenge of providing userswith a minimum level of support de-spite the lack of explicit funding forsuch support remains a dilemma.

Continued maintenance and develop-ment are also required to meet new cri-teria, which may be regulatory, techni-cal, or even political. Higher standardsof accountability, particularly in thearea of health, safety, and environment,have generated an avalanche of govern-ment requirements concerning the qual-ity-control standards imposed on com-puter codes, including physics codes.Most of the requirements are long over-due, and most have already been metby MCNP. All require voluminous pa-perwork and are an increasing part ofthe MCNP-maintenance effort. Newtechnical criteria come about from ad-vances in science and new applications.For example, as new libraries of dataabout the interactions of neutrons, pho-tons, and electrons with matter becomeavailable, MCNP must be upgraded toaccommodate different sampling tech-niques and data formats. New applica-tions may require different code fea-tures, such as periodic boundaries andenhanced tally options. Modificationsto MCNP are also required for linkageto related computer codes, such as theSabrina graphics code.

Our current priorities for MCNP arequality, value, and new features.

A Monte Carlo Code for Particle Transport

42 Los Alamos Science Number 22 1994

Page 13: A Monte Carlo Code - Federation of American Scientists · 1994. 7. 26. · A Monte Carlo Code for Particle Transport 32 Los Alamos ScienceNumber 22 1994 The Monte Carlo method was

“Quality” encompasses not only rigor-ous quality control but also demonstra-tions of the code’s validity and accura-cy by comparison with experiment.“Value” encompasses good documenta-tion, timely and controlled releases ofcode versions, and sufficient standard-ization and portability that the code canbe run on the computers favored byMCNP users. “New features” are theessence of code development but can-not supersede quality and value in im-portance.

The Future

The future of the Monte Carlomethod is secure. As computers be-come cheaper and faster, it will moreand more become the method of choicefor solving a wide range of problems.And as the applications of radiation in-crease, Monte Carlo radiation-transportcodes will become more and morewidely used. The future of MCNP atthe Laboratory is also bright, despite re-ductions in nuclear-weapons research.In fact, the code is likely to become amore important tool, as physical testingof nuclear weapons is phased out andsimulations come to constitute a largerfraction of weapons research. Andevery enhancement in MCNP benefitsnot only the Department of Energy’sdefense programs but also its programsin many other areas: nuclear-criticalitysafety, environmental restoration, nu-clear-waste management, prevention ofnuclear proliferation, accelerator pro-duction of tritium, accelerator transmu-tation of nuclear waste, space nuclearpower, nuclear safeguards, fusion andfission energy, arms control, intelli-gence, and on and on. Furthermore,MCNP is one of the Laboratory’s mostpromising candidates for technologytransfer to industry. Many companieshave already expressed interest in Co-

operative Research and DevelopmentAgreements on utilizing or jointly de-veloping MCNP for specific applica-tions. Those collaborations and con-tacts can provide a wide range ofindustries with a marvelous introductionto the Laboratory.

Further Reading

N. Metropolis and S. Ulam. 1949. The MonteCarlo method. Journal of the American Statisti-cal Association 44: 335–341.

W. W. Wood. 1986. Early history of computersimulations in statistical mechanics. In Molecu-lar-Dynamics Simulation of Statistical-Mechani-cal Systems. Proceedings of the InternationalSchool of Physics Enrico Fermi, course 97, editedby G. Ciccotti and W. G. Hoover. North-HollandPhysics Publishing.

Roger Eckhardt. 1987. Stan Ulam, John vonNeumann, and the Monte Carlo method. LosAlamos Science 15: 131–137. Los Alamos Na-tional Laboratory.

N. Metropolis. 1987. The beginning of theMonte Carlo method. Los Alamos Science15: 125–130. Los Alamos National Laboratory.

L. L. Carter and E. D. Cashwell. 1975. Particle-Transport Simulation with the Monte CarloMethod. U.S. Energy Research and DevelopmentAdministration. Available as TID-26607 fromNational Technical Information Service, Spring-field, Virginia 22161.

K. Binder, editor. 1984. Applications of theMonte Carlo Method in Statistical Physics. Top-ics in Current Physics, volume 36. Springer-Ver-lag.

R. A. Forster, R. C. Little, J. F. Briesmeister, andJ. S. Hendricks. 1990. MCNP capabilities fornuclear well logging calculations. IEEE Transac-tions on Nuclear Science 37: 1378–1385.

Ivan Lux and Laszlo Koblinger. 1991. MonteCarlo Transport Methods: Neutron and PhotonCalculations. CRC Press.

J. F. Briesmeister, editor. 1993. MCNP: A gen-eral Monte Carlo N-particle transport code, ver-sion 4A. Los Alamos National Laboratory reportLA-12625.

A Monte Carlo Code for Particle Transport

Number 22 1994 Los Alamos Science 43

John S. Hendricks received his B.S. and M.S. innuclear engineering from the University of Cali-fornia, Los Angeles, in 1972 and his Ph.D. in nu-clear engineering from the Massachusetts Insti-tute of Technology in 1975. He joined theLaboratory in 1975 as a staff member in the Ra-diation Transport Group and has remained withthat group ever since, except for a two-year stinton the staff of the Laboratory’s director as theCongressional liaison. He is currently teamleader for Monte Carlo in the Radiation Trans-port Group.

Acknowledgements

Sabrina illustrations provided by Kenneth VanRiper. MCNP is the product of many peopleover many years, and the following list of pre-sent and past contributors to its development isbound to be incomplete. Unless otherwise noted,all are or were affiliated with Los Alamos Na-tional Laboratory. Present principal developers:Thomas E. Booth, Judith F. Briesmeister, R.Arthur Forster, John S. Hendricks, H. GradyHughes, Gregg W. McKinney, Richard E. Prael.Recent significant developers: Thomas N. K.Godfrey, Leland L. Carter (Westinghouse Han-ford), David G. Collins, Guy P. Estes, HenryLichtenstein, Robert C. Little, Shane P. Pederson,Roger R. Roberts, Robert G. Schrandt, Robert E.Seamon, Edward C. Snow, Patrick D. Soran,William M. Taylor, William L. Thompson, Ken-neth Van Riper, Laurie S. Waters, James T. WestIII (IBM), William T. Urban. Graduate studentsand other contributors: Ronald C. Brockhoff,Robert S. Brown, David A. Cardon, Peter P. Ce-bull, David E. Hollowell, J. Steven Hansen, GlenT. Nakafuji, Scott P. Palmtag, Everett L. Red-mond II, James E. Sisolak, Jennifer L. Uhle,Todd J. Urbatsch, Jason W. VanDenburg, JohnC. Wagner, Daniel J. Whalen. Distinguished“alumni”: Edmond D. Cashwell, C. J. Everett,Enrico Fermi, Nicholas C. Metropolis, John vonNeumann, Robert Richtmyer, Stanislaw Ulam.