generate heating number

This commit is contained in:
liangjg 2019-03-28 16:58:46 -04:00
parent deda8ce076
commit f5cff7baef
2 changed files with 10 additions and 9 deletions

View file

@ -523,8 +523,7 @@ class IncidentPhoton(EqualityMixin):
data.reactions[mt] = PhotonReaction.from_ace(ace, mt)
# Get heating cross sections [eV*barn] from factors [eV per collision]
# by multiplying with total xs (sum of (502, 504, 515, 517, 522))
# but currently we cannot do this right as we miss 517)
# by multiplying with total xs (sum of (502, 504, 515, 522))
data.reactions[525].xs.y *= sum([data.reactions[mt].xs.y for mt in
(502, 504, 515, 522)])
@ -658,7 +657,7 @@ class IncidentPhoton(EqualityMixin):
data._add_bremsstrahlung()
# Add heating cross sections
#data._compute_heating()
data._compute_heating()
return data
@ -909,12 +908,14 @@ class IncidentPhoton(EqualityMixin):
k = E/MASS_ELECTRON_EV
k_p = k/(1.0 + k*(1.0 - mu))
x = E * np.sqrt(0.5*(1.0 - mu)) / PLANCK_C
return np.pi * RE*RE * k_p/k * k_p/k * (k_p + 1.0/k_p +
return np.pi*RE*RE*k_p/k*k_p/k*(k_p + 1.0/k_p +
mu*mu - 1.0) * rx.scattering_factor(x)
def xs_mu_E(mu, E):
E_p = E/(1.0 + E/MASS_ELECTRON_EV*(1-mu))
return xs_mu(mu, E) * E_p
e_new = np.array([quad(xs_mu_E, -1, 1, args=(e,))[0]/quad(xs_mu, -1, 1, args=(e,))[0] for e in energy])
e_new = np.array([quad(xs_mu_E, -1, 1, args=(e,), epsabs=0.0,
epsrel=1.0e-3)[0] / quad(xs_mu, -1, 1, args=(e,),
epsabs=0.0, epsrel=1.0e-3)[0] for e in energy])
heating_xs += (energy - e_new)*rx.xs(energy)
if 515 in self:

View file

@ -1247,8 +1247,8 @@ score_general_ce(Particle* p, int i_tally, int start_index,
std::string element = name.substr(0, pos);
int i_element = data::element_map[element];
auto& heating {data::elements[i_element].heating_};
auto i_grid = simulation::micro_photon_xs[i_element].index_grid;
auto f = simulation::micro_photon_xs[i_element].interp_factor;
auto i_grid = p->photon_xs_[i_element].index_grid;
auto f = p->photon_xs_[i_element].interp_factor;
score = std::exp(heating(i_grid) + f * (heating(i_grid+1) -
heating(i_grid))) * atom_density * flux;
} else {
@ -1258,8 +1258,8 @@ score_general_ce(Particle* p, int i_tally, int start_index,
auto i_element = material.element_[i];
auto atom_density = material.atom_density_(i);
auto& heating {data::elements[i_element].heating_};
auto i_grid = simulation::micro_photon_xs[i_element].index_grid;
auto f = simulation::micro_photon_xs[i_element].interp_factor;
auto i_grid = p->photon_xs_[i_element].index_grid;
auto f = p->photon_xs_[i_element].interp_factor;
score += std::exp(heating(i_grid) + f * (heating(i_grid+1) -
heating(i_grid))) * atom_density * flux;
}