← Modern Nuclear Data Processing

Software · MCNP to SCALE · version 0.0.27+keno.1

csg2csg-keno: MCNP to SCALE KENO-VI

csg2csg-keno converts an MCNP deck into a SCALE 6.3 continuous-energy KENO-VI (CSAS6) input, universes, lattices and rotations included, and compares the converted model with the deck point by point. It is a modified copy of csg2csg, the open-source geometry translator by Andrew Davis, Jonathan Shimwell, Steve Lilley and Patrick Shriwise; the KENO-VI writer and the comparison tool are additions, not part of the upstream project.

About this work. Most of this work, including this page, was generated with AI (Claude, Anthropic) under the direction of Ian H; it has not been independently reviewed. Compare plots of a converted model with the deck and run a short transport calculation before relying on it.

1. What it converts

The converter has its own MCNP reader, because csg2csg's does not keep lattices, fill arrays or LIKE n BUT. Surfaces are written exactly, not meshed.

MCNPKENO-VI
planes, spheres, cylinders, two-sheet cones, sq, gq, with TRPLANE or QUADRATIC
whole macrobodies (rpp box sph rcc trc rhp hex) in any orientationnative bodies with ORIGIN and ROTATE
cells with unions and complementsone MEDIA record per disjoint intersection; pieces shown to be empty are dropped
universe fills, TRCL, fill transformationsexpanded in place, surfaces moved exactly
lat=1cuboidal ARRAY, clipped by the filling cell's region as MCNP clips the lattice
lat=2 along z, flats normal to x or to yTYP=HEXAGONAL or TYP=RHEXAGONAL
a lattice, or a universe holding one, under a rotationrotated HOLE
imp:n=0 cells; reflecting surfacesthe global unit's boundary; all=mirror, per-face codes or body=… surface(1)=mirror
m, mt, cell density, tmp, kcodestandard compositions with SCALE nuclide names from the installed library; npg, nsk, gen

It also reads the less common forms found in older decks: Fortran-style numbers, nJ and nR, planes through three points, partial rotation matrices, u=-n, vertical-format imp:n, and lattice entries with their own transformation. Cells of one universe that share volume are resolved as MCNP's cell search does, and a start box is written around the parts of the model that hold an actinide. Not supported (an error names the card): tori, white and periodic boundaries, lat=2 other than a regular hexagon along z, and a model boundary that is not one intersection. The module README has the full lists, and the KENO-VI behaviour that the SCALE manual leaves open and was measured with small test decks.

2. Install and run

It needs Python 3 with numpy, and a SCALE 6.3 installation for the nuclide names; the comparison tool also needs Pillow.

pip install "git+https://gitlab.com/hardtohit10/csg2csg-keno.git@v0.0.27+keno.1"
python -m csg2csg.keno DECK.inp -o OUT.inp --scale /path/to/SCALE-6.3.3

Other options: --library (default ce_v8.0_endf), --temperature for cells without tmp, --param for KENO-VI parameters and --plot for plot specifications. Alongside the input it writes OUT.inp.mixtures.json, which maps each KENO-VI mixture to its MCNP material, density and temperature and lists any notes; read it before running. The usual csg2csg command also works: csg2csg -i DECK.inp -f mcnp -o keno.

3. Comparing a conversion with the deck

The comparison tool decodes KENO-VI's own plots into mixture numbers and asks, for every pixel, which cell the MCNP deck puts at that point. The point locator applies MCNP's rules directly and shares only the deck reader with the converter. Pixels that differ are tested against their neighbours, so a pixel cut by a boundary is not counted as a disagreement, and a coverage line reports which mixtures the plots reached, so plots that miss part of the model do not pass silently.

Two plots of the same test model, side by side and identical: on the left KENO-VI's plot of the converted input, on the right the MCNP deck as the point locator sees it. Graphite background with zirconium cylinders, fuel pin lattices, a rotated lattice in a zirconium-lined cylinder and a dense lattice of fuel particles. No pixel disagrees out of 870,000.
The converter's test deck at z = 0, 0.08 cm per pixel. Every pixel of the KENO-VI plot was compared with the deck: 0 disagreements in 870,000 pixels, and 79 pixels on a boundary that match a neighbouring pixel. Made with version 0.0.27+keno.1 and SCALE 6.3.3.

The test deck (csg2csg-keno-test-deck.inp, written for the converter, not a benchmark model) has one of each construction that is hard to convert:

  1. a cell that is the union of two cylinders;
  2. a hexagonal lattice with flats normal to x (TYP=HEXAGONAL), clipped by a cylinder;
  3. a square lattice clipped by a cylinder, its centre element filled with the lattice's own material;
  4. a hexagonal lattice with flats normal to y (TYP=RHEXAGONAL);
  5. a universe of two cylinders moved and turned 45° by TRCL;
  6. a square lattice in a zirconium-lined cylinder, turned 30° by the fill transformation (a rotated HOLE);
  7. an unbounded lattice of fuel particles, clipped by a cylinder.

To repeat the comparison:

python -m csg2csg.keno csg2csg-keno-test-deck.inp -o t2k.inp --param run=no \
  --plot "xul=-46 yul=36 zul=0 xlr=34 ylr=-34 zlr=0 uax=1 vdn=-1 nax=1000"
scalerte t2k.inp
python -m csg2csg.keno.verify csg2csg-keno-test-deck.inp t2k.inp --stride 1 --compare

With --compare it writes a picture for each plot: KENO-VI, the point locator and the differences. Pixels must be smaller than the thinnest feature. Plots do not exercise KENO-VI's tracking, so run a short transport calculation as well.

4. What was compared

5. Known limits

Davis A, Shimwell J, Lilley S, Shriwise P, Hill I, Claude (Anthropic AI model). csg2csg-keno: csg2csg with an MCNP to SCALE KENO-VI writer, version 0.0.27+keno.1. Zenodo, 2026. https://doi.org/10.5281/zenodo.24137058

The repository's CITATION.cff has the same reference. A second DOI, 10.5281/zenodo.24137057, always points to the latest version.