diff --git a/docs/source/methods/introduction.rst b/docs/source/methods/introduction.rst index 70ae114177..5648e17883 100644 --- a/docs/source/methods/introduction.rst +++ b/docs/source/methods/introduction.rst @@ -31,6 +31,99 @@ simulate: where :math:`\sigma^2` is the variance of the sample mean and :math:`N` is the number of realizations. +------------------------ +Overview of Program Flow +------------------------ + +OpenMC performs a Monte Carlo simulation one particle at a time -- at no point +is more than one particle being tracked. Before any particles are tracked, the +problem must be initialized. This involves the following steps: + + - Read input files and building data structures for the geometry, materials, + tallies, and other associated variables. + + - Initialize the pseudorandom number generator. + + - Read ACE format cross-sections specified in the problem. + + - If using a special energy grid treatment such as a union energy grid or + lethargy bins, that must be initialized as well. + + - In a fixed source problem, source sites are sampled from the specified + source. In a criticality problem, source sites are sampled from some initial + source distribution or from a source file. The source sites consist of + coordinates, a direction, and an energy. + +Once initialization is complete, the actual transport simulation can +proceed. The life of a single particle will proceed as follows: + + 1. The particle's properties are initialized from a source site previously + sampled. + + 2. Based on the particle's coordinates, the current cell in which the particle + resides is determined. + + 3. The energy-dependent cross-sections for the material that the particle is + currently in are determined. Note that this includes the total + cross-section, which is not pre-calculated. + + 4. The distance to the nearest boundary of the particle's cell is determined + based on the bounding surfaces to the cell. + + 5. The distance to the next collision is sampled. If the total material + cross-section is :math:`\Sigma_t`, this can be shown to be + + .. math:: + + d = -\frac{\ln \xi}{\Sigma_t} + + where :math:`\sigma` is a `pseudorandom number`_ sampled from a uniform + distribution on [0,1). + + 5. If the distance to the nearest boundary is less than the distance to the next + collision, the particle is moved forward to this boundary. Then, the process + is repeated from step 2. If the distance to collision is closer than the + distance to the nearest boundary, then the particle will undergo a collision. + + 6. The material at the collision site may consist of multiple nuclides. First, + the nuclide with which the collision will happen is sampled based on the + total cross-sections. If the total cross section of material :math:`i` is + :math:`\Sigma_{t,i}`, then the probability that any nuclide is sampled is + + .. math:: + + P(i) = \frac{\Sigma_{t,i}}{\Sigma_t} + + 7. Once the specific nuclide is sampled, the random samples a reaction for + that nuclide based on the microscopic cross sections. If the microscopic + cross-section for some reaction :math:`x` is :math:`\sigma_x` and the total + microscopic cross section for the nuclide is :math:`\sigma_t`, then the + probability that reaction :math:`x` will occur is + + .. math:: + + P(x) = \frac{\sigma_x}{\sigma_t} + + 8. If the sampled reaction is elastic or inelastic scattering, the outgoing + energy and angle is sampled from the appropriate distribution. If the + reaction is (n,xn), it's also treated as scattering and the weight of the + particle is increased by the multiplicity of the reaction. The particle + then continues from step 3. If the reaction is absorption or fission, the + particle dies and if necessary, fission sites are created and stored in the + fission bank. + +After all particles have been simulated, there are a few final tasks that must +be performed before the run is finished. This include the following: + + - With the accumulated sum and sum of squares for each tally, the sample mean + and its variance is calculated. + + - All tallies and other results are written to disk. + + - If requested, a source file is written to disk + + - All allocatable arrays are deallocated. + --------------------- Criticality Algorithm --------------------- @@ -38,3 +131,4 @@ Criticality Algorithm .. _probability distributions: http://en.wikipedia.org/wiki/Probability_distribution .. _Monte Carlo: http://en.wikipedia.org/wiki/Monte_Carlo_method .. _central limit theorem: http://en.wikipedia.org/wiki/Central_limit_theorem +.. _pseudorandom number: http://en.wikipedia.org/wiki/Pseudorandom_number_generator