mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
Add bindings for getting multipole attributes of Nuclide
This commit is contained in:
parent
e8af7a2d16
commit
b34283ca40
3 changed files with 31 additions and 13 deletions
|
|
@ -160,7 +160,11 @@ extern "C" MaterialMacroXS material_xs;
|
|||
// Fortran compatibility
|
||||
//==============================================================================
|
||||
|
||||
void set_micro_xs();
|
||||
extern "C" void set_micro_xs();
|
||||
extern "C" bool nuclide_wmp_present(int i_nuclide);
|
||||
extern "C" double nuclide_wmp_emin(int i_nuclide);
|
||||
extern "C" double nuclide_wmp_emax(int i_nuclide);
|
||||
|
||||
|
||||
} // namespace openmc
|
||||
|
||||
|
|
|
|||
|
|
@ -1556,4 +1556,23 @@ contains
|
|||
end if
|
||||
end function openmc_nuclide_name
|
||||
|
||||
function nuclide_wmp_present(i_nuclide) result(b) bind(C)
|
||||
integer(C_INT), value :: i_nuclide
|
||||
logical(C_BOOL) :: b
|
||||
b = nuclides(i_nuclide) % mp_present
|
||||
end function
|
||||
|
||||
function nuclide_wmp_emin(i_nuclide) result(E) bind(C)
|
||||
integer(C_INT), value :: i_nuclide
|
||||
real(C_DOUBLE) :: E
|
||||
E = nuclides(i_nuclide) % multipole % E_min
|
||||
end function
|
||||
|
||||
function nuclide_wmp_emax(i_nuclide) result(E) bind(C)
|
||||
integer(C_INT), value :: i_nuclide
|
||||
real(C_DOUBLE) :: E
|
||||
E = nuclides(i_nuclide) % multipole % E_max
|
||||
end function
|
||||
|
||||
|
||||
end module nuclide_header
|
||||
|
|
|
|||
|
|
@ -505,12 +505,11 @@ Reaction* sample_fission(int i_nuclide, double E)
|
|||
|
||||
// Check to see if we are in a windowed multipole range. WMP only supports
|
||||
// the first fission reaction.
|
||||
// if (nuc % mp_present) {
|
||||
// if (E >= nuc % multipole % E_min && &
|
||||
// E <= nuc % multipole % E_max) {
|
||||
// return nuc->fission_rx_[0];
|
||||
// }
|
||||
// }
|
||||
if (nuclide_wmp_present(i_nuclide)) {
|
||||
if (E >= nuclide_wmp_emin(i_nuclide) && E <= nuclide_wmp_emax(i_nuclide)) {
|
||||
return nuc->fission_rx_[0];
|
||||
}
|
||||
}
|
||||
|
||||
// Get grid index and interpolatoin factor and sample fission cdf
|
||||
int i_temp = simulation::micro_xs[i_nuclide-1].index_temp - 1;
|
||||
|
|
@ -628,12 +627,8 @@ void scatter(Particle* p, int i_nuclide, int i_nuc_mat)
|
|||
// NON-S(A,B) ELASTIC SCATTERING
|
||||
|
||||
// Determine temperature
|
||||
double kT;
|
||||
// if (nuc % mp_present) {
|
||||
// kT = p->sqrtkT**2
|
||||
// } else {
|
||||
kT = nuc->kTs_[i_temp];
|
||||
// }
|
||||
double kT = nuclide_wmp_present(i_nuclide) ?
|
||||
p->sqrtkT*p->sqrtkT : nuc->kTs_[i_temp];
|
||||
|
||||
// Perform collision physics for elastic scattering
|
||||
elastic_scatter(i_nuclide, nuc->reactions_[0].get(), kT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue