From 4d51fb6e5bdb9a4c05d5960d479a6994adfdef57 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 10 Nov 2015 10:00:52 -0500 Subject: [PATCH 1/4] changed p % E to p % last_E for collision and analog tallies and changed neutron velocity to cm/s --- docs/source/usersguide/input.rst | 2 +- src/constants.F90 | 2 +- src/tally.F90 | 40 ++++++++++++++++++++++---------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 04a6406dc8..0b132275bb 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -1507,7 +1507,7 @@ The ```` element accepts the following sub-elements: :inverse-velocity: The flux-weighted inverse velocity where the velocity is in units of - meters per second. + centimeters per second. .. note:: The ``analog`` estimator is actually identical to the ``collision`` diff --git a/src/constants.F90 b/src/constants.F90 index 375c517e76..1ca896c3f9 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -66,7 +66,7 @@ module constants MASS_NEUTRON_MEV = 939.565379_8, & ! mass of a neutron in MeV/c^2 MASS_PROTON = 1.007276466812_8, & ! mass of a proton in amu AMU = 1.660538921e-27_8, & ! 1 amu in kg - C_LIGHT = 2.99792458e8_8, & ! speed of light in m/s + C_LIGHT = 2.99792458e10_8, & ! speed of light in cm/s N_AVOGADRO = 0.602214129_8, & ! Avogadro's number in 10^24/mol K_BOLTZMANN = 8.6173324e-11_8, & ! Boltzmann constant in MeV/K INFINITY = huge(0.0_8), & ! positive infinity diff --git a/src/tally.F90 b/src/tally.F90 index fcd6dfdd9b..31bce232a0 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -65,6 +65,7 @@ contains real(8) :: macro_total ! material macro total xs real(8) :: macro_scatt ! material macro scatt xs real(8) :: uvw(3) ! particle direction + real(8) :: E ! particle energy type(Material), pointer :: mat type(Reaction), pointer :: rxn type(Nuclide), pointer :: nuc @@ -128,6 +129,14 @@ contains case (SCORE_INVERSE_VELOCITY) + + ! make sure the correct energy is used + if (t % estimator == ESTIMATOR_TRACKLENGTH) then + E = p % E + else + E = p % last_E + end if + if (t % estimator == ESTIMATOR_ANALOG) then ! All events score to an inverse velocity bin. We actually use a ! collision estimator in place of an analog one since there is no way @@ -140,11 +149,11 @@ contains score = p % last_wgt end if score = score / material_xs % total & - / (sqrt(TWO * p % E / (MASS_NEUTRON_MEV)) * C_LIGHT) + / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT) else - ! For inverse velocity, we need no cross section - score = flux / (sqrt(TWO * p % E / (MASS_NEUTRON_MEV)) * C_LIGHT) + ! For inverse velocity, we don't need a cross section + score = flux / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT) end if @@ -425,6 +434,13 @@ contains case (SCORE_DELAYED_NU_FISSION) + ! make sure the correct energy is used + if (t % estimator == ESTIMATOR_TRACKLENGTH) then + E = p % E + else + E = p % last_E + end if + ! Set the delayedgroup filter index and the number of delayed group bins dg_filter = t % find_filter(FILTER_DELAYEDGROUP) @@ -460,11 +476,11 @@ contains d = t % filters(dg_filter) % int_bins(d_bin) ! Compute the yield for this delayed group - yield = yield_delayed(nuc, p % E, d) + yield = yield_delayed(nuc, E, d) ! Compute the score and tally to bin score = p % absorb_wgt * yield * micro_xs(p % event_nuclide) & - % fission * nu_delayed(nuc, p % E) / & + % fission * nu_delayed(nuc, E) / & micro_xs(p % event_nuclide) % absorption call score_fission_delayed_dg(t, d_bin, score, score_index) end do @@ -474,7 +490,7 @@ contains ! by multiplying the absorbed weight by the fraction of the ! delayed-nu-fission xs to the absorption xs score = p % absorb_wgt * micro_xs(p % event_nuclide) & - % fission * nu_delayed(nuc, p % E) / & + % fission * nu_delayed(nuc, E) / & micro_xs(p % event_nuclide) % absorption end if end if @@ -528,11 +544,11 @@ contains d = t % filters(dg_filter) % int_bins(d_bin) ! Compute the yield for this delayed group - yield = yield_delayed(nuc, p % E, d) + yield = yield_delayed(nuc, E, d) ! Compute the score and tally to bin score = micro_xs(i_nuclide) % fission * yield & - * nu_delayed(nuc, p % E) * atom_density * flux + * nu_delayed(nuc, E) * atom_density * flux call score_fission_delayed_dg(t, d_bin, score, score_index) end do cycle SCORE_LOOP @@ -540,7 +556,7 @@ contains ! If the delayed group filter is not present, compute the score ! by multiplying the delayed-nu-fission macro xs by the flux - score = micro_xs(i_nuclide) % fission * nu_delayed(nuc, p % E)& + score = micro_xs(i_nuclide) % fission * nu_delayed(nuc, E)& * atom_density * flux end if @@ -572,11 +588,11 @@ contains nuc => nuclides(i_nuc) ! Get the yield for the desired nuclide and delayed group - yield = yield_delayed(nuc, p % E, d) + yield = yield_delayed(nuc, E, d) ! Compute the score and tally to bin score = micro_xs(i_nuc) % fission * yield & - * nu_delayed(nuc, p % E) * atom_density_ * flux + * nu_delayed(nuc, E) * atom_density_ * flux call score_fission_delayed_dg(t, d_bin, score, score_index) end do end do @@ -596,7 +612,7 @@ contains ! Accumulate the contribution from each nuclide score = score + micro_xs(i_nuc) % fission & - * nu_delayed(nuclides(i_nuc), p % E) * atom_density_ * flux + * nu_delayed(nuclides(i_nuc), E) * atom_density_ * flux end do end if end if From c16c43d8667efd6b10ea3ff949e4253d624107fe Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 10 Nov 2015 10:17:14 -0500 Subject: [PATCH 2/4] changed C_LIGHT back to m/s and changed velocity units in tally.F90 --- src/constants.F90 | 2 +- src/tally.F90 | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/constants.F90 b/src/constants.F90 index 1ca896c3f9..375c517e76 100644 --- a/src/constants.F90 +++ b/src/constants.F90 @@ -66,7 +66,7 @@ module constants MASS_NEUTRON_MEV = 939.565379_8, & ! mass of a neutron in MeV/c^2 MASS_PROTON = 1.007276466812_8, & ! mass of a proton in amu AMU = 1.660538921e-27_8, & ! 1 amu in kg - C_LIGHT = 2.99792458e10_8, & ! speed of light in cm/s + C_LIGHT = 2.99792458e8_8, & ! speed of light in m/s N_AVOGADRO = 0.602214129_8, & ! Avogadro's number in 10^24/mol K_BOLTZMANN = 8.6173324e-11_8, & ! Boltzmann constant in MeV/K INFINITY = huge(0.0_8), & ! positive infinity diff --git a/src/tally.F90 b/src/tally.F90 index 31bce232a0..a5d7f3f0de 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -148,12 +148,16 @@ contains else score = p % last_wgt end if + + ! Score the flux weighted inverse velocity with velocity in units of + ! cm/s score = score / material_xs % total & - / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT) + / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT * 100.0) else - ! For inverse velocity, we don't need a cross section - score = flux / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT) + ! For inverse velocity, we don't need a cross section. The velocity is + ! in units of cm/s. + score = flux / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT * 100.0) end if From 92e2a16b01568c61876d9c5b9b8142bdbb403d95 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 10 Nov 2015 11:50:17 -0500 Subject: [PATCH 3/4] fixed inverse velocity and delayed nu fission score tests --- src/tally.F90 | 4 +-- .../results_true.dat | 8 ++--- .../results_true.dat | 32 +++++++++---------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/tally.F90 b/src/tally.F90 index a5d7f3f0de..da4e828003 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -152,12 +152,12 @@ contains ! Score the flux weighted inverse velocity with velocity in units of ! cm/s score = score / material_xs % total & - / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT * 100.0) + / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT * 100.0_8) else ! For inverse velocity, we don't need a cross section. The velocity is ! in units of cm/s. - score = flux / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT * 100.0) + score = flux / (sqrt(TWO * E / (MASS_NEUTRON_MEV)) * C_LIGHT * 100.0_8) end if diff --git a/tests/test_score_delayed_nufission/results_true.dat b/tests/test_score_delayed_nufission/results_true.dat index d797baf18c..bc2b8e8a7f 100644 --- a/tests/test_score_delayed_nufission/results_true.dat +++ b/tests/test_score_delayed_nufission/results_true.dat @@ -19,11 +19,11 @@ tally 2: 1.976462E-02 1.953328E-04 tally 3: -1.687894E-02 -5.776176E-05 +1.686299E-02 +5.765477E-05 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00 -1.061803E-02 -2.308636E-05 +1.061240E-02 +2.305936E-05 diff --git a/tests/test_score_inverse_velocity/results_true.dat b/tests/test_score_inverse_velocity/results_true.dat index f86a8beb5b..8f2f84cc62 100644 --- a/tests/test_score_inverse_velocity/results_true.dat +++ b/tests/test_score_inverse_velocity/results_true.dat @@ -10,20 +10,20 @@ tally 1: 6.354432E-04 8.370608E-08 tally 2: -1.048031E-03 -2.263789E-07 -4.276093E-04 -4.136358E-08 -2.667795E-03 -1.528407E-06 -6.199140E-04 -7.840402E-08 +1.029200E-03 +2.180706E-07 +4.353200E-04 +4.363747E-08 +2.211790E-03 +1.055892E-06 +6.086777E-04 +7.589579E-08 tally 3: -1.048031E-03 -2.263789E-07 -4.276093E-04 -4.136358E-08 -2.667795E-03 -1.528407E-06 -6.199140E-04 -7.840402E-08 +1.029200E-03 +2.180706E-07 +4.353200E-04 +4.363747E-08 +2.211790E-03 +1.055892E-06 +6.086777E-04 +7.589579E-08 From cfae3d2c2c81e11b98a827615cc6946d1c6b3278 Mon Sep 17 00:00:00 2001 From: Sam Shaner Date: Tue, 10 Nov 2015 13:50:42 -0500 Subject: [PATCH 4/4] fixed output of inverse velocity test --- .../results_true.dat | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/test_score_inverse_velocity/results_true.dat b/tests/test_score_inverse_velocity/results_true.dat index 8f2f84cc62..740d31f16b 100644 --- a/tests/test_score_inverse_velocity/results_true.dat +++ b/tests/test_score_inverse_velocity/results_true.dat @@ -1,29 +1,29 @@ k-combined: 9.903196E-01 4.279617E-02 tally 1: -1.049628E-03 -2.261930E-07 -4.056389E-04 -3.411247E-08 -2.243766E-03 -1.069671E-06 -6.354432E-04 -8.370608E-08 +1.049628E-05 +2.261930E-11 +4.056389E-06 +3.411247E-12 +2.243766E-05 +1.069671E-10 +6.354432E-06 +8.370608E-12 tally 2: -1.029200E-03 -2.180706E-07 -4.353200E-04 -4.363747E-08 -2.211790E-03 -1.055892E-06 -6.086777E-04 -7.589579E-08 +1.029200E-05 +2.180706E-11 +4.353200E-06 +4.363747E-12 +2.211790E-05 +1.055892E-10 +6.086777E-06 +7.589579E-12 tally 3: -1.029200E-03 -2.180706E-07 -4.353200E-04 -4.363747E-08 -2.211790E-03 -1.055892E-06 -6.086777E-04 -7.589579E-08 +1.029200E-05 +2.180706E-11 +4.353200E-06 +4.363747E-12 +2.211790E-05 +1.055892E-10 +6.086777E-06 +7.589579E-12