Hello forum,
I am trying to use TimeFilter to tally the flux of neutrons of certain lifetime. I started with a simple case to verify the feature but I found some weird results.
As shown in the diagram below: the neutron source is a mono-energetic (1000 eV), mono directional (+x direction) point neutron source released at t=0. The flux is tallied within the 10x10x10 box centered at (130, 0, 0). In other words, the left side is located at x=125cm and right boundary at x=135cm. The model is vacuum everywhere.
Speed of 1000 eV neutrons would be 4.38E7 cm/s. Thus, it takes 2.86E-6s to reach the left side of the tally box and 3.08E-6s to reach the right side of the tally box. As a result, if I understand correctly, if a timefilter is applied to the flux tally, all the flux should be in the time range [2.86E-6, 3.08E-6] s.
However, thatâs not what I got. My results are attached below:
======================> TALLY 1: HALL TALLY <======================
Mesh Index (1, 1, 1)
Time [0.0, 2.8467358545984326e-06)
Total Material
Flux 8.58719 +/- 0.00000
Time [2.8467358545984326e-06, 3.0870506644926456e-06)
Total Material
Flux 0.72491 +/- 0.00000
Time [3.0870506644926456e-06, 1.0)
Total Material
Flux 0.687901 +/- 0.00000
One can see that, the majority of the flux are in the range <2.86E-6 s. Did I misunderstand anything?
Thank you very much for your help!
Xinyan
My code are attached below:
import openmc as omc
import numpy as np
import neutronics_material_maker as nmm
import math
surface
hall_xy = 290.0
hall_z = 10.0
hall_W = omc.XPlane(- hall_xy / 2.0, boundary_type = âvacuumâ);
hall_E = omc.XPlane(hall_xy / 2.0, boundary_type = âvacuumâ);
hall_N = omc.YPlane(- hall_xy / 2.0, boundary_type = âvacuumâ);
hall_S = omc.YPlane(hall_xy / 2.0, boundary_type = âvacuumâ);
hall_B = omc.ZPlane(- hall_z / 2.0, boundary_type = âvacuumâ);
hall_T = omc.ZPlane(hall_z / 2.0, boundary_type = âvacuumâ);
region
Inside_reg = +hall_W & -hall_E & +hall_N & -hall_S & +hall_B & -hall_T
Outside_reg = -hall_W | +hall_E | -hall_N | +hall_S | -hall_B | +hall_T
material
nmm.AddMaterialFromFile(âmaterial_library.jsonâ)
air = nmm.Material.from_library(âairâ).openmc_material
materials = omc.Materials([air])
materials.cross_sections = â/usr/local/share/xs_data/endfb71_hdf5/cross_sections.xmlâ
cell
Inside_cell = omc.Cell(name = âinside_cellâ, fill = None, region = Inside_reg);
Outside_cell = omc.Cell(name = âoutside_cellâ, fill = None, region = Outside_reg);
#geometry
universe = omc.Universe(cells = [Inside_cell, Outside_cell])
geometry = omc.Geometry(universe)
source
point = omc.stats.Point((0.0, 0.0, 0.0))
src1 = omc.Source()
src1.space = point
src1.energy = omc.stats.Discrete([1.0E3], [1.0])
src1.time = omc.stats.Discrete([0.0], [1.0])
#src1.angle = omc.stats.Isotropic()
src1.angle = omc.stats.Monodirectional(reference_uvw=[1.0, 0.0, 0.0])
src1.strength = 1.0
src_set = [src1]
#tally
hall_mesh = omc.RectilinearMesh()
hall_mesh.x_grid = np.arange(125.0, 135.01, 10.0)
hall_mesh.y_grid = np.arange(- 5.0, 5.01, 10.0)
hall_mesh.z_grid = np.arange(- 5.0, 5.01, 10.0)
hall_meshfilter = omc.MeshFilter(hall_mesh)
n_spd = 1.383E6 * math.sqrt(1.0E3) # cm/s
time_bins = [0, 124.5 / n_spd, 135.01 / n_spd, 1.0]
hall_timefilter = omc.TimeFilter(time_bins)
Hall_Tally = omc.Tally(name = âHall Tallyâ)
Hall_Tally.filters = [hall_meshfilter, hall_timefilter]
Hall_Tally.scores = [âfluxâ]
#settings
settings = omc.Settings()
settings.run_mode = âfixed sourceâ
settings.source = src_set
settings.batches = 100
settings.particles = 100000
#run
model = omc.Model(materials=materials, geometry=geometry, settings=settings, tallies=[Hall_Tally])
model.run(threads = 32)