-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import numpy as np | ||
import sys | ||
|
||
import mcdc | ||
|
||
|
||
# ============================================================================= | ||
# Set model | ||
# ============================================================================= | ||
# The infinite homogenous medium is modeled with reflecting slab | ||
|
||
# Load material data | ||
with np.load("SHEM-361.npz") as data: | ||
SigmaC = data["SigmaC"] * 1.28 # /cm | ||
SigmaS = data["SigmaS"] | ||
SigmaF = data["SigmaF"] | ||
nu_p = data["nu_p"] | ||
nu_d = data["nu_d"] | ||
chi_p = data["chi_p"] | ||
chi_d = data["chi_d"] | ||
G = data["G"] | ||
speed = data["v"] | ||
lamd = data["lamd"] | ||
|
||
# Set material | ||
m = mcdc.material( | ||
capture=SigmaC, | ||
scatter=SigmaS, | ||
fission=SigmaF, | ||
nu_p=nu_p, | ||
chi_p=chi_p, | ||
nu_d=nu_d, | ||
chi_d=chi_d, | ||
decay=lamd, | ||
speed=speed, | ||
) | ||
|
||
# Set surfaces | ||
s1 = mcdc.surface("plane-x", x=-1e10, bc="reflective") | ||
s2 = mcdc.surface("plane-x", x=1e10, bc="reflective") | ||
|
||
# Set cells | ||
c = mcdc.cell(+s1 & -s2, m) | ||
|
||
# ============================================================================= | ||
# Set initial source | ||
# ============================================================================= | ||
|
||
energy = np.zeros(G) | ||
energy[-1] = 1.0 | ||
source = mcdc.source(energy=energy) | ||
|
||
# ============================================================================= | ||
# Set problem and tally, and then run mcdc | ||
# ============================================================================= | ||
|
||
# Tally | ||
mcdc.tally.mesh_tally( | ||
scores=["flux"], t=np.insert(np.logspace(-8, 1, 100), 0, 0.0), g="all" | ||
) | ||
|
||
# Setting | ||
mcdc.setting(N_particle=9, active_bank_buff=1000, rng_seed=4) | ||
mcdc.time_census(np.logspace(-5, 1, 6)) | ||
mcdc.population_control() | ||
|
||
# Run | ||
mcdc.run() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import numpy as np | ||
|
||
import mcdc | ||
|
||
|
||
# ============================================================================= | ||
# Set model | ||
# ============================================================================= | ||
# Finite homogeneous pure-absorbing slab | ||
|
||
# Set materials | ||
m = mcdc.material(capture=np.array([1.0])) | ||
|
||
# Set surfaces | ||
s1 = mcdc.surface("plane-x", x=0.0, bc="vacuum") | ||
s2 = mcdc.surface("plane-x", x=5.0, bc="vacuum") | ||
|
||
# Set cells | ||
mcdc.cell(+s1 & -s2, m) | ||
|
||
# ============================================================================= | ||
# Set source | ||
# ============================================================================= | ||
# Isotropic beam from left-end | ||
|
||
mcdc.source(point=[1e-10, 0.0, 0.0], time=[0.0, 5.0], white_direction=[1.0, 0.0, 0.0]) | ||
|
||
# ============================================================================= | ||
# Set tally, setting, and run mcdc | ||
# ============================================================================= | ||
|
||
# Tally | ||
mcdc.tally.mesh_tally( | ||
scores=["flux"], | ||
x=np.linspace(0.0, 5.0, 51), | ||
t=np.linspace(0.0, 5.0, 51), | ||
) | ||
|
||
# Setting | ||
mcdc.setting(N_particle=100) | ||
mcdc.time_census(np.linspace(0.0, 5.0, 6)[1:]) | ||
mcdc.population_control() | ||
|
||
# Run | ||
mcdc.run() |