Those who are in the nuclear engineering business might be interested to know that I've updated the LaTeX class for ANS transaction summaries. It is now more compliant with the ANS-specified guidelines, and it uses a much better version of the Times math font.
07 June 2011
05 June 2011
Ah, Python
Another reason to write regression tests for C++ code in Python: integration with matplotlib. Here, I test my sampling algorithms with a Q-Q plot:
Yes, this at one point saved me from an implementation snafu.
23 April 2011
Research code is now open sourced
Well, after talking with a group of nuclear engineers who are interested in open sourcing their codes, and after being persuaded by my friend Mike that it was justifiable to return some of my tools to the taxpayers who've sponsored my education, I have decided to open up my research code. The project is called PyTRT, and it's available at GitHub under a Simplified BSD license. Documentation for PyTRT is available, but it is probably overwhelming. We'll see if this ever amounts to anything.
23 February 2011
Particle tracking bugs
Tracking Monte Carlo particles (or in this case, ray traces) through a geometry can be tricky because of the subtlety of edge cases. Today I discovered that my tracking routine failed when given a direction of −0.0 . I never imagined that the existence of signed zeroes in IEEE floating point arithmetic could ever bite me.
12 February 2011
Reflecting on the hard work I've put into my research code
I am still proud of my code to get the angle in a quadrature set reflected across an axis. It's a little crazy.
const AngleT& getReflectedAngle(const AngleT& a, unsigned int axis ) const { return angles_[ (a.getOctantIndex() ^ (1 + ( axis << 1)) + 1) * numAnglesPerOctant_ - 1 - a.getSubIndex() ]; }
This section of code is copyright © 2011 Seth R Johnson, All rights reserved.
02 December 2010
MC2011 proceedings bibliography style
In case anyone out there hasn't yet submitted their paper for the upcoming M&C conference, I have cooked up a BibTeX bibliography style file for the International Conference on Mathematics and Computational Methods that accurately reproduces their example references in the provided LaTeX template. Download it to save yourself the trouble of manually formatting your citations.
26 July 2010
The Case-book of Linear Transport Theory
There are very few people who, upon glancing at the section titles in their neutron transport theory books, would chuckle because "The Case of Anisotropic Scattering," "The Albedo Problem," and "The X-Function Identities" all read like titles from a collection of mysteries.
21 January 2010
Reference people
A couple of days ago, a rather malformed email with the subject "Reference man....bad? should it be changed?" arrived in my inbox:
Hi,
I am and one of the cases is talking about how the nuclear clean-up sites standards should be changed from not only including the Reference Man...but other age groups as well.
Do you think this would be an effective policy to put in place? Or do you see places where they might have problems?
Thanks!
~Chrissy
I am still baffled by the first half of the first sentence, but I attempted a coherent answer nonetheless, since I have the feeling that this individual is a grade schooler asking for information for a research report. Conceivably, my answer may be of use to some other fledgeling researcher, so I'm posting it here.
Dear Chrissy,
If I understand your question correctly, you're asking if the Reference Man model is too inaccurate to continue being used. In short, the answer is no; however, there are a number of applications where its use as model would be inappropriate. In fact, in the 35 years since ICRP 23 (which defined Reference Man) was released, a number of other reference individuals have been created. According to the book for my health physics class [James E. Turner, Atoms, Radiation, and Radiation Protection, 2nd ed., John Wiley & Sons, Inc., New York, 1995, pp. 487--489], "reference data have been compiled for an adult female and for children and infants of various ages." So, actually, part of what you're asking has already been done.
Reference Man's purpose is to simulate the effect of an internal radiation dose (i.e., inhaling radioactive dust that sticks inside the lungs) on the rest of a person's body. For the most part, these estimates for effective radiation doses are very rough, accurate to perhaps on the order of ten percent. Since Reference Man is primarily used to estimate values for workmen, it would usually approximate an average worker pretty well. (Children, for example, are not often radiation cleanup workers.) For other cases where more accurate doses to particular people need to be calculated, one of the other reference models can be used.
When high precision is needed, the models used are far more detailed. As an example, consider radiation therapy for cancer, where very high doses of radiation are needed to very specific areas of a person (the cancerous parts). Cancer tissue is more susceptible to radiation than healthy tissue, but healthy parts are still damaged by large amounts of radiation. Therefore, the medical physicists need to make very accurate representations of the person, which is usually done by taking a detailed scan of them with MRI or CT scans. Then, once they have determined the proper settings that will eliminate the cancer but not the person, they do the therapy. No professional would consider using a rough model like Reference Man for a one-shot, high-precision job like that.
In summary, Reference Man is only a tool. He is a model used as a good first-order approximation to the general public. As such, it's not necessary to impose extra policies: when more precision is needed, better models are used.
I hope this answers your question satisfactorily.
Regards,
Seth Johnson
25 November 2009
Who needs five digits of accuracy anyway
At the ANS Mathematics & Computational topical conference this spring, I heard a rumor (from a very well-placed source) about an ironic error in MCNP.
MCNP is considered by many in the labs and industry to be "the" nuclear simulation program of choice. It's a Monte Carlo transport program with continuous energy data and the ability to represent virtually exact geometry (with no truncation error for smooth surface, unlike in deterministic methods). It's had many decades of development, and it's been tested and tweaked considerably to match up with experimental and numerical benchmarks. Naturally, then, a simulated result from MCNP is often used as a reference answer when comparing new codes.
No simulation can exactly represent reality: there are always errors in data, simplifications in the physics, etc. This should always be kept in mind when doing computational anything. Case in point, I heard of a "run-off" benchmark between MCNP and another reactor code, SCALE. The result was that MCNP got the right answer and SCALE was wrong: the only problem was that their definition of the "right" answer was based on an MCNP-run calculation.
The error in MCNP—which you can verify yourself with the card entry print 98
—is laughably simple yet indeterminately old. Avogadro's number, which converts between the number of atoms and the mass in a material, is programmed to be 6.022043447E+23 rather than the correct 6.02214179E+23. (In fact, it's written to 16 digits of "accuracy" even though only about ten are scientifically known to any precision.) The irony is that if they change Avogadro's number, their carefully benchmarked answers will come out "wrong."
It's not a huge problem, since I doubt most answers would be sensitive to such a small perturbation, but it serves as a warning to carefully consider the difference between "true" and "best approximation."
30 May 2009
MCNP criticality search Python script
Undergraduates, being unthinking animals, usually try this arduous task by hand, laboriously changing the parameter in an input file, running it, and repeating. As a graduate student, such tediousness is beneath me, as I would rather spend an equal amount of time writing a script to do the task for me. (Experience dictates that most of the time, some error or revision will require re-doing the task at least once, which means that a script will often save time by a factor of two or more. Besides, scripts are reusable and an educational experience.)
These Python scripts (gzipped archive) will do just that. It's a fairly simple binary search (no Newton–Krylov iterations) partly because of the complicating factor of the uncertainty in each answer. When criticality is reported to within the experimental standard deviation, the script increases the number of particles until such a parameter is determined that results in criticality within the user's specified tolerance. The script will run MCNP, process the output to determine k-effective, and iterate to your heart's content. If you have matplotlib installed, it will also produce a plot of how k varies with the parameter:

The MCNP search script is by no means perfect, and it assumes you have mcnp5 in your path. You have to know some Python to create a subclass of McnpSolver for your particular problem.
Included are scripts for finding the critical parameters of HEU cubes, cylinders, hemispheres, etc. There's also a script for generating a spherical shell volume tally to calculate the radial flux of the converged critical sphere.
Future updates of the MCNP criticality script will be posted on my projects page, although you should not expect there to be any. If you use this script, please cite its use if you report or present the results.
05 February 2009
MCNP syntax highlighting in vim
This syntax highlighter for MCNP in VIM is due to Giacomo Grasso. The file on his page is inaccessible other than through the white paper, so I have taken the liberty of extracting it and putting into a file available for download. Put it inside the ~/.vim/syntax folder.
There's no easy sure-fire way of detecting an MCNP input file, but if you create a file at ~/.vim/scripts.vim with the contents
if did_filetype() " filetype already set.. finish " ..don't do these checks endif if getline(2) =~ '^C.*\<mcnp\>\c' setfiletype imcnp endif
it will load the MCNP syntax coloring if the second line of your input deck is a comment (the first letter of the line is a 'c') with the word MCNP in it somewhere.
18 June 2008
Diffusion
19 April 2008
Modern research technology
So my partner and I chose metallic fuels for our topic. Well, basically, thanks to the amazing technology that's only shown up in recent years in available consumer technology, my life and ability to communicate information was fantastically simplified.
The first step was to use Google Scholar to find some good references. So I searched for "metallic fuel" fast reactor and found a few to start with. There's an option in the preferences to show a link to import the bibliography information into BibTeX format (like so). With Michigan's library subscriptions I was able to follow the link to ScienceDirect and other sites and actually download a digital copy of the article as a PDF. [Brief aside: I just realized that PDF format is one of those redundant acronyms.] So with the copied BibTeX information, I opened up BibDesk, created a new entry that now has all of the bibliography data, and dragged in the PDF. From this, I can automatically generate a bibliography in the report and citations and so forth (which, with LaTeX using BibTeX, is a piece of cake).
In short, I was able to easily find a lot of useful references, organize them, and use them. But one of the coolest things actually made itself useful during our presentation. Someone asked a question about iodine and technetium radiotoxicity, and how fast reactors transmuted those to less harmful elements. I couldn't recall anywhere in the papers offhand, but I opened up BibDesk, entered "iodine" in the search file content field, and double-clicked on the paper that showed up. It opened the publication in Preview, and inside that it had automatically highlighted eveywhere that "iodine" appeared in the document. Then I dragged the window over to the projector screen to show the relevent plot and text. So in about 10 seconds I was able to find exactly what information he needed. Pretty sweet! And to think that 25 years ago graduate students were lucky if they didn't have to use a typewrite to write their thesis.
26 March 2008
MCNP
14 January 2008
LaTeX ANS template
Well, for those of you who want to publish a summary for the American Nuclear Society transactions (or to write an abstract for the ANS student conference) but prefer LaTeX to Microsoft Word, today I completed a class and bibliography style that are (EDIT 6/2011) now completely compliant with the published ANS guidelines. Hopefully someone will find this useful. Example files and more details are here.
27 October 2007
Centrifuge enrichment
Recently a company called USEC has leased the facility and classified centrifuge technology
from the Department of Energy. They have improved upon the centrifuge technology and set up a pilot cascade of about 12. Each centrifuge is about 45 feet tall, and has a capacity of around 350 SWU, around a factor of 10 larger than the european centrifuges. The centrifuges consume 5% of the power of the gaseous diffusion plants per SWU -- the technology level required (even if you had schematics you would still require high-tech materials and precision machining) is much higher than gaseous diffusion.
On the tour we got to see the outside of six of them assembled -- the inside of course is highly classified -- and walk through the building where they will work. (The part where their prototype cascade is built is sealed off from the area in which we were allowed to be escorted. There was a gate at the edge of the property, a fence around the whole building complex near the parking lot where we were badged, a fence inside the giant buildings where the centrifuges were to be housed, and finally the fourth covered fence inside of which only those with a Q clearance could enter.)
So this looks to be pretty promising. The main obstacle is that right now, enriched uranium imports are reduced by protective tariffs that will be disappearing at some point in the near future. It is unclear whether USEC can become operational before and cost-competitive at that time. If they are able to, then they will be making a lot of money, because once the megawatts-to-megatons program stops providing utilities with enriched uranium, and with the likely upsurge in nuclear power brought on by the impending energy crisis, the demand for enriched uranium will guarantee that these guys will be operating at full capacity.
10 August 2007
Nuclear data, of a sort
My landlady gave me, at my request, a bunch of pamphlets I discovered lying around. They're educational booklets published in the mid-'60s by the U.S. Atomic Energy Commision, printed right here in Oak Ridge. They're really cool -- they vary in subject matter from space nuclear power to physical attributes of plutonium to medical uses of radioisotopes. It provides a fascinating look into the past. For example, one of the medical uses was injecting [Na-24]Cl into a patient's bloodstream and placing shielded detectors at points in his body, using the intensity to calculate where flow constrictions might be. I really doubt they do that nowadays. (I assume it was superseded by MRI.)
I was curious to see if any of that detailed information on plutonium had been reclassified, so I did a little googling and came up with this interesting site. There is some really cool (and some useful) information there, but the organization that hosts it seems kind of questionable. Do they think that by posting a bunch of that kind of information, they'll make the US decide to release all of its nuclear secrets into the public domain and simultaneously cease development of advanced nuclear weapons? I hope not.
02 June 2007
DOE takes the axe to another program dear to my heart
I spent a week and a half in the area as part of an award trip through the DOE Science Bowl. It was an amazing learning experience that not only showed the null effects of the present-day operations on the ecology but also enhanced the scientific repository through the invention of new techniques and the discovery of new species in the southeast marshlands.
Even though it's possible that the funding may well be spent in better places, I'm sorry to see it go.
09 October 2006
Nuclear North Korea
Worst case, according to our resident nonproliferation expert professor, is NK weapons increase --> Japan weapons increase --> Russia weapons increase --> US weapons increase and we have another cold war on our hands.
According to the USGS, the nuke-induced quake registered about 4.2 on the Richter scale. I actually get to use something I learned in my 1-hour survey course about nonproliferation: a formula that converts earthquake magnitude to nuclear device power in kT. Assuming it's "well-coupled" (they're not using a large cavern or anything to mask its magnitude, which would be silly at this point in their program), mag = 4.01 + 0.79*log(yield). This gives a yield of about 1.7 kilotons.
The first U.S. nuclear test, the plutonium-based implosion device Trinity, measured about 20 kT. Maybe North Korea's first test was a fizzle? It might also just be a small test.
Regardless, the world is notably less stable today than it was before the weekend.