Merge pull request #1425 from paulromano/photon-data-fixes

Fix a number of problems related to photoatomic data
This commit is contained in:
Amanda Lund 2019-12-08 17:38:53 -06:00 committed by GitHub
commit 23e4d3ced2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View file

@ -616,17 +616,23 @@ class IncidentPhoton(EqualityMixin):
rx = PhotonReaction(mt)
data.reactions[mt] = rx
# Store cross section
# Store cross section, determining threshold
xs = ace.xss[idx : idx+n_energy].copy()
nonzero = (xs != 0.0)
xs[nonzero] = np.exp(xs[nonzero])
rx.xs = Tabulated1D(energy, xs, [n_energy], [5])
threshold = np.where(xs > 0.0)[0][0]
rx.xs = Tabulated1D(energy[threshold:], xs[threshold:],
[n_energy - threshold], [5])
idx += n_energy
# Copy binding energy
shell = _SUBSHELLS[d]
e = data.atomic_relaxation.binding_energy[shell]
rx.subshell_binding_energy = e
else:
raise ValueError("ACE table {} does not have subshell data. Only "
"newer ACE photoatomic libraries are supported "
"(e.g., eprdata14).".format(ace.name))
# Add bremsstrahlung DCS data
data._add_bremsstrahlung()
@ -990,7 +996,11 @@ class IncidentPhoton(EqualityMixin):
for mt, rx in self.reactions.items():
if mt >= 534 and mt <= 572:
shell = _REACTION_NAME[mt][1]
e_f = self.atomic_relaxation.energy_fluorescence(shell)
relax_data = self.atomic_relaxation
if relax_data is not None:
e_f = relax_data.energy_fluorescence(shell)
else:
e_f = 0.0
heating_xs += (energy - e_f) * rx.xs(energy)
heat_rx = PhotonReaction(525)

View file

@ -110,6 +110,11 @@ PhotonInteraction::PhotonInteraction(hid_t group, int i_element)
std::vector<std::string> designators;
read_attribute(rgroup, "designators", designators);
auto n_shell = designators.size();
if (n_shell == 0) {
throw std::runtime_error{"Photoatomic data for " + name_ +
" does not have subshell data."};
}
for (int i = 0; i < n_shell; ++i) {
const auto& designator {designators[i]};