mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Fix saving pendf in make_ace
This commit is contained in:
parent
09ce720dc1
commit
31e5a9e081
2 changed files with 9 additions and 7 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue