openmc-dev / openmc

OpenMC Monte Carlo Code
https://docs.openmc.org
Other
767 stars 493 forks source link

Incorrect surface current values #49

Closed paulromano closed 12 years ago

paulromano commented 12 years ago

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
paulromano commented 12 years ago

With the latest commit, I now get the following results (10000 particles per cycle, 10 inactive, 3000 total):

============================>     TALLY 1     <============================

Mesh Index (1, 1, 1)
  Total Reaction Rate         3.38046        +/- 6.50331E-04
  Scattering Rate             2.72691        +/- 5.35790E-04
  Scattering Production Rate  2.72922        +/- 6.42279E-04
  Absorption Rate             0.653550       +/- 1.16532E-04
  Fission Rate                0.609447       +/- 1.05189E-04
  Nu-Fission Rate             1.76583        +/- 2.98909E-04

============================>     TALLY 2     <============================

Mesh Index (1, 1, 1)
  Outgoing Current to Left       0.174854       +/- 5.74593E-04
  Incoming Current from Left     0.0            +/- 0.0
  Incoming Current from Right    0.0            +/- 0.0
  Outgoing Current to Right      0.174877       +/- 6.15736E-04
  Outgoing Current to Back       0.0            +/- 0.0
  Incoming Current from Back     0.0            +/- 0.0
  Incoming Current from Front    0.0            +/- 0.0
  Outgoing Current to Front      0.0            +/- 0.0
  Outgoing Current to Bottom     0.0            +/- 0.0
  Incoming Current from Bottom   0.0            +/- 0.0
  Incoming Current from Top      0.0            +/- 0.0
  Outgoing Current to Top        0.0            +/- 0.0

Plugging this into Python with the uncertainties module, it looks like neutron balance is ok:

In [1]: from uncertainties import ufloat

In [2]: total = ufloat((3.38046,6.50331e-4))

In [3]: nuscatter = ufloat((2.72922,6.42279e-4))

In [4]: leak_left = ufloat((0.174854,5.74593e-4))

In [5]: leak_right = ufloat((0.174877,6.15736e-4))

In [6]: leak_left + leak_right + total - nuscatter
Out[6]: 1.0009709999999994+/-0.0012428759635406102