Back to Community Library

Benchmark Decks

Featured full-core reactor models curated by ReactorMC. These are always available here regardless of whether the Community Library backend is configured. Copy a deck to your clipboard and paste it into your editor or OWEN.

BEAVRS Benchmark Disclaimer

BEAVRS (Benchmark for Evaluation and Validation of Reactor Simulations) is developed and maintained by the Computational Reactor Physics Group (CRPG) at MIT. The decks here are translations derived from the public specification — they are not official MIT/CRPG products and may contain simplifications or transcription differences. Do not use them for licensing, safety, or regulatory purposes without independent verification. Decks labelled run-verified have been run end-to-end here (clean geometry + a sensible eigenvalue) but, like the spec-derived translations, are not benchmark-validated against measured BEAVRS data.

MIT BEAVRS — Official Documentation
scone
PWRVerified deck

BEAVRS Cycle 1 — Full-Core PWR (SCONE)

MIT BEAVRS rev 2.0.2 — Westinghouse 4-loop PWR, 193 assemblies on a 17×17 lattice; 1.6/2.4/3.1% UO2 enrichments; 975 ppm soluble boron; 600 K, control rods withdrawn. This is the author-verified Cambridge SCONE full-core deck (parity twin of `scone_beavrs_clean.inp`, exercised by `npm run verify:beavrs-parity`) and is the geometry/materials source of truth the other three codes were translated from. Author-verified at Cambridge with JEFF-3.1.1 @ 600 K; additionally re-run independently here against a downloaded ENDF/B-VIII.0 (Lib80x) ACE library, giving k-eff = 0.98906 ± 0.00019 (stable across 10k and 30k populations). Set `aceLibrary` to your local ACE data (e.g. JEF-3.1.1); enable the H-1 / S(α,β) `moder` line for physics runs. Full-core eigenvalue runs need substantial memory and CPU.

beavrs-scone-fullcore.inp· 1,243 lines · 69,637 chars
// ===================================================================
// BEAVRS Cycle 1 full-core PWR - SCONE deck (VERIFIED)
// Westinghouse 4-loop PWR, 193 assemblies, 17x17 lattice
// Enrichments: 1.6/2.4/3.1% UO2, 975 ppm boron, 600 K, CRs withdrawn
// Reference: MIT BEAVRS rev 2.0.2 (Horelik, Herman, Forget, Smith; CRPG/MIT)
//
// PROVENANCE: This is the author-VERIFIED Cambridge SCONE BEAVRS full-core
// model (parity twin of scone-examples/scone_beavrs_clean.inp and the
// repo-root "Scone Input"), named to match the geometry/materials-derived
// beavrs_fullcore.{i,sss,py} translations for the other three codes. Its
// geometry + material number densities are the SOURCE OF TRUTH those
// translations were ported from. Full universe hierarchy: surfaces ->
// pin/cell/lat universes -> 193-assembly core -> RPV/barrel/shields.
//
// LIBRARY: ZAID suffix .06 = 600 K; author run used JEF-3.1.1
// (/home/.../JEF311.aceXS). Set `aceLibrary` below to your local ACE data.
//
// WATER / S(a,b) FLAG: H-1 is carried on the commented `moder` line in the
// Water material (with its BEAVRS number density 4.9456E-02). Uncomment it
// and point `file` at an H-in-H2O thermal-scattering table that matches your
// library before running for physics; as shipped (H-1 commented) the deck is
// geometry/preview-faithful but water lacks hydrogen. S(a,b) belongs on WATER
// ONLY - never on UO2.
//
// Full verification-grade eigenvalue runs need substantial memory + CPU.
// ===================================================================
type eigenPhysicsPackage;
pop      100000;
active   300;
inactive 200;
XSdata   ce;
dataType ce;
collisionOperator { neutronCE { type neutronCEstd; } }
transportOperator { type transportOperatorDT; }
inactiveTally {}
activeTally {
  fissionRate {
    type collisionClerk;
    response (fission);
    fission { type macroResponse; MT -6; }
    map {
      type multiMap;
      maps (xax yax);
      xax { type spaceMap; axis x; grid lin; N 255; min -161.2773; max 161.2773; }
      yax { type spaceMap; axis y; grid lin; N 255; min -161.2773; max 161.2773; }
    }
  }
}
// ===================================================================
// GEOMETRY
// ===================================================================
geometry {
  type geometryStd;
  boundary (0 0 0 0 0 0);
  graph { type shrunk; }

  // -----------------------------------------------------------------
  // Surfaces
  // -----------------------------------------------------------------
  surfaces {
    // RPV and RPV liner
    outerRPV      { id 1; type zTruncCylinder; radius 241.3; origin (0.0 0.0 230.0); halfwidth 230; }
    innerRPV      { id 2; type zCylinder; radius 219.710; origin (0.0 0.0 0.0); }
    innerRPVLiner { id 3; type zCylinder; radius 219.150; origin (0.0 0.0 0.0); }
    // Neutron shield boundaries
    outerBoundNS { id 4; type zCylinder; radius 201.630; origin (0.0 0.0 0.0); }
    innerBoundNS { id 5; type zCylinder; radius 194.84;  origin (0.0 0.0 0.0); }
    // Core barrel
    outerCoreBarrel { id 6; type zCylinder; radius 193.675; origin (0.0 0.0 0.0); }
    innerCoreBarrel { id 7; type zCylinder; radius 187.96;  origin (0.0 0.0 0.0); }
    // Neutron shield panel bounding planes (octant symmetry)
    P1 { id 8;  type plane; coeffs (-0.48480962025  0.87461970714 0.0 0.0); }
    P2 { id 9;  type plane; coeffs (-0.87461970714  0.48480962025 0.0 0.0); }
    P3 { id 10; type plane; coeffs (-0.87461970714 -0.48480962025 0.0 0.0); }
    P4 { id 11; type plane; coeffs (-0.48480962025 -0.87461970714 0.0 0.0); }
    // Baffle plates (close = core side, away = reflector side)
    rightClose  { id 50; type plane; coeffs ( 1.0  0.0 0.0  8.36662); }
    rightAway   { id 51; type plane; coeffs ( 1.0  0.0 0.0 10.58912); }
    leftClose   { id 60; type plane; coeffs (-1.0  0.0 0.0  8.36662); }
    leftAway    { id 61; type plane; coeffs (-1.0  0.0 0.0 10.58912); }
    bottomClose { id 70; type plane; coeffs ( 0.0 -1.0 0.0  8.36662); }
    bottomAway  { id 71; type plane; coeffs ( 0.0 -1.0 0.0 10.58912); }
    topClose    { id 80; type plane; coeffs ( 0.0  1.0 0.0  8.36662); }
    topAway     { id 81; type plane; coeffs ( 0.0  1.0 0.0 10.58912); }
    // Grid spacer surfaces (thick and thin Inconel sleeves)
    pinThickGridInner { id 90; type zSquareCylinder; origin (0.0 0.0 0.0); halfwidth (0.61015 0.61015 0.0); }
    pinThickGridOuter { id 91; type zSquareCylinder; origin (0.0 0.0 0.0); halfwidth (0.62992 0.62992 0.0); }
    pinThinGridInner  { id 92; type zSquareCylinder; origin (0.0 0.0 0.0); halfwidth (0.61049 0.61049 0.0); }
    pinThinGridOuter  { id 93; type zSquareCylinder; origin (0.0 0.0 0.0); halfwidth (0.62992 0.62992 0.0); }
    // Axial planes (z-elevations from bottom to top of model)
    plane460    { id 120;  type plane; coeffs (0.0 0.0 1.0 460.0); }
    plane431876 { id 121;  type plane; coeffs (0.0 0.0 1.0 431.876); }
    plane423049 { id 122;  type plane; coeffs (0.0 0.0 1.0 423.049); }
    plane421532 { id 123;  type plane; coeffs (0.0 0.0 1.0 421.532); }
    plane419704 { id 124;  type plane; coeffs (0.0 0.0 1.0 419.704); }
    plane417164 { id 125;  type plane; coeffs (0.0 0.0 1.0 417.164); }
    plane415164 { id 126;  type plane; coeffs (0.0 0.0 1.0 415.164); }
    plane411806 { id 127;  type plane; coeffs (0.0 0.0 1.0 411.806); }
    plane401238 { id 128;  type plane; coeffs (0.0 0.0 1.0 401.238); }
    plane364725 { id 129;  type plane; coeffs (0.0 0.0 1.0 364.725); }
    plane35901  { id 130;  type plane; coeffs (0.0 0.0 1.0 359.01); }
    plane312528 { id 131;  type plane; coeffs (0.0 0.0 1.0 312.528); }
    plane306813 { id 132;  type plane; coeffs (0.0 0.0 1.0 306.813); }
    plane260331 { id 133;  type plane; coeffs (0.0 0.0 1.0 260.331); }
    plane254616 { id 134;  type plane; coeffs (0.0 0.0 1.0 254.616); }
    plane208134 { id 135;  type plane; coeffs (0.0 0.0 1.0 208.134); }
    plane202419 { id 136;  type plane; coeffs (0.0 0.0 1.0 202.419); }
    plane155937 { id 137;  type plane; coeffs (0.0 0.0 1.0 155.937); }
    plane150222 { id 138;  type plane; coeffs (0.0 0.0 1.0 150.222); }
    plane10374  { id 139;  type plane; coeffs (0.0 0.0 1.0 103.74); }
    plane98025  { id 140;  type plane; coeffs (0.0 0.0 1.0 98.025); }
    plane40558  { id 141;  type plane; coeffs (0.0 0.0 1.0 40.558); }
    plane4052   { id 142;  type plane; coeffs (0.0 0.0 1.0 40.52); }
    plane39958  { id 143;  type plane; coeffs (0.0 0.0 1.0 39.958); }
    plane3866   { id 144;  type plane; coeffs (0.0 0.0 1.0 38.66); }
    plane371621 { id 145;  type plane; coeffs (0.0 0.0 1.0 37.1621); }
    plane36748  { id 146;  type plane; coeffs (0.0 0.0 1.0 36.748); }
    plane35     { id 147;  type plane; coeffs (0.0 0.0 1.0 35.0); }
    plane20     { id 148;  type plane; coeffs (0.0 0.0 1.0 20.0); }
    plane0      { id 149;  type plane; coeffs (0.0 0.0 1.0 0.0); }
    // Additional axial planes for control rod and BA geometry
    plane402  { id 402;  type plane; coeffs (0.0 0.0 1.0 402.508); }
    plane403  { id 403;  type plane; coeffs (0.0 0.0 1.0 403.778); }
    plane1430 { id 1430; type plane; coeffs (0.0 0.0 1.0 143.428); }
    plane41   { id 41;   type plane; coeffs (0.0 0.0 1.0 41.828); }
  }

  // -----------------------------------------------------------------
  // Cells
  // -----------------------------------------------------------------
  cells {
    // --- RPV structure and core barrel ---
    pressureVessel { type simpleCell; id 7;  surfaces (-1 2);   filltype mat; material CarbonSteel; }
    RPVLiner       { type simpleCell; id 8;  surfaces (-2 3);   filltype mat; material StainlessSteel304; }
    outerWater1    { type simpleCell; id 9;  surfaces (-3 4);   filltype mat; material Water; }
    outerWater2    { type simpleCell; id 15; surfaces (-5 6);   filltype mat; material Water; }
    coreBarrel     { type simpleCell; id 16; surfaces (-6 7);   filltype mat; material StainlessSteel304; }
    core           { type simpleCell; id 17; surfaces (-5);     filltype uni; universe 9999; }
    // --- Neutron shield panels (4 octant segments + water fill) ---
    NS1            { type simpleCell; id 10; surfaces (-4 5 -8 9);   filltype mat; material StainlessSteel304; }
    NS2            { type simpleCell; id 11; surfaces (-4 5 8 -9);   filltype mat; material StainlessSteel304; }
    NS3            { type simpleCell; id 12; surfaces (-4 5 -10 11); filltype mat; material StainlessSteel304; }
    NS4            { type simpleCell; id 13; surfaces (-4 5 10 -11); filltype mat; material StainlessSteel304; }
    outerWaterSeg1 { type simpleCell; id 14; surfaces (-4 5);        filltype mat; material Water; }
    // --- Grid spacer cells ---
    thickGrid { type simpleCell; id 55; surfaces (90); filltype mat; material Inconel; }
    thinGrid  { type simpleCell; id 56; surfaces (92); filltype mat; material Inconel; }
    // Thick grid overlay: pin inside thick grid envelope
    gridThick24   { type simpleCell; id 1240; surfaces (-90); filltype uni; universe 24000; }
    gridThickGT   { type simpleCell; id 112;  surfaces (-90); filltype uni; universe 12000; }
    gridThickBA   { type simpleCell; id 110;  surfaces (-90); filltype uni; universe 1000; }
    gridThick31   { type simpleCell; id 1310; surfaces (-90); filltype uni; universe 31000; }
    gridThick16   { type simpleCell; id 1166; surfaces (-90); filltype uni; universe 16000; }
    gridThickIT   { type simpleCell; id 114;  surfaces (-90); filltype uni; universe 14000; }
    gridThickDP   { type simpleCell; id 230;  surfaces (-90); filltype uni; universe 1010; }
    gridThickPlen { type simpleCell; id 232;  surfaces (-90); filltype uni; universe 1008; }
    gridThickSSGT { type simpleCell; id 234;  surfaces (-90); filltype uni; universe 1023; }
    gridThickSSDP { type simpleCell; id 236;  surfaces (-90); filltype uni; universe 1024; }
    gridThickBPP  { type simpleCell; id 238;  surfaces (-90); filltype uni; universe 1012; }
    // Thin grid overlay: pin inside thin grid envelope
    gridThin24    { type simpleCell; id 2240; surfaces (-92); filltype uni; universe 24000; }
    gridThinGT    { type simpleCell; id 2120; surfaces (-92); filltype uni; universe 12000; }
    gridThinBA    { type simpleCell; id 2100; surfaces (-92); filltype uni; universe 1000; }
    gridThin31    { type simpleCell; id 2310; surfaces (-92); filltype uni; universe 31000; }
    gridThin16    { type simpleCell; id 2160; surfaces (-92); filltype uni; universe 16000; }
    gridThinIT    { type simpleCell; id 2140; surfaces (-92); filltype uni; universe 14000; }
    gridThinDP    { type simpleCell; id 240;  surfaces (-92); filltype uni; universe 1010; }
    gridThinPlen  { type simpleCell; id 233;  surfaces (-92); filltype uni; universe 1008; }
    gridThinSSGT  { type simpleCell; id 235;  surfaces (-92); filltype uni; universe 1023; }
    gridThinSSDP  { type simpleCell; id 237;  surfaces (-92); filltype uni; universe 1024; }
    gridThinBPP   { type simpleCell; id 239;  surfaces (-92); filltype uni; universe 1012; }
    // --- 3.1% UO2 fuel pin axial layers (top to bottom) ---
    31FP460  { type simpleCell; id 100; surfaces (-120 121); filltype uni; universe 1001; }
    31FP431  { type simpleCell; id 101; surfaces (-121 122); filltype uni; universe 1003; }
    31FP423  { type simpleCell; id 102; surfaces (-122 124); filltype uni; universe 1001; }
    31FP419  { type simpleCell; id 103; surfaces (-124 125); filltype uni; universe 1006; }
    31FP417  { type simpleCell; id 104; surfaces (-125 126); filltype uni; universe 1008; }
    31FP415  { type simpleCell; id 105; surfaces (-126 127); filltype uni; universe 1017; }
    31FP411  { type simpleCell; id 106; surfaces (-127 402); filltype uni; universe 1008; }
    31FP402  { type simpleCell; id 307; surfaces (-402 129); filltype uni; universe 31000; }
    31FP364  { type simpleCell; id 308; surfaces (-129 130); filltype uni; universe 1131; }
    31FP359  { type simpleCell; id 309; surfaces (-130 131); filltype uni; universe 31000; }
    31FP312  { type simpleCell; id 310; surfaces (-131 132); filltype uni; universe 1131; }
    31FP306  { type simpleCell; id 311; surfaces (-132 133); filltype uni; universe 31000; }
    31FP260  { type simpleCell; id 312; surfaces (-133 134); filltype uni; universe 1131; }
    31FP254  { type simpleCell; id 313; surfaces (-134 135); filltype uni; universe 31000; }
    31FP208  { type simpleCell; id 314; surfaces (-135 136); filltype uni; universe 1131; }
    31FP202  { type simpleCell; id 315; surfaces (-136 137); filltype uni; universe 31000; }
    31FP155  { type simpleCell; id 316; surfaces (-137 138); filltype uni; universe 1131; }
    31FP150  { type simpleCell; id 317; surfaces (-138 139); filltype uni; universe 31000; }
    31FP103  { type simpleCell; id 318; surfaces (-139 140); filltype uni; universe 1131; }
    31FP98   { type simpleCell; id 319; surfaces (-140 142); filltype uni; universe 31000; }
    31FP4052 { type simpleCell; id 320; surfaces (-142 145); filltype uni; universe 1131; }
    31FP37   { type simpleCell; id 321; surfaces (-145 146); filltype uni; universe 31000; }
    31FP36   { type simpleCell; id 322; surfaces (-146 147); filltype uni; universe 1006; }
    31FP35   { type simpleCell; id 323; surfaces (-147 148); filltype uni; universe 1004; }
    31FP20   { type simpleCell; id 324; surfaces (-148 149); filltype uni; universe 1001; }
    // --- 2.4% UO2 fuel pin axial layers (top to bottom) ---
    24FP460  { type simpleCell; id 325;  surfaces (-120 121); filltype uni; universe 1001; }
    24FP431  { type simpleCell; id 326;  surfaces (-121 122); filltype uni; universe 1003; }
    24FP423  { type simpleCell; id 327;  surfaces (-122 124); filltype uni; universe 1001; }
    24FP419  { type simpleCell; id 328;  surfaces (-124 125); filltype uni; universe 1006; }
    24FP417  { type simpleCell; id 329;  surfaces (-125 126); filltype uni; universe 1008; }
    24FP415  { type simpleCell; id 330;  surfaces (-126 127); filltype uni; universe 1017; }
    24FP411  { type simpleCell; id 331;  surfaces (-127 402); filltype uni; universe 1008; }
    24FP402  { type simpleCell; id 332;  surfaces (-402 129); filltype uni; universe 24000; }
    24FP364  { type simpleCell; id 333;  surfaces (-129 130); filltype uni; universe 1124; }
    24FP359  { type simpleCell; id 334;  surfaces (-130 131); filltype uni; universe 24000; }
    24FP312  { type simpleCell; id 335;  surfaces (-131 132); filltype uni; universe 1124; }
    24FP306  { type simpleCell; id 336;  surfaces (-132 133); filltype uni; universe 24000; }
    24FP260  { type simpleCell; id 337;  surfaces (-133 134); filltype uni; universe 1124; }
    24FP254  { type simpleCell; id 338;  surfaces (-134 135); filltype uni; universe 24000; }
    24FP208  { type simpleCell; id 3380; surfaces (-135 136); filltype uni; universe 1124; }
    24FP202  { type simpleCell; id 339;  surfaces (-136 137); filltype uni; universe 24000; }
    24FP155  { type simpleCell; id 340;  surfaces (-137 138); filltype uni; universe 1124; }
    24FP150  { type simpleCell; id 341;  surfaces (-138 139); filltype uni; universe 24000; }
    24FP103  { type simpleCell; id 342;  surfaces (-139 140); filltype uni; universe 1124; }
    24FP98   { type simpleCell; id 343;  surfaces (-140 142); filltype uni; universe 24000; }
    24FP4052 { type simpleCell; id 344;  surfaces (-142 145); filltype uni; universe 1124; }
    24FP37   { type simpleCell; id 345;  surfaces (-145 146); filltype uni; universe 24000; }
    24FP36   { type simpleCell; id 346;  surfaces (-146 147); filltype uni; universe 1006; }
    24FP35   { type simpleCell; id 347;  surfaces (-147 148); filltype uni; universe 1004; }
    24FP20   { type simpleCell; id 348;  surfaces (-148 149); filltype uni; universe 1001; }
    // --- 1.6% UO2 fuel pin axial layers (top to bottom) ---
    16FP460  { type simpleCell; id 349; surfaces (-120 121); filltype uni; universe 1001; }
    16FP431  { type simpleCell; id 350; surfaces (-121 122); filltype uni; universe 1003; }
    16FP423  { type simpleCell; id 351; surfaces (-122 124); filltype uni; universe 1001; }
    16FP419  { type simpleCell; id 352; surfaces (-124 125); filltype uni; universe 1006; }
    16FP417  { type simpleCell; id 353; surfaces (-125 126); filltype uni; universe 1008; }
    16FP415  { type simpleCell; id 354; surfaces (-126 127); filltype uni; universe 1017; }
    16FP411  { type simpleCell; id 355; surfaces (-127 402); filltype uni; universe 1008; }
    16FP402  { type simpleCell; id 356; surfaces (-402 129); filltype uni; universe 16000; }
    16FP364  { type simpleCell; id 357; surfaces (-129 130); filltype uni; universe 1116; }
    16FP359  { type simpleCell; id 358; surfaces (-130 131); filltype uni; universe 16000; }
    16FP312  { type simpleCell; id 359; surfaces (-131 132); filltype uni; universe 1116; }
    16FP306  { type simpleCell; id 360; surfaces (-132 133); filltype uni; universe 16000; }
    16FP260  { type simpleCell; id 361; surfaces (-133 134); filltype uni; universe 1116; }
    16FP254  { type simpleCell; id 362; surfaces (-134 135); filltype uni; universe 16000; }
    16FP208  { type simpleCell; id 363; surfaces (-135 136); filltype uni; universe 1116; }
    16FP202  { type simpleCell; id 364; surfaces (-136 137); filltype uni; universe 16000; }
    16FP155  { type simpleCell; id 365; surfaces (-137 138); filltype uni; universe 1116; }
    16FP150  { type simpleCell; id 366; surfaces (-138 139); filltype uni; universe 16000; }
    16FP103  { type simpleCell; id 367; surfaces (-139 140); filltype uni; universe 1116; }
    16FP98   { type simpleCell; id 368; surfaces (-140 142); filltype uni; universe 16000; }
    16FP4052 { type simpleCell; id 369; surfaces (-142 145); filltype uni; universe 1116; }
    16FP37   { type simpleCell; id 370; surfaces (-145 146); filltype uni; universe 16000; }
    16FP36   { type simpleCell; id 371; surfaces (-146 147); filltype uni; universe 1006; }
    16FP35   { type simpleCell; id 372; surfaces (-147 148); filltype uni; universe 1004; }
    16FP20   { type simpleCell; id 373; surfaces (-148 149); filltype uni; universe 1001; }
    // --- Guide tube axial layers (top to bottom) ---
    GT460  { type simpleCell; id 374; surfaces (-120 121); filltype uni; universe 1001; }
    GT431  { type simpleCell; id 375; surfaces (-121 122); filltype uni; universe 1005; }
    GT423  { type simpleCell; id 376; surfaces (-122 126); filltype uni; universe 12000; }
    GT415  { type simpleCell; id 377; surfaces (-126 127); filltype uni; universe 1112; }
    GT411  { type simpleCell; id 378; surfaces (-127 129); filltype uni; universe 12000; }
    GT364  { type simpleCell; id 379; surfaces (-129 130); filltype uni; universe 1112; }
    GT359  { type simpleCell; id 380; surfaces (-130 131); filltype uni; universe 12000; }
    GT312  { type simpleCell; id 381; surfaces (-131 132); filltype uni; universe 1112; }
    GT306  { type simpleCell; id 382; surfaces (-132 133); filltype uni; universe 12000; }
    GT260  { type simpleCell; id 383; surfaces (-133 134); filltype uni; universe 1112; }
    GT254  { type simpleCell; id 384; surfaces (-134 135); filltype uni; universe 12000; }
    GT208  { type simpleCell; id 385; surfaces (-135 136); filltype uni; universe 1112; }
    GT202  { type simpleCell; id 386; surfaces (-136 137); filltype uni; universe 12000; }
    GT155  { type simpleCell; id 387; surfaces (-137 138); filltype uni; universe 1112; }
    GT150  { type simpleCell; id 388; surfaces (-138 139); filltype uni; universe 12000; }
    GT103  { type simpleCell; id 389; surfaces (-139 140); filltype uni; universe 1112; }
    GT98   { type simpleCell; id 390; surfaces (-140 142); filltype uni; universe 1010; }
    GT4052 { type simpleCell; id 391; surfaces (-142 143); filltype uni; universe 12000; }
    GT39   { type simpleCell; id 392; surfaces (-143 145); filltype uni; universe 1019; }
    GT37   { type simpleCell; id 393; surfaces (-145 147); filltype uni; universe 1010; }
    GT35   { type simpleCell; id 394; surfaces (-147 148); filltype uni; universe 1005; }
    GT20   { type simpleCell; id 395; surfaces (-148 149); filltype uni; universe 1001; }
    // --- Instrument tube axial layers (top to bottom) ---
    IT460  { type simpleCell; id 396; surfaces (-120 122); filltype uni; universe 1001; }
    IT423  { type simpleCell; id 397; surfaces (-122 126); filltype uni; universe 14000; }
    IT415  { type simpleCell; id 398; surfaces (-126 127); filltype uni; universe 1114; }
    IT411  { type simpleCell; id 399; surfaces (-127 129); filltype uni; universe 14000; }
    IT364  { type simpleCell; id 406; surfaces (-129 130); filltype uni; universe 1114; }
    IT359  { type simpleCell; id 407; surfaces (-130 131); filltype uni; universe 14000; }
    IT312  { type simpleCell; id 408; surfaces (-131 132); filltype uni; universe 1114; }
    IT306  { type simpleCell; id 409; surfaces (-132 133); filltype uni; universe 14000; }
    IT260  { type simpleCell; id 410; surfaces (-133 134); filltype uni; universe 1114; }
    IT254  { type simpleCell; id 411; surfaces (-134 135); filltype uni; universe 14000; }
    IT208  { type simpleCell; id 412; surfaces (-135 136); filltype uni; universe 1114; }
    IT202  { type simpleCell; id 413; surfaces (-136 137); filltype uni; universe 14000; }
    IT155  { type simpleCell; id 414; surfaces (-137 138); filltype uni; universe 1114; }
    IT150  { type simpleCell; id 415; surfaces (-138 139); filltype uni; universe 14000; }
    IT103  { type simpleCell; id 416; surfaces (-139 140); filltype uni; universe 1114; }
    IT98   { type simpleCell; id 417; surfaces (-140 142); filltype uni; universe 14000; }
    IT40   { type simpleCell; id 418; surfaces (-142 145); filltype uni; universe 1114; }
    IT37   { type simpleCell; id 419; surfaces (-145 147); filltype uni; universe 14000; }
    IT35   { type simpleCell; id 420; surfaces (-147 148); filltype uni; universe 1005; }
    IT20   { type simpleCell; id 421; surfaces (-148);     filltype uni; universe 1011; }
    // --- Burnable absorber axial layers (top to bottom) ---
    BA460  { type simpleCell; id 422; surfaces (-120 121); filltype uni; universe 1001; }
    BA431  { type simpleCell; id 423; surfaces (-121 122); filltype uni; universe 1002; }
    BA423  { type simpleCell; id 424; surfaces (-122 123); filltype uni; universe 1023; }
    BA421  { type simpleCell; id 425; surfaces (-123 126); filltype uni; universe 1012; }
    BA415  { type simpleCell; id 426; surfaces (-126 127); filltype uni; universe 1027; }
    BA411  { type simpleCell; id 427; surfaces (-127 128); filltype uni; universe 1012; }
    BA401  { type simpleCell; id 428; surfaces (-128 129); filltype uni; universe 1000; }
    BA364  { type simpleCell; id 429; surfaces (-129 130); filltype uni; universe 1110; }
    BA359  { type simpleCell; id 430; surfaces (-130 131); filltype uni; universe 1000; }
    BA312  { type simpleCell; id 431; surfaces (-131 132); filltype uni; universe 1110; }
    BA306  { type simpleCell; id 432; surfaces (-132 133); filltype uni; universe 1000; }
    BA260  { type simpleCell; id 433; surfaces (-133 134); filltype uni; universe 1110; }
    BA254  { type simpleCell; id 434; surfaces (-134 135); filltype uni; universe 1000; }
    BA208  { type simpleCell; id 435; surfaces (-135 136); filltype uni; universe 1110; }
    BA202  { type simpleCell; id 436; surfaces (-136 137); filltype uni; universe 1000; }
    BA155  { type simpleCell; id 437; surfaces (-137 138); filltype uni; universe 1110; }
    BA150  { type simpleCell; id 438; surfaces (-138 139); filltype uni; universe 1000; }
    BA103  { type simpleCell; id 439; surfaces (-139 140); filltype uni; universe 1110; }
    BA98   { type simpleCell; id 440; surfaces (-140 141); filltype uni; universe 1000; }
    BA4055 { type simpleCell; id 441; surfaces (-141 142); filltype uni; universe 1023; }
    BA4052 { type simpleCell; id 442; surfaces (-142 143); filltype uni; universe 1021; }
    BA39   { type simpleCell; id 443; surfaces (-143 144); filltype uni; universe 1025; }
    BA38   { type simpleCell; id 444; surfaces (-144 145); filltype uni; universe 1019; }
    BA37   { type simpleCell; id 445; surfaces (-145 147); filltype uni; universe 1010; }
    BA35   { type simpleCell; id 446; surfaces (-147 148); filltype uni; universe 1005; }
    BA20   { type simpleCell; id 447; surfaces (-148 149); filltype uni; universe 1001; }
    // --- Control rod axial layers (top to bottom, rods fully withdrawn) ---
    CR460  { type simpleCell; id 448; surfaces (-120 121);  filltype uni; universe 1002; }
    CR415  { type simpleCell; id 449; surfaces (-126 403);  filltype uni; universe 1013; }
    CR403  { type simpleCell; id 450; surfaces (-403 402);  filltype uni; universe 1015; }
    CR402  { type simpleCell; id 451; surfaces (-402 1430); filltype uni; universe 1013; }
    CR143  { type simpleCell; id 452; surfaces (-1430 41);  filltype uni; universe 1014; }
    CR41   { type simpleCell; id 453; surfaces (-41 143);   filltype uni; universe 1002; }
    CR39   { type simpleCell; id 454; surfaces (-143 147);  filltype uni; universe 1001; }
    CR35   { type simpleCell; id 455; surfaces (-147 148);  filltype uni; universe 1005; }
    CR20   { type simpleCell; id 456; surfaces (-148 149);  filltype uni; universe 1001; }
    // --- Baffle cells (4 sides: left/right/top/bottom) ---
    outsideLeftBaffle   { type simpleCell; id 52; surfaces (-50);    filltype mat; material Water; }
    leftBaffle          { type simpleCell; id 53; surfaces (50 -51); filltype mat; material StainlessSteel304; }
    insideLeftBaffle    { type simpleCell; id 54; surfaces (51);     filltype mat; material Water; }
    outsideRightBaffle  { type simpleCell; id 62; surfaces (-60);    filltype mat; material Water; }
    rightBaffle         { type simpleCell; id 63; surfaces (60 -61); filltype mat; material StainlessSteel304; }
    insideRightBaffle   { type simpleCell; id 64; surfaces (61);     filltype mat; material Water; }
    outsideTopBaffle    { type simpleCell; id 72; surfaces (-70);    filltype mat; material Water; }
    topBaffle           { type simpleCell; id 73; surfaces (70 -71); filltype mat; material StainlessSteel304; }
    insideTopBaffle     { type simpleCell; id 74; surfaces (71);     filltype mat; material Water; }
    outsideBottomBaffle { type simpleCell; id 82; surfaces (-80);    filltype mat; material Water; }
    bottomBaffle        { type simpleCell; id 83; surfaces (80 -81); filltype mat; material StainlessSteel304; }
    insideBottomBaffle  { type simpleCell; id 84; surfaces (81);     filltype mat; material Water; }
    // --- Corner baffle cells (top-left) ---
    topLeftCornerBaffle1 { type simpleCell; id 201; surfaces (60 -61 -81); filltype mat; material StainlessSteel304; }
    topLeftCornerBaffle2 { type simpleCell; id 202; surfaces (80 -81 -60); filltype mat; material StainlessSteel304; }
    topLeftCornerGap1    { type simpleCell; id 203; surfaces (81);         filltype mat; material Water; }
    topLeftCornerGap2    { type simpleCell; id 204; surfaces (61);         filltype mat; material Water; }
    topLeftMajorGap      { type simpleCell; id 205; surfaces (-80 -60);    filltype mat; material Water; }
    // --- Corner baffle cells (top-right) ---
    topRightCornerBaffle1 { type simpleCell; id 301; surfaces (-81 50 -51); filltype mat; material StainlessSteel304; }
    topRightCornerBaffle2 { type simpleCell; id 302; surfaces (-50 80 -81); filltype mat; material StainlessSteel304; }
    topRightCornerGap1    { type simpleCell; id 303; surfaces (81);         filltype mat; material Water; }
    topRightCornerGap2    { type simpleCell; id 304; surfaces (51);         filltype mat; material Water; }
    topRightMajorGap      { type simpleCell; id 305; surfaces (-80 -50);    filltype mat; material Water; }
    // --- Corner baffle cells (bottom-left) ---
    bottomLeftCornerBaffle1 { type simpleCell; id 401; surfaces (-71 60 -61); filltype mat; material StainlessSteel304; }
    bottomLeftCornerBaffle2 { type simpleCell; id 402; surfaces (-71 70 -60); filltype mat; material StainlessSteel304; }
    bottomLeftCornerGap1    { type simpleCell; id 403; surfaces (71);         filltype mat; material Water; }
    bottomLeftCornerGap2    { type simpleCell; id 404; surfaces (61);         filltype mat; material Water; }
    bottomLeftMajorGap      { type simpleCell; id 405; surfaces (-70 -60);    filltype mat; material Water; }
    // --- Corner baffle cells (bottom-right) ---
    bottomRightCornerBaffle1 { type simpleCell; id 501; surfaces (-51 50 -71); filltype mat; material StainlessSteel304; }
    bottomRightCornerBaffle2 { type simpleCell; id 502; surfaces (-71 70 -50); filltype mat; material StainlessSteel304; }
    bottomRightCornerGap1    { type simpleCell; id 503; surfaces (51);         filltype mat; material Water; }
    bottomRightCornerGap2    { type simpleCell; id 504; surfaces (71);         filltype mat; material Water; }
    bottomRightMajorGap      { type simpleCell; id 505; surfaces (-50 -70);    filltype mat; material Water; }
    // --- Square corner cells (top-left) ---
    TLSG1          { type simpleCell; id 601; surfaces (-80 -60); filltype mat; material Water; }
    TLSG2          { type simpleCell; id 602; surfaces (-80 60);  filltype mat; material Water; }
    TLSG3          { type simpleCell; id 603; surfaces (80 -60);  filltype mat; material Water; }
    topLeftSquare  { type simpleCell; id 604; surfaces (80 60);   filltype mat; material StainlessSteel304; }
    // --- Square corner cells (top-right) ---
    TRSG1          { type simpleCell; id 701; surfaces (-80 50);  filltype mat; material Water; }
    TRSG2          { type simpleCell; id 702; surfaces (-80 -50); filltype mat; material Water; }
    TRSG3          { type simpleCell; id 703; surfaces (80 -50);  filltype mat; material Water; }
    topRightSquare { type simpleCell; id 704; surfaces (80 50);   filltype mat; material StainlessSteel304; }
    // --- Square corner cells (bottom-left) ---
    BLSG1            { type simpleCell; id 801; surfaces (70 -60);  filltype mat; material Water; }
    BLSG2            { type simpleCell; id 802; surfaces (-70 60);  filltype mat; material Water; }
    BLSG3            { type simpleCell; id 803; surfaces (-70 -60); filltype mat; material Water; }
    bottomLeftSquare { type simpleCell; id 804; surfaces (70 60);   filltype mat; material StainlessSteel304; }
    // --- Square corner cells (bottom-right) ---
    BRSG1             { type simpleCell; id 901; surfaces (-70 50);  filltype mat; material Water; }
    BRSG2             { type simpleCell; id 902; surfaces (70 -50);  filltype mat; material Water; }
    BRSG3             { type simpleCell; id 903; surfaces (-70 -50); filltype mat; material Water; }
    bottomRightSquare { type simpleCell; id 904; surfaces (70 50);   filltype mat; material StainlessSteel304; }
  }

  // -----------------------------------------------------------------
  // Universes
  // -----------------------------------------------------------------
  universes {
    root { id 1; type rootUniverse; border 1; fill u<8888>; }
    // ===============================================================
    // Pin Universes
    // ===============================================================
    // Fuel pins (pellet / gap / clad / coolant)
    pinFuel16 { id 16000; type pinUniverse;
      radii (0.39218 0.40005 0.45720 0.0);
      fills (UO2-16 Helium Zircaloy Water); }
    pinFuel24 { id 24000; type pinUniverse;
      radii (0.39218 0.40005 0.45720 0.0);
      fills (UO2-24 Helium Zircaloy Water); }
    pinFuel31 { id 31000; type pinUniverse;
      radii (0.39218 0.40005 0.45720 0.0);
      fills (UO2-31 Helium Zircaloy Water); }
    pinFuel32 { id 32000; type pinUniverse;
      radii (0.39218 0.40005 0.45720 0.0);
      fills (UO2-32 Helium Zircaloy Water); }
    pinFuel34 { id 34000; type pinUniverse;
      radii (0.39218 0.40005 0.45720 0.0);
      fills (UO2-34 Helium Zircaloy Water); }
    // Guide tube (inner water / Zircaloy tube / outer water)
    pinGuideTube { id 12000; type pinUniverse;
      radii (0.56134 0.60198 0.0);
      fills (Water Zircaloy Water); }
    // Instrument tube (air / Zr inner tube / water / Zr guide tube / water)
    pinInstrumentTube { id 14000; type pinUniverse;
      radii (0.43688 0.48387 0.56134 0.60198 0.0);
      fills (Air Zircaloy Water Zircaloy Water); }
    // Burnable absorber pin above dashpot (full radial detail)
    pinBPAboveDashpot { id 1000; type pinUniverse;
      radii (0.21400 0.23051 0.24130 0.42672 0.43688 0.48387 0.56134 0.60198 0.0);
      fills (Air SS304 Helium BorosilicateGlass Helium SS304 Water Zircaloy Water); }
    // Structural and water-fill pins
    pinWater          { id 1001; type pinUniverse; radii (0.0); fills (Water); }
    pinSteel          { id 1002; type pinUniverse; radii (0.45720 0.0); fills (StainlessSteel304 Water); }
    pinNozzleSteel    { id 1003; type pinUniverse; radii (0.45720 0.0); fills (StainlessSteel304 Water); }
    pinSupportPlateSS { id 1004; type pinUniverse; radii (0.45720 0.0); fills (SupportPlateSS Water); }
    pinSupportPlateBW { id 1005; type pinUniverse; radii (0.45720 0.0); fills (SupportPlateBW Water); }
    pinZircaloy       { id 1006; type pinUniverse; radii (0.45720 0.0); fills (Zircaloy Water); }
    // Upper fuel rod plenum (spring / gap / clad / water)
    pinUpperFuelPlenum { id 1008; type pinUniverse;
      radii (0.06459 0.40005 0.45720 0.0);
      fills (Inconel Helium Zircaloy Water); }
    // Empty guide tube variants
    pinEmptyGTaboveDashpot { id 1009; type pinUniverse;
      radii (0.56134 0.60198 0.0);
      fills (Water Zircaloy Water); }
    pinEmptyGTatDashpot { id 1010; type pinUniverse;
      radii (0.50419 0.54610 0.0);
      fills (Water Zircaloy Water); }
    // Bare instrument thimble (below lower support plate)
    pinBareInstrumentThimble { id 1011; type pinUniverse;
      radii (0.43688 0.48387 0.0);
      fills (Air Zircaloy Water); }
    // BA plenum geometry (complex multi-layer)
    pinBPPlenumGeometry { id 1012; type pinUniverse;
      radii (0.21400 0.23051 0.43688 0.48387 0.50419 0.54610 0.0);
      fills (Air SS304 Helium SS304 Water Zircaloy Water); }
    // SS-filled guide tube and dashpot
    SSinGuideTube { id 1023; type pinUniverse;
      radii (0.56134 0.60198 0.0);
      fills (StainlessSteel304 Zircaloy Water); }
    SSinDashPot { id 1024; type pinUniverse;
      radii (0.50419 0.54610 0.0);
      fills (StainlessSteel304 Zircaloy Water); }
    // Control rod pins
    pinControlRodUpper { id 1013; type pinUniverse;
      radii (0.37338 0.38608 0.48387 0.56134 0.60198 0.0);
      fills (B4C Helium SS304 Water Zircaloy Water); }
    pinControlRodLower { id 1014; type pinUniverse;
      radii (0.38227 0.38608 0.48387 0.56134 0.60198 0.0);
      fills (Ag-In-Cd Helium SS304 Water Zircaloy Water); }
    pinControlRodSpacer { id 1015; type pinUniverse;
      radii (0.37845 0.38608 0.48387 0.56134 0.60198 0.0);
      fills (SS304 Helium SS304 Water Zircaloy Water); }
    pinControlRodPlenum { id 1016; type pinUniverse;
      radii (0.06459 0.38608 0.48387 0.56134 0.60198 0.0);
      fills (Inconel Helium SS304 Water Zircaloy Water); }
    // ===============================================================
    // Grid Overlay Cell Universes (pin + Inconel grid spacer)
    // ===============================================================
    // Thick grid overlays
    fuelRodPlenumWithGridThick { id 1017; type cellUniverse; cells (232 55); }
    fuelRodPlenumWithGridThin  { id 1018; type cellUniverse; cells (233 56); }
    dashPotGuideTubeGridThick  { id 1019; type cellUniverse; cells (230 55); }
    dashPotGuideTubeGridThin   { id 1020; type cellUniverse; cells (240 56); }
    SSinGuideTubeThick         { id 1021; type cellUniverse; cells (234 55); }
    SSinGuideTubeThin          { id 1022; type cellUniverse; cells (235 56); }
    SSinDashPotThick           { id 1025; type cellUniverse; cells (236 55); }
    SSinDashPotThin            { id 1026; type cellUniverse; cells (237 56); }
    pinBPPlenumGeometryThick   { id 1027; type cellUniverse; cells (238 55); }
    pinBPPlenumGeometryThin    { id 1028; type cellUniverse; cells (239 56); }
    // ===============================================================
    // Pin-with-Grid Cell Universes (at grid spacer elevations)
    // ===============================================================
    // Thick grid spacer (0.0198 cm Inconel sleeve)
    GridPinBA31Thick { id 1110; type cellUniverse; cells (110 55); }
    GridPinGTThick   { id 1112; type cellUniverse; cells (112 55); }
    GridPinITThick   { id 1114; type cellUniverse; cells (114 55); }
    GridPin16Thick   { id 1116; type cellUniverse; cells (1166 55); }
    GridPin24Thick   { id 1124; type cellUniverse; cells (1240 55); }
    GridPin31Thick   { id 1131; type cellUniverse; cells (1310 55); }
    // Thin grid spacer (0.0194 cm Inconel sleeve)
    GridPinBA31Thin { id 9110; type cellUniverse; cells (2100 56); }
    GridPinGTThin   { id 9112; type cellUniverse; cells (2120 56); }
    GridPinITThin   { id 9114; type cellUniverse; cells (2140 56); }
    GridPin16Thin   { id 9216; type cellUniverse; cells (2160 56); }
    GridPin24Thin   { id 9224; type cellUniverse; cells (2240 56); }
    GridPin31Thin   { id 9231; type cellUniverse; cells (2310 56); }
    // ===============================================================
    // Axial Stack Cell Universes (full-height pin definitions)
    // ===============================================================
    fuelPin31 { id 31; type cellUniverse;
      cells (100 101 102 103 104 105 106 307 308 309 310 311 312
             313 314 315 316 317 318 319 320 321 322 323 324); }
    fuelPin24 { id 24; type cellUniverse;
      cells (325 326 327 328 329 330 331 332 333 334 335 336 337
             338 3380 339 340 341 342 343 344 345 346 347 348); }
    fuelPin16 { id 16; type cellUniverse;
      cells (349 350 351 352 353 354 355 356 357 358 359 360 361
             362 363 364 365 366 367 368 369 370 371 372 373); }
    guideTube { id 12; type cellUniverse;
      cells (374 375 376 377 378 379 380 381 382 383 384 385
             386 387 388 389 390 391 392 393 394 395); }
    instrumentTube { id 14; type cellUniverse;
      cells (396 397 398 399 406 407 408 409 410 411 412 413
             414 415 416 417 418 419 420 421); }
    burnableAbsorber { id 10; type cellUniverse;
      cells (422 423 424 425 426 427 428 429 430 431 432 433 434
             435 436 437 438 439 440 441 442 443 444 445 446 447); }
    controlRod { id 555555; type cellUniverse;
      cells (448 449 450 451 452 453 454 455 456); }
    // ===============================================================
    // Assembly Lattice Definitions (17x17, pitch = 1.26 cm)
    // ===============================================================
    // Guide tube positions: standard Westinghouse 17x17 pattern
    // id=12 guide tube, id=14 instrument tube (center), id=10 BA

    // 14 guide tubes, 2.4% enrichment, no BAs
    A14E24 { id 1424; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 12 24 24 12 24 24 12 24 24 24 24 24
        24 24 24 12 24 24 24 24 24 24 24 24 24 12 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 12 24 24 12 24 24 12 24 24 12 24 24 12 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 12 24 24 12 24 24 14 24 24 12 24 24 12 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 12 24 24 12 24 24 12 24 24 12 24 24 12 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 12 24 24 24 24 24 24 24 24 24 12 24 24 24
        24 24 24 24 24 12 24 24 12 24 24 12 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 ); }
    // 14 guide tubes, 1.6% enrichment, no BAs
    A14E16 { id 1416; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 16 16 16 12 16 16 12 16 16 12 16 16 16 16 16
        16 16 16 12 16 16 16 16 16 16 16 16 16 12 16 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 12 16 16 12 16 16 12 16 16 12 16 16 12 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 12 16 16 12 16 16 14 16 16 12 16 16 12 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 12 16 16 12 16 16 12 16 16 12 16 16 12 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 16 12 16 16 16 16 16 16 16 16 16 12 16 16 16
        16 16 16 16 16 12 16 16 12 16 16 12 16 16 16 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16
        16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 ); }
    // 14 guide tubes, 3.1% enrichment, no BAs
    A14E31 { id 1431; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 12 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 14 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 12 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 6 BAs on top half (bottom-facing when placed at core bottom)
    A60E31B { id 60316; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 10 31 31 12 31 31 10 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 12 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 14 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 12 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 6 BAs on bottom half (top-facing when placed at core top)
    A60E31T { id 603112; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 12 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 14 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 12 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 10 31 31 12 31 31 10 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 6 BAs on left half (right-facing when placed at core right)
    A60E31R { id 60313; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 10 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 12 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 14 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 12 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 10 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 6 BAs on right half (left-facing when placed at core left)
    A60E31L { id 60319; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 10 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 12 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 14 31 31 12 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 12 31 31 12 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 10 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 15 BAs, bottom-right quadrant clear of BAs
    A15E31BR { id 15315; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 10 31 31 10 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 14 31 31 10 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 10 31 31 10 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 15 BAs, bottom-left quadrant clear of BAs
    A15E31BL { id 15317; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 10 31 31 10 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 10 31 31 14 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 10 31 31 10 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 15 BAs, top-right quadrant clear of BAs
    A15E31TR { id 15311; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 10 31 31 10 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 14 31 31 10 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 10 31 31 10 31 31 12 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 15 BAs, top-left quadrant clear of BAs
    A15E31TL { id 153111; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 12 31 31 12 31 31 12 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 12 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 10 31 31 10 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 10 31 31 14 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 12 31 31 10 31 31 10 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 12 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 16 BAs (all corner GT positions), 3.1% enrichment
    A16E31 { id 1631; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 12 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 14 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 12 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 20 BAs (corners + middle ring), 3.1% enrichment
    A20E31 { id 2031; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 12 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 12 31 31 14 31 31 12 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 10 31 31 10 31 31 12 31 31 10 31 31 10 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 10 31 31 31 31 31 31 31 31 31 10 31 31 31
        31 31 31 31 31 10 31 31 10 31 31 10 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31
        31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 ); }

    // 12 BAs, 2.4% enrichment
    A12E24 { id 1224; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 10 24 24 12 24 24 10 24 24 24 24 24
        24 24 24 10 24 24 24 24 24 24 24 24 24 10 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 10 24 24 12 24 24 12 24 24 12 24 24 10 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 12 24 24 12 24 24 14 24 24 12 24 24 12 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 10 24 24 12 24 24 12 24 24 12 24 24 10 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 10 24 24 24 24 24 24 24 24 24 10 24 24 24
        24 24 24 24 24 10 24 24 12 24 24 10 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 ); }

    // 16 BAs, 2.4% enrichment
    A16E24 { id 1624; type latUniverse; origin (0.0 0.0 0.0);
      pitch (1.26 1.26 0.0); shape (17 17 0); padMat Water; map (
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 10 24 24 10 24 24 10 24 24 24 24 24
        24 24 24 10 24 24 24 24 24 24 24 24 24 10 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 10 24 24 12 24 24 12 24 24 12 24 24 10 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 10 24 24 12 24 24 14 24 24 12 24 24 10 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 10 24 24 12 24 24 12 24 24 12 24 24 10 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 10 24 24 24 24 24 24 24 24 24 10 24 24 24
        24 24 24 24 24 10 24 24 10 24 24 10 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
        24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 ); }

    // ===============================================================
    // Core Lattice (17x17 assemblies, pitch = 21.50364 cm)
    // ===============================================================
    latCore { id 9999; type latUniverse; origin (0.0 0.0 0.0);
      pitch (21.50364 21.50364 0.0); shape (17 17 0); padMat Water; map (
        1001   1001   1001   1001   1800   2224   2224   2224   2224   2224   2224   2224   1700   1001   1001   1001   1001
        1001   1001   1800   2224   2229   1431   603112 1431   603112 1431   603112 1431   2228   2224   1700   1001   1001
        1001   1800   2229   1431   1431   1631   1416   2031   1416   2031   1416   1631   1431   1431   2228   1700   1001
        1001   2222   1431   153111 1624   1416   1624   1416   1624   1416   1624   1416   1624   15311  1431   2223   1001
        1800   2229   1431   1624   1424   1624   1416   1224   1416   1224   1416   1624   1424   1624   1431   2228   1700
        2222   1431   1631   1416   1624   1416   1224   1416   1224   1416   1224   1416   1624   1416   1631   1431   2223
        2222   60319  1416   1624   1416   1224   1416   1224   1416   1224   1416   1224   1416   1624   1416   60313  2223
        2222   1431   2031   1416   1224   1416   1224   1416   1224   1416   1224   1416   1224   1416   2031   1431   2223
        2222   60319  1416   1624   1416   1224   1416   1224   1416   1224   1416   1224   1416   1624   1416   60313  2223
        2222   1431   2031   1416   1224   1416   1224   1416   1224   1416   1224   1416   1224   1416   2031   1431   2223
        2222   60319  1416   1624   1416   1224   1416   1224   1416   1224   1416   1224   1416   1624   1416   60313  2223
        2222   1431   1631   1416   1624   1416   1224   1416   1224   1416   1224   1416   1624   1416   1631   1431   2223
        1600   2227   1431   1624   1424   1624   1416   1224   1416   1224   1416   1624   1424   1624   1431   2226   1500
        1001   2222   1431   15317  1624   1416   1624   1416   1624   1416   1624   1416   1624   15315  1431   2223   1001
        1001   1600   2227   1431   1431   1631   1416   2031   1416   2031   1416   1631   1431   1431   2226   1500   1001
        1001   1001   1600   2225   2227   1431   60316  1431   60316  1431   60316  1431   2226   2225   1500   1001   1001
        1001   1001   1001   1001   1600   2225   2225   2225   2225   2225   2225   2225   1500   1001   1001   1001   1001 ); }

    // ===============================================================
    // Baffle and Structural Universes
    // ===============================================================

    // Side baffles
    leftBaffleUni   { id 2222; type cellUniverse; cells (52 53 54); }
    rightBaffleUni  { id 2223; type cellUniverse; cells (62 63 64); }
    topBaffleUni    { id 2224; type cellUniverse; cells (72 73 74); }
    bottomBaffleUni { id 2225; type cellUniverse; cells (84 83 82); }

    // Corner baffles (L-shaped intersections)
    topLeft     { id 2226; type cellUniverse; cells (201 202 203 204 205); }
    topRight    { id 2227; type cellUniverse; cells (301 302 303 304 305); }
    bottomLeft  { id 2228; type cellUniverse; cells (401 402 403 404 405); }
    bottomRight { id 2229; type cellUniverse; cells (501 502 503 504 505); }

    // Square corner baffles (outermost corners of baffle structure)
    SQTL { id 1500; type cellUniverse; cells (601 602 603 604); }
    SQTR { id 1600; type cellUniverse; cells (701 702 703 704); }
    SQBL { id 1700; type cellUniverse; cells (801 802 803 804); }
    SQBR { id 1800; type cellUniverse; cells (901 902 903 904); }

    // ===============================================================
    // Core + Structural Shell (RPV, barrel, shields)
    // ===============================================================
    coreAndStructures { id 8888; type cellUniverse;
      cells (7 8 9 10 11 12 13 14 15 16 17); }
  }
}

// ===================================================================
// VISUALIZATION
// ===================================================================
viz {
  bmpZ {
    type bmp;
    output imgZ;
    what material;
    centre (0.0 0.0 422.5);
    width (500.0 500.0);
    axis z;
    res (5000 5000);
  }
  // Second view: axis y (matches verified input keyword "bmp")
  bmp {
    type bmp;
    output imgY;
    what material;
    centre (0.0 0.0 0.0);
    width (800.0 1200.0);
    axis y;
    res (5000 5000);
  }
}

// ===================================================================
// NUCLEAR DATA
// ===================================================================
nuclearData {
  handles {
    // Author verified run used: /home/vr339/SCONE/myACE/JEF311.aceXS
    // Replace with your local JEF-3.1.1 (or equivalent) ACE library path:
    ce { type aceNeutronDatabase; aceLibrary /path/to/JEF311.aceXS; }
  }

  materials {

    Air {
      temp 600;
      composition {
        18036.06 7.8730E-09;
        18038.06 1.4844E-09;
        18040.06 2.3506E-06;
        6012.06  6.7539E-08;
        7014.06  1.9680E-04;
        7015.06  7.2354E-07;
        8016.06  5.2866E-05;
        8017.06  2.0084E-08; }
    }
    SS304 {
      temp 600;
      composition {
        24050.06 7.6778E-04;
        24052.06 1.4806E-02;
        24053.06 1.6789E-03;
        24054.06 4.1791E-04;
        26054.06 3.4620E-03;
        26056.06 5.4345E-02;
        26057.06 1.2551E-03;
        26058.06 1.6703E-04;
        25055.06 1.7604E-03;
        28058.06 5.6089E-03;
        28060.06 2.1605E-03;
        28061.06 9.3917E-05;
        28062.06 2.9945E-04;
        28064.06 7.6261E-05;
        14028.06 9.5281E-04;
        14029.06 4.8381E-05;
        14030.06 3.1893E-05; }
    }
    Helium {
      temp 600;
      composition {
        2003.06 4.8089E-10;
        2004.06 2.4044E-04; }
    }
    BorosilicateGlass {
      temp 600;
      composition {
        13027.06 1.7352E-03;
        5010.06  9.6506E-04;
        5011.06  3.9189E-03;
        8016.06  4.6514E-02;
        8017.06  1.7671E-05;
        14028.06 1.6926E-02;
        14029.06 8.5944E-04;
        14030.06 5.6654E-04; }
    }
    Water {
      temp 600;
      composition {
        5010.06 7.9714E-06;
        5011.06 3.2247E-05;
        // H-1 with S(a,b) thermal scattering (uncomment with valid data file):
        // moder {1001.06 4.9456E-02; file h-h2o.53; }
        1002.06 7.7035E-06;
        8016.06 2.4673E-02;
        8017.06 9.3734E-06; }
    }
    Zircaloy {
      temp 600;
      composition {
        24050.06 3.2962E-06;
        24052.06 6.3564E-05;
        24053.06 7.2076E-06;
        24054.06 1.7941E-06;
        26054.06 8.6698E-06;
        26056.06 1.3610E-04;
        26057.06 3.1431E-06;
        26058.06 4.1829E-07;
        8016.06  3.0744E-04;
        8017.06  1.1680E-07;
        50112.06 4.6735E-06;
        50114.06 3.1799E-06;
        50115.06 1.6381E-06;
        50116.06 7.0055E-05;
        50117.06 3.7003E-05;
        50118.06 1.1669E-04;
        50119.06 4.1387E-05;
        50120.06 1.5697E-04;
        50122.06 2.2308E-05;
        50124.06 2.7897E-05;
        40090.06 2.1828E-02;
        40091.06 4.7601E-03;
        40092.06 7.2759E-03;
        40094.06 7.3734E-03;
        40096.06 1.1879E-03; }
    }
    Inconel {
      temp 600;
      composition {
        24050.06 7.8239E-04;
        24052.06 1.5088E-02;
        24053.06 1.7108E-03;
        24054.06 4.2586E-04;
        26054.06 1.4797E-03;
        26056.06 2.3229E-02;
        26057.06 5.3645E-04;
        26058.06 7.1392E-05;
        25055.06 7.8201E-04;
        28058.06 2.9320E-02;
        28060.06 1.1294E-02;
        28061.06 4.9094E-04;
        28062.06 1.5653E-03;
        28064.06 3.9864E-04;
        14028.06 5.6757E-04;
        14029.06 2.8820E-05;
        14030.06 1.8998E-05; }
    }
    B4C {
      temp 600;
      composition {
        5010.06 1.5206E-02;
        5011.06 6.1514E-02;
        6012.06 1.8972E-02; }
    }
    Ag-In-Cd {
      temp 600;
      composition {
        47107.06 2.3523E-02;
        47109.06 2.1854E-02;
        48106.06 3.3882E-05;
        48108.06 2.4166E-05;
        48110.06 3.3936E-04;
        48111.06 3.4821E-04;
        48112.06 6.5611E-04;
        48113.06 3.3275E-04;
        48114.06 7.8252E-04;
        48116.06 2.0443E-04;
        49113.06 3.4219E-04;
        49115.06 7.6511E-03; }
    }
    UO2-16 {
      temp 600;
      composition {
        8016.06  4.5897E-02;
        8017.06  1.7436E-05;
        92234.06 3.0131E-06;
        92235.06 3.7503E-04;
        92238.06 2.2625E-02; }
    }
    UO2-24 {
      temp 600;
      composition {
        8016.06  4.5830E-02;
        8017.06  1.7411E-05;
        92234.06 4.4842E-06;
        92235.06 5.5814E-04;
        92238.06 2.2407E-02; }
    }
    UO2-31 {
      temp 600;
      composition {
        8016.06  4.5853E-02;
        8017.06  1.7420E-05;
        92234.06 5.7987E-06;
        92235.06 7.2175E-04;
        92238.06 2.2253E-02; }
    }
    UO2-32 {
      temp 600;
      composition {
        8016.06  4.6029E-02;
        8017.06  1.7487E-05;
        92234.06 5.9959E-06;
        92235.06 7.4630E-04;
        92238.06 2.2317E-02; }
    }
    UO2-34 {
      temp 600;
      composition {
        8016.06  4.6110E-02;
        8017.06  1.7517E-05;
        92234.06 6.4018E-06;
        92235.06 7.9681E-04;
        92238.06 2.2307E-02; }
    }
    CarbonSteel {
      temp 600;
      composition {
        13027.06 4.3523E-05;
        5010.06  2.5833E-06;
        5011.06  1.0450E-05;
        6012.06  1.0442E-03;
        20040.06 1.7043E-05;
        20042.06 1.1375E-07;
        20043.06 2.3734E-08;
        20044.06 3.6673E-07;
        20046.06 7.0322E-10;
        20048.06 3.2875E-08;
        24050.06 1.3738E-05;
        24052.06 2.6493E-04;
        24053.06 3.0041E-05;
        24054.06 7.4778E-06;
        29063.06 1.0223E-04;
        29065.06 4.5608E-05;
        26054.06 4.7437E-03;
        26056.06 7.4465E-02;
        26057.06 1.7197E-03;
        26058.06 2.2886E-04;
        25055.06 6.4126E-04;
        42100.06 2.9814E-05;
        42092.06 4.4822E-05;
        42094.06 2.8110E-05;
        42095.06 4.8567E-05;
        42096.06 5.1015E-05;
        42097.06 2.9319E-05;
        42098.06 7.4327E-05;
        41093.06 5.0559E-06;
        28058.06 4.0862E-04;
        28060.06 1.5740E-04;
        28061.06 6.8420E-06;
        28062.06 2.1815E-05;
        28064.06 5.5557E-06;
        15031.06 3.7913E-05;
        16032.06 3.4808E-05;
        16033.06 2.7420E-07;
        16034.06 1.5368E-06;
        16036.06 5.3398E-09;
        14028.06 6.1702E-04;
        14029.06 3.1330E-05;
        14030.06 2.0653E-05;
        22046.06 1.2144E-06;
        22047.06 1.0952E-06;
        22048.06 1.0851E-05;
        22049.06 7.9634E-07;
        22050.06 7.6249E-07;
        23051.06 4.5989E-05; }
    }
    SupportPlateSS {
      temp 600;
      composition {
        24050.06 3.5223E-04;
        24052.06 6.7924E-03;
        24053.06 7.7020E-04;
        24054.06 1.9172E-04;
        26054.06 1.5882E-03;
        26056.06 2.4931E-02;
        26057.06 5.7578E-04;
        26058.06 7.6625E-05;
        25055.06 8.0762E-04;
        28058.06 2.5731E-03;
        28060.06 9.9117E-04;
        28061.06 4.3085E-05;
        28062.06 1.3738E-04;
        28064.06 3.4985E-05;
        14028.06 4.3711E-04;
        14029.06 2.2195E-05;
        14030.06 1.4631E-05; }
    }
    StainlessSteel304 {
      temp 600;
      composition {
        24050.06 7.6778E-04;
        24052.06 1.4806E-02;
        24053.06 1.6789E-03;
        24054.06 4.1791E-04;
        26054.06 3.4620E-03;
        26056.06 5.4345E-02;
        26057.06 1.2551E-03;
        26058.06 1.6703E-04;
        25055.06 1.7604E-03;
        28058.06 5.6089E-03;
        28060.06 2.1605E-03;
        28061.06 9.3917E-05;
        28062.06 2.9945E-04;
        28064.06 7.6261E-05;
        14028.06 9.5281E-04;
        14029.06 4.8381E-05;
        14030.06 3.1893E-05; }
    }
    SupportPlateBW {
      temp 600;
      composition {
        5010.06 1.0559E-05;
        5011.06 4.2716E-05;
        1001.06 6.5512E-02;
        1002.06 1.0204E-05;
        8016.06 3.2683E-02;
        8017.06 1.2416E-05;
        //8018.06 6.5535E-05;
      }
    }

    // Optional Zircaloy alias (C5G7-style table in verified deck; not referenced by fills)
    clad {
      temp 600;
      composition {
        40090.06 2.21235E-02;
        40091.06 4.82460E-03;
        40092.06 7.37450E-03;
        40094.06 7.47340E-03;
        40096.06 1.20400E-03;
      }
    }

    alClad {
      temp 600;
      composition {
        13027.06 6.00E-2;
      }
    }

  }
}
mcnp
PWRSpec-derived translation (not converged)

BEAVRS Cycle 1 — Full-Core PWR (MCNP)

An MCNP translation of the verified SCONE BEAVRS full core: a nested core lattice (21.50364 cm assembly pitch) of 17×17 assembly lattices (1.26 cm pin pitch) on the real 193-assembly loading map (1.6/2.4/3.1 wt% UO2), with 24 guide tubes + central instrument tube per assembly, Pyrex burnable-poison rods, control rods withdrawn, and the core barrel/RPV shells. Material number densities are the verified deck’s values; ZAID `.80c` (ENDF/B-VII.1) assumed for availability though the verified data was JEF-3.1.1 at 600 K (cross-library k-eff bias expected). Spec-derived example translation — NOT benchmark-validated. Now AXIALLY COMPLETE — a full ~25-layer axial build per pin (active fuel z 36.748–402.508 cm, continuous UO2 segmented by 8 Inconel grid spacers; plenum/spring, SS top nozzle, support plates, guide-tube dashpot, Pyrex BA + plenum stacks, end plugs) ported layer-for-layer from the verified SCONE deck. Now also RADIALLY COMPLETE — per-assembly Pyrex BA clusters (real 6/12/15/16/20-rod patterns), the stepped SS304 baffle/former, the four octant neutron-shield pads, downcomer water and the RPV rings are all ported from the verified SCONE core; no radial simplifications remain. Converge with your own ACE data before drawing physics conclusions.

serpent
PWRSpec-derived translation (not converged)

BEAVRS Cycle 1 — Full-Core PWR (Serpent)

A Serpent 2 translation of the verified SCONE BEAVRS full core: `pin`/`lat` universes on the real 193-assembly loading map (1.6/2.4/3.1 wt% UO2) with 24 guide tubes + central instrument tube, Pyrex burnable-poison rods, control rods withdrawn, and core barrel/RPV. Energies in MeV; run `sss2 -omp N`. Material number densities are the verified deck’s values; ZAID `.06c` (600 K) assumed — set `set acelib` to match. Spec-derived example translation — NOT benchmark-validated. Now AXIALLY COMPLETE — a full ~25-layer axial build per pin (active fuel z 36.748–402.508 cm, continuous UO2 segmented by 8 Inconel grid spacers; plenum/spring, SS top nozzle, support plates, guide-tube dashpot, Pyrex BA + plenum stacks, end plugs) ported layer-for-layer from the verified SCONE deck. Now also RADIALLY COMPLETE — per-assembly Pyrex BA clusters (real 6/12/15/16/20-rod patterns), the stepped SS304 baffle/former, the four octant neutron-shield pads, downcomer water and the RPV rings are all ported from the verified SCONE core; no radial simplifications remain. Supply your own cross sections and converge before drawing physics conclusions.

openmc
PWRRun-verified (not benchmark-validated)

BEAVRS Cycle 1 — Full-Core PWR (OpenMC)

An OpenMC (Python) build script translating the verified SCONE BEAVRS full core: 17×17 `RectLattice` assemblies on the real 193-assembly loading map (1.6/2.4/3.1 wt% UO2) with 24 guide tubes + central instrument tube, Pyrex burnable-poison rods, control rods withdrawn, and core barrel/RPV. Uses `openmc.IndependentSource`, `Material.set_density` with atom densities, temperature (600 K) on cells, and `c_H_in_H2O` S(α,β) on water only; run `model.run(threads=N)` then `openmc.StatePoint(path)`. RUN-VERIFIED here in OpenMC 0.15.3 with full ENDF/B-VIII.0 nuclide coverage: the geometry passes OpenMC’s overlap check (no overlaps, no lost particles) and the deck runs end-to-end to k-eff = 0.99737 ± 0.00030 (40 inactive + 100 active cycles, 100k particles/cycle) — physically sensible for the deck as written (BEAVRS Cycle-1 HZP, ~977 ppm soluble boron, all rods out → expected k ≈ 1.0). Caveat: the H-in-H2O thermal kernel ran at 294 K (only temperature available locally) while the neutron data was at exactly 600 K. This is still a spec-derived translation — NOT benchmark-validated against measured BEAVRS data. Material number densities are the verified deck’s values; whatever `OPENMC_CROSS_SECTIONS` points at is used (cross-library k-eff bias expected). Now AXIALLY COMPLETE — a full ~25-layer axial build per pin (active fuel z 36.748–402.508 cm, continuous UO2 segmented by 8 Inconel grid spacers; plenum/spring, SS top nozzle, support plates, guide-tube dashpot, Pyrex BA + plenum stacks, end plugs) ported layer-for-layer from the verified SCONE deck. Now also RADIALLY COMPLETE — per-assembly Pyrex BA clusters (real 6/12/15/16/20-rod patterns), the stepped SS304 baffle/former, the four octant neutron-shield pads, downcomer water and the RPV rings are all ported from the verified SCONE core; no radial simplifications remain.

beavrs-openmc-fullcore.py· 903 lines · 39,848 chars
#!/usr/bin/env python3
"""BEAVRS Cycle 1 full-core PWR - OpenMC translation (community example deck).

PROVENANCE
----------
Geometry + materials translated from the author-VERIFIED Cambridge SCONE
BEAVRS full-core deck (reactor-test-decks/beavrs_scone_fullcore.scone) and the
public MIT BEAVRS rev 2.0.2 specification (Horelik, Herman, Forget, Smith;
CRPG/MIT, 2018). This is a COMMUNITY EXAMPLE DECK - it is NOT benchmark-
validated and is not an official MIT/CRPG product.

WHAT THIS BUILDS
----------------
- 17x17 core lattice (assembly pitch 21.50364 cm), 193 fuel assemblies on the
  verified BEAVRS loading map (3 enrichment zones).
- 17x17 assemblies (pin pitch 1.26 cm; fuel 0.39218 / gap 0.40005 /
  clad 0.45720 cm) with 24 guide tubes + 1 central instrument tube.
- Enrichment zones 1.6 / 2.4 / 3.1 wt% UO2; per-assembly Pyrex burnable-
  poison clusters (real 6/12/15/16/20-rod patterns from the verified SCONE
  core); control rods WITHDRAWN (water-filled guide tubes); SS304
  baffle/former plates, core barrel, 4 octant neutron-shield pads,
  downcomer, RPV liner / RPV; vacuum boundary.
- FULL AXIAL MODEL (this is the completed axial build; the older single-zone
  caveat is gone). Each pin type is an axial STACK of cells along z, ported
  layer-for-layer from the verified SCONE deck (z 0 -> 460 cm):
    * active fuel z 36.748 -> 402.508 cm (height 365.76), continuous UO2
      pellet, segmented by 7 Inconel grid spacers + 1 plenum-region spacer;
    * bottom: water (0->20), lower core/support plate (20->35), Zircaloy
      bottom end plug (35->36.748);
    * top: upper fuel-rod plenum w/ Inconel spring (402.508->417.164,
      with a grid spacer band), Zircaloy top end plug (417.164->419.704),
      water (419.704->423.049), SS304 top nozzle (423.049->431.876),
      water (431.876->460);
    * guide tubes: dashpot (narrowed thimble) below z~98, normal thimble
      above, Borated-water support plate, all 8 spacer bands;
    * instrument tube: bare thimble below support plate, full thimble above;
    * Pyrex BA rods: SS/dashpot transition + plenum geometry above the
      poison column (Pyrex active z 40.558 -> 401.238), all spacer bands.
  Inconel grid spacers are modeled as the verified deck's square Inconel
  sleeve in the coolant channel (half-widths 0.61015 -> 0.62992 cm) at the
  8 BEAVRS spacer elevations.

ASSUMPTIONS / SIMPLIFICATIONS (FLAGGED)
---------------------------------------
* Cross sections: requires OPENMC_CROSS_SECTIONS. Number densities are
  identical to the verified SCONE deck (which used JEF-3.1.1 at 600 K);
  pick a 600 K-capable library or rely on windowed multipole / on-the-fly
  Doppler. Expect a cross-library k-eff bias vs the SCONE/JEFF result.
* AXIAL and RADIAL models are both complete: per-assembly Pyrex BA clusters,
  the stepped SS304 baffle/former, core barrel, the four octant neutron-
  shield pads, downcomer and RPV are all ported from the verified SCONE
  core. No radial simplifications remain.
* Temperature (600 K) is set on CELLS (per OpenMC convention) and as the
  Settings default; S(a,b) c_H_in_H2O is on WATER ONLY (incl. borated-water
  support plate), never on UO2/structure.
* Run with:  model.run(threads=N)  then  openmc.StatePoint(<path>).
"""
import openmc
import openmc.model

# ===================== MATERIALS (atoms/b-cm) =====================
fuel16 = openmc.Material(name="UO2-16")
fuel16.set_density("atom/b-cm", 6.89175e-2)
fuel16.add_nuclide("O16", 4.58970e-2, "ao")
fuel16.add_nuclide("O17", 1.74360e-5, "ao")
fuel16.add_nuclide("U234", 3.01310e-6, "ao")
fuel16.add_nuclide("U235", 3.75030e-4, "ao")
fuel16.add_nuclide("U238", 2.26250e-2, "ao")

fuel24 = openmc.Material(name="UO2-24")
fuel24.set_density("atom/b-cm", 6.88170e-2)
fuel24.add_nuclide("O16", 4.58300e-2, "ao")
fuel24.add_nuclide("O17", 1.74110e-5, "ao")
fuel24.add_nuclide("U234", 4.48420e-6, "ao")
fuel24.add_nuclide("U235", 5.58140e-4, "ao")
fuel24.add_nuclide("U238", 2.24070e-2, "ao")

fuel31 = openmc.Material(name="UO2-31")
fuel31.set_density("atom/b-cm", 6.88510e-2)
fuel31.add_nuclide("O16", 4.58530e-2, "ao")
fuel31.add_nuclide("O17", 1.74200e-5, "ao")
fuel31.add_nuclide("U234", 5.79870e-6, "ao")
fuel31.add_nuclide("U235", 7.21750e-4, "ao")
fuel31.add_nuclide("U238", 2.22530e-2, "ao")

helium = openmc.Material(name="Helium")
helium.set_density("atom/b-cm", 2.40440e-4)
helium.add_nuclide("He3", 4.80890e-10, "ao")
helium.add_nuclide("He4", 2.40440e-4, "ao")

zirc = openmc.Material(name="Zircaloy")
zirc.set_density("atom/b-cm", 4.34389e-2)
zirc.add_nuclide("Cr50", 3.29620e-6, "ao")
zirc.add_nuclide("Cr52", 6.35640e-5, "ao")
zirc.add_nuclide("Cr53", 7.20760e-6, "ao")
zirc.add_nuclide("Cr54", 1.79410e-6, "ao")
zirc.add_nuclide("Fe54", 8.66980e-6, "ao")
zirc.add_nuclide("Fe56", 1.36100e-4, "ao")
zirc.add_nuclide("Fe57", 3.14310e-6, "ao")
zirc.add_nuclide("Fe58", 4.18290e-7, "ao")
zirc.add_nuclide("O16", 3.07440e-4, "ao")
zirc.add_nuclide("O17", 1.16800e-7, "ao")
zirc.add_nuclide("Sn112", 4.67350e-6, "ao")
zirc.add_nuclide("Sn114", 3.17990e-6, "ao")
zirc.add_nuclide("Sn115", 1.63810e-6, "ao")
zirc.add_nuclide("Sn116", 7.00550e-5, "ao")
zirc.add_nuclide("Sn117", 3.70030e-5, "ao")
zirc.add_nuclide("Sn118", 1.16690e-4, "ao")
zirc.add_nuclide("Sn119", 4.13870e-5, "ao")
zirc.add_nuclide("Sn120", 1.56970e-4, "ao")
zirc.add_nuclide("Sn122", 2.23080e-5, "ao")
zirc.add_nuclide("Sn124", 2.78970e-5, "ao")
zirc.add_nuclide("Zr90", 2.18280e-2, "ao")
zirc.add_nuclide("Zr91", 4.76010e-3, "ao")
zirc.add_nuclide("Zr92", 7.27590e-3, "ao")
zirc.add_nuclide("Zr94", 7.37340e-3, "ao")
zirc.add_nuclide("Zr96", 1.18790e-3, "ao")

water = openmc.Material(name="Water")
water.set_density("atom/b-cm", 7.41863e-2)
water.add_nuclide("H1", 4.94560e-2, "ao")
water.add_nuclide("B10", 7.97140e-6, "ao")
water.add_nuclide("B11", 3.22470e-5, "ao")
water.add_nuclide("H2", 7.70350e-6, "ao")
water.add_nuclide("O16", 2.46730e-2, "ao")
water.add_nuclide("O17", 9.37340e-6, "ao")
water.add_s_alpha_beta("c_H_in_H2O")

pyrex = openmc.Material(name="BorosilicateGlass")
pyrex.set_density("atom/b-cm", 7.15028e-2)
pyrex.add_nuclide("Al27", 1.73520e-3, "ao")
pyrex.add_nuclide("B10", 9.65060e-4, "ao")
pyrex.add_nuclide("B11", 3.91890e-3, "ao")
pyrex.add_nuclide("O16", 4.65140e-2, "ao")
pyrex.add_nuclide("O17", 1.76710e-5, "ao")
pyrex.add_nuclide("Si28", 1.69260e-2, "ao")
pyrex.add_nuclide("Si29", 8.59440e-4, "ao")
pyrex.add_nuclide("Si30", 5.66540e-4, "ao")

ss304 = openmc.Material(name="StainlessSteel304")
ss304.set_density("atom/b-cm", 8.79322e-2)
ss304.add_nuclide("Cr50", 7.67780e-4, "ao")
ss304.add_nuclide("Cr52", 1.48060e-2, "ao")
ss304.add_nuclide("Cr53", 1.67890e-3, "ao")
ss304.add_nuclide("Cr54", 4.17910e-4, "ao")
ss304.add_nuclide("Fe54", 3.46200e-3, "ao")
ss304.add_nuclide("Fe56", 5.43450e-2, "ao")
ss304.add_nuclide("Fe57", 1.25510e-3, "ao")
ss304.add_nuclide("Fe58", 1.67030e-4, "ao")
ss304.add_nuclide("Mn55", 1.76040e-3, "ao")
ss304.add_nuclide("Ni58", 5.60890e-3, "ao")
ss304.add_nuclide("Ni60", 2.16050e-3, "ao")
ss304.add_nuclide("Ni61", 9.39170e-5, "ao")
ss304.add_nuclide("Ni62", 2.99450e-4, "ao")
ss304.add_nuclide("Ni64", 7.62610e-5, "ao")
ss304.add_nuclide("Si28", 9.52810e-4, "ao")
ss304.add_nuclide("Si29", 4.83810e-5, "ao")
ss304.add_nuclide("Si30", 3.18930e-5, "ao")

# Inconel-718 grid spacers and fuel-rod / control-rod springs.
inconel = openmc.Material(name="Inconel")
inconel.set_density("atom/b-cm", 8.77899e-2)
inconel.add_nuclide("Cr50", 7.82390e-4, "ao")
inconel.add_nuclide("Cr52", 1.50880e-2, "ao")
inconel.add_nuclide("Cr53", 1.71080e-3, "ao")
inconel.add_nuclide("Cr54", 4.25860e-4, "ao")
inconel.add_nuclide("Fe54", 1.47970e-3, "ao")
inconel.add_nuclide("Fe56", 2.32290e-2, "ao")
inconel.add_nuclide("Fe57", 5.36450e-4, "ao")
inconel.add_nuclide("Fe58", 7.13920e-5, "ao")
inconel.add_nuclide("Mn55", 7.82010e-4, "ao")
inconel.add_nuclide("Ni58", 2.93200e-2, "ao")
inconel.add_nuclide("Ni60", 1.12940e-2, "ao")
inconel.add_nuclide("Ni61", 4.90940e-4, "ao")
inconel.add_nuclide("Ni62", 1.56530e-3, "ao")
inconel.add_nuclide("Ni64", 3.98640e-4, "ao")
inconel.add_nuclide("Si28", 5.67570e-4, "ao")
inconel.add_nuclide("Si29", 2.88200e-5, "ao")
inconel.add_nuclide("Si30", 1.89980e-5, "ao")

# Lower-density SS for the lower core / support plate region.
support_ss = openmc.Material(name="SupportPlateSS")
support_ss.set_density("atom/b-cm", 4.03396e-2)
support_ss.add_nuclide("Cr50", 3.52230e-4, "ao")
support_ss.add_nuclide("Cr52", 6.79240e-3, "ao")
support_ss.add_nuclide("Cr53", 7.70200e-4, "ao")
support_ss.add_nuclide("Cr54", 1.91720e-4, "ao")
support_ss.add_nuclide("Fe54", 1.58820e-3, "ao")
support_ss.add_nuclide("Fe56", 2.49310e-2, "ao")
support_ss.add_nuclide("Fe57", 5.75780e-4, "ao")
support_ss.add_nuclide("Fe58", 7.66250e-5, "ao")
support_ss.add_nuclide("Mn55", 8.07620e-4, "ao")
support_ss.add_nuclide("Ni58", 2.57310e-3, "ao")
support_ss.add_nuclide("Ni60", 9.91170e-4, "ao")
support_ss.add_nuclide("Ni61", 4.30850e-5, "ao")
support_ss.add_nuclide("Ni62", 1.37380e-4, "ao")
support_ss.add_nuclide("Ni64", 3.49850e-5, "ao")
support_ss.add_nuclide("Si28", 4.37110e-4, "ao")
support_ss.add_nuclide("Si29", 2.21950e-5, "ao")
support_ss.add_nuclide("Si30", 1.46310e-5, "ao")

# Borated water of the lower support plate (guide-tube/instrument positions).
support_bw = openmc.Material(name="SupportPlateBW")
support_bw.set_density("atom/b-cm", 9.82709e-2)
support_bw.add_nuclide("B10", 1.05590e-5, "ao")
support_bw.add_nuclide("B11", 4.27160e-5, "ao")
support_bw.add_nuclide("H1", 6.55120e-2, "ao")
support_bw.add_nuclide("H2", 1.02040e-5, "ao")
support_bw.add_nuclide("O16", 3.26830e-2, "ao")
support_bw.add_nuclide("O17", 1.24160e-5, "ao")
support_bw.add_s_alpha_beta("c_H_in_H2O")

carbonsteel = openmc.Material(name="CarbonSteel")
carbonsteel.set_density("atom/b-cm", 8.50964e-2)
carbonsteel.add_nuclide("Al27", 4.35230e-5, "ao")
carbonsteel.add_nuclide("B10", 2.58330e-6, "ao")
carbonsteel.add_nuclide("B11", 1.04500e-5, "ao")
carbonsteel.add_nuclide("C12", 1.04420e-3, "ao")
carbonsteel.add_nuclide("Ca40", 1.70430e-5, "ao")
carbonsteel.add_nuclide("Ca42", 1.13750e-7, "ao")
carbonsteel.add_nuclide("Ca43", 2.37340e-8, "ao")
carbonsteel.add_nuclide("Ca44", 3.66730e-7, "ao")
carbonsteel.add_nuclide("Ca46", 7.03220e-10, "ao")
carbonsteel.add_nuclide("Ca48", 3.28750e-8, "ao")
carbonsteel.add_nuclide("Cr50", 1.37380e-5, "ao")
carbonsteel.add_nuclide("Cr52", 2.64930e-4, "ao")
carbonsteel.add_nuclide("Cr53", 3.00410e-5, "ao")
carbonsteel.add_nuclide("Cr54", 7.47780e-6, "ao")
carbonsteel.add_nuclide("Cu63", 1.02230e-4, "ao")
carbonsteel.add_nuclide("Cu65", 4.56080e-5, "ao")
carbonsteel.add_nuclide("Fe54", 4.74370e-3, "ao")
carbonsteel.add_nuclide("Fe56", 7.44650e-2, "ao")
carbonsteel.add_nuclide("Fe57", 1.71970e-3, "ao")
carbonsteel.add_nuclide("Fe58", 2.28860e-4, "ao")
carbonsteel.add_nuclide("Mn55", 6.41260e-4, "ao")
carbonsteel.add_nuclide("Mo100", 2.98140e-5, "ao")
carbonsteel.add_nuclide("Mo92", 4.48220e-5, "ao")
carbonsteel.add_nuclide("Mo94", 2.81100e-5, "ao")
carbonsteel.add_nuclide("Mo95", 4.85670e-5, "ao")
carbonsteel.add_nuclide("Mo96", 5.10150e-5, "ao")
carbonsteel.add_nuclide("Mo97", 2.93190e-5, "ao")
carbonsteel.add_nuclide("Mo98", 7.43270e-5, "ao")
carbonsteel.add_nuclide("Nb93", 5.05590e-6, "ao")
carbonsteel.add_nuclide("Ni58", 4.08620e-4, "ao")
carbonsteel.add_nuclide("Ni60", 1.57400e-4, "ao")
carbonsteel.add_nuclide("Ni61", 6.84200e-6, "ao")
carbonsteel.add_nuclide("Ni62", 2.18150e-5, "ao")
carbonsteel.add_nuclide("Ni64", 5.55570e-6, "ao")
carbonsteel.add_nuclide("P31", 3.79130e-5, "ao")
carbonsteel.add_nuclide("S32", 3.48080e-5, "ao")
carbonsteel.add_nuclide("S33", 2.74200e-7, "ao")
carbonsteel.add_nuclide("S34", 1.53680e-6, "ao")
carbonsteel.add_nuclide("S36", 5.33980e-9, "ao")
carbonsteel.add_nuclide("Si28", 6.17020e-4, "ao")
carbonsteel.add_nuclide("Si29", 3.13300e-5, "ao")
carbonsteel.add_nuclide("Si30", 2.06530e-5, "ao")
carbonsteel.add_nuclide("Ti46", 1.21440e-6, "ao")
carbonsteel.add_nuclide("Ti47", 1.09520e-6, "ao")
carbonsteel.add_nuclide("Ti48", 1.08510e-5, "ao")
carbonsteel.add_nuclide("Ti49", 7.96340e-7, "ao")
carbonsteel.add_nuclide("Ti50", 7.62490e-7, "ao")
carbonsteel.add_nuclide("V51", 4.59890e-5, "ao")

air = openmc.Material(name="Air")
air.set_density("atom/b-cm", 2.52837e-4)
air.add_nuclide("Ar36", 7.87300e-9, "ao")
air.add_nuclide("Ar38", 1.48440e-9, "ao")
air.add_nuclide("Ar40", 2.35060e-6, "ao")
air.add_nuclide("C12", 6.75390e-8, "ao")
air.add_nuclide("N14", 1.96800e-4, "ao")
air.add_nuclide("N15", 7.23540e-7, "ao")
air.add_nuclide("O16", 5.28660e-5, "ao")
air.add_nuclide("O17", 2.00840e-8, "ao")

materials = openmc.Materials([
    fuel16, fuel24, fuel31, helium, zirc, water, pyrex, ss304,
    inconel, support_ss, support_bw, carbonsteel, air
])

TEMP = 600.0

# ===================== GRID-SPACER SQUARE SLEEVE =====================
# Verified SCONE thick grid: square Inconel sleeve, half-widths 0.61015 ->
# 0.62992 cm in the coolant channel (pin pitch 1.26 => half-pitch 0.63).
GRID_IN = 2 * 0.61015   # full width of inner square
GRID_OUT = 2 * 0.62992  # full width of outer square
_grid_inner = -openmc.model.RectangularPrism(GRID_IN, GRID_IN)
_grid_outer = -openmc.model.RectangularPrism(GRID_OUT, GRID_OUT)


def make_pin(name, shells, grid=False):
    """Build a radial pin universe.

    shells: list of (material, r_outer); the FINAL entry has r_outer=None and
    is the infinite outer fill (always Water in this deck). When grid=True the
    outer fill is split by the Inconel grid sleeve (square annulus in coolant).
    """
    cells = []
    inner_surf = None
    outer_fill = None
    for mat, r in shells:
        if r is None:
            outer_fill = mat
            break
        s = openmc.ZCylinder(r=r)
        reg = (-s) if inner_surf is None else (+inner_surf & -s)
        c = openmc.Cell(fill=mat, region=reg)
        c.temperature = TEMP
        cells.append(c)
        inner_surf = s
    base = +inner_surf if inner_surf is not None else None
    if not grid:
        c = openmc.Cell(fill=outer_fill, region=base)
        c.temperature = TEMP
        cells.append(c)
    else:
        water_in = openmc.Cell(fill=outer_fill,
                               region=(base & _grid_inner) if base is not None else _grid_inner)
        sleeve = openmc.Cell(fill=inconel, region=_grid_outer & ~_grid_inner)
        water_out = openmc.Cell(fill=outer_fill, region=~_grid_outer)
        for c in (water_in, sleeve, water_out):
            c.temperature = TEMP
        cells += [water_in, sleeve, water_out]
    return openmc.Universe(name=name, cells=cells)


# Radial pin layer specifications (material, r_outer); final = infinite outer.
_SHELLS = {
    "f16": [(fuel16, 0.39218), (helium, 0.40005), (zirc, 0.45720), (water, None)],
    "f24": [(fuel24, 0.39218), (helium, 0.40005), (zirc, 0.45720), (water, None)],
    "f31": [(fuel31, 0.39218), (helium, 0.40005), (zirc, 0.45720), (water, None)],
    "gt":  [(water, 0.56134), (zirc, 0.60198), (water, None)],
    "gtd": [(water, 0.50419), (zirc, 0.54610), (water, None)],
    "it":  [(air, 0.43688), (zirc, 0.48387), (water, 0.56134), (zirc, 0.60198), (water, None)],
    "itb": [(air, 0.43688), (zirc, 0.48387), (water, None)],
    "ba":  [(air, 0.21400), (ss304, 0.23051), (helium, 0.24130), (pyrex, 0.42672),
            (helium, 0.43688), (ss304, 0.48387), (water, 0.56134), (zirc, 0.60198), (water, None)],
    "bap": [(air, 0.21400), (ss304, 0.23051), (helium, 0.43688), (ss304, 0.48387),
            (water, 0.50419), (zirc, 0.54610), (water, None)],
    "ssgt": [(ss304, 0.56134), (zirc, 0.60198), (water, None)],
    "ssdp": [(ss304, 0.50419), (zirc, 0.54610), (water, None)],
    "w":   [(water, None)],
    "ss":  [(ss304, 0.45720), (water, None)],
    "sps": [(support_ss, 0.45720), (water, None)],
    "spb": [(support_bw, 0.45720), (water, None)],
    "zr":  [(zirc, 0.45720), (water, None)],
    "plen": [(inconel, 0.06459), (helium, 0.40005), (zirc, 0.45720), (water, None)],
}
# Grid-overlay variants get the Inconel square sleeve in the coolant.
_GRID_VARIANTS = ["f16", "f24", "f31", "gt", "it", "ba", "bap", "plen", "gtd", "ssgt", "ssdp"]

R = {}
for key, shells in _SHELLS.items():
    R[key] = make_pin(f"pin_{key}", shells, grid=False)
for key in _GRID_VARIANTS:
    R[key + "g"] = make_pin(f"pin_{key}g", _SHELLS[key], grid=True)

# ===================== AXIAL Z-PLANES (cm, ported from SCONE) =====================
Z_BOT, Z_TOP = 0.0, 460.0
_zvals = sorted({
    0.0, 20.0, 35.0, 36.748, 37.1621, 38.66, 39.958, 40.52, 40.558, 98.025,
    103.74, 150.222, 155.937, 202.419, 208.134, 254.616, 260.331, 306.813,
    312.528, 359.01, 364.725, 401.238, 402.508, 411.806, 415.164, 417.164,
    419.704, 421.532, 423.049, 431.876, 460.0,
})
ZP = {}
for z in _zvals:
    bt = "vacuum" if z in (Z_BOT, Z_TOP) else "transmission"
    ZP[z] = openmc.ZPlane(z0=z, boundary_type=bt)

# ===================== AXIAL STACKS (z_bottom, z_top, radial key) =========
# Active fuel z 36.748 -> 402.508; grid spacers at the 7 fuel-region bands
# plus the plenum band (411.806 -> 415.164).
def _fuel_stack(e):
    return [
        (0.0, 20.0, "w"), (20.0, 35.0, "sps"), (35.0, 36.748, "zr"),
        (36.748, 37.1621, e), (37.1621, 40.52, e + "g"), (40.52, 98.025, e),
        (98.025, 103.74, e + "g"), (103.74, 150.222, e), (150.222, 155.937, e + "g"),
        (155.937, 202.419, e), (202.419, 208.134, e + "g"), (208.134, 254.616, e),
        (254.616, 260.331, e + "g"), (260.331, 306.813, e), (306.813, 312.528, e + "g"),
        (312.528, 359.01, e), (359.01, 364.725, e + "g"), (364.725, 402.508, e),
        (402.508, 411.806, "plen"), (411.806, 415.164, "pleng"), (415.164, 417.164, "plen"),
        (417.164, 419.704, "zr"), (419.704, 423.049, "w"), (423.049, 431.876, "ss"),
        (431.876, 460.0, "w"),
    ]

STACKS = {
    "f16": _fuel_stack("f16"),
    "f24": _fuel_stack("f24"),
    "f31": _fuel_stack("f31"),
    "gt": [
        (0.0, 20.0, "w"), (20.0, 35.0, "spb"), (35.0, 37.1621, "gtd"),
        (37.1621, 39.958, "gtdg"), (39.958, 40.52, "gt"), (40.52, 98.025, "gtd"),
        (98.025, 103.74, "gtg"), (103.74, 150.222, "gt"), (150.222, 155.937, "gtg"),
        (155.937, 202.419, "gt"), (202.419, 208.134, "gtg"), (208.134, 254.616, "gt"),
        (254.616, 260.331, "gtg"), (260.331, 306.813, "gt"), (306.813, 312.528, "gtg"),
        (312.528, 359.01, "gt"), (359.01, 364.725, "gtg"), (364.725, 411.806, "gt"),
        (411.806, 415.164, "gtg"), (415.164, 423.049, "gt"), (423.049, 431.876, "spb"),
        (431.876, 460.0, "w"),
    ],
    "it": [
        (0.0, 20.0, "itb"), (20.0, 35.0, "spb"), (35.0, 37.1621, "it"),
        (37.1621, 40.52, "itg"), (40.52, 98.025, "it"), (98.025, 103.74, "itg"),
        (103.74, 150.222, "it"), (150.222, 155.937, "itg"), (155.937, 202.419, "it"),
        (202.419, 208.134, "itg"), (208.134, 254.616, "it"), (254.616, 260.331, "itg"),
        (260.331, 306.813, "it"), (306.813, 312.528, "itg"), (312.528, 359.01, "it"),
        (359.01, 364.725, "itg"), (364.725, 411.806, "it"), (411.806, 415.164, "itg"),
        (415.164, 423.049, "it"), (423.049, 460.0, "w"),
    ],
    "ba": [
        (0.0, 20.0, "w"), (20.0, 35.0, "spb"), (35.0, 37.1621, "gtd"),
        (37.1621, 38.66, "gtdg"), (38.66, 39.958, "ssdpg"), (39.958, 40.52, "ssgtg"),
        (40.52, 40.558, "ssgt"), (40.558, 98.025, "ba"), (98.025, 103.74, "bag"),
        (103.74, 150.222, "ba"), (150.222, 155.937, "bag"), (155.937, 202.419, "ba"),
        (202.419, 208.134, "bag"), (208.134, 254.616, "ba"), (254.616, 260.331, "bag"),
        (260.331, 306.813, "ba"), (306.813, 312.528, "bag"), (312.528, 359.01, "ba"),
        (359.01, 364.725, "bag"), (364.725, 401.238, "ba"), (401.238, 411.806, "bap"),
        (411.806, 415.164, "bapg"), (415.164, 421.532, "bap"), (421.532, 423.049, "ssgt"),
        (423.049, 431.876, "ss"), (431.876, 460.0, "w"),
    ],
}


def column(name, table):
    cells = []
    for zb, zt, key in table:
        c = openmc.Cell(name=f"{name}_{zb:g}", fill=R[key],
                        region=+ZP[zb] & -ZP[zt])
        cells.append(c)
    return openmc.Universe(name=name, cells=cells)


COL = {k: column(f"col_{k}", t) for k, t in STACKS.items()}
# Full-height water column for reflector / lattice-outer positions.
u_water = openmc.Universe(name="water_col", cells=[openmc.Cell(fill=water, region=+ZP[Z_BOT] & -ZP[Z_TOP])])

# ===================== ASSEMBLY LATTICES =====================
# Each lattice element is a full-height AXIAL COLUMN universe.
# Per-assembly Pyrex BA (burnable-absorber) templates ported verbatim from the
# verified SCONE core: 6/12/15/16/20-rod Pyrex clusters in their real in-assembly
# positions. '.'=fuel  'G'=guide tube  'I'=instrument tube  'B'=Pyrex BA rod.
ASM_TEMPLATES = {
    "A16": [
        ".................",
        ".................",
        ".....G..G..G.....",
        "...G.........G...",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        "...G.........G...",
        ".....G..G..G.....",
        ".................",
        ".................",
    ],
    "A24": [
        ".................",
        ".................",
        ".....G..G..G.....",
        "...G.........G...",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        "...G.........G...",
        ".....G..G..G.....",
        ".................",
        ".................",
    ],
    "A31": [
        ".................",
        ".................",
        ".....G..G..G.....",
        "...G.........G...",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        "...G.........G...",
        ".....G..G..G.....",
        ".................",
        ".................",
    ],
    "A24_BA12": [
        ".................",
        ".................",
        ".....B..G..B.....",
        "...B.........B...",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        "...B.........B...",
        ".....B..G..B.....",
        ".................",
        ".................",
    ],
    "A24_BA16": [
        ".................",
        ".................",
        ".....B..B..B.....",
        "...B.........B...",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        ".................",
        "..B..G..I..G..B..",
        ".................",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        "...B.........B...",
        ".....B..B..B.....",
        ".................",
        ".................",
    ],
    "A31_BA16": [
        ".................",
        ".................",
        ".....B..B..B.....",
        "...B.........B...",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        ".................",
        "..B..G..I..G..B..",
        ".................",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        "...B.........B...",
        ".....B..B..B.....",
        ".................",
        ".................",
    ],
    "A31_BA20": [
        ".................",
        ".................",
        ".....B..B..B.....",
        "...B.........B...",
        ".................",
        "..B..B..G..B..B..",
        ".................",
        ".................",
        "..B..G..I..G..B..",
        ".................",
        ".................",
        "..B..B..G..B..B..",
        ".................",
        "...B.........B...",
        ".....B..B..B.....",
        ".................",
        ".................",
    ],
    "A31_BA6T": [
        ".................",
        ".................",
        ".....B..G..B.....",
        "...B.........B...",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        "...G.........G...",
        ".....G..G..G.....",
        ".................",
        ".................",
    ],
    "A31_BA6B": [
        ".................",
        ".................",
        ".....G..G..G.....",
        "...G.........G...",
        ".................",
        "..G..G..G..G..G..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..B..G..G..G..B..",
        ".................",
        "...B.........B...",
        ".....B..G..B.....",
        ".................",
        ".................",
    ],
    "A31_BA6L": [
        ".................",
        ".................",
        ".....B..G..G.....",
        "...B.........G...",
        ".................",
        "..B..G..G..G..G..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..B..G..G..G..G..",
        ".................",
        "...B.........G...",
        ".....B..G..G.....",
        ".................",
        ".................",
    ],
    "A31_BA6R": [
        ".................",
        ".................",
        ".....G..G..B.....",
        "...G.........B...",
        ".................",
        "..G..G..G..G..B..",
        ".................",
        ".................",
        "..G..G..I..G..G..",
        ".................",
        ".................",
        "..G..G..G..G..B..",
        ".................",
        "...G.........B...",
        ".....G..G..B.....",
        ".................",
        ".................",
    ],
    "A31_BA15BR": [
        ".................",
        ".................",
        ".....B..B..B.....",
        "...B.........G...",
        ".................",
        "..B..B..B..B..G..",
        ".................",
        ".................",
        "..B..B..I..B..G..",
        ".................",
        ".................",
        "..B..B..B..B..G..",
        ".................",
        "...G.........G...",
        ".....G..G..G.....",
        ".................",
        ".................",
    ],
    "A31_BA15BL": [
        ".................",
        ".................",
        ".....B..B..B.....",
        "...G.........B...",
        ".................",
        "..G..B..B..B..B..",
        ".................",
        ".................",
        "..G..B..I..B..B..",
        ".................",
        ".................",
        "..G..B..B..B..B..",
        ".................",
        "...G.........G...",
        ".....G..G..G.....",
        ".................",
        ".................",
    ],
    "A31_BA15TR": [
        ".................",
        ".................",
        ".....G..G..G.....",
        "...G.........G...",
        ".................",
        "..B..B..B..B..G..",
        ".................",
        ".................",
        "..B..B..I..B..G..",
        ".................",
        ".................",
        "..B..B..B..B..G..",
        ".................",
        "...B.........G...",
        ".....B..B..B.....",
        ".................",
        ".................",
    ],
    "A31_BA15TL": [
        ".................",
        ".................",
        ".....G..G..G.....",
        "...G.........G...",
        ".................",
        "..G..B..B..B..B..",
        ".................",
        ".................",
        "..G..B..I..B..B..",
        ".................",
        ".................",
        "..G..B..B..B..B..",
        ".................",
        "...G.........B...",
        ".....B..B..B.....",
        ".................",
        ".................",
    ],
}


def _assembly(name, fuel_key, template):
    F = COL[fuel_key]
    pick = {"G": COL["gt"], "B": COL["ba"], "I": COL["it"]}
    lat = openmc.RectLattice(name=name)
    lat.lower_left = (-10.71, -10.71)
    lat.pitch = (1.26, 1.26)
    lat.outer = u_water
    lat.universes = [[pick.get(ch, F) for ch in row] for row in template]
    return openmc.Universe(name=name + "_u", cells=[openmc.Cell(fill=lat)])


# ===================== BAFFLE / FORMER UNIVERSES =====================
# SS304 plate bands (local |x|,|y| in [8.36662, 10.58912] cm) ported from the
# verified SCONE core; placed in the peripheral core-lattice positions.
_bxp = openmc.XPlane(8.36662);   _bxm = openmc.XPlane(-8.36662)
_bxP = openmc.XPlane(10.58912);  _bxM = openmc.XPlane(-10.58912)
_byp = openmc.YPlane(8.36662);   _bym = openmc.YPlane(-8.36662)
_byP = openmc.YPlane(10.58912);  _byM = openmc.YPlane(-10.58912)


def _baffle(name, ss_region):
    ss = openmc.Cell(fill=ss304, region=ss_region)
    wat = openmc.Cell(fill=water, region=~ss_region)
    ss.temperature = TEMP
    wat.temperature = TEMP
    return openmc.Universe(name=name, cells=[ss, wat])


BAF = {
    "baf_l": _baffle("baf_l", +_bxp & -_bxP),
    "baf_r": _baffle("baf_r", +_bxM & -_bxm),
    "baf_t": _baffle("baf_t", +_byM & -_bym),
    "baf_b": _baffle("baf_b", +_byp & -_byP),
    "baf_tl": _baffle("baf_tl", (+_bxM & -_bxm & -_byP) | (+_byp & -_byP & +_bxm)),
    "baf_tr": _baffle("baf_tr", (+_bxp & -_bxP & -_byP) | (+_byp & -_byP & -_bxp)),
    "baf_bl": _baffle("baf_bl", (+_bxM & -_bxm & +_byM) | (+_byM & -_bym & +_bxm)),
    "baf_br": _baffle("baf_br", (+_bxp & -_bxP & +_byM) | (+_byM & -_bym & -_bxp)),
    "sq_tl": _baffle("sq_tl", -_bxm & +_byp),
    "sq_tr": _baffle("sq_tr", +_bxp & +_byp),
    "sq_bl": _baffle("sq_bl", -_bxm & -_bym),
    "sq_br": _baffle("sq_br", +_bxp & -_bym),
}

asm_a16_u = _assembly("asm_a16", "f16", ASM_TEMPLATES["A16"])
asm_a24_u = _assembly("asm_a24", "f24", ASM_TEMPLATES["A24"])
asm_a31_u = _assembly("asm_a31", "f31", ASM_TEMPLATES["A31"])
asm_a24ba12_u = _assembly("asm_a24ba12", "f24", ASM_TEMPLATES["A24_BA12"])
asm_a24ba16_u = _assembly("asm_a24ba16", "f24", ASM_TEMPLATES["A24_BA16"])
asm_a31ba16_u = _assembly("asm_a31ba16", "f31", ASM_TEMPLATES["A31_BA16"])
asm_a31ba20_u = _assembly("asm_a31ba20", "f31", ASM_TEMPLATES["A31_BA20"])
asm_a31ba6t_u = _assembly("asm_a31ba6t", "f31", ASM_TEMPLATES["A31_BA6T"])
asm_a31ba6b_u = _assembly("asm_a31ba6b", "f31", ASM_TEMPLATES["A31_BA6B"])
asm_a31ba6l_u = _assembly("asm_a31ba6l", "f31", ASM_TEMPLATES["A31_BA6L"])
asm_a31ba6r_u = _assembly("asm_a31ba6r", "f31", ASM_TEMPLATES["A31_BA6R"])
asm_a31b15br_u = _assembly("asm_a31b15br", "f31", ASM_TEMPLATES["A31_BA15BR"])
asm_a31b15bl_u = _assembly("asm_a31b15bl", "f31", ASM_TEMPLATES["A31_BA15BL"])
asm_a31b15tr_u = _assembly("asm_a31b15tr", "f31", ASM_TEMPLATES["A31_BA15TR"])
asm_a31b15tl_u = _assembly("asm_a31b15tl", "f31", ASM_TEMPLATES["A31_BA15TL"])

# core lattice rows (top-first, matching SCONE)
ASM_U = {
    "A16": asm_a16_u,
    "A24": asm_a24_u,
    "A31": asm_a31_u,
    "A24_BA12": asm_a24ba12_u,
    "A24_BA16": asm_a24ba16_u,
    "A31_BA16": asm_a31ba16_u,
    "A31_BA20": asm_a31ba20_u,
    "A31_BA6T": asm_a31ba6t_u,
    "A31_BA6B": asm_a31ba6b_u,
    "A31_BA6L": asm_a31ba6l_u,
    "A31_BA6R": asm_a31ba6r_u,
    "A31_BA15BR": asm_a31b15br_u,
    "A31_BA15BL": asm_a31b15bl_u,
    "A31_BA15TR": asm_a31b15tr_u,
    "A31_BA15TL": asm_a31b15tl_u,
}

# ===================== CORE LATTICE =====================
core_lat = openmc.RectLattice(name="core")
core_lat.lower_left = (-182.78094, -182.78094)
core_lat.pitch = (21.50364, 21.50364)
core_lat.outer = u_water
W = u_water
core_lat.universes = [
    [W, W, W, W, BAF["sq_br"], BAF["baf_t"], BAF["baf_t"], BAF["baf_t"], BAF["baf_t"], BAF["baf_t"], BAF["baf_t"], BAF["baf_t"], BAF["sq_bl"], W, W, W, W],
    [W, W, BAF["sq_br"], BAF["baf_t"], BAF["baf_br"], ASM_U["A31"], ASM_U["A31_BA6B"], ASM_U["A31"], ASM_U["A31_BA6B"], ASM_U["A31"], ASM_U["A31_BA6B"], ASM_U["A31"], BAF["baf_bl"], BAF["baf_t"], BAF["sq_bl"], W, W],
    [W, BAF["sq_br"], BAF["baf_br"], ASM_U["A31"], ASM_U["A31"], ASM_U["A31_BA16"], ASM_U["A16"], ASM_U["A31_BA20"], ASM_U["A16"], ASM_U["A31_BA20"], ASM_U["A16"], ASM_U["A31_BA16"], ASM_U["A31"], ASM_U["A31"], BAF["baf_bl"], BAF["sq_bl"], W],
    [W, BAF["baf_l"], ASM_U["A31"], ASM_U["A31_BA15TL"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A31_BA15TR"], ASM_U["A31"], BAF["baf_r"], W],
    [BAF["sq_br"], BAF["baf_br"], ASM_U["A31"], ASM_U["A24_BA16"], ASM_U["A24"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A24"], ASM_U["A24_BA16"], ASM_U["A31"], BAF["baf_bl"], BAF["sq_bl"]],
    [BAF["baf_l"], ASM_U["A31"], ASM_U["A31_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A31_BA16"], ASM_U["A31"], BAF["baf_r"]],
    [BAF["baf_l"], ASM_U["A31_BA6R"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A31_BA6L"], BAF["baf_r"]],
    [BAF["baf_l"], ASM_U["A31"], ASM_U["A31_BA20"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A31_BA20"], ASM_U["A31"], BAF["baf_r"]],
    [BAF["baf_l"], ASM_U["A31_BA6R"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A31_BA6L"], BAF["baf_r"]],
    [BAF["baf_l"], ASM_U["A31"], ASM_U["A31_BA20"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A31_BA20"], ASM_U["A31"], BAF["baf_r"]],
    [BAF["baf_l"], ASM_U["A31_BA6R"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A31_BA6L"], BAF["baf_r"]],
    [BAF["baf_l"], ASM_U["A31"], ASM_U["A31_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A31_BA16"], ASM_U["A31"], BAF["baf_r"]],
    [BAF["sq_tr"], BAF["baf_tr"], ASM_U["A31"], ASM_U["A24_BA16"], ASM_U["A24"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA12"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A24"], ASM_U["A24_BA16"], ASM_U["A31"], BAF["baf_tl"], BAF["sq_tl"]],
    [W, BAF["baf_l"], ASM_U["A31"], ASM_U["A31_BA15BL"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A16"], ASM_U["A24_BA16"], ASM_U["A31_BA15BR"], ASM_U["A31"], BAF["baf_r"], W],
    [W, BAF["sq_tr"], BAF["baf_tr"], ASM_U["A31"], ASM_U["A31"], ASM_U["A31_BA16"], ASM_U["A16"], ASM_U["A31_BA20"], ASM_U["A16"], ASM_U["A31_BA20"], ASM_U["A16"], ASM_U["A31_BA16"], ASM_U["A31"], ASM_U["A31"], BAF["baf_tl"], BAF["sq_tl"], W],
    [W, W, BAF["sq_tr"], BAF["baf_b"], BAF["baf_tr"], ASM_U["A31"], ASM_U["A31_BA6T"], ASM_U["A31"], ASM_U["A31_BA6T"], ASM_U["A31"], ASM_U["A31_BA6T"], ASM_U["A31"], BAF["baf_tl"], BAF["baf_b"], BAF["sq_tl"], W, W],
    [W, W, W, W, BAF["sq_tr"], BAF["baf_b"], BAF["baf_b"], BAF["baf_b"], BAF["baf_b"], BAF["baf_b"], BAF["baf_b"], BAF["baf_b"], BAF["sq_tl"], W, W, W, W],
]

# ===================== RADIAL / AXIAL CONTAINMENT =====================
cyl_cb_in = openmc.ZCylinder(r=187.96)
cyl_cb_out = openmc.ZCylinder(r=193.675)
cyl_ns_in = openmc.ZCylinder(r=194.84)
cyl_ns_out = openmc.ZCylinder(r=201.630)
cyl_lin = openmc.ZCylinder(r=219.150)
cyl_rpv_in = openmc.ZCylinder(r=219.710)
cyl_rpv_out = openmc.ZCylinder(r=241.3, boundary_type="vacuum")
# Neutron-shield panel bounding planes (octant symmetry).
nsp1 = openmc.Plane(-0.48480962025, 0.87461970714, 0.0, 0.0)
nsp2 = openmc.Plane(-0.87461970714, 0.48480962025, 0.0, 0.0)
nsp3 = openmc.Plane(-0.87461970714, -0.48480962025, 0.0, 0.0)
nsp4 = openmc.Plane(-0.48480962025, -0.87461970714, 0.0, 0.0)
z_bot = ZP[Z_BOT]   # vacuum
z_top = ZP[Z_TOP]   # vacuum

core_cell = openmc.Cell(fill=core_lat, region=-cyl_cb_in & +z_bot & -z_top)
barrel = openmc.Cell(fill=ss304, region=+cyl_cb_in & -cyl_cb_out & +z_bot & -z_top)
wt_ns = openmc.Cell(fill=water, region=+cyl_cb_out & -cyl_ns_in & +z_bot & -z_top)
# 4 SS304 neutron-shield pads at the octant positions; water fills the rest.
_ns_ring = +cyl_ns_in & -cyl_ns_out & +z_bot & -z_top
_pads = (-nsp1 & +nsp2) | (+nsp1 & -nsp2) | (-nsp3 & +nsp4) | (+nsp3 & -nsp4)
ns1 = openmc.Cell(fill=ss304, region=_ns_ring & -nsp1 & +nsp2)
ns2 = openmc.Cell(fill=ss304, region=_ns_ring & +nsp1 & -nsp2)
ns3 = openmc.Cell(fill=ss304, region=_ns_ring & -nsp3 & +nsp4)
ns4 = openmc.Cell(fill=ss304, region=_ns_ring & +nsp3 & -nsp4)
ns_water = openmc.Cell(fill=water, region=_ns_ring & ~_pads)
down = openmc.Cell(fill=water, region=+cyl_ns_out & -cyl_lin & +z_bot & -z_top)
liner = openmc.Cell(fill=ss304, region=+cyl_lin & -cyl_rpv_in & +z_bot & -z_top)
rpv = openmc.Cell(fill=carbonsteel, region=+cyl_rpv_in & -cyl_rpv_out & +z_bot & -z_top)
root = openmc.Universe(cells=[core_cell, barrel, wt_ns, ns1, ns2, ns3, ns4,
                              ns_water, down, liner, rpv])
geometry = openmc.Geometry(root)

# ===================== SETTINGS + TALLIES =====================
settings = openmc.Settings()
settings.run_mode = "eigenvalue"
settings.batches = 250
settings.inactive = 50
settings.particles = 20000
settings.temperature = {"default": TEMP, "method": "interpolation"}
# Initial source: uniform over the active-fuel envelope (z 36.748 -> 402.508).
bounds_lo = [-182.78094, -182.78094, 36.748]
bounds_hi = [182.78094, 182.78094, 402.508]
settings.source = openmc.IndependentSource(
    space=openmc.stats.Box(bounds_lo, bounds_hi, only_fissionable=True)
)

# Pin-power-style mesh tally over the core footprint (17x17 assemblies),
# axially over the active fuel column.
mesh = openmc.RegularMesh()
mesh.dimension = [17, 17, 1]
mesh.lower_left = [-182.78094, -182.78094, 36.748]
mesh.upper_right = [182.78094, 182.78094, 402.508]
fission_tally = openmc.Tally(name="assembly_fission")
fission_tally.filters = [openmc.MeshFilter(mesh)]
fission_tally.scores = ["fission", "nu-fission"]
tallies = openmc.Tallies([fission_tally])

model = openmc.Model(geometry=geometry, materials=materials,
                     settings=settings, tallies=tallies)

if __name__ == "__main__":
    # Full-core eigenvalue is expensive: use many threads and converge.
    #   sp_path = model.run(threads=8)
    #   with openmc.StatePoint(sp_path) as sp:
    #       print("k-eff =", sp.keff)
    model.export_to_model_xml()

Looking for a guided walkthrough of the SCONE full-core model? See the BEAVRS in SCONE tutorial.