1FRENDY exercise
Japan Atomic Energy Agency (JAEA)
Kenichi TADA
https://rpg.jaea.go.jp/main/en/program_frendy/index.html

2Contents• Installation of additional tools for FRENDY exercise• gnuplot• CMake• NJOY2016• Overview of FRENDY exercise• Calculation of Godiva reactor (HMF-001) using MCNP
• ACE file generation using FRENDY and NJOY2016• Generation of XS library for MCNP calculation using

above ACE files• Application example of FRENDY’s modules• XS edit tool for ACE and PENDF files• Perturbation of ACE file3

Installation of additional tools
for FRENDY exercise

4

Installation environment• Ubuntu (Ubuntu 20.04.1 LTS) on WSL• WSL: Windows subsystem for Linux• Green letters mean Ubuntu command.

• Please ask the administrator before installingthese tools.

d05099:46459a

5Installation of gnuplot• FRENDY exercise plots figures using gnuplot tocompare the processing results (XS data)• Installation of gnuplot• sudo apt-get install gnuplot• Wait about 10 minutes.
• For CentOS: sudo yum install gnuplot• Try to run the following command if gnuplot does notplot figures and shows the following warning message.
• Warning message• gnuplot: error while loading shared libraries: libQt5Core.so.5: cannot
open shared object file: No such file or directory• Command to resolve this problem• sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linuxgnu/libQt5Core.so.5

6Installation of NJOY2016 (1/2)• FRENDY exercise uses NJOY2016 to compare theprocessing results.
• NJOY2016 compilation requires Cmake.
• gcc version 7, gfortran, and python are also required• Default gcc version of CentOS may not compile NJOY2016.
• In this case, devtoolset should be used to install higher version of gcc.
• 1) sudo yum install centos-release-scl• 2) sudo yum install devtoolset-9• 3) scl enable devtoolset-9 bash

• Installation of CMake• sudo apt-get install cmake• Please install CMake3 when CMake cannot generate make file of NJOY2016.
• sudo apt-get install cmake3• Get NJOY2016 from github• git clone https://github.com/njoy/NJOY2016.git• Installation of Git is required if git command is not available.
• sudo apt-get install git

7Installation of NJOY2016 (2/2)• Compilation of NJOY
• cd NJOY2016 (Move to cloned “NJOY2016” directory.)• mkdir bin (Make “bin” directory.)• cd bin (Move to “bin” directory)• cmake ../ (Run CMake in “bin” directory)• Please use CMake3 when CMake cannot generate make file of NJOY2016.
• cmake3 ../• Linux OS may not have f95 and make file of NJOY2016 may not be generated.
• User has to set up a link to f95.
• ln -s /usr/bin/gfortran /usr/bin/f95• For CentOS using devtoolset (Please change version number of devtoolset.)• ln -s /opt/rh/devtoolset-9/root/usr/bin/gfortran /opt/rh/devtoolset-9/root/usr/bin/f95• make (Compile NJOY2016)• Executable file of NJOY2016 (njoy) in “bin” directory• References for NJOY2016 compilation• https://github.com/njoy/NJOY2016• http://www.njoy21.io/Build/index.html

8Overview of FRENDY exercise

9Content of exercise• Calculation of Godiva reactor (HMF-001) using MCNP
• ACE file generation using FRENDY and NJOY2016• U-235, U-238, O-16, and N-14
• U-234 is removed to reduce processing time.
• HinH2O is also processed for reference case of TSL data processing.

• Generation of XS library for MCNP calculation using above ACEfiles• Application example of FRENDY’s modules• Comparison and edit of XS using FRENDY modules• Plotting comparison results using gnuplot• Perturbation of ACE file
• Random sampling of ACE file

• Total calculation time: about 2 hours

10Directory structure of frendy_exercise
link_base

ACE file generation
using FRENDY

inp_frendy

User has to set
up a link(see next slide)

frendylibnjoy

mcnp_data

inpmcnp

inp

ACE file generation
using NJOY
XS library of MCNP

gnuplot

Running MCNP
(Godiva rector)

comp_ace_xs
inp
comp_pendf_xs
plot_dat

write_ace_xs
frendy_exercise
write_pendf_xs

Comparison and editof processing results

make_perturbation_factor

Random samplingof ACE fileMulti-group XS file
generation using
FRENDYrandom_sampling

perturbation_
ace_file

comp_ace_xs

Gnuplot

frendymg_generation
input
run_all.csh

README,README_jp

Running shell

11

Preparation of exercise (1/2)• FRENDY exercise uses FRENDY, NJOY2016, andMCNP• User has to set up a link at“frendy_exercise/link_base”• frendy_dir• Top directory of FRENDY (frendy_YYYYMMDD)• YYYYMMDD means release date• njoy• Executable file of NJOY2016• mcnp6• Executable file of MCNP

12Preparation of exercise (2/2)• Compilation of FRENDY and some tools• Executable of FRENDY (frendy/main/frendy.exe)• cd frendy/main• make• Collection of ACE file tool, ACE file random sampling tool,and ACE file perturbation tool
• tools/make_xsdir_list/make_xsdir_list.exe• tools/make_perturbation_factor/make_perturbation_factor.exe• tools/perturbation_ace_file/perturbation_ace_file.exe• cd tools• csh ./compile_all.csh

13

ACE file generation using FRENDY• Working directory: frendy_exercise/frendy• inp_frendy: Input files of FRENDY• “~.dat”: Input for FRENDY to generate ACE file• “~.n”: Input for FRENDY to generate NJOY input file (see nextslide)• Input format is explained in “02.Input_format_of_FRENDY”.

• lib: Evaluated nuclear data files• run_frendy.csh: Running shell• Generated directories• ace: ACE files generated by FRENDY• pendf: PENDF files generated by FRENDY• After probability table generation

14NJOY input file generation using FRENDY• Working directory: frendy_exercise/frendy• inp_frendy: input files of FRENDY• “~.n” is input for FRENDY to generate NJOY input file• lib: Evaluated nuclear data files• make_njoy_input.csh: Running shell• Generated directory• inp_njoy: Input files for NJOY

15ACE file generation using NJOY
• Working directory: frendy_exercise/njoy• Input files of NJOY are generated by FRENDY• frendy_exercise/frendy/inp_njoy: Input files of NJOY

• run_njoy.csh: Running shell• Generated directories• ace: ACE files generated by NJOY
• pendf: PENDF files generated by NJOY
• After probability table generation• out： Output files of NJOY

16Comparison of processing results• Comparison of XS processed by FRENDY and NJOY
• frendy_exercise/comp_ace_xs• Comparison of all XS data in ACE file and plotting using gnuplot.

• frendy_exercise/comp_pendf_xs• Comparison of all XS data in PENDF file and plotting using gnuplot.

• Source files are set in “src” directories.
• frendy_exercise/comp_ace_xs/src,
frendy_exercise/comp_pendf_xs/src• Running shells• run_comp_ace.csh, run_comp_pendf.csh[Comparison of total XS of U-238][Comparison of incoherent inelastic
scattering XS of Hin H2O]

17XS edit tool for ACE and PENDF files• This tool is a sample to make edit tool for ACE and ENDF files byusers.
• frendy_exercise/write_ace_xs• Extraction of all cross sections in ACE file and plotting using gnuplot.
• frendy_exercise/write_pendf_xs• Extraction of all cross sections in PENDF file and plotting using gnuplot.

• Source files are set in “src” directories.
• frendy_exercise/write_ace_xs/src, frendy_exercise/write_pendf_xs/src• Running shells• run_write_ace_xs.csh、run_write_pendf_xs.csh[Total XS of U-235][Total XS of O-16]

18

Generation of XS library for MCNP
• Working directory: frendy_exercise/mcnp_data• Collect ACE files generated by FRENDY and NJOY• Modification of XSDIR file
• Add atomic weight ratio and modify directory information• inp: input files• run_ace_data_collector.csh: Running shell• Generated files• Generated by FRENDY• ace_f/j40a00fa : Collected ACE files• xsdir.j40a00f: XSDIR file

• Generated by NJOY
• ace_n/j40a00na : Collected ACE files• xsdir.j40a00n: XSDIR file19MCNP calculation (Godiva)• Working directory: frendy_exercise/mcnp• mcnp_data: XS library for MCNP calculation• inp: input files• hmf001.i: Consideration of self-shielding effect in the unresolved

resonance region using probability table• hmf001_no_ptable.i: Without probability table• run_all.csh: Running shell• Running MCNP calculation and copying k-eff to result_keff.log• Generated directory• out： output files• “~_f~.out”: Calculation result using ACE files processed by FRENDY• “~_n~.out”: Calculation result using ACE files processed by NJOY

20Perturbation of ACE file• This exercise is identical to sample in FRENDY• Working directory:

frendy_exercise/random_sampling• Random sampling of ACE file• make_perturbation_factor• Generation of perturbation factor using covariance data
“1001_MT_102_2.csv”.
• Perturbation of ACE file• perturbation_ace_file• Perturbation factor is generated in “make_perturbation_factor”
directory• Perturbed XS is compared to the original data and plottedby gnuplot

21

Automatic execution of all calculations• Running run_all.csh in “frendy_exercise” directory• csh ./run_all.csh• Running remove_all.csh in “frendy_exercise”

directory if user wants to remove all generated
directories and files.
• csh ./remove_all.csh• run_all.csh shell runs remove_all.csh shell befor

execution of all calculations to remove previous
calculation results.

22

Input format of FRENDY

23

Basics of FRENDY input format• First line must be processing mode.
• ace_fast_mode ： Neutron induced ACE file• ace_tsl_mode ： ACE file of thermal scattering law data
• ace_dosi_mode： Dosimetry ACE file
• Other lines are free format.
• Setting “input data name” and “input data”• Bracket is used to describe array data, e.g., (1.0 2.0 3.0).
• Text data is surrounded by single or double quotation mark,e.g., “~” or ‘~’.
• Multiline is available for array data and text data.

• Comment line is similar to C/C++.
• //~ or /* ~ */24

Main input parameters• Required parameters• nucl_file_name：Evaluated nuclear data file name
• nucl_file_name_tsl：TSL data file name (TSL only)• Other main input parameters• temp：Temperature (K) (Default: 293.6 K)• ace_file_name：ACE file name• ace_dir_file_name：XSDIR file name• suffix_id：Suffix ID of ACE file• ace_label_data：Comment line of ACE file (one line)• thermal_za_id_name： S(α, β) identifier of MCNP (TSL only)• Additional parameters• Write_pendf_probability_table：PENDF file name after probability tablegeneration• Write_pendf_tsl：PENDF file name after TSL data processing (TSL only)• PENDF (Point-wise ENDF) file is a processing result of NJOY.
• These PENDF file can be used as input PENDF of NJOY.

25

Example of FRENDY input (Neutron induced)
ace_fast_mode // Processing modeFirst line must be set
nucl_file_name../lib/U235.dat
processing mode.
temp /* [K] */300.0
ace_file_name./ace/U235.ace
Relative path orabsolute path
ace_dir_file_name ./xsd/U235.xsdir
ace_label_data“U-235 from JENDL-4.0”
suffix_id0.50• Processing conditions of above example• Evaluated nuclear data file name： ../lib/U235.dat• Temperature：
300.0 [K]• ACE file name：./ace/U235.ace• XSDIR file name：./xsd/U235.xsdir• Comment line of ACE file：U-235 from JENDL-4.0• Suffix ID：
0.50

26

Modification of processing conditions(Neutron induced)• Please try to modify input file if processing conditions

are changed as follows:• Evaluated nuclear data file name： ./j40/lib/Fe056.dat• Temperature：• ACE file name：• XSDIR file name：• Comment line of ACE file：• Suffix ID：• PENDF file name:550.0 [K]./j40/ace/Fe056.ace./j40/xsd/Fe056.xsdir
Fe-056 from JENDL-4.0
0.10./j40/pendf/Fe056.pendf

The answer is next slide.

27

Modification of processing conditions(Neutron induced)
Input is modified to meetthe processing conditions.

ace_fast_mode // Processing mode
nucl_file_name./j40/lib/Fe056.dat
temp /* [K] */550.0
ace_file_name./j40/ace/Fe056.ace
Text data issurrounded by
ace_dir_file_name ./j40/xsd/Fe056.xsdir
single or double
ace_label_data‘Fe-056 from JENDL-4.0’ quotation mark.
suffix_id0.10
write_pendf_probability_table ./j40/pendf/Fe056.pendf
Adding PENDF output option

28

Example of FRENDY input (TSL)First line must be set
ace_tsl_mode // Processing mode
processing mode.
nucl_file_name../lib/H001.dat
nucl_file_name_tsl../lib_sab/01_h_in_h2o.txt
ace_label_data“HinH2O from JENDL-4.0”
temp296.0
Temperature prepared in TSL
ace_file_name./ace_sab/lwtr.ace
data file (nucl_file_name_tsl)
is only available.
ace_dir_file_name./xsd_sab/lwtr.xsdir
suffix_id0.50
S(α, β) identifier of MCNP
thermal_za_id_name “lwtr”(Maximum: 6 characters)• Processing conditions of above example• TSL data file name: ../lib_sab/01_h_in_h2o.txt• S(α, β) identifier of MCNP： lwtr
• lwtr：light water• This name is used in S(α, β) card of MCNP input.

29

Modification of processing conditions (TSL)• Please try to modify input file if processing conditions arechanged as follows:• Evaluated nuclear data file name：./j40/lib/C000.dat• TSL data file name：./j40/lib/31_graphite.txe• Temperature：
500.0 [K]• ACE file name：./j40/ace/graphite.ace• XSDIR file name：./j40/xsd/graphite.xsdir• Comment line of ACE file：
Graphite from JENDL-4.0• Suffix ID：
0.10• S(α, β) identifier of MCNP：
grph• PENDF file name:./j40/pendf/graphite.pendf

The answer is next slide.

30

Modification of processing conditions (TSL)
Input is modified to meetthe processing conditions.

ace_tsl_mode // Processing mode
nucl_file_name./j40/lib/C000.dat
nucl_file_name_tsl../lib_sab/31_graphite.txt
temp /* [K] */500.0
ace_file_name./j40/ace/graphite.ace
ace_dir_file_name./j40/xsd/graphite.xsdir
ace_label_data‘Graphite from JENDL-4.0’
suffix_id
0.10
thermal_za_id_name ‘grph’write_pendf_tsl./j40/pendf/graphite.pendf
Adding PENDF output option

31TSL data generation
for MCNP5 and PHITS 3.24

• Three types of ACE format is now available.
• IFENG=0 (discrete), 1 (skewed), 2 (continuous)• MCNP5 and PHITS ver.3.24 cannot treat IFENG=2.
• The default input option of FRENDY version 2 generates IFENG=2.
• Please add “weight_option” and modify parameter from “tabulated”
to “variable”.
ace_tsl_mode // Processing mode
nucl_file_name../lib/H001.dat
nucl_file_name_tsl../lib_sab/01_h_in_h2o.txt
ace_label_data“HinH2O from JENDL-4.0”
temp296.0
ace_file_name./ace_sab/lwtr.ace
ace_dir_file_name./xsd_sab/lwtr.xsdir
suffix_id0.50
thermal_za_id_name “lwtr”
weight_option
variable