Time-Dependent Kobayashi Dog-Leg#

Description#

Time-dependent variant of the Kobayashi dog-leg shielding benchmark. See the steady-state Kobayashi example for geometry and material specifications; this variant drives the problem with a pulsed source and records time-resolved tallies.

Step-by-Step Walkthrough#

This example reuses the exact geometry from the steady-state Kobayashi dog-leg benchmark. The key differences are highlighted below.

1. Source with a Time Window (line 54–60)

50# ======================================================================================
51# The source pulses in t=[0, 50]
52
53source = mcdc.Source(
54    x=[0.0, 10.0],
55    y=[0.0, 10.0],
56    z=[0.0, 10.0],
57    isotropic=True,
58    energy=0,
59    time=[0.0, 50.0],
60)

The source now has time=[0.0, 50.0], meaning particles are emitted over a 50 s window rather than instantaneously.

2. Time-Resolved Tallies (lines 66–69)

66
67# Tallies
68time_grid = np.linspace(0.0, 200.0, 21)
69mesh = mcdc.MeshUniform(x=(0.0, 1.0, 60), y=(0.0, 1.0, 100))

A time grid is added to both the mesh tally and a global density tally. This creates a time-resolved \(\phi(x, y, t)\) dataset. Global Tally with scores=["density"] tracks total neutron population over time.

What to try:

  • Shorten the source time to create a short pulse and watch the neutron cloud propagate.

  • Add a finer time grid to capture early transient behaviour.

  • Compare with the steady-state Kobayashi results.

Full Input#

Click here to view the input file: examples/kobayashi-TD/input.py.

The complete input used for this example is embedded below:

 1import numpy as np
 2import mcdc
 3
 4simulation = mcdc.Simulation("Time-dependent Kobayashi dog-leg benchmark")
 5
 6# ======================================================================================
 7# Set model
 8# ======================================================================================
 9# Based on Kobayashi dog-leg benchmark problem
10# (PNE 2001, https://doi.org/10.1016/S0149-1970(01)00007-5)
11
12# Set materials
13m = mcdc.Material.multigroup(capture=np.array([0.05]), scatter=np.array([[0.05]]))
14m_void = mcdc.Material.multigroup(capture=np.array([5e-5]), scatter=np.array([[5e-5]]))
15
16# Set surfaces
17sx1 = mcdc.Surface.PlaneX(x=0.0, boundary_condition="reflective")
18sx2 = mcdc.Surface.PlaneX(x=10.0)
19sx3 = mcdc.Surface.PlaneX(x=30.0)
20sx4 = mcdc.Surface.PlaneX(x=40.0)
21sx5 = mcdc.Surface.PlaneX(x=60.0, boundary_condition="vacuum")
22sy1 = mcdc.Surface.PlaneY(y=0.0, boundary_condition="reflective")
23sy2 = mcdc.Surface.PlaneY(y=10.0)
24sy3 = mcdc.Surface.PlaneY(y=50.0)
25sy4 = mcdc.Surface.PlaneY(y=60.0)
26sy5 = mcdc.Surface.PlaneY(y=100.0, boundary_condition="vacuum")
27sz1 = mcdc.Surface.PlaneZ(z=0.0, boundary_condition="reflective")
28sz2 = mcdc.Surface.PlaneZ(z=10.0)
29sz3 = mcdc.Surface.PlaneZ(z=30.0)
30sz4 = mcdc.Surface.PlaneZ(z=40.0)
31sz5 = mcdc.Surface.PlaneZ(z=60.0, boundary_condition="vacuum")
32
33# Set cells
34# Source
35source_cell = mcdc.Cell(region=+sx1 & -sx2 & +sy1 & -sy2 & +sz1 & -sz2, fill=m)
36# Voids
37channel_1 = +sx1 & -sx2 & +sy2 & -sy3 & +sz1 & -sz2
38channel_2 = +sx1 & -sx3 & +sy3 & -sy4 & +sz1 & -sz2
39channel_3 = +sx3 & -sx4 & +sy3 & -sy4 & +sz1 & -sz3
40channel_4 = +sx3 & -sx4 & +sy3 & -sy5 & +sz3 & -sz4
41void_channel = channel_1 | channel_2 | channel_3 | channel_4
42void_cell = mcdc.Cell(region=void_channel, fill=m_void)
43# Shield
44box = +sx1 & -sx5 & +sy1 & -sy5 & +sz1 & -sz5
45shield_cell = mcdc.Cell(region=box & ~void_channel, fill=m)
46simulation.set_model([source_cell, void_cell, shield_cell])
47
48# ======================================================================================
49# Set source
50# ======================================================================================
51# The source pulses in t=[0, 50]
52
53source = mcdc.Source(
54    x=[0.0, 10.0],
55    y=[0.0, 10.0],
56    z=[0.0, 10.0],
57    isotropic=True,
58    energy=0,
59    time=[0.0, 50.0],
60)
61simulation.set_sources([source])
62
63# ======================================================================================
64# Set tallies, settings, techniques, and run MC/DC
65# ======================================================================================
66
67# Tallies
68time_grid = np.linspace(0.0, 200.0, 21)
69mesh = mcdc.MeshUniform(x=(0.0, 1.0, 60), y=(0.0, 1.0, 100))
70flux_tally = mcdc.Tally(mesh=mesh, scores=["flux"], time=time_grid)
71density_tally = mcdc.Tally(scores=["density"], time=time_grid)
72simulation.set_tallies([flux_tally, density_tally])
73
74# Settings
75simulation.settings.N_particle = 100
76simulation.settings.N_batch = 2
77
78# Techniques
79simulation.technique.implicit_capture()
80
81# Run
82simulation.run()

How to Run#

From inside examples/kobayashi-TD run:

python input.py

Expected Output#

Time-resolved mesh tally HDF5 file and an animation produced by process-output.py that visualises neutron density versus time.

References#

See: Kobayashi et al. (2001), Progress in Nuclear Energy.