SLIG.rst.txt 25.4 KB
 Batson Iii committed Jan 19, 2021 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 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 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 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 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 .. _5A: SCALE/Origen Library Generator (SLIG) ===================================== .. sectionauthor:: B. R. Betzler .. program:: SLIG This Python script (:file:slig.py) semi-automates the process of generating sets of cross-section libraries for ORIGEN calculations for spent fuel depletion, decay, and source term analysis. SLIG performs several tasks: #. reads standard-format template files, obtaining information (e.g, enrichments, burnups, moderator densities, etc.) from the file header #. generates a set of input files according to this header information; #. builds a directory tree to house these input files; #. writes the addition to the :file:arpdata.txt file; #. moves the final libraries to a new directory; and #. reads the burnup list for each set of libraries and writes them in the addition to the :file:arpdata.txt file. This manual is divided into five main sections based on the desired application: :ref:sect-SLIG-running for running SCALE on a local machine or a computing cluster without a queue system; :ref:sect-SLIG-advanced for running SCALE on a cluster with a queue system; :ref:sect-SLIG-examples for editing and writing template files; :ref:sect-SLIG-troubleshooting for issues running SLIG; and :ref:sect-SLIG-code-info for making changes to the code. .. _sect-SLIG-running: Quick Start Directions ---------------------- The SLIG package is located in the SCALE source directory in :file:./packages/etc/slig/. Because it is necessary to run SCALE to generate the appropriate cross-section libraries, SLIG runs in a disjointed, three-step process: #. Copy the contents of the :file:./slig/src/ directory into :file:./slig/testing/. Move to the :file:./slig/testing/ directory and use :command:./slig.py -g to perform tasks 1) through 4). If SLIG returns an error, follow the directions in the error message (see :ref:sect-SLIG-troubleshooting). After a successful run, three new items will appear in the current directory: :file:runSpace/ the directory tree containing the input files, :file:arpLibList.txt a list of the locations of the libraries in the directory tree, and :file:addToArpData.txt additional lines for the arpdata.txt file. #. Run SCALE with each input within the directory tree (:file:runSpace/). Each input is located within the directory tree in the location :file:./runSpace/templateName/inputID/, where templateName is the prefix of the template file (i.e., :file:templateName_template.inp) and inputID is a string identifying the enrichment (eNN), moderator density (wMM, if applicable), and plutonium vector (vPP, if applicable) for the input. #. After all SCALE calculations are complete, use :command:./slig.py -f to perform task 5) and 6). SLIG will identify any missing libraries. After a successful run, two changes will be made in the current directory: :file:newLibraries/ this directory containing the new libraries will appear, and :file:addToArpData.txt the burnup lists will be written on the this file. The final result is an addition to the :file:arpdata.txt file (:file:addToArpData.txt) and a directory containing all generated libraries (:file:newLibraries/). Do not delete any files associated with :file:slig.py unless it directs you to do so. The following options are available to the user (see :ref:sect-SLIG-running for more options): .. option:: -p , -path= This specifies the location of the template files. SLIG will search PATH and all its subdirectories for template files. The default path is the current directory. .. option:: -x , -xsections= This specifies the cross section library used in all calculations. The default is v7-252. .. _sect-SLIG-advanced: Advanced Options ---------------- The following are more advanced options available to the user: .. option:: -e , -extension= This specifies the file extension that identifies a template file. By default, SLIG searches for files ending in _template.inp). .. option:: -a, -add This flag is used with the -g option (:command:./slig.py -ga) to add input files to the current directory tree (runSpace/). It also adds library information to addToArpData.txt and adds the location of the libraries in the directory tree to file:arpLibList.txt. This flag is used with the -f option (:command:./slig.py -fa) to add newly generated libraries to the current library directory (:file:newLibraries/). .. option:: -d, -document This flag turns on documentation routines that automatically generate a LaTeX file (libraryInformation.tex) with data about each template file using information on the file header. This also generates a .pdf file (libraryInformation.pdf) using pdflatex (required for this to function properly). Additionally, any figures referenced within the templates must be located within the current directory or any of its subdirectories. .. option:: -s, -submit This flag turns on routines that generate a PBS submit script for each input file for running on clusters with a queue system. It also generates a shell script to submit these jobs (with :command:qsub). The PBS submit script template (:file:run1proc.pbs) must be placed in the current directory. The first two steps of the three-step process for running SLIG (see :ref:sect-SLIG-running) change: 1. Use :command:./slig.py -gs to perform tasks 1) through 4). After a successful run, four new items will appear in the current directory: :file:runSpace/ the directory tree containing the input files, :file:arpLibList.txt a list of the locations of the libraries in the directory tree, :file:addToArpData.txt additional lines for the arpdata.txt file, and :file:submitSLIGjobs a shell script for submitting jobs to the queue. 2. Run the shell script (:file:./submitSLIGjobs) to submit jobs to the queue. Note that this may submit a very large number of jobs to the queue. When using :command:./slig.py -ga, SLIG will check for documentation and submit scripts and will proceed with the same settings that were used for the initial run of SLIG. For example, if the user initially runs :command:./slig.py -gds to generate documentation and submit scripts then later uses :command:./slig.py -ga, SLIG will proceed with adding documentation for the additional templates and generating submit scripts. When SLIG generates additional submit scripts, a separate numbered file is generated for each new template (e.g., :file:submitSLIGjobs1). .. _sect-SLIG-examples: Template File Rules and Examples -------------------------------- Example templates are provided with the SCALE distribution. For creating new templates, it is best to use these templates as starter files and make incremental changes as necessary for the new application. The header at the top of each template file contains the information that will be used to generate input files and documentation. Each line of this header must start with an apostrophe; each line is a comment line according to the SCALE standard input. There are two main sections in this header: 1. The **template header** (see :numref:ex-SLIG-BWR and :numref:ex-SLIG-MOX). This header has a parameter list and an option list: a. The *parameter list* identifies the strings within the template file that SLIG will replace as it generates input files. These parameters are found throughout the template file; SLIG will replace these with values as it generates each input files. SLIG identifies the parameter list starting from the first line containing the 'parameter' string and each line thereafter that is indented more than five blank spaces (not including the apostrophe). The following is a list of rules for entering parameters: * Each parameter is entered on a separate line in the form "parameter-description". * Each parameter must be a unique string of characters. * Each parameter is a single string without spaces. * SLIG uses the "description" to characterize the parameter. If these descriptions are changed, SLIG may not be able to properly characterize each parameter. Thus, it is suggested that the descriptions in the following list are not changed. * There is some flexibility in changing the parameter strings. b. The *option list* identifies the quantities or values that SLIG uses to determine the values that will replace the parameters in each input file. SLIG identifies the option list starting from the first line containing the 'option' string and each line thereafter that is indented more than five blank spaces (not including the apostrophe). The following is a list of rules for entering options: * Each option is entered on a separate line in the form option - values. * SLIG uses the "option" to recognize what to do with the values. If this is changed, SLIG may not be able to properly characterize each option. Thus, it is suggested that the options (to the left of the dash) in the following list are not changed. * For options with multiple values, each value must be separated with a comma. * For values to continue onto the next line, the last value in a line must end with a comma and the next line must be indented and must begin with the next value. * The values may be changed. 2. The **documentation header** (see :numref:ex-SLIG-MOX-doc-header). The documentation header has two purposes. First, it is used to track information about the template (e.g., author, date created, and methodology) and the source documents that contributed to the template's creation. This simplifies updating input files for new versions of SCALE. Second, SLIG uses this header information to generate documentation files. SLIG identifies the documentation header starting from the first line containing 'Documentation' to the line starting with an apostrophe followed by a space and five dashes (' -----). .. code-block:: none :name: ex-SLIG-BWR :caption: A typical BWR template header. ' ---------------------------------------------------------------- ' template to generate libraries for ORIGEN-S ' parameters are: u235wt% - wt% U235 ' u234wt% - wt% U234 ' u236wt% - wt% U236 ' u238wt% - wt% U238 ' ddd - coolant density (g/cc) ' dancoff1 - dancoff factor 1 ' dancoff2 - dancoff factor 2 ' namelibrary - name of generated ORIGEN library ' specpow - average specific power ' daystoburn - depletion interval in days ' options are: name - g10_ ' enrichment - 0.5, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0 ' cool. density - 0.1, 0.3, 0.5, 0.7, 0.9 ' dancoff1 - 0.5041, 0.3937, 0.3182, 0.2631, ' 0.2211 ' dancoff2 - 0.3229, 0.2541, 0.2069, 0.1722, ' 0.1455 ' spec. power - 25.0 ' ---------------------------------------------------------------- .. code-block:: none :name: ex-SLIG-MOX :caption: A typical BWR MOX template header. ' ---------------------------------------------------------------- ' template to generate libraries for ORIGEN-S ' parameters are: IcontentPu - wt% plutonium: inner ' IcontentU - wt% uranium: inner ' IEcontentPu - wt% plutonium: inside edge ' IEcontentU - wt% uranium: inside edge ' EcontentPu - wt% plutonium: edge ' EcontentU - wt% uranium: edge ' CcontentPu - wt% plutonium: corner ' CcontentU - wt% uranium: corner ' pu238wt% - wt% Pu238 ' pu239wt% - wt% Pu239 ' pu240wt% - wt% Pu240 ' pu241wt% - wt% Pu241 ' pu242wt% - wt% Pu242 ' densityAm - americium density (g/cc) ' ddd - coolant density (g/cc) ' dancoff1 - dancoff factor 1 ' dancoff2 - dancoff factor 2 ' namelibrary - name of generated ORIGEN library ' specpow - average specific power ' daystoburn - depletion interval in days ' options are: name - mox_g10_ ' pu content - 4.0, 7.0, 10.0 ' pu vector - 50.0, 55.0, 60.0, 65.0, 70.0 ' cool. density - 0.1, 0.3, 0.5, 0.7, 0.9 ' dancoff1 - 0.5041, 0.3937, 0.3182, 0.2631, ' 0.2211 ' dancoff2 - 0.3229, 0.2541, 0.2069, 0.1722, ' 0.1455 ' spec. power - 25.0 ' burnups - 0, 1, 2, 3, 4.5, 6, 7.5, 9, ' 10.5, 12, 13.5, 15, 16.5, 18, ' 19.5, 21, 24, 27, 30, 33, 36, ' 39, 42, 45, 48, 51, 54, 57, 60, ' 63, 66, 69, 72 ' pin_zone - 26, 16, 24, 12 ' pin_gad - 14 ' avg_pin_dens. - 10.4 ' ---------------------------------------------------------------- .. code-block:: none :name: ex-SLIG-MOX-doc-header :caption: A typical MOX BWR documentation header. ' ---------------------------------------------------------------- ' Documentation and Notes (empty fields are auto-populated): ' [Change Log] ' Rev 0: Generated by J. Doe | ' Rev 1: Generated by B. R. Betzler, June 2014 | ' Rev 2: Generated by B. R. Betzler, September 2015 ' [Author(s)] B. R. Betzler ' [SCALE Version] SCALE 6.2 ' [Reactor Type] Mixed Oxide Boiling Water Reactor General Electric 10x10-8 ' [Model Info] 2D t-depl full assembly model (see Figure \ref{fi:mox_ge10x10-8}), xsLib cross-section library ' [Sources] ' 1. B. J. Ade, Generation of Collapsed Cross Sections for Hatch 1 Cycles 1-3 and Generation of Generic BWR Reflector Cross Sections'', ORNL/LTR-2012/559, Oak Ridge National Laboratory, 2012. | ' 2. H. Smith, J. Peterson, and J. Hu, Fuel Assembly Modeling for the Modeling and Simulation Toolset'', ORNL/LTR-2012-555 Rev. 1, Oak Ridge National Laboratory, 2013. | ' 3. I. C. Gauld, MOX Cross-Section Libraries for ORIGEN-ARP'', ORNL/TM-2003/2, Oak Ridge National Laboratory, Oak Ridge, Tennessee, 2003. | ' 4. U. Mertyurek and I. C. Gauld, Development of ORIGEN Libraries for Mixed Oxide (MOX) Fuel Assembly Designs'', to be published, 2015. ' 5. H. Smith, J. Peterson, and J. Hu, Fuel Assembly Modeling for the Modeling and Simulation Toolset'', ORNL/LTR-2012-555 Rev. 1, Oak Ridge National Laboratory, 2013. ' [Data Range] ' [Libraries] ' [Power] ' [Other Info] ' Channel box data, fuel/gap/channel moderator densities, and temperatures from Reference 1. ' All other dimensions, materials, etc. from Reference 2. ' Gad layout altered according to best engineering judgement. ' MOX isotopic vector information from Reference 3. ' MOX zoning pattern from section 4.1 of Reference 4 (see Table 2, Eq.~3, and Eq.~4). ' Specific power from Reference 5. ' figure{mox_ge10x10-8.pdf: MOX BWR GE 10x10-8.} ' ---------------------------------------------------------------- UOX fuel parameters ~~~~~~~~~~~~~~~~~~~ The following (:numref:ex-slig-uox-opts) is a list of some of the parameters available to the user for working with most PWR and BWR lattices: .. code-block:: none :name: ex-slig-uox-opts :caption: SLIG input options for UOX-based templates u235wt% - wt% U235 u234wt% - wt% U234 u236wt% - wt% U236 u238wt% - wt% U238 ddd - coolant density (g/cc) dancoff1 - dancoff factor 1 dancoff2 - dancoff factor 2 namelibrary - name of generated ORIGEN library specpow - average specific power daystoburn - depletion interval in days .. code-block:: none :name: ex-slig-uox-sample :caption: Example of a fully-specified UOX input. name - abb_ enrichment - 0.5, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0 cool. density - 0.1, 0.3, 0.5, 0.7, 0.9 (or mod. density - 1.65) dancoff1 - 0.4686, 0.3429, 0.2651, 0.2122, 0.1742 dancoff2 - 0.3103, 0.2316, 0.1823, 0.1484, 0.1237 spec. power - 25.0 burnups - 0, 1, 2, 3, 4.5, 6, 7.5, 9,           10.5, 12, 13.5, 15, 16.5, 18,           19.5, 21, 24, 27, 30, 33, 36,           39, 42, 45, 48, 51, 54, 57, 60,           63, 66, 69, 72 MOX fuel parameters ~~~~~~~~~~~~~~~~~~~ For mixed oxide (MOX) PWR and BWR assemblies, there is a different set of parameters available to the user. SLIG will recognize a file as a MOX template by searching for the Pu-239 parameter. SLIG automatically generates a MOX zoning pattern (see :numref:fig-mox-zoning) for BWR and PWR lattices according to the values of pin_zone, pin_gad, and avg_pin_dens.. .. code-block:: none :name: ex-SLIG-mox-opts :caption: SLIG input options for MOX-based templates. IcontentPu - wt% plutonium: inner IcontentU - wt% uranium: inner IEcontentPu - wt% plutonium: inside edge IEcontentU - wt% uranium: inside edge EcontentPu - wt% plutonium: edge EcontentU - wt% uranium: edge CcontentPu - wt% plutonium: corner CcontentU - wt% uranium: corner pu238wt% - wt% Pu238 pu239wt% - wt% Pu239 pu240wt% - wt% Pu240 pu241wt% - wt% Pu241 pu242wt% - wt% Pu242 densityAm - americium density (g/cc) ddd - coolant density (g/cc) dancoff1 - dancoff factor 1 dancoff2 - dancoff factor 2 namelibrary - name of generated ORIGEN library specpow - average specific power daystoburn - depletion interval in days .. _fig-mox-zoning: .. figure:: figs/SLIG/fig3.png :align: center :width: 500 MOX zoning layout for a Westinghouse 14×14 PWR assembly showing the corner (green), edge (salmon), inside edge (magenta), and inner (red) pin zones. .. code-block:: none :name: ex-mox-sample :caption: Example of a fully-specified MOX input. name - mox_abb_ pu content - 4.0, 7.0, 10.0 pu vector - 50.0, 55.0, 60.0, 65.0, 70.0 cool. density - 0.1, 0.3, 0.5, 0.7, 0.9 dancoff1 - 0.4686, 0.3429, 0.2651, 0.2122, 0.1742 dancoff2 - 0.3103, 0.2316, 0.1823, 0.1484, 0.1237 spec. power - 25.0 burnups - 0, 1, 2, 3, 4.5, 6, 7.5, 9,           10.5, 12, 13.5, 15, 16.5, 18,           19.5, 21, 24, 27, 30, 33, 36,           39, 42, 45, 48, 51, 54, 57, 60,           63, 66, 69, 72 pin_zone - 11, 20, 16, 12 pin_gad - 4 avg_pin_dens. - 10.4 The following is an explanation of each option: .. describe:: name This is the prefix for the name of the final generated libraries. It should be unique to the template (i.e., other templates should have a different name). .. describe:: enrichment This is a list of the :sup:235\ U enrichments [%] for which SLIG will create separate inputs. .. describe:: cool.\ density, mod.\ density This is a list of the coolant or moderator densities [g/cm\ :sup:3] for which SLIG will create separate inputs. .. describe:: dancoffN This is a list of dancoff factors that correspond to pin N. The length of this list must match the length of the coolant/moderator density list (the dancoff factor varies significantly with this density). .. describe:: spec.\ power This is the specific power [MW/MTU] of the assembly. .. describe:: burnups This is a list of cumulative burnup steps [GWd/MTU] that will be used to create the depletion steps. If a small step is not included, SLIG will print a warning and automatically insert one at the beginning of the calculation (for Xe equilibrium). .. describe:: pu\ content This is a MOX-specific parameter that is a list of the average content of plutonium [%] in the assembly for which SLIG will create separate inputs. These quantities are calculated as a percentage of the total heavy metal loading in the assembly. .. describe:: pu\ vector This is a MOX-specific parameter that is a list of the enrichments of :sup:239\ Pu [%] for which SLIG will create separate inputs. These quantities are calculated as a percentage of the total plutonium in the assembly and are used to calculate the entire plutonium vector :cite:Gauld2003. .. describe:: pin_zone This is a MOX-specific parameter that lists of the number of pins in the inner, inside edge, edge, and corner zones (see Figure 5.A.3). This varies for each assembly. .. describe:: pin_gad This is a MOX-specific parameter that specifies the number of Gd-bearing pins in the assembly. SLIG uses this quantity to calculate ensure that the specified Pu content of the assembly is correctly represented :cite:Gauld2003. .. describe:: avg_pin_dens. This is a MOX-specific parameter that specifies the average density [g/cm\ :sup:3] of the pins in the assembly. SLIG uses this quantity to calculate ensure that the specified Pu content of the assembly is correctly represented. Documentation header ~~~~~~~~~~~~~~~~~~~~ The documentation header has a free form–style entry, where sections are specified by [Section Name] and the text for each section follows afterward. Figures are referenced as figure{figureName.pdf: Figure caption.}. Any reference to the figure within the header must be in LaTeX-like form; for this, the figure is labeled as fi:figureName. The section name keywords [Data Range], [Libraries], and [Power] are reserved to be auto-populated by SLIG according to information provided within the vars list. All information within this header is transferred to the documentation file. The parameters in the file headers are located within the template file in the appropriate locations. See the example templates for the proper usage. The burndata card in the input file should only be three lines: .. code-block:: none read burndata power=specpow burn=daystoburn down=0 end end burndata because it will be populated by the burnup points listed in the file header. There should also be a shell command at the end of the input file to save the cross-section library: .. code-block:: none =shell cp ft33f001.cmbined \$RTNDIR/namelibrary end .. _sect-SLIG-troubleshooting: Troubleshooting --------------- If at any time an error occurs, SLIG will exit after printing the reason for the error and offer a possible solution. Following these instructions should resolve most issues with SLIG. The following is a list of factors to consider when having trouble running SLIG. * SLIG uses the module argparse.py (see https://docs.python.org/3/library/argparse.html) to handle command line arguments; SLIG will crash if it does not have access to it. For versions of Python that do not inherently support this module, download the :file:argparse.py file and include it in the directory with :file:slig.py. * If SLIG is crashing, there may be an issue with the version of Python. SLIG was developed to be functional with Python 2.7.6. * After running :command:./slig.py -g, the :file:addToArpData.txt file will have dummy placeholders instead of the burnup lists. These placeholders are replaced with the burnup lists that are read off of the SCALE output files. The burnup lists in the documentation file are the burnup lists specified in the template files. .. _sect-SLIG-code-info: Code Information ---------------- SLIG consists of a :class:main, one SCALE-specific class (:class:manageTemplate), and three generic classes (:class:messenger, :class:manageDirectory, and :class:manageFile): * :class:main reads and validates arguments, and contains a loop to make inputs and collect libraries * :class:manageTemplate manages templates (reads/sorts options, calculates concentrations) * :class:messenger manages all prints to the screen * :class:manageDirectory manages external directories (searching, making, etc.) * :class:manageFile manages external files (reading, writing, searching, copying, etc.) SLIG calls a separate Python script (:file:collectinfov04.py) to perform documentation functions. This script uses a template (:file:basedoc.v04.tex) to generate the documentation file. .. raw:: latex \clearpage .. . U. Mertyurek and I. C. Gauld, "Development of ORIGEN Libraries for Mixed Oxide (MOX) Fuel Assembly Designs," to be published, 2015.