Hi,
I would like to tally the neutron current on a hemispherical surface, but it appears that such a surface is not available. There is only a surface representing the entire spherical surface. Is there an alternative solution for this? Additionally, I would like to define a thermal neutron source with an energy range of [0, 0.025 eV] and emission in the x-direction. Below is my code, could you please confirm if it is correct?
Thanks!
settings = openmc.Settings()
settings.run_mode = ‘fixed source’
settings.particles = 10000
settings.batches = 500
angle = openmc.stats.Monodirectional((1.0, 0.0, 0.0))
source = openmc.Source()
source.particle = “neutron”
source.angle = angle
energy_values = [0,0.013,0.026]
probabilities = [0.5, 0.5]
energy_distribution = openmc.stats.Tabular(energy_values, probabilities)
source.energy = energy_distribution
settings.source = source
Hi @Tianxiang. To compute the current in a hemispherical surface, cut the sphere in two with a plane, and add an FromCell()
filter to choose the side you want.
As for the distribution, x
and p
have to have the same length in openmc.stats.Tabular()
. Also, if you just want a flat distribution you could just use openmc.stats.Uniform()
.
BTW: you can use the .sample()
method in the distribution to check it:
import matplotlib.pyplot as plt
samples = energy_distribution.sample(1000000)
a = plt.hist(samples,bins=100)
Thank you very much @Ignacio . Also, I wanted to ask, is it using ‘openmc.CellFromFilter’? So, does a particle that comes from one of the hemispheres of the Cell equate to the neutron flux reaching the surface of that hemisphere? I believe that the number of particles originating from that hemisphere should not be equivalent to the number of particles reaching the surface of the hemisphere.My understanding is that this tally includes not only the number of particles coming from the curved surface of the sphere but also the number of particles coming from the cut surface.
Yes, it is using CellFromFilter()
. Sorry for the typo.
Perhaps I misunderstood what you want to calculate. A tally with a current
score, with a SurfaceFilter()
applied to a sphere, and with a CellFromFilter()
applied to a cell that is one hemisphere, will count the particles that go through the sphere after flying inside that hemisphere. That is the integral of the outgoing current over the hemisphere.
If you want to calculate flux or something else, you will need different tallies.
1 Like