Hi all:
I may find a bug of “current” tally. I define my geometry like that:
min_x = openmc.XPlane(surface_id=3, x0=-0.63, boundary_type='reflective')
max_x = openmc.XPlane(surface_id=4, x0=+0.63, boundary_type='reflective')
min_y = openmc.YPlane(surface_id=5, y0=-0.63, boundary_type='reflective')
max_y = openmc.YPlane(surface_id=6, y0=+0.63, boundary_type='reflective')
min_z = openmc.ZPlane(surface_id=7, z0=-100, boundary_type='vacuum')
max_z = openmc.ZPlane(surface_id=8, z0=+100, boundary_type='vacuum')
In order to get the leakage rate, I create a mesh and define a meshFilter and a current tally like that:
mesh = openmc.Mesh()
mesh.type = 'regular'
mesh.dimension = [1, 1, 1]
mesh.lower_left = [-0.63, -0.63, -100.]
mesh.width = [1.26, 1.26, 200.]
mesh_filter = openmc.MeshFilter(mesh)
leak = openmc.Tally(name='total leakage')
leak.filters = [mesh_filter]
leak.scores = ['current']
The “tallies.out” file gives the current tally as below:
Mesh Index (1, 1, 1)
Outgoing Current on Left 0.0 +/- 0.0
Incoming Current on Left 0.0 +/- 0.0
Outgoing Current on Right 0.0 +/- 0.0
Incoming Current on Right 0.0 +/- 0.0
Outgoing Current on Back 0.0 +/- 0.0
Incoming Current on Back 0.0 +/- 0.0
Outgoing Current on Front 0.0 +/- 0.0
Incoming Current on Front 0.0 +/- 0.0
Outgoing Current on Bottom 9.60000E-03 +/- 8.10408E-04
Incoming Current on Bottom 0.0 +/- 0.0
Outgoing Current on Top 7.78667E-03 +/- 5.53247E-04
Incoming Current on Top 0.0 +/- 0.0
Because of the “reflective” boundary condition defined as before, the current is 0. And the bottom and top surface’s current is not equal to 0 on the account of the “vacuum” boundary. This result is satisfied for me and I believe it is correct.
However, I wanna try another way to get the “current”, which I think more direct. Why not using openmc.SurfaceFilter so that we don’t need to create a mesh. Thus, I defined a SurfaceFilter directely as below:
leak = openmc.Tally(name='leakage')
leak.filters = [openmc.SurfaceFilter(bins=(3,4,5,6,7,8))]
leak.scores = ['current']
But I found the result is not correct, it is showed following:
Surface 3
Total Material
Current 8.91443 +/- 1.82308E-02
Surface 4
Total Material
Current -8.92693 +/- 2.07226E-02
Surface 5
Total Material
Current 8.94605 +/- 1.95561E-02
Surface 6
Total Material
Current -8.92419 +/- 2.15556E-02
Surface 7
Total Material
Current -9.60000E-03 +/- 8.10408E-04
Surface 8
Total Material
Current 7.78667E-03 +/- 5.53247E-04
As we can see, the results of surface 7 and surface 8 keep a great uniform with the results of “meshFilter”. But the others’ results are distinct wrong, it should be 0 as desired because of the “reflective” boundary.
Is it a bug or my fault? You know, using the way of “openmc.SurfaceFilter” to get the “current” is reasonable. Especially in some complex geometry, we have to try another way to get the “current” tally, cause we can only create a structured Cartesian mesh by using “openmc.mesh”.
Any reply will be great appreciated !!
Best Wishes!
Benjamin