Hi all, I’d like to use Julia to solve the time-independent Boltzmann transport equation (BTE) over unstructured grids in 2 or 3 dimensions using the Sn method for neutrons. So far I’ve identified Trixi.jl and Gridap.jl as two libraries that might be capable of doing this, but I am unsure exactly how the problem should be formulated to be solved using one of these tools.
There are many papers which present various formulations of the BTE to be solved deterministically, but I have struggled to find a resource which fully explains (at least, in a way that I can understand) how these formulations are implemented in software.
My apologies if this topic is too broad or vague. For context, I use solvers that do this sort of thing regularly at work and this is an effort to improve my understanding of what they are actually doing. I am a reasonably experienced programmer (including some Julia) but I am a considerably less experienced in mathematics, which I think may be the cause of my difficulties with this so far.
Could anyone here lend some insight into this problem?
I think you should definitely look into
NeutronTransport.jl, which AFAIU is designed to do just this (CC @rvignolo).
Gridap might be helpful if you want to solve diffusion-like approximations to neutron transport (Diffusion or Simplified Pn), but I wouldn’t go for finite elements to solve the Boltzmann Transport Equation (especially nbot in its integro-differential form). However, Gridap (and more generally, finite elements) might be useful in order to implement a Diffusion Synthetic Acceleration ; but this might be a bit more advanced.
I have no experience with Trixi, but seeing that it aims at solving hyperbolic equations, it might be relevant to solve the transport part of the BTE (in its integro-differential formulation). However, you’ll probably still have to somehow handle the scattering source terms by yourself. And the power iterations (when you speak of time-independant neutron transport, I’m assuming you refer to some sort of criticality calculations?)
EDIT: and welcome to the community! A new Julian who works on neutron transport… what more could I ask for?
Of course I would be more than happy to help you on this topic!
I think adding new discretizations to NeutronTransport.jl would be very straight forward. We could work on an implementation for SN or collision probabilities for example.
Notice that I am using Gridap.jl already, since I need to load unstructured meshes and apply a ray tracing over it (look into RayTracing.jl).
I believe that if you look into NeutronTransport.jl source code you will demystify the complexity under nuclear reactor codes and you will never see them as black boxes again.
Have a nice day!
Thank you both for your responses and for the warm welcome!
From what you say it seems that it would be somewhat complicated to use existing frameworks to solve the BTE using the Sn discrete ordinates method, but I may still look into the diffusion approximation or the Pn method. I am curious though as to why you wouldn’t recommend FEM for neutron transport? I have been able to obtain comparable results from FEM solvers and Monte Carlo solvers in most cases so from my point of view at least it seems like as good a method as any. And yes, by time-independent neutron transport I was referring to simple k-eigenvalue and fixed source problems with no depletion.
NeutronTransport.jl looks very interesting! I have not had the chance to use any MOC solvers yet so I look forward to looking into the source code and how the method works. Since this method seems to make use of ray tracing, I am interested in the reason you chose to use unstructured meshes for the geometry representation rather than something like constructive solid geometry which is common in Monte Carlo, for example.
I am pleased to see there is some interest in neutron transport in the Julia community - I believe the language and its scientific-focused ecosystem is very well suited to this application and I hope it can help to replace some of the old Fortran code that seems to be prevalent in this field.
We have a package Kinetic, which focuses more on the Boltzmann equation for gases, but it can also deal with radiative transport.
An example can be found here (Kinetic.jl/example/radiation/linesource.jl at master · vavrines/Kinetic.jl · GitHub).
It’s simply that in its standard integro-differential formulation, the spatial operator in the BTE is hyperbolic, whereas standard finite elements are easier to use for elliptic operators.
EDIT: there exist formulations of the BTE that are more suited to FEM, such as the 2nd-order even-parity formulation. Are you referring to those?
Could you tell what kind of FEM-based tools you’ve used? It might very well be that we’re not speaking of the same kind of things here.
Primarily I have used the commercial code ATTILA, it may be that this solver uses a formulation more suited to FEM, perhaps the one that you mentioned. I think to have any hope of implementing this, I will have to do more reading around the different formulations of the BTE and how they are used.
Indeed, we should implement CSG for NeutronTransport.jl. At the moment, I was more familiar with unstructured meshes so I used them. If we implement a method that segmentizes tracks transversing a CSG, then we could just use the same solver implemented for NeutronTransport.jl (we might need to segmentize segments based on their length and material properties).
@ffevotte I have worked on implementing Finite Elements and Finite Volumes for both Diffusion and Sn (discrete ordinates) discretizations in the past (see here). I don’t know if this adds some valuable input from my side
I think to have any hope of implementing this, I will have to do more reading around the different formulations of the BTE and how they are used.
@WarmConsidering We could just copy the implementations here to Julia. That software was developed by some friends and myself when I used to work in the Nuclear industry, the equations there are easy to follow. It could be a great starting point: that source code + reactor physics books.
Yes, that’s an excellent starting point - I haven’t seen any source code for Sn solvers before, so I think I can learn a lot by studying that, thank you!