Skip to content

Commit 88ace3c

Browse files
authored
Merge pull request #252 from CEMeNT-PSAAP/dev
v0.11.1
2 parents 8335ac8 + 3cc4759 commit 88ace3c

File tree

9 files changed

+960
-222
lines changed

9 files changed

+960
-222
lines changed

examples/c5g7/3d/k-eigenvalue/input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ def set_mat(mat):
296296
mcdc.tally.mesh_tally(scores=["flux"], x=x_grid, y=y_grid, z=z_grid, g=g_grid)
297297

298298
# Setting
299-
mcdc.setting(N_particle=1e4, census_bank_buff=4)
299+
mcdc.setting(N_particle=1e3, census_bank_buff=4)
300300

301301
mcdc.eigenmode(N_inactive=50, N_active=150, gyration_radius="all")
302-
mcdc.population_control("splitting-roulette-weight")
302+
mcdc.population_control()
303303

304304
# Run
305305
mcdc.run()
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
import os
2+
import numpy as np
3+
import mcdc
4+
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+
13+
x_sect = X_SECT
14+
15+
# Set materials
16+
m = mcdc.material(
17+
capture=np.array([0.01 * x_sect]), scatter=np.array([[0.01 * x_sect]])
18+
)
19+
m_void = mcdc.material(
20+
capture=np.array([5e-5 * x_sect]), scatter=np.array([[5e-5 * x_sect]])
21+
)
22+
23+
# Set surfaces
24+
sx1 = mcdc.surface("plane-x", x=0.0, bc="reflective")
25+
sx2 = mcdc.surface("plane-x", x=10.0)
26+
sx3 = mcdc.surface("plane-x", x=30.0)
27+
sx4 = mcdc.surface("plane-x", x=40.0)
28+
sx5 = mcdc.surface("plane-x", x=60.0, bc="vacuum")
29+
sy1 = mcdc.surface("plane-y", y=0.0, bc="reflective")
30+
sy2 = mcdc.surface("plane-y", y=10.0)
31+
sy3 = mcdc.surface("plane-y", y=50.0)
32+
sy4 = mcdc.surface("plane-y", y=60.0)
33+
sy5 = mcdc.surface("plane-y", y=100.0, bc="vacuum")
34+
sz1 = mcdc.surface("plane-z", z=0.0, bc="reflective")
35+
sz2 = mcdc.surface("plane-z", z=10.0)
36+
sz3 = mcdc.surface("plane-z", z=30.0)
37+
sz4 = mcdc.surface("plane-z", z=40.0)
38+
sz5 = mcdc.surface("plane-z", z=60.0, bc="vacuum")
39+
40+
# Set cells
41+
# Soruce
42+
mcdc.cell(+sx1 & -sx2 & +sy1 & -sy2 & +sz1 & -sz2, m)
43+
# Voids
44+
mcdc.cell(+sx1 & -sx2 & +sy2 & -sy3 & +sz1 & -sz2, m_void)
45+
mcdc.cell(+sx1 & -sx3 & +sy3 & -sy4 & +sz1 & -sz2, m_void)
46+
mcdc.cell(+sx3 & -sx4 & +sy3 & -sy4 & +sz1 & -sz3, m_void)
47+
mcdc.cell(+sx3 & -sx4 & +sy3 & -sy5 & +sz3 & -sz4, m_void)
48+
# Shield
49+
mcdc.cell(+sx1 & -sx3 & +sy1 & -sy5 & +sz2 & -sz5, m)
50+
mcdc.cell(+sx2 & -sx5 & +sy1 & -sy3 & +sz1 & -sz2, m)
51+
mcdc.cell(+sx3 & -sx5 & +sy1 & -sy3 & +sz2 & -sz5, m)
52+
mcdc.cell(+sx3 & -sx5 & +sy4 & -sy5 & +sz1 & -sz3, m)
53+
mcdc.cell(+sx4 & -sx5 & +sy4 & -sy5 & +sz3 & -sz5, m)
54+
mcdc.cell(+sx4 & -sx5 & +sy3 & -sy4 & +sz1 & -sz5, m)
55+
mcdc.cell(+sx3 & -sx4 & +sy3 & -sy5 & +sz4 & -sz5, m)
56+
mcdc.cell(+sx1 & -sx3 & +sy4 & -sy5 & +sz1 & -sz2, m)
57+
58+
# =============================================================================
59+
# Set source
60+
# =============================================================================
61+
# The source pulses in t=[0,5]
62+
63+
mcdc.source(
64+
x=[0.0, 10.0], y=[0.0, 10.0], z=[0.0, 10.0], time=[0.0, 50.0], isotropic=True
65+
)
66+
67+
# =============================================================================
68+
# Set tally, setting, and run mcdc
69+
# =============================================================================
70+
71+
# Tally: z-integrated flux (X-Y section view)
72+
mcdc.tally.mesh_tally(
73+
scores=["flux"],
74+
x=np.linspace(0.0, 60.0, 61),
75+
y=np.linspace(0.0, 100.0, 101),
76+
z=np.linspace(0.0, 60.0, 61),
77+
t=np.linspace(0.0, 200.0, TIME_SPLITS),
78+
)
79+
80+
# Setting
81+
mcdc.setting(N_particle=PARTICLE_COUNT)
82+
# mcdc.implicit_capture()
83+
84+
# Run
85+
mcdc.run()

0 commit comments

Comments
 (0)