Skip to content

Commit

Permalink
added slab_reed_dd_3d to regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermote committed Jan 7, 2025
1 parent 99f0d49 commit e5b4586
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/regression/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
+ "Note: Skipping %s (require 4 MPI ranks)" % name
+ Style.RESET_ALL
)
elif name == "dd_cooper" and not (mpiexec == 8 or srun == 8):
elif name == "slab_reed_dd_3d" and not ((mpiexec % 16) == 0 or (srun % 16) == 0):
temp.remove(name)
print(
Fore.YELLOW
+ "Note: Skipping %s (require 8 MPI ranks)" % name
+ "Note: Skipping %s (require 16 MPI ranks)" % name
+ Style.RESET_ALL
)
names = temp
Expand Down
Binary file added test/regression/slab_reed_dd_3d/answer.h5
Binary file not shown.
81 changes: 81 additions & 0 deletions test/regression/slab_reed_dd_3d/input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import numpy as np

import mcdc

# =============================================================================
# Set model
# =============================================================================
# Three slab layers with different materials
# Based on William H. Reed, NSE (1971), 46:2, 309-314, DOI: 10.13182/NSE46-309

# Set materials
m1 = mcdc.material(capture=np.array([50.0]))
m2 = mcdc.material(capture=np.array([5.0]))
m3 = mcdc.material(capture=np.array([0.0])) # Vacuum
m4 = mcdc.material(capture=np.array([0.1]), scatter=np.array([[0.9]]))

# Set surfaces
s1 = mcdc.surface("plane-z", z=0.0, bc="reflective")
s2 = mcdc.surface("plane-z", z=2.0)
s3 = mcdc.surface("plane-z", z=3.0)
s4 = mcdc.surface("plane-z", z=5.0)
s5 = mcdc.surface("plane-z", z=8.0, bc="vacuum")
sx1 = mcdc.surface("plane-x", x=0.0, bc="reflective")
sx2 = mcdc.surface("plane-x", x=8.0, bc="vacuum")
sx3 = mcdc.surface("plane-x", x=4.0)
sy1 = mcdc.surface("plane-y", y=0.0, bc="reflective")
sy2 = mcdc.surface("plane-y", y=8.0, bc="vacuum")
sy3 = mcdc.surface("plane-y", y=4.0)

# Set cells
mcdc.cell(+s1 & -s2 & +sx1 & -sx3 & +sy1 & -sy3, m1)
mcdc.cell(+s2 & -s3 & +sx1 & -sx3 & +sy1 & -sy3, m2)
mcdc.cell(+s3 & -s4 & +sx1 & -sx3 & +sy1 & -sy3, m3)
mcdc.cell(+s4 & -s5 & +sx1 & -sx3 & +sy1 & -sy3, m4)

mcdc.cell(+s1 & -s2 & +sx3 & -sx2 & +sy1 & -sy3, m1)
mcdc.cell(+s2 & -s3 & +sx3 & -sx2 & +sy1 & -sy3, m2)
mcdc.cell(+s3 & -s4 & +sx3 & -sx2 & +sy1 & -sy3, m3)
mcdc.cell(+s4 & -s5 & +sx3 & -sx2 & +sy1 & -sy3, m4)

mcdc.cell(+s1 & -s2 & +sx1 & -sx3 & +sy3 & -sy2, m1)
mcdc.cell(+s2 & -s3 & +sx1 & -sx3 & +sy3 & -sy2, m2)
mcdc.cell(+s3 & -s4 & +sx1 & -sx3 & +sy3 & -sy2, m3)
mcdc.cell(+s4 & -s5 & +sx1 & -sx3 & +sy3 & -sy2, m4)

mcdc.cell(+s1 & -s2 & +sx3 & -sx2 & +sy3 & -sy2, m1)
mcdc.cell(+s2 & -s3 & +sx3 & -sx2 & +sy3 & -sy2, m2)
mcdc.cell(+s3 & -s4 & +sx3 & -sx2 & +sy3 & -sy2, m3)
mcdc.cell(+s4 & -s5 & +sx3 & -sx2 & +sy3 & -sy2, m4)

# =============================================================================
# Set source
# =============================================================================

# Isotropic source in the absorbing medium
mcdc.source(x=[0.0,4.0],y=[0.0,4.0],z=[0.0, 2.0], isotropic=True, prob=50.0)
mcdc.source(x=[4.0,8.0],y=[0.0,4.0],z=[0.0, 2.0], isotropic=True, prob=50.0)
mcdc.source(x=[0.0,4.0],y=[4.0,8.0],z=[0.0, 2.0], isotropic=True, prob=50.0)
mcdc.source(x=[4.0,8.0],y=[4.0,8.0],z=[0.0, 2.0], isotropic=True, prob=50.0)

# Isotropic source in the first half of the outermost medium,
# with 1/100 strength
mcdc.source(x=[0.0,4.0],y=[0.0,4.0],z=[4.0, 6.0], isotropic=True, prob=0.5)
mcdc.source(x=[4.0,8.0],y=[0.0,4.0],z=[4.0, 6.0], isotropic=True, prob=0.5)
mcdc.source(x=[0.0,4.0],y=[4.0,8.0],z=[4.0, 6.0], isotropic=True, prob=0.5)
mcdc.source(x=[4.0,8.0],y=[4.0,8.0],z=[4.0, 6.0], isotropic=True, prob=0.5)

# =============================================================================
# Set tally, setting, and run mcdc
# =============================================================================

mcdc.tally.mesh_tally(scores=["flux"], x=np.linspace(0.0, 8.0, 9), y=np.linspace(0.0, 8.0, 9), z=np.linspace(0.0, 8.0, 9))

# Setting
mcdc.setting(N_particle=5000)
dd_x = np.array([0.0,4.0,8.0])
dd_y = np.array([0.0,4.0,8.0])
dd_z = np.array([0.0, 2.0, 3.0, 5.0, 8.0])
mcdc.domain_decomposition(x=dd_x,y=dd_y,z=dd_z)
# Run
mcdc.run()

0 comments on commit e5b4586

Please sign in to comment.