The 2014 Nuclear Engineering Code-a-thon: The Details

The 2014 code-a-thon was a 24 hour exercise where a group of students worked to put together a fully functional Eulerian hydrodynamics code.  In particular we were interested in a code that could handle multiple materials.  The motivation for the nuclear engineering students is that many of them had experience with Lagrangian hydrodynamics methods in a graduate course on radiation-hydrodynamics, and exposure to Eulerian hydrodynamics was missing from their experience.  Also, last year the students had so much fun at the code-a-thon they wanted to do it again.  This year our chief code architect was Andrew Till and his vision was the binding force in the organization of the pre-event coordination.

In 2013 we tried to do a straight 24 hour exercise. That experience taught us that this year it should be two 12 hour days.  At one point this year, someone asked why not just one 24 block and the unanimous answer was “You must not have been here last year.”  The actual reason is that at about 3am in the morning debugging code is more stressful and less effective than we could have imagined.

Like 2013, we are using C++ as the programming language for the code.  Most students had experience with C++, though some learned on-the-fly. This year we used the object-oriented paradigm, as opposed to last year where we (overly) used templates. Also this year, test-driven development was a point of emphasis. Our technical expert from Los Alamos National Laboratory, Gabriel Rockefeller introduced this concept to the students, and several were quite enamored with the idea.

Another feature that people assigned themselves to teams before the event.  These teams discussed ahead of time the structure of the their code, including designing any classes or functions they would need. Most groups used the class-generator produced by one of the participants, Jonathan Madsen.

The code, named meh (multi-material Eulerian hydrodynamics), was designed to be a 3-D code that could handle an arbitrary number of materials. The code as of now only handles materials that have a gamma-law equation of state.  We also base the mixed-material equation of state on pressure-temperature equilibrium in a cell.

In terms of the physics/numerics in the code, we used HLL and HLLC for the Riemann solvers (a good reference, and one we used, is the book by Toro-Riemann Solvers and Numerical Methods for Fluid Dynamics: A Practical Introduction). For time integration we used Runge-Kutta time integration, and our implementation can use an arbitrary (explicit) Butcher tableaux. Our spatial scheme is discontinuous Galerkin finite elements (though we only support P0 elements with slope reconstruction at present).

For development we used subversion for version control (partially because our department already has an svn server set up), Cmake for our build system (thanks again to Jonathan Madsen).  The code was also designed to break work into blocks that could be sized to the available cache on a given machine.

For all the best laid plans, we did not get a complete code that solved the Euler equations. However, all was not lost: the code worked in that each piece of the code, boundary conditions, Runge-Kutta time integrator, Riemann solver, EOS, etc. could all talk to each other and run a time step.  Each piece was not tested fully in the integrated code, but each could at least talk to each other.  Over the next semester, we plan on bringing it all together and I will report on the findings here.

The participants were, in no particular order,

Don Bruss, Andrew Till, Alex Long, Jonathan Madsen, Bruno Turcksin, Damien Lebrun-Grandie, Akansha Kumar, Vischal Patel, Daniel Holladay, Taylor Lane, Michael Hackemack, Marco Delchini, Peter Maginot, Ryan McClarren, and Gabriel Rockefeller.

The 2014 Code-a-thon in pictures

We’re still recovering from the 24 hours of coding that was the 2014 Nuclear engineering code-a-thon.  More on what happened and what we did later. For now I wanted to share with everyone the pictures I took of the event.  In the panoramic shots you might notice that some people don’t change position much, even when there is food.

First coffee at the code-a-thon

First coffee at the code-a-thon

 

Code-a-thon First Hour

Code-a-thon First Hour

Day 2 - Pizza Time

Day 2 – Pizza Time

Day 2 Mid-afternoon malaise

Day 2 Mid-afternoon malaise

Day 2: Two Hours to go

Day 2: Two Hours to go

 

 

 

High-Impact Learning For Computational Science Education Through A Code-A-Thon

photo1

It is almost the one-year anniversary of the first Code-a-thon I helped organize for Texas A&M nuclear engineering students. It is a good time to reflect on what we did last year. A code-a-thon is an event where a group of people gathers, usually in one location, for a defined period of time to solve a particular problem. In our code-a-thon the students were tasked with developing a Monte Carlo code for thermal x-ray transport that was parallel using C++.

After the jump we go into a lot more detail.

Continue reading

POD: Scalar Flux outside a planar source

Consider a plane of thickness $$\Delta z$$. The plane emits $$q$$ neutrons per second per unit area at a single energy and is comprised of a pure absorber. What is the angular flux at the right edge of the plane, $$\Phi(\Delta z, \mu)$$? Use your solution to give the angular flux emerging from an infinitely thin plane source. Hint: Use an integrating factor of $$\exp{(\sigma z / \mu)}$$.

 

The derivation of this solution is after the jump

Continue reading

So what do Nuclear Engineers Do?

A fuel assembly for a nuclear reactor.

Good question and one I get all the time. The other links I’ve found on the internets do a good,  but dry, job describing what career paths are available to nuclear engineers. I get this question a lot from prospective students, so I thought I would jot down the answer here.

Before we begin it is important to remember that with many, if not all, degrees, the discipline helps define the career but does not cast the graduate into an ineluctable career path. How many English majors do you know that write books for a living.

Also, it is important to keep in mind that the typical career is dependent on what degree level we are talking about.  In most cases, when someone asks this question they want to know about a nuclear engineer with a bachelor’s degree, so that is where we will start after the jump.

Continue reading

Show your students that grades aren’t random with ggplot2

Grade Analysis Figure

Lots of data on this plot: for each student you can read his/her exam scores, homework grades, and quiz grades.

I had some success recently in demonstrating to my students that their performance on the exams of a course is at least correlated with their performance on homework and quizzes.  The figure above is from my fall 2012 nuclear reactor theory course.  As it is obvious, those who did better on exam 1 were likely to perform well on exam 2. Also, the big dots, high homework scores, are likely to be in the top right as well.

Those students who did not get the point of this figure after some explanation at least had some fun pointing out their dot on the figure.

The following will demonstrate how I made this figure using R and the ggplot2 (Grammar of Graphics 2) package. Hit the jump to see more.

Continue reading

Congratulations Weixiong Zheng on your Masters Degree

On Wednesday morning my student Weixiong Zheng successfully defended his Masters thesis entitled “Physics-Based Uncertainty Quantification for ZrHx Thermal Scattering Law”.  His thesis work is partially covered in this American Nuclear Society Transactions paper.

ZhengMasters

His work centered on how low-energy neutrons scatter off zirconium hydrate (ZrHx — the x varies from 1 to 2). For those not nuclear engineers, most nuclear reactors use fission caused by thermal (low energy) neutrons.  In some reactors, especially research reactors like we have here at TAMU, there is zirconium hydride in the fuel.

Continue reading

International Conference on Transport Theory 23 (ICTT23) Day One

Greetings from Santa Fe.  I’m here for the International Conference on Transport Theory.  This is a meeting that happens every two years and brings together people from several disciplines: gas kinetics, neutron transport, radiative transfer, and even computer graphics.

I gave a talk  today about using filters to improve the accuracy of discrete ordinates calculations for neutral particle transport. It was pretty well received, I think at least in part, to the fact that it is a pretty novel idea.  Most approaches to get high fidelity in angle transport simulations just throw more degrees of freedom (unknowns) at the problem.  My method actually tries to crack the nut of the problem by making the angles talk to each other.

Another highlight from today was the talk by Richard Sanchez from CEA.  His paper talked about boundary and interface conditions for the Pn equations.  I had worked on these equations in my PhD thesis, and had used a simple approach to the interface conditions.  These conditions are equivalent to the Mark conditions.  The basic idea is that the characteristics of the equations (that is linear combinations of the moments) that cross the interface should be continuous across an interface, but the other characteristics can have a jump across the interface.

At the end of Richard’s talk, Jim Morel pointed out that the upwinding procedure I used will give the correct number of boundary/interface conditions.  I had not thought of this before, but I’m now interested in comparing my conditions to the “correct” conditions.

One other thing I would like to mention is Max Rosa’s talk regarding a Lattice Boltzmann method to solve the neutron diffusion equation.  Based on his derivation, which started with a BGK collision operator, I bet it is possible to derive a Pn or SPn solution using lattice Boltzmann.  I’m going to talk to him about it tomorrow.