High performance cyclic ray tracing algorithm for neutron transport in Julia.
Author rvignolo
8 Stars
Updated Last
1 Year Ago
Started In
December 2020


Build Status

The partial integro-differential neutron transport equation can be casted to an ordinary differential equation over tracks that emulate neutron trajectories across a problem domain by means of the Method of Characteristics. This library addresses the cyclic ray tracing of those paths over any 2D rectangular mesh and computes quantities used to solve the transport equation in NeutronTransport.jl.


The package can be installed using the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run:

pkg> add RayTracing

Or, equivalently, via the Pkg API:

julia> import Pkg; Pkg.add("RayTracing")


Create a gmsh mesh using any available tool of your choice (checkout GridapGmsh.jl for convenience). For example, this file shows the definition of a simple pin-cell geometry. Then, the ray tracing consists in two steps, namely, the track tracing and the segmentation of those tracks.

using RayTracing
using GridapGmsh: GmshDiscreteModel

# load mesh and define a model with it
mshfile = joinpath(@__DIR__, "demo", "pincell.msh")
model = GmshDiscreteModel(mshfile; renumber=true)

# number of azimuthal angles= 8

# azimuthal spacing
δ = 2e-2

# initialize track generator
tg = TrackGenerator(model, nφ, δ)

# perform ray or track tracing

# proceed to segmentation
Geometry / Mesh Tracks Segments

Used By Packages