From 477da9b47dd7aec81c5ada5056559cc004b7db7f Mon Sep 17 00:00:00 2001 From: Qingming He <906459647@qq.com> Date: Tue, 11 Oct 2016 14:35:09 -0400 Subject: [PATCH] add energy_cutoff Kill particles under certain energy --- src/global.F90 | 1 + src/input_xml.F90 | 11 +++++++++-- src/physics.F90 | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/global.F90 b/src/global.F90 index a5720464de..042d530f37 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -304,6 +304,7 @@ module global logical :: survival_biasing = .false. real(8) :: weight_cutoff = 0.25_8 + real(8) :: energy_cutoff = ZERO real(8) :: weight_survive = ONE ! ============================================================================ diff --git a/src/input_xml.F90 b/src/input_xml.F90 index c92ceee8c5..18af461a79 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -659,8 +659,15 @@ contains ! Cutoffs if (check_for_node(doc, "cutoff")) then call get_node_ptr(doc, "cutoff", node_cutoff) - call get_node_value(node_cutoff, "weight", weight_cutoff) - call get_node_value(node_cutoff, "weight_avg", weight_survive) + if (check_for_node(node_cutoff, "weight")) then + call get_node_value(node_cutoff, "weight", weight_cutoff) + end if + if (check_for_node(node_cutoff, "weight_avg")) then + call get_node_value(node_cutoff, "weight_avg", weight_survive) + end if + if (check_for_node(node_cutoff, "energy")) then + call get_node_value(node_cutoff, "energy", energy_cutoff) + end if end if ! Particle trace diff --git a/src/physics.F90 b/src/physics.F90 index 232effebf3..842540d166 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -127,6 +127,13 @@ contains if (.not. p % alive) return end if + ! Kill neutron under certain energy + if (p % E < energy_cutoff) then + p % alive = .false. + p % wgt = ZERO + p % last_wgt = ZERO + end if + end subroutine sample_reaction !===============================================================================