Skip to content

Commit

Permalink
Bring Barnfire up to NJOY2012. NJOY99 compatible version is no in bra…
Browse files Browse the repository at this point in the history
…nch.

Fixed water elastic scattering option.
MT 2452 is not defined as nu*sigma_f, to be consistent with PDT.
Several new materials definitions are added for CASL and Triga applications.
  • Loading branch information
yunhuangzhang committed Oct 8, 2017
1 parent 361be79 commit 6c9fd7c
Show file tree
Hide file tree
Showing 7 changed files with 914 additions and 130 deletions.
8 changes: 8 additions & 0 deletions examples/create_mg_xs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ cd $srcdir
cd $scriptdir
# The result should be a list of .data files in $SCRATCH_BARN/xs/pdtxs

# Step 11: Run NJOY to generate the ACE files (can be done after step 2)
cd $SCRATCH_BARN/xs
./RunAce.sh
# Step 12: Copy ACE files and create xsdir
cd ace/xdata
./copyAce.sh
cd $scriptdir
# The result should be ACE files and xsdir (tells MCNP where the ACE files are) in $SCRATCH_BARN/xs/ace/xdata
235 changes: 132 additions & 103 deletions src/Readgroupr.py

Large diffs are not rendered by default.

19 changes: 16 additions & 3 deletions src/indicators.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ def do_all(inputDict):
materials.append(mat.get_triga_grid_plate_material())
materials.append(mat.get_triga_lead_material())
elif materialOpt == 'ctrigafuel':
materials.append(mat.get_depleted_triga_fuel_material())
materials.append(mat.get_ctriga_fuel_material())
if workOpt == 'wgt':
materials.append(mat.get_triga_clad_material())
materials.append(mat.get_ctriga_clad_material())
materials.append(mat.get_triga_zirconium_material())
materials.append(mat.get_triga_graphite_material())
materials.append(mat.get_triga_borated_graphite_material())
Expand Down Expand Up @@ -242,6 +242,19 @@ def do_all(inputDict):
materials.append(mat.get_triga_air_material())
materials.append(mat.get_triga_grid_plate_material())
materials.append(mat.get_triga_lead_material())
elif materialOpt == 'CASL':
materials.append(mat.get_CASL_fuel_p4_211_material())
materials.append(mat.get_CASL_fuel_p4_262_material())
materials.append(mat.get_CASL_fuel_p5_31_material())
if workOpt == 'wgt':
materials.append(mat.get_CASL_cladding_p5_material())
materials.append(mat.get_CASL_pyrex_p5_material())
materials.append(mat.get_CASL_AIC_p5_material())
materials.append(mat.get_CASL_B4C_p5_material())
materials.append(mat.get_CASL_moderator_p5_material())
materials.append(mat.get_CASL_gas_p5_material())
materials.append(mat.get_CASL_coreplates_material())
materials.append(mat.get_CASL_StainlessSteel_p5_material())
elif materialOpt == 'deb':
materials.append(mat.get_bruss_enriched_rod_fuel_material())
else:
Expand Down Expand Up @@ -1303,7 +1316,7 @@ def define_input_parser():
parser.add_argument('-G', '--groupopt', help="Base coarse group structure file head. If the flux work option is used, the output group structure is the base coarse group structure with the RRR overwritten by the hyperfine group structure. Some examples include 'c5g7', 'scale-44', and 'res-N' where N=1,..9. Always looks in default directory of makegroups.", default=defaults['groupopt'])
parser.add_argument('-r', '--resolution', help='Resolution to use for the pointwise flux calculations', type=int, choices=range(11), default=defaults['resolution'])
parser.add_argument('-E', '--energyspacing', help='The maximum energy jump in the final grid is equal to this factor multiplied by a jump normalization based on downscattering distance off a heavy nucleus.', type=float, default=defaults['energyspacing'])
parser.add_argument('-m', '--materialopt', help=" Unless 'manual' is used, specifies a set of materials to use. If 'manual' is used, give a space-separated list of material names in 'listmaterials'.", choices=['3','4','5','c5g7', 'graphite', 'iron', 'kpin', 'kenrichedpin', 'kcladpin', 'kpin2d', 'kenrichedpin2d', 'kmoxpin2d', 'kmoxenrichedpin2d', 'trigafuel', 'ctrigafuel', 'ctrigafuel_0', 'trigamore', 'deb', 'manual'], default=defaults['materialopt'])
parser.add_argument('-m', '--materialopt', help=" Unless 'manual' is used, specifies a set of materials to use. If 'manual' is used, give a space-separated list of material names in 'listmaterials'.", choices=['3','4','5','c5g7', 'graphite', 'iron', 'kpin', 'kenrichedpin', 'kcladpin', 'kpin2d', 'kenrichedpin2d', 'kmoxpin2d', 'kmoxenrichedpin2d', 'trigafuel', 'ctrigafuel', 'ctrigafuel_0', 'trigamore', 'CASL', 'deb', 'manual'], default=defaults['materialopt'])
parser.add_argument('-i', '--indicatormaterials', dest='listmaterials', help="When manual 'materialopt' is used, specify the materials to use.", nargs='+', default=defaults['listmaterials'], choices=mat.get_materials_name2function_dict().keys())
parser.add_argument('-t', '--temperaturedependence', help="If specified, use the temperature in the PENDF file that corresponds to the temperature of the material (as specified in 'materials_materials.py'). If this temperature does not exist, an error is thrown. If not specified, the first temperature in the PENDF file is used. This flag is added for 'materialopt' of '3'.", action='store_true', default=False)
parser.add_argument('-M', '--meshname', help="The energy mesh on which the output fluxes are constructed. {r} is replaced by the resolution. If the 'flux' workopt is used, the mesh file is written to. Else, is it read from. If no file type is specified, '.txt' is used. If no directory is specified, the 'energyDat' directory from directories is used.", default=defaults['meshname'])
Expand Down
4 changes: 3 additions & 1 deletion src/indicators_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ def read_energy_and_indicators(dataDict):
importanceDict = {'tdFUEL_0': 1}
elif materialOpt == 'trigamore':
importanceDict = {'tFUEL': 10, 'tCLAD': 2, 'tZIRC': 2, 'tIRRADIATIONTUBE': 1}
elif materialOpt == 'CASL':
importanceDict = {'CASLfuel_P4_211': 1, 'CASLfuel_P4_262': 1, 'CASLfuel_P5_31': 1}
elif materialOpt == 'manual':
if not importancesList:
importancesList = [1]*len(materialsList)
Expand Down Expand Up @@ -976,7 +978,7 @@ def define_input_parser():
parser.add_argument('-n', '--numcoarsegroups', help="The number of coarse groups to be used. If nonzero, overwrites the internal members of 'coarsebdrs'", type=int, default=defaults['numcoarsegroups'])
parser.add_argument('-l', '--listnumelements', help='Number of elements to be put in each coarse boundary. Number of arguments should be one less than the number of coarse boundaries. Takes priority over "elements" if set', type=int, nargs='+', default=defaults['listnumelements'])
parser.add_argument('-r', '--resolution', help='Resolution to use for the pointwise flux calculations', type=int, choices=range(11), default=defaults['resolution'])
parser.add_argument('-m', '--materialopt', help="Unless 'manual' is used, specifies a set of materials to use. If 'manual' is used, give a space-separated list of material names in 'listmaterials'.", choices=['4','5','c5g7', 'graphite', 'iron', 'kpin', 'kenrichedpin', 'kcladpin', 'kpin2d', 'kenrichedpin2d', 'kmoxpin2d', 'kmoxenrichedpin2d', 'trigafuel', 'ctrigafuel', 'ctrigafuel_0' 'trigamore', 'manual'], default=defaults['materialopt'])
parser.add_argument('-m', '--materialopt', help="Unless 'manual' is used, specifies a set of materials to use. If 'manual' is used, give a space-separated list of material names in 'listmaterials'.", choices=['4','5','c5g7', 'graphite', 'iron', 'kpin', 'kenrichedpin', 'kcladpin', 'kpin2d', 'kenrichedpin2d', 'kmoxpin2d', 'kmoxenrichedpin2d', 'trigafuel', 'ctrigafuel', 'ctrigafuel_0', 'trigamore', 'CASL', 'manual'], default=defaults['materialopt'])
parser.add_argument('-i', '--indicatormaterials', dest='listmaterials', help="When manual 'materialopt' is used, specify the materials to use.", nargs='+', default=defaults['listmaterials'])
parser.add_argument('-I', '--importances', dest='listimportances', help="When manual 'materialopt' is used, specify the weightings (importances) to use when clustering.", nargs='+', type=int, default=[])
parser.add_argument('-p', '--plotopt', help='Which observations to plot', choices=['none', 'first', 'last', 'firstlast', 'half', 'all', 'sum'], default=defaults['plotopt'])
Expand Down
6 changes: 3 additions & 3 deletions src/materials_bondarenko.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ def form_and_print_macroscopic_xs(dirr, ZAList, material, numGroups, verbosity=F
for MT in MTsAvg:
if np.all(norms[MT]>0.0):
xsOut[MT] /= norms[MT]

# Recompute steady-state nu and chi
if all(MTs in xsIn for MTs in [MTnuSigF, MTfission, MTssNu, MTssChi]):
if all(mts in MTs for mts in [MTnuSigF, MTfission, MTssNu, MTssChi]):
flux = xsOut[MTwgt]
promptProd = xsOut[MTnuSigF]
fission_xs = xsOut[MTfission]
Expand All @@ -268,7 +268,7 @@ def form_and_print_macroscopic_xs(dirr, ZAList, material, numGroups, verbosity=F
fission_x_prompt = xsOut[MTfissionMatrix]

nu_prompt = promptProd/fission_xs
nu_ss = nu_prompt + nu_delayed
nu_ss = (nu_prompt + nu_delayed) * fission_xs
n_per_gout = ( np.dot(fission_x_prompt, flux) + \
chi_delayed*np.sum(nu_delayed*fission_xs*flux) )
chi_ss = n_per_gout/np.sum(n_per_gout)
Expand Down
Loading

0 comments on commit 6c9fd7c

Please sign in to comment.