Skip to content

High performance cyclic ray tracing algorithm for neutron transport in Julia.

License

Notifications You must be signed in to change notification settings

rvignolo/RayTracing.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RayTracing

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.

Cyclic Ray Tracing

Installation

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")

Example

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
trace!(tg)

# proceed to segmentation
segmentize!(tg)
Geometry / Mesh Tracks Segments