← Modern Nuclear Data Processing
Software · MCNP to SCALE · version 0.0.27+keno.1
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.
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.
| MCNP | KENO-VI |
|---|---|
planes, spheres, cylinders, two-sheet cones, sq, gq, with TR | PLANE or QUADRATIC |
whole macrobodies (rpp box sph rcc trc rhp hex) in any orientation | native bodies with ORIGIN and ROTATE |
| cells with unions and complements | one MEDIA record per disjoint intersection; pieces shown to be empty are dropped |
universe fills, TRCL, fill transformations | expanded in place, surfaces moved exactly |
lat=1 | cuboidal ARRAY, clipped by the filling cell's region as MCNP clips the lattice |
lat=2 along z, flats normal to x or to y | TYP=HEXAGONAL or TYP=RHEXAGONAL |
| a lattice, or a universe holding one, under a rotation | rotated HOLE |
imp:n=0 cells; reflecting surfaces | the global unit's boundary; all=mirror, per-face codes or body=… surface(1)=mirror |
m, mt, cell density, tmp, kcode | standard 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.
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.
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.
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:
TYP=HEXAGONAL), clipped by a cylinder;TYP=RHEXAGONAL);TRCL;HOLE);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.
tests/test_keno.py).hfreegas and dfreegas, because SCALE 6.3's plain h-1 and h-2 are bound in light and heavy water.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.
upstream-master in the repository is upstream's master as forked).