Sphere-in-Cube Fission Detector#

Problem Description#

A three-dimensional time-dependent problem with a homogeneous fissile sphere embedded inside a scattering cube. A cell-based tally records the fission rate inside the sphere, demonstrating MC/DC’s cell tally functionality.

Geometry and Materials#

The computational domain is a cube: \(x,y,z \in [0,4]\) cm, with vacuum boundary conditions.

A sphere of radius 1.5 cm is centred at \((2,2,2)\) cm.

Cross-section data (mono-energetic, cm-1)#

Region

\(\Sigma_s\)

\(\Sigma_f\)

\(\nu\)

Cube (outside sphere)

1.0

Sphere (fissile)

1.0

1.2

Physical Assumptions#

  • Mono-energetic (one-speed) neutron transport.

  • Isotropic scattering (cube) and isotropic fission (sphere).

  • Time-dependent transport with a uniform isotropic source, \(t \in [0,50]\) s.

  • Implicit capture variance-reduction technique.

Numerical Setup#

Tally type

Cell tally on the spherical region

Tally score

Fission rate

Source particles

\(10^{3}\) (demonstration)

Batches

2

Quantities of Interest#

  • Volume-integrated fission rate inside the sphere.

  • Statistical uncertainty (standard deviation) of the cell tally.

Reference Solution#

The problem can be verified analytically for simple cross-section combinations using first-flight collision probabilities.

Step-by-Step Walkthrough#

1. Import and Materials (lines 1–12)

 1import numpy as np
 2import mcdc
 3
 4simulation = mcdc.Simulation("Sphere in cube")
 5
 6# ======================================================================================
 7# Set model
 8# ======================================================================================
 9# Homogeneous pure-fission sphere inside a pure-scattering cube
10
11# Set materials
12pure_f = mcdc.Material.multigroup(fission=np.array([1.0]), nu_p=np.array([1.2]))

Two mono-energetic materials: a purely fissile material (pure_f, \(\Sigma_f = 1.0\), \(\nu = 1.2\)) for the sphere, and a purely scattering material (pure_s, \(\Sigma_s = 1.0\)) for the cube.

2. Surfaces and CSG Regions (lines 14–26)

14
15# Set surfaces
16sx1 = mcdc.Surface.PlaneX(x=0.0, boundary_condition="vacuum")
17sx2 = mcdc.Surface.PlaneX(x=4.0, boundary_condition="vacuum")
18sy1 = mcdc.Surface.PlaneY(y=0.0, boundary_condition="vacuum")
19sy2 = mcdc.Surface.PlaneY(y=4.0, boundary_condition="vacuum")
20sz1 = mcdc.Surface.PlaneZ(z=0.0, boundary_condition="vacuum")
21sz2 = mcdc.Surface.PlaneZ(z=4.0, boundary_condition="vacuum")
22sphere = mcdc.Surface.Sphere(center=[2.0, 2.0, 2.0], radius=1.5)
23inside_sphere = -sphere
24inside_box = +sx1 & -sx2 & +sy1 & -sy2 & +sz1 & -sz2
25
26# Set cells

Six planes define the cube, and a Sphere surface defines the detector region. The ~ (complement) operator carves out the sphere from the cube.

3. Source (lines 32–39)

32# Set source
33# ======================================================================================
34
35source = mcdc.Source(
36    x=[0.0, 4.0],
37    y=[0.0, 4.0],
38    z=[0.0, 4.0],
39    isotropic=True,

A uniform isotropic source fills the cube over \(t \in [0,50]\) s.

4. Cell Tally, Settings, and Run (lines 45–55)

45# ======================================================================================
46# Set tallies, settings, techniques, and run MC/DC
47# ======================================================================================
48
49# Tallies
50tally = mcdc.Tally(
51    name="Spherical fission detector", cell=sphere_cell, scores=["fission"]
52)
53simulation.set_tallies([tally])
54
55# Settings

This example uses cell-filtered Tally — it tallies fission events inside a specific cell (the sphere) rather than on a spatial mesh. Implicit capture is enabled to keep particles alive longer.

What to try:

  • Replace the cell filter with a mesh filter to visualise the 3-D flux.

  • Change the sphere radius or \(\nu\) to see how fission rate changes.

  • Add a time grid to the cell tally for time-resolved data.

  • Change the cell-filtered current scores to ["current-net", "current-in", "current-out"] to score current across the sphere cell boundary.

Full Input#

Click here to view the input file: examples/sphere_in_cube/input.py.

The complete input used for this example is embedded below:

 1import numpy as np
 2import mcdc
 3
 4simulation = mcdc.Simulation("Sphere in cube")
 5
 6# ======================================================================================
 7# Set model
 8# ======================================================================================
 9# Homogeneous pure-fission sphere inside a pure-scattering cube
10
11# Set materials
12pure_f = mcdc.Material.multigroup(fission=np.array([1.0]), nu_p=np.array([1.2]))
13pure_s = mcdc.Material.multigroup(scatter=np.array([[1.0]]))
14
15# Set surfaces
16sx1 = mcdc.Surface.PlaneX(x=0.0, boundary_condition="vacuum")
17sx2 = mcdc.Surface.PlaneX(x=4.0, boundary_condition="vacuum")
18sy1 = mcdc.Surface.PlaneY(y=0.0, boundary_condition="vacuum")
19sy2 = mcdc.Surface.PlaneY(y=4.0, boundary_condition="vacuum")
20sz1 = mcdc.Surface.PlaneZ(z=0.0, boundary_condition="vacuum")
21sz2 = mcdc.Surface.PlaneZ(z=4.0, boundary_condition="vacuum")
22sphere = mcdc.Surface.Sphere(center=[2.0, 2.0, 2.0], radius=1.5)
23inside_sphere = -sphere
24inside_box = +sx1 & -sx2 & +sy1 & -sy2 & +sz1 & -sz2
25
26# Set cells
27box_cell = mcdc.Cell(name="Box cover", region=inside_box & ~inside_sphere, fill=pure_s)
28sphere_cell = mcdc.Cell(name="The sphere", region=inside_sphere, fill=pure_f)
29simulation.set_model([box_cell, sphere_cell])
30
31# ======================================================================================
32# Set source
33# ======================================================================================
34
35source = mcdc.Source(
36    x=[0.0, 4.0],
37    y=[0.0, 4.0],
38    z=[0.0, 4.0],
39    isotropic=True,
40    energy=0,
41    time=[0.0, 50.0],
42)
43simulation.set_sources([source])
44
45# ======================================================================================
46# Set tallies, settings, techniques, and run MC/DC
47# ======================================================================================
48
49# Tallies
50tally = mcdc.Tally(
51    name="Spherical fission detector", cell=sphere_cell, scores=["fission"]
52)
53simulation.set_tallies([tally])
54
55# Settings
56simulation.settings.N_particle = 1000
57simulation.settings.N_batch = 2
58
59# Techniques
60simulation.technique.implicit_capture()
61
62# Run
63simulation.run()

How to Run#

From inside examples/sphere_in_cube run:

python input.py

Expected Output#

Volume-integrated fission rate time series saved by the tally and a small printed summary from the example’s process-output.py script.