From d5723793994a2d9bc19083dd324e17af8705baa5 Mon Sep 17 00:00:00 2001 From: Paul Romano Date: Fri, 6 Sep 2019 16:26:44 -0500 Subject: [PATCH] Fix reading of Debye-Waller for incoherent elastic --- include/openmc/thermal.h | 5 ----- src/secondary_thermal.cpp | 2 +- src/thermal.cpp | 14 ++------------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/include/openmc/thermal.h b/include/openmc/thermal.h index a084c1888..cb6a7ce7b 100644 --- a/include/openmc/thermal.h +++ b/include/openmc/thermal.h @@ -76,11 +76,6 @@ private: std::unique_ptr distribution; //!< Secondary angle-energy distribution }; - //! Upper threshold for incoherent inelastic scattering (usually ~4 eV) - double threshold_inelastic_; - //! Upper threshold for coherent/incoherent elastic scattering - double threshold_elastic_ {0.0}; - // Inelastic scattering data Reaction elastic_; Reaction inelastic_; diff --git a/src/secondary_thermal.cpp b/src/secondary_thermal.cpp index 696907a17..8c9cc6967 100644 --- a/src/secondary_thermal.cpp +++ b/src/secondary_thermal.cpp @@ -61,7 +61,7 @@ CoherentElasticAE::sample(double E_in, double& E_out, double& mu) const IncoherentElasticAE::IncoherentElasticAE(hid_t group) { - read_attribute(group, "debye_waller", debye_waller_); + read_dataset(group, "debye_waller", debye_waller_); } void diff --git a/src/thermal.cpp b/src/thermal.cpp index 5cc395e13..49b522376 100644 --- a/src/thermal.cpp +++ b/src/thermal.cpp @@ -210,22 +210,15 @@ ThermalData::ThermalData(hid_t group) if (temp == "coherent_elastic") { auto xs = dynamic_cast(elastic_.xs.get()); elastic_.distribution = std::make_unique(*xs); - - // Set threshold energy - threshold_elastic_ = xs->bragg_edges().back(); - } else { - auto xs = dynamic_cast(elastic_.xs.get()); if (temp == "incoherent_elastic") { elastic_.distribution = std::make_unique(dgroup); } else if (temp == "incoherent_elastic_discrete") { + auto xs = dynamic_cast(elastic_.xs.get()); elastic_.distribution = std::make_unique( dgroup, xs->x() ); } - - // Set threshold energy - threshold_elastic_ = xs->x().back(); } close_group(elastic_group); @@ -239,10 +232,6 @@ ThermalData::ThermalData(hid_t group) // Read inelastic cross section inelastic_.xs = read_function(inelastic_group, "xs"); - // Set inelastic threshold - auto xs = dynamic_cast(inelastic_.xs.get()); - threshold_inelastic_ = xs->x().back(); - // Read angle-energy distribution hid_t dgroup = open_group(inelastic_group, "distribution"); std::string temp; @@ -250,6 +239,7 @@ ThermalData::ThermalData(hid_t group) if (temp == "incoherent_inelastic") { inelastic_.distribution = std::make_unique(dgroup); } else if (temp == "incoherent_inelastic_discrete") { + auto xs = dynamic_cast(inelastic_.xs.get()); inelastic_.distribution = std::make_unique( dgroup, xs->x() );