arfc / mlmc

Machine Learning acceleration of Monte Carlo neutron trasnport. Test problems and exploration.
BSD 3-Clause "New" or "Revised" License
4 stars 1 forks source link

Run OpenMC Example Files #7

Open katyhuff opened 6 years ago

katyhuff commented 6 years ago

Additionally, run any example input files provided in the software examples directory, and spend a little time browsing the code and reading the tests.

vancouvergorilla commented 6 years ago

set OPENMC_CROSS_SECTIONS environment variable to get cross_sections.xml

e.g. os.environ['OPENMC_CROSS_SECTIONS']='/Users/wenxin/nndc_hdf5/cross_sections.xml'

Don't use !export in jupyter notebook

vancouvergorilla commented 6 years ago

import miniconda path

import sys sys.executable sys.path = ['', '/Users/wenxin/miniconda3/lib/python36.zip', '/Users/wenxin/miniconda3/lib/python3.6', '/Users/wenxin/miniconda3/lib/python3.6/lib-dynload', '/Users/wenxin/miniconda3/lib/python3.6/site-packages', '/Users/wenxin/miniconda3/lib/python3.6/site-packages/cycler-0.10.0-py3.6.egg', '/Users/wenxin/miniconda3/lib/python3.6/site-packages/setuptools-27.2.0-py3.6.egg']

vancouvergorilla commented 6 years ago

files needed for running openmc materials.xml: materials of pin-cell cross_sections.xml: tells OpenMC where it can find nuclide cross sections and S(α,β) tables geometry.xml: store shape of the containers settings.xml: specify how many batches and particles we want to run tallies.xml

output: plots.xml

vancouvergorilla commented 6 years ago

After running:

find the statepoint file. _tally.getvalues get pandas dataframs _tally.get_pandasdataframe use of pandas df.boxplot

vancouvergorilla commented 6 years ago

./docs/source/io_formats/settings.rst:40:cutoff used below which particles undergo Russian roulette. Surviving particles ./docs/source/io_formats/settings.rst:42:rouletting are not turned on by default. The second is the energy cutoff which ./docs/source/io_formats/settings.rst:48: The weight below which particles undergo Russian roulette. ./docs/source/io_formats/settings.rst:54: roulette. ./docs/source/methods/physics.rst:1621:Russian rouletting. Two user adjustable parameters :math:w_c and :math:w_s ./docs/source/methods/physics.rst:1623:roulette and the weight should they survive Russian roulette. The algorithm for ./docs/source/methods/physics.rst:1624:Russian rouletting is as follows. After a collision if :math:w < w_c, then the ./docs/source/methods/physics.rst:1627:Russian roulette is simply :math:w, so the game can be considered "fair". By ./openmc/settings.py:43: Russian roulette. Value for 'weight_avg' should be a float indicating ./openmc/settings.py:45: roulette. Value of energy should be a float indicating energy in eV ./src/physics.F90:122: ! Play russian roulette if survival biasing is turned on ./src/physics.F90:125: call russian_roulette(p) ./src/physics_common.F90:16: subroutine russian_roulette(p) ./src/physics_common.F90:31: end subroutine russian_roulette ./src/physics_mg.F90:94: ! Play russian roulette if survival biasing is turned on ./src/physics_mg.F90:96: call russian_roulette(p)


From openmc/docs/source/methods/physics.rst Additionally, since survival biasing can reduce the weight of the neutron to very low values, it is always used in conjunction with a weight cutoff and Russian rouletting. Two user adjustable parameters :math:w_c and :math:w_s are given which are the weight below which neutrons should undergo Russian roulette and the weight should they survive Russian roulette. The algorithm for Russian rouletting is as follows. After a collision if :math:w < w_c, then the neutron is killed with probability :math:1 - w/w_s. If it survives, the weight is set equal to :math:w_s. One can confirm that the average weight following Russian roulette is simply :math:w, so the game can be considered "fair". By default, the cutoff weight in OpenMC is :math:w_c = 0.25 and the survival weight is :math:w_s = 1.0. These parameters vary from one Monte Carlo code to another.

vancouvergorilla commented 6 years ago

./docs/source/io_formats/settings.rst:582:<survival_biasing> Element ./docs/source/io_formats/settings.rst:585:The <survival_biasing> element has no attributes and has an accepted value ./docs/source/io_formats/settings.rst:587:survival biasing, otherwise known as implicit capture or absorption. ./docs/source/methods/eigenvalue.rst:139:source contained in cell :math:i. To ensure that no bias is introduced, the ./docs/source/methods/parallelization.rst:370:method of successive generations) will be biased from the true fundamental ./docs/source/methods/parallelization.rst:373:per cycle is sufficiently large to neglect this bias. ./docs/source/methods/physics.rst:318:fission. If no survival biasing is being used, then the number of neutrons ./docs/source/methods/physics.rst:328:produced is biased in this manner so that the expected number of fission ./docs/source/methods/physics.rst:1588:biasing or implicit absorption (or sometimes implicit capture*, even though ./docs/source/methods/physics.rst:1591:In survival biasing, absorption reactions are prohibited from occurring and ./docs/source/methods/physics.rst:1596: :label: survival-biasing-weight ./docs/source/methods/physics.rst:1602:handled differently if survival biasing is turned on. Although fission reactions ./docs/source/methods/physics.rst:1603:never actually occur with survival biasing, we still need to create fission ./docs/source/methods/physics.rst:1619:Additionally, since survival biasing can reduce the weight of the neutron to ./docs/source/methods/tallies.rst:95:by the volume of the region of integration. If survival biasing is employed, the ./docs/source/methods/tallies.rst:278::math:x_1, x_2, \dots, x_N, then an unbiased estimator for the population mean ./docs/source/methods/tallies.rst:294:distribution also known as the biased sample variance: ./docs/source/methods/tallies.rst:297: :label: biased-variance ./docs/source/methods/tallies.rst:302:This estimator is biased because its expected value is actually not equal to the ./docs/source/methods/tallies.rst:306: :label: biased-variance-expectation ./docs/source/methods/tallies.rst:312:correction_ to come up with an unbiased sample variance estimator: ./docs/source/methods/tallies.rst:315: :label: unbiased-variance ./docs/source/methods/tallies.rst:321:in equation :eq:unbiased-varianceis especially suitable for computation since ./docs/source/methods/tallies.rst:361:We can combine this result with equation :eq:unbiased-varianceto come up with ./docs/source/methods/tallies.rst:362:an unbiased estimator for the variance of the sample mean: ./docs/source/methods/tallies.rst:373:population based on equation :eq:unbiased-variancewill tend to the true ./docs/source/methods/tallies.rst:404::eq:unbiased-variance. If the random variables :math:X_i` are


From ./docs/source/io_formats/settings.rst The <survival_biasing> element has no attributes and has an accepted value of "true" or "false". If set to "true", this option will enable the use of survival biasing, otherwise known as implicit capture or absorption.

Default: false

From ./docs/source/methods/physics.rst In problems with highly absorbing materials, a large fraction of neutrons may be killed through absorption reactions, thus leading to tallies with very few scoring events. To remedy this situation, an algorithm known as survival biasing or implicit absorption (or sometimes implicit capture, even though this is a misnomer) is commonly used. In survival biasing, absorption reactions are prohibited from occurring and instead, at every collision, the weight of neutron is reduced by probability of absorption occurring, i.e.

To be continued

vancouvergorilla commented 6 years ago

add openmc to path export PATH=$PATH:/home/xinwen5/openmc/build/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/xinwen5/openmc/build/lib