GithubHelp home page GithubHelp logo

openmc-dev / openmc Goto Github PK

View Code? Open in Web Editor NEW
752.0 74.0 483.0 70.84 MB

OpenMC Monte Carlo Code

Home Page: https://docs.openmc.org

License: Other

Python 67.52% CMake 0.40% C 0.23% C++ 31.57% Shell 0.14% Dockerfile 0.15%
monte-carlo-simulation particle-transport nuclear-engineering nuclear-energy nuclear-fusion openmc neutronics photon-transport neutron-transport radiation-transport

openmc's People

Contributors

amandalund avatar aprilnovak avatar drewejohnson avatar dryuri92 avatar ebknudsen avatar eepeterson avatar giudgiud avatar gridley avatar hanzhuoran avatar icmeyer avatar joshmay1 avatar jtramm avatar kkiesling avatar lewisgross1296 avatar liangjg avatar makeclean avatar mkreher13 avatar myerspat avatar nelsonag avatar nhorelik avatar ojschumann avatar paulromano avatar pshriwise avatar remdelaportemathurin avatar rockfool avatar samuelshaner avatar shimwell avatar smharper avatar yardasol avatar ypark234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openmc's Issues

Fission secondary energy distribution

Looks like it doesn't currently sample secondary energy distributions for fission and instead just assumes a U-235 thermal fission spectrum. Energies should be sampled and passed through the banks to the next cycle.

Extend sampling of chi-squared distribution

The sampling of a chi-squared distribution is currently only possible for a number of degrees of freedom from 1 to 4. However, it is very easy to extend the sampling to any number of degrees of freedom using rule C64 for odd n and rule C45 for even n (rules are from the Los Alamos Monte Carlo Sampler, LA-9721-MS).

Free-gas thermal scattering

It is important to account for the velocity distribution of target particles when the energy of the neutron is thermal or epithermal (<400kT). Assuming the target material has a particle velocity distribution that is Maxwellian, one can develop a formulation for the effect on the cross-section and the scattering kinematics.

Universe transformations

For working with real geometries, universe transformations will be very helpful. In particular, for the MITR model, universe translation and rotation is used heavily in the MCNP model.

Dominance Ratio calculation

After adding the Shannon entropy capability, it is fairly straightforward to do a dominance ratio calculation via the noise propagation matrix method outlined in T. M. Sutton, P. K. Romano, and B. R. Nease, "On-the-Fly Monte Carlo Dominance Ratio Calculation Using the Noise Propagation Matrix," Progress in Nuclear Science and Technology, 2, pp. 749-756 (2011).

Delta tracking

At some point, it would be nice to have the capability to do delta tracking. Jaakko Leppanen has found that delta tracking speeds up certain problems greatly (those with high mfp?).

Create cross_sections.xml

Right now we are using the xsdata format for looking up cross section tables that is used by Serpent. I'd like to move away from this and have an XML format for the cross section library as well. That way no special reading of the xsdata format would be needed and the standard xml-fortran reading could be used instead. Of course, converters would be supplied that could convert xsdata or xsdir files to the XML format.

Coincident surfaces/lattice boundaries

Lattices may not work correctly if surfaces within the contained universe or within the parent cell are coincident with the lattice boundaries. Additional logic should be added to handle these cases.

Multiple scattering laws for evaporation spectra

Some reactions specify multiple scattering laws. This is mainly used for (n,xn) reactions. In such reactions, the emission of each neutron corresponds to a different excitation energy of the compound nucleus and thus they have different observed energy spectra.

This could be done by having a pointer at the end of the AceEnergyDist pointing to another AceEnergyDist (as many times as necessary).

ACE libraries don't work in binary

Currently, OpenMC can only read ASCII ACE files. Extending to binary shouldn't be too difficult, but will need special handling of Fortran records.

Direct sampling for Maxwell fission spectrum

Currently, the sampling of the Maxwell fission spectrum is done by a rejection sampling technique as in MCNP. This was historically done because evaluating a cos or sin used to be an expensive operation, so rejection sampling could be done faster. Nowadays with highly optimized trigonometric intrinsics, it makes more sense to just to direct sampling both because the performance is likely better and in the interest of clarity.

XML input broken for runs compiled with ifort 12.0.0 (Build 084)

Runs ok with DEBUG turned on, but with DEBUG off and -traceback manually added, we get:

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC        Routine            Line        Source             
openmc             08074FBE  xml_data_geometry          88  xml_geometry.f90
openmc             08074F2C  xml_data_geometry          58  xml_geometry.f90
openmc             08074765  xml_data_geometry         674  xml_geometry.f90
openmc             0805D30A  input_xml_mp_read         119  input_xml.f90
openmc             0805CBF0  input_xml_mp_read          26  input_xml.f90
openmc             0805C906  initialize_mp_ini          66  initialize.f90
openmc             0805FF0C  MAIN__                     26  main.f90
openmc             08049EC4  Unknown               Unknown  Unknown
libc.so.6          B7611E37  Unknown               Unknown  Unknown
openmc             08049DD1  Unknown               Unknown  Unknown

Catch interrupt signal

It would be nice to be able to catch interrupt signals when running in serial like MCNP is able to.

gfortran doesn't run with -O3

When running the input_sample problem, you just get the generic error:

 ERROR: Multiple interpolation regions not supported while attempting to sample 
        secondary energy distribution.                                          

Segmentation Fault - No Material Association

When I created a slab reactor, I forgot to add in the material tags. When I ran openmc I got the following message:

===========================================================================
========================>     INITIALIZATION     <=========================
===========================================================================

Missing data on lattice_ - at or near line          41
Missing data on sab - at or near line           8
Missing data on material_ - at or near line           9
Segmentation fault

I would also suggest, having a better error statement for the user, especially since I do not have any lattices or sab info. In addition, maybe something along the lines of a warning if a material is associated with any cells.

Runs fail with -ipo turned on with ifort 12.0.5 on x86_64

Makes it up to reading geometry XML file and then fails with:

 Reading settings XML file...
 Reading geometry XML file...
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source             
openmc             00000000004E03D2  Unknown               Unknown  Unknown
openmc             00000000004DA022  Unknown               Unknown  Unknown
openmc             00000000004D98B9  Unknown               Unknown  Unknown
openmc             00000000004DBBA2  Unknown               Unknown  Unknown
openmc             00000000004E05DF  Unknown               Unknown  Unknown
openmc             00000000004A9005  Unknown               Unknown  Unknown
openmc             000000000040333C  Unknown               Unknown  Unknown
libc.so.6          00007FD154CF4EFF  Unknown               Unknown  Unknown
openmc             0000000000403239  Unknown               Unknown  Unknown

Incoherent inelastic S(a,b) treatment

This will be based on directly sampling S(a,b) data from the ACE format given as equiprobable cosine and outgoing energy bins for a given incoming energy. Interestingly, MC21 empoys a direct S(a,b) sampling method whereby the original ENDF data tabulated on an a,b mesh is turned into pdfs p(b|E,T) and p(a|b,E,T) which can be directly sampled in the MC simulation. This eliminates some non-physical effects (observed by Bjorn Becker). See Clint Ballingers 1995 M&C paper.

Shannon Entropy

The Shannon entropy has emerged as the primary means of detecting fission source (eigenfunction) convergence in a criticality calculation. The implementation is quite simple and is detailed in a number of papers by Forrest Brown. For a diagnostic criterion, the stochastic oscillator developed by Romano should be used.

Calculation of cell volumes

The capability to calculate cell volumes is both an essential and non-trivial capability. It can generally be broken down into three types of calculations:

  1. Rotationally symmetric bodies
  2. Arbitrary polyhedra
  3. All others (which must be calculated stochastically)

The algorithm for calculating cell volumes is outlined in LA-8113-MS.

Generate particles from (n,xn)

Currently, although (n,xn) reactions are sampled, the secondary neutrons are not actually produced to be simulated during the cycle.

k-inf calculation (homogeneous cube)

I did a simple test, homogeneous cube 10 cm in each direction. The material is half U-235, half Pu-239 by atom. My final k-effective is:

Final Keff (also kinf here) = 2.73037 +/- 5.58283E-04

I tally all macro reaction rates in this cube and get the following:

Cell 1
Total Reaction Rate 5.44065 +/- 2.81300E-03
Scattering Rate 4.41040 +/- 2.32543E-03
Scattering Production Rate 4.41392 +/- 2.79901E-03
Absorption Rate 1.03025 +/- 4.94128E-04
Fission Rate 0.951405 +/- 4.38750E-04
Nu-Fission Rate 2.73125 +/- 1.23006E-03

Looking at the neutron balance equation:

TotalRate = NuScatterRate + NuFissionRate/kinf

Computing: kinf = NuFissionRate/(TotalRate - NuScatterRate)
kinf = 2.73125/(5.44065 - 4.41392) = 2.66014

This is about a 1000 pcm difference, which is too large here. Also should the total reaction rate minus the scattering production rate be 1.00? Usually the denominator of the kinf calculation in MC is 1 and therefore Nu-Fission Rate is k-inf.

Do you see this same difference?

"No neutron emission data" error when running with gfortran

For commits between 3404aa and d5bc1a, the code successfully compiles with gfortran but when running the basic example problem halts with an error:

ERROR: No neutron emission data for table: 1001.03c

This is related to the addition of cross section caches, and more importantly the fissionable flag on each nuclide.

N-body phase space distribution

As far as I'm aware, this is the only remaining scattering law that is not implemented in OpenMC that actually occurs in data. However, it only exists for the (n,2n) reaction in H-2 so can be ignored safely for the time being.

xsdata path

From using the code, you are forced to have the xsdata file named xsdata. Wouldn't it be easier to just have the user specify the full path including filename?

Geometry plotting capability

Having the ability to plot geometry would be very nice for debugging geometry issues... Not sure what the best/established method is for doing 2D slice plots.

No use of discrete lines in Law 4, 44, 61 data

Currently, any data for discrete energy of photons emitted from Law 4, 44, or 61 data is disregarded. This is not important for us now because we don't have any photon transport, but if that were ever to be added in, we would need to be able to read those discrete photon energy distributions.

Energy grid unionization fails with debug turned on

Looks like it violates an array out-of-bounds check:

forrtl: severe (408): fort: (2): Subscript #1 of the array ENERGY has value 251 which is greater than the upper bound of 250

Image              PC                Routine            Line        Source             
openmc             000000000061C67A  Unknown               Unknown  Unknown
openmc             000000000061B1F5  Unknown               Unknown  Unknown
openmc             00000000005CEEE6  Unknown               Unknown  Unknown
openmc             0000000000590AF5  Unknown               Unknown  Unknown
openmc             0000000000590F49  Unknown               Unknown  Unknown
openmc             0000000000478966  energy_grid_mp_ad         138  energy_grid.f90
openmc             0000000000475F3D  energy_grid_mp_un          40  energy_grid.f90
openmc             00000000004DCE6F  MAIN__                     83  main.f90
openmc             00000000004033CC  Unknown               Unknown  Unknown
libc.so.6          00007F09DE196D8E  Unknown               Unknown  Unknown
openmc             00000000004032C9  Unknown               Unknown  Unknown

Nu-fission rate not printed, same as nu-Scattering

Problem: 20cm cube now with 0.5 a% U-235, 0.25 a% Pu-239 and 0.25 a% H-1.

Tallying nu-scatter and nu-fission in the following energy groups
3: 0.0 0.625ev
2: 0.625eV to 500keV
1: 500 keV to 20.0MeV

The exact same numbers are shown for nu-scatter and nu-fission tallies in the tally.out file. Since there is no transfer of neutrons from a lower number group to a higher number group, I am guessing these numbers represent nu-scatter since there must be group to group transfer from g3 to g1 in nu-fission.

Length of path in xsdata

The path for cross-section files as specified in xsdata is currently hardwired at 100 characters. This should be expanded to allow for long paths.

Scaled interpolation on tabular distributions

As originally written, outgoing energy distributions using Law 1 did not perform scaled interpolation as specified in the MCNP manual. Law 1 doesn't appear to occur often in ENDF/B-VII data so this shouldn't affect results much at all.

Incorrect surface current values

Running Bryan's problem of a 50cm x 20cm x 20cm box, reflective boundary conditions in y and z, and a single mesh cell that covers the geometry. There are two problems with the reported results:

  1. No outgoing current is shown on the left or right faces even though vacuum boundary conditions are used there. This is because the particle is killed before any surface currents are tallied.
  2. Positive currents are reported on front/back/top/bottom even though there should be no current through those surfaces. When a particle is reflected off the y and z surfaces, surface currents are not scored until the particle reaches a collision, thus making xyz and last_xyz not very meaningful.

The results are:

Mesh Index (1, 1, 1)
    Outgoing Current to Left       0.0            +/- 0.0
    Incoming Current from Left     0.0            +/- 0.0
    Incoming Current from Right    0.0            +/- 0.0
    Outgoing Current to Right      0.0            +/- 0.0
    Outgoing Current to Back       0.0            +/- 0.0
    Incoming Current from Back     0.234552       +/- 8.86087E-04
    Incoming Current from Front    2.67500E-04    +/- 2.65489E-05
    Outgoing Current to Front      0.0            +/- 0.0
    Outgoing Current to Bottom     0.0            +/- 0.0
    Incoming Current from Bottom   0.235355       +/- 7.78403E-04
    Incoming Current from Top      2.42500E-04    +/- 2.49719E-05
    Outgoing Current to Top        0.0            +/- 0.0

Add timing capability

Currently, timing is only done via MPI_WTIME(). This should be changed to Fortran intrinsics for time rather than MPI calls and expanded to measure common data, e.g. total run time, total time loading cross sections, total time reading input, total time in compute, total communication time, etc.

Reflective Boundaries on Slab Reactor

For a 1-D reactor (x-direction) I surrounded the y- and z- directions with reflective boundaries and vacuum in x-direction. Openmc gave me the following error:

 ===========================================================================
 =======================>     BEGIN SIMULATION     <========================
 ===========================================================================

 ERROR: After particle crossed surface -4, it could not be located in any cell a
       nd it did not leak.   

When I replace all the boundary conditions to vacuum, the simulation runs properly.

Energy grid

I realized today that if you take the union of the energy grids of all the nuclides in ENDF/B-VII, you end up with a union energy grid of about 4.5 million points. The pointer scheme may need to be modified- there is a strong motive to do some kind of thinning of the energy grid with that many points.

Uniform fission source weighting

Tom and Kord seem to have gotten very good results reducing variance in low flux regions by doing a uniform fission source weighting scheme. This would be nice to add to the code eventually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.