Serpent-to-MCNP input converter

Questions and discussion about applications, input, output and general user topics
Post Reply
Andrei Fokau
Posts: 77
Joined: Thu Mar 25, 2010 12:25 am
Security question 2: 0
Location: KTH, Stockholm, Sweden

Serpent-to-MCNP input converter

Post by Andrei Fokau » Fri Sep 24, 2010 1:07 pm

In some cases, one has to use MCNP instead of Serpent in order to calculate parameters of a pin-, assembly- or full-core model. Since, it is quite hard and time-consuming to make a MCNP input file, I was always looking for an alternative way, as probably most of MCNP users are. Visual editors developed for MCNP were not really suitable for my daily work, so I started to use input-templates and some metaprogramming in order to save my time and to make the process efficient. However, geometry modeling was still quite ugly, and I was continuously looking for a better way of doing it. In this respect, discovering Serpent was a long-waited miracle. Being so easy and straightforward, Serpent makes geometry definition so clear that I am not sure that one can make it better than it is. My solution was simple - to use Serpent for defining the model and calculation of what Serpent can do, and to convert Serpent input to MCNP input in order to obtain the missing values and/or to compare similar ones.

For the conversion, I wrote a bunch of Ruby classes which presently allow me to convert the models I am working on. The converter is still in a very deep development phase, so you need to be careful if you want to use it. Note, that there are not so many error checkers, therefore the converter may crash with a meaningless error message. Thanks to the Ruby syntax, it is very easy to read the code, so you have a good chance to find what's wrong by yourself.

If you like the idea and want to contribute to the development, you can easily do so by creating an account at and forking the sources.

Source code:

Serpent geometry of an ADS model:

MCNP geometry:
KTH Reactor Physics (Stockholm, Sweden)

Post Reply