From 31e5a9e081787d3430f63dcb879314a29ebc4a69 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Thu, 13 Apr 2017 07:20:05 -0500 Subject: [PATCH] Fix saving pendf in make_ace --- openmc/data/neutron.py | 6 ++++-- openmc/data/njoy.py | 10 +++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index b1ee7c5e35..4da0d08c38 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -850,7 +850,9 @@ class IncidentNeutron(EqualityMixin): # Run NJOY to create an ACE library ace_file = os.path.join(tmpdir, 'ace') xsdir_file = os.path.join(tmpdir, 'xsdir') - make_ace(filename, temperatures, ace_file, xsdir_file, **kwargs) + pendf_file = os.path.join(tmpdir, 'pendf') + make_ace(filename, temperatures, ace_file, xsdir_file, + pendf_file, **kwargs) # Create instance from ACE tables within library lib = Library(ace_file) @@ -864,7 +866,7 @@ class IncidentNeutron(EqualityMixin): data.fission_energy = FissionEnergyRelease.from_endf(ev) # Add 0K elastic scattering cross section - pendf = Evaluation('pendf') + pendf = Evaluation(pendf_file) file_obj = StringIO(pendf.section[3, 2]) get_head_record(file_obj) params, xs = get_tab1_record(file_obj) diff --git a/openmc/data/njoy.py b/openmc/data/njoy.py index 05216790a7..06f0020bad 100644 --- a/openmc/data/njoy.py +++ b/openmc/data/njoy.py @@ -227,7 +227,7 @@ def make_pendf(filename, pendf='pendf', stdout=False): def make_ace(filename, temperatures=None, ace='ace', xsdir='xsdir', - keep_pendf=False, **kwargs): + pendf=None, **kwargs): """Generate incident neutron ACE file from an ENDF file Parameters @@ -241,8 +241,8 @@ def make_ace(filename, temperatures=None, ace='ace', xsdir='xsdir', Path of ACE file to write xsdir : str, optional Path of xsdir file to write - keep_pendf : bool - Whether to retain PENDF file (written to 'pendf') + pendf : str, optional + Path of pendf file to write. If omitted, the pendf file is not saved. **kwargs Keyword arguments passed to :func:`openmc.data.njoy.run` @@ -275,8 +275,8 @@ def make_ace(filename, temperatures=None, ace='ace', xsdir='xsdir', commands = _ACE_TEMPLATE.format(**locals()) tapein = {20: filename} tapeout = {} - if keep_pendf: - tapeout[21] = 'pendf' + if pendf is not None: + tapeout[21] = pendf fname = '{}_{:.1f}' for i, temperature in enumerate(temperatures): # Extend input with an ACER run for each temperature