diff --git a/.travis.yml b/.travis.yml index 676bfb42f..e922eba6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ install: true before_script: - if [[ ! -e $HOME/nndc_hdf5/cross_sections.xml ]]; then - wget https://anl.box.com/shared/static/fouwc8lh9he2wc97kzq65u4rp8zt9sgq.xz -O - | tar -C $HOME -xvJ; + wget https://anl.box.com/shared/static/1ow880up90hgwynvh91twwfteameuwre.xz -O - | tar -C $HOME -xvJ; fi - export OPENMC_CROSS_SECTIONS=$HOME/nndc_hdf5/cross_sections.xml diff --git a/docs/source/io_formats/mgxs_library.rst b/docs/source/io_formats/mgxs_library.rst index 4e5ea2196..fd00ad8c3 100644 --- a/docs/source/io_formats/mgxs_library.rst +++ b/docs/source/io_formats/mgxs_library.rst @@ -30,7 +30,7 @@ MGXS Library Specification :Attributes: - **groups** (*int*) -- Number of energy groups - **group structure** (*double[]*) -- Monotonically increasing - list of group boundaries, in units of MeV. The length of this + list of group boundaries, in units of eV. The length of this array should be the number of groups plus 1. **//** @@ -77,8 +77,8 @@ data for the nuclide or material that it represents. **//kTs/** -:Datasets: - - **K** (*double*) -- kT values (in MeV) for each Temperature +:Datasets: + - **K** (*double*) -- kT values (in eV) for each temperature TTT (in Kelvin), rounded to the nearest integer **//K/** @@ -161,4 +161,4 @@ Data specific to neutron scattering for the temperature K 1.0) will be assumed. The pre-flattened array is shapes consistent with `scatter_matrix` except the "[Order]" dimension in `scatter_shape` is ignored since - this data is assumed isotropic. \ No newline at end of file + this data is assumed isotropic. diff --git a/docs/source/io_formats/nuclear_data.rst b/docs/source/io_formats/nuclear_data.rst index 060e96c0c..4a9b82b1c 100644 --- a/docs/source/io_formats/nuclear_data.rst +++ b/docs/source/io_formats/nuclear_data.rst @@ -27,14 +27,14 @@ temperature-dependent data set. For example, the data set corresponding to 300 Kelvin would be located at `300K`. :Datasets: - - **K** (*double*) -- kT values (in MeV) for each Temperature + - **K** (*double*) -- kT values (in eV) for each temperature TTT (in Kelvin) **//reactions/reaction_/** :Attributes: - **mt** (*int*) -- ENDF MT reaction number - **label** (*char[]*) -- Name of the reaction - - **Q_value** (*double*) -- Q value in MeV + - **Q_value** (*double*) -- Q value in eV - **center_of_mass** (*int*) -- Whether the reference frame for scattering is center-of-mass (1) or laboratory (0) - **n_product** (*int*) -- Number of reaction products @@ -129,7 +129,7 @@ temperature-dependent data set. For example, the data set corresponding to 300 Kelvin would be located at `300K`. :Datasets: - - **K** (*double*) -- kT values (in MeV) for each Temperature + - **K** (*double*) -- kT values (in eV) for each temperature TTT (in Kelvin) **//elastic/K/** @@ -333,7 +333,7 @@ N-Body Phase Space - **n_particles** (*int*) -- Number of product particles - **atomic_weight_ratio** (*double*) -- Atomic weight ratio of the target nuclide in neutron masses - - **q_value** (*double*) -- Q value for the reaction in MeV + - **q_value** (*double*) -- Q value for the reaction in eV .. _energy_distribution: @@ -346,7 +346,7 @@ Maxwell :Object type: Group :Attributes: - **type** (*char[]*) -- 'maxwell' - - **u** (*double*) -- Restriction energy in MeV + - **u** (*double*) -- Restriction energy in eV :Datasets: - **theta** (:ref:`tabulated <1d_tabulated>`) -- Maxwellian temperature as a function of energy @@ -356,7 +356,7 @@ Evaporation :Object type: Group :Attributes: - **type** (*char[]*) -- 'evaporation' - - **u** (*double*) -- Restriction energy in MeV + - **u** (*double*) -- Restriction energy in eV :Datasets: - **theta** (:ref:`tabulated <1d_tabulated>`) -- Evaporation temperature as a function of energy @@ -366,7 +366,7 @@ Watt Fission Spectrum :Object type: Group :Attributes: - **type** (*char[]*) -- 'watt' - - **u** (*double*) -- Restriction energy in MeV + - **u** (*double*) -- Restriction energy in eV :Datasets: - **a** (:ref:`tabulated <1d_tabulated>`) -- Watt parameter :math:`a` as a function of incident energy - **b** (:ref:`tabulated <1d_tabulated>`) -- Watt parameter :math:`b` @@ -386,7 +386,7 @@ Discrete Photon :Object type: Group :Attributes: - **type** (*char[]*) -- 'discrete_photon' - **primary_flag** (*int*) -- Whether photon is a primary - - **energy** (*double*) -- Photon energy in MeV + - **energy** (*double*) -- Photon energy in eV - **atomic_weight_ratio** (*double*) -- Atomic weight ratio of target nuclide in neutron masses @@ -396,7 +396,7 @@ Level Inelastic :Object type: Group :Attributes: - **type** (*char[]*) -- 'level' - **threshold** (*double*) -- Energy threshold in the laboratory - system in MeV + system in eV - **mass_ratio** (*double*) -- :math:`(A/(A + 1))^2` Continuous Tabular diff --git a/docs/source/io_formats/particle_restart.rst b/docs/source/io_formats/particle_restart.rst index c30eda318..3dee8c47d 100644 --- a/docs/source/io_formats/particle_restart.rst +++ b/docs/source/io_formats/particle_restart.rst @@ -46,7 +46,7 @@ The current revision of the particle restart file format is 1. **/energy** (*double*) - Energy of the particle in MeV for continuous-energy mode, or the energy + Energy of the particle in eV for continuous-energy mode, or the energy group of the particle for multi-group mode. **/xyz** (*double[3]*) diff --git a/docs/source/usersguide/input.rst b/docs/source/usersguide/input.rst index 74de4caa4..26f3bdc04 100644 --- a/docs/source/usersguide/input.rst +++ b/docs/source/usersguide/input.rst @@ -1520,7 +1520,7 @@ The ```` element accepts the following sub-elements: .. code-block:: xml - + then two energy bins will be created, one with energies between 0 and 1 MeV and the other with energies between 1 and 20 MeV. @@ -1535,7 +1535,7 @@ The ```` element accepts the following sub-elements: .. code-block:: xml - + then two post-collision energy bins will be created, one with energies between 0 and 1 MeV and the other with energies between @@ -1854,7 +1854,7 @@ The ```` element accepts the following sub-elements: | |particles. The neutrino energy does not contribute | | |to this response. The prompt and delayed | | |:math:`\gamma`-rays are assumed to deposit their | - | |energy locally. Units are MeV per source particle. | + | |energy locally. Units are eV per source particle. | +----------------------+---------------------------------------------------+ |fission-q-prompt |The prompt fission energy production rate. This | | |energy comes in the form of fission fragment | @@ -1863,7 +1863,7 @@ The ```` element accepts the following sub-elements: | |incident energy and it requires that the nuclear | | |data library contains the optional fission energy | | |release data. Energy is assumed to be deposited | - | |locally. Units are MeV per source particle. | + | |locally. Units are eV per source particle. | +----------------------+---------------------------------------------------+ |fission-q-recoverable |The recoverable fission energy production rate. | | |This energy comes in the form of fission fragment | @@ -1874,7 +1874,7 @@ The ```` element accepts the following sub-elements: | |incident neutron energy and it requires that the | | |nuclear data library contains the optional fission | | |energy release data. Energy is assumed to be | - | |deposited locally. Units are MeV per source | + | |deposited locally. Units are eV per source | | |paticle. | +----------------------+---------------------------------------------------+ |decay-rate |The delayed-nu-fission-weighted decay rate where | @@ -2256,7 +2256,7 @@ attributes/sub-elements: The width of mesh cells in each direction. :energy: - Energy bins [in MeV], listed in ascending order (e.g. 0.0 0.625e-7 20.0) + Energy bins [in eV], listed in ascending order (e.g. 0.0 0.625 20.0e6) for CMFD tallies and acceleration. If no energy bins are listed, OpenMC automatically assumes a one energy group calculation over the entire energy range. diff --git a/examples/python/basic/build-xml.py b/examples/python/basic/build-xml.py index 5a3fae740..4dc1c72e0 100644 --- a/examples/python/basic/build-xml.py +++ b/examples/python/basic/build-xml.py @@ -101,8 +101,8 @@ settings_file.export_to_xml() # Instantiate some tally Filters cell_filter = openmc.CellFilter(100) -energy_filter = openmc.EnergyFilter([0., 20.]) -energyout_filter = openmc.EnergyoutFilter([0., 20.]) +energy_filter = openmc.EnergyFilter([0., 20.e6]) +energyout_filter = openmc.EnergyoutFilter([0., 20.e6]) # Instantiate the first Tally first_tally = openmc.Tally(tally_id=1, name='first tally') diff --git a/examples/python/pincell/build-xml.py b/examples/python/pincell/build-xml.py index 534c3ab82..979614d63 100644 --- a/examples/python/pincell/build-xml.py +++ b/examples/python/pincell/build-xml.py @@ -181,7 +181,7 @@ mesh.lower_left = [-0.62992, -0.62992, -1.e50] mesh.upper_right = [0.62992, 0.62992, 1.e50] # Instantiate some tally Filters -energy_filter = openmc.EnergyFilter([0., 4.e-6, 20.]) +energy_filter = openmc.EnergyFilter([0., 4., 20.e6]) mesh_filter = openmc.MeshFilter(mesh) # Instantiate the Tally diff --git a/examples/python/pincell_multigroup/build-xml.py b/examples/python/pincell_multigroup/build-xml.py index 1dcfc896b..ee74233c1 100644 --- a/examples/python/pincell_multigroup/build-xml.py +++ b/examples/python/pincell_multigroup/build-xml.py @@ -15,8 +15,8 @@ particles = 1000 ############################################################################### # Instantiate the energy group data -groups = openmc.mgxs.EnergyGroups(group_edges=[1E-11, 0.0635E-6, 10.0E-6, - 1.0E-4, 1.0E-3, 0.5, 1.0, 20.0]) +groups = openmc.mgxs.EnergyGroups(group_edges=[ + 1e-5, 0.0635, 10.0, 1.0e2, 1.0e3, 0.5e6, 1.0e6, 20.0e6]) # Instantiate the 7-group (C5G7) cross section data uo2_xsdata = openmc.XSdata('UO2', groups) @@ -156,8 +156,8 @@ mesh.lower_left = [-0.63, -0.63, -1.e50] mesh.upper_right = [0.63, 0.63, 1.e50] # Instantiate some tally Filters -energy_filter = openmc.EnergyFilter([1E-11, 0.0635E-6, 10.0E-6, 1.0E-4, 1.0E-3, - 0.5, 1.0, 20.0]) +energy_filter = openmc.EnergyFilter([1e-5, 0.0635, 10.0, 1.0e2, 1.0e3, 0.5e6, + 1.0e6, 20.0e6]) mesh_filter = openmc.MeshFilter(mesh) # Instantiate the Tally diff --git a/examples/xml/basic/tallies.xml b/examples/xml/basic/tallies.xml index fb1dfbc9c..26e61995d 100644 --- a/examples/xml/basic/tallies.xml +++ b/examples/xml/basic/tallies.xml @@ -8,14 +8,14 @@ - + total scatter nu-scatter absorption fission nu-fission - - + + scatter nu-scatter nu-fission diff --git a/examples/xml/pincell/tallies.xml b/examples/xml/pincell/tallies.xml index 73242b913..f740530cf 100644 --- a/examples/xml/pincell/tallies.xml +++ b/examples/xml/pincell/tallies.xml @@ -9,7 +9,7 @@ - + flux fission nu-fission diff --git a/examples/xml/pincell_multigroup/mgxs.h5 b/examples/xml/pincell_multigroup/mgxs.h5 index fe93c44bf..77f445c6d 100644 Binary files a/examples/xml/pincell_multigroup/mgxs.h5 and b/examples/xml/pincell_multigroup/mgxs.h5 differ diff --git a/openmc/cmfd.py b/openmc/cmfd.py index 51acf4d42..4e1fccb8b 100644 --- a/openmc/cmfd.py +++ b/openmc/cmfd.py @@ -39,8 +39,8 @@ class CMFDMesh(object): width : Iterable of float The width of mesh cells in each direction. energy : Iterable of float - Energy bins in MeV, listed in ascending order (e.g. [0.0, 0.625e-7, - 20.0]) for CMFD tallies and acceleration. If no energy bins are listed, + Energy bins in eV, listed in ascending order (e.g. [0.0, 0.625e-1, + 20.0e6]) for CMFD tallies and acceleration. If no energy bins are listed, OpenMC automatically assumes a one energy group calculation over the entire energy range. albedo : Iterable of float diff --git a/openmc/data/angle_distribution.py b/openmc/data/angle_distribution.py index 669951059..ad3ba8919 100644 --- a/openmc/data/angle_distribution.py +++ b/openmc/data/angle_distribution.py @@ -9,6 +9,7 @@ import openmc.checkvalue as cv from openmc.mixin import EqualityMixin from openmc.stats import Univariate, Tabular, Uniform, Legendre from .function import INTERPOLATION_SCHEME +from .data import EV_PER_MEV from .endf import get_head_record, get_cont_record, get_tab1_record, \ get_list_record, get_tab2_record @@ -19,14 +20,14 @@ class AngleDistribution(EqualityMixin): Parameters ---------- energy : Iterable of float - Incoming energies at which distributions exist + Incoming energies in eV at which distributions exist mu : Iterable of openmc.stats.Univariate Distribution of scattering cosines corresponding to each incoming energy Attributes ---------- energy : Iterable of float - Incoming energies at which distributions exist + Incoming energies in eV at which distributions exist mu : Iterable of openmc.stats.Univariate Distribution of scattering cosines corresponding to each incoming energy @@ -167,7 +168,7 @@ class AngleDistribution(EqualityMixin): idx += 1 # Incoming energy grid - energy = ace.xss[idx:idx + n_energies] + energy = ace.xss[idx:idx + n_energies]*EV_PER_MEV idx += n_energies # Read locations for angular distributions diff --git a/openmc/data/correlated.py b/openmc/data/correlated.py index dac1968ad..49d116efd 100644 --- a/openmc/data/correlated.py +++ b/openmc/data/correlated.py @@ -9,6 +9,7 @@ from openmc.stats import Tabular, Univariate, Discrete, Mixture, \ Uniform, Legendre from .function import INTERPOLATION_SCHEME from .angle_energy import AngleEnergy +from .data import EV_PER_MEV from .endf import get_list_record, get_tab2_record @@ -328,7 +329,7 @@ class CorrelatedAngleEnergy(AngleEnergy): # Incoming energies at which distributions exist idx += 2*n_regions + 1 - energy = ace.xss[idx:idx + n_energy_in] + energy = ace.xss[idx:idx + n_energy_in]*EV_PER_MEV # Location of distributions idx += n_energy_in @@ -353,12 +354,13 @@ class CorrelatedAngleEnergy(AngleEnergy): # Secondary energy distribution n_energy_out = int(ace.xss[idx + 1]) - data = ace.xss[idx + 2:idx + 2 + 4*n_energy_out] + data = ace.xss[idx + 2:idx + 2 + 4*n_energy_out].copy() data.shape = (4, n_energy_out) + data[0,:] *= EV_PER_MEV # Create continuous distribution eout_continuous = Tabular(data[0][n_discrete_lines:], - data[1][n_discrete_lines:], + data[1][n_discrete_lines:]/EV_PER_MEV, INTERPOLATION_SCHEME[intt], ignore_negative=True) eout_continuous.c = data[2][n_discrete_lines:] diff --git a/openmc/data/data.py b/openmc/data/data.py index 46fcdf36f..1f759d3d4 100644 --- a/openmc/data/data.py +++ b/openmc/data/data.py @@ -165,7 +165,10 @@ def atomic_mass(isotope): return _ATOMIC_MASS.get(isotope.lower()) -# The value of the Boltzman constant in units of MeV / K +# The value of the Boltzman constant in units of eV / K # Values here are from the Committee on Data for Science and Technology # (CODATA) 2010 recommendation (doi:10.1103/RevModPhys.84.1527). -K_BOLTZMANN = 8.6173324E-11 +K_BOLTZMANN = 8.6173324e-5 + +# Used for converting units in ACE data +EV_PER_MEV = 1.0e6 diff --git a/openmc/data/energy_distribution.py b/openmc/data/energy_distribution.py index c1762d5bc..c3740beaf 100644 --- a/openmc/data/energy_distribution.py +++ b/openmc/data/energy_distribution.py @@ -10,6 +10,7 @@ from .function import Tabulated1D, INTERPOLATION_SCHEME from openmc.stats.univariate import Univariate, Tabular, Discrete, Mixture import openmc.checkvalue as cv from openmc.mixin import EqualityMixin +from .data import EV_PER_MEV from .endf import get_tab1_record, get_tab2_record @@ -318,13 +319,14 @@ class MaxwellEnergy(EnergyDistribution): Maxwell distribution """ - # Read nuclear temperature + # Read nuclear temperature -- since units are MeV, convert to eV theta = Tabulated1D.from_ace(ace, idx) + theta.y *= EV_PER_MEV # Restriction energy nr = int(ace.xss[idx]) ne = int(ace.xss[idx + 1 + 2*nr]) - u = ace.xss[idx + 2 + 2*nr + 2*ne] + u = ace.xss[idx + 2 + 2*nr + 2*ne]*EV_PER_MEV return cls(theta, u) @@ -450,13 +452,14 @@ class Evaporation(EnergyDistribution): Evaporation spectrum """ - # Read nuclear temperature + # Read nuclear temperature -- since units are MeV, convert to eV theta = Tabulated1D.from_ace(ace, idx) + theta.y *= EV_PER_MEV # Restriction energy nr = int(ace.xss[idx]) ne = int(ace.xss[idx + 1 + 2*nr]) - u = ace.xss[idx + 2 + 2*nr + 2*ne] + u = ace.xss[idx + 2 + 2*nr + 2*ne]*EV_PER_MEV return cls(theta, u) @@ -597,16 +600,18 @@ class WattEnergy(EnergyDistribution): Watt fission spectrum """ - # Energy-dependent a parameter + # Energy-dependent a parameter -- units are MeV, convert to eV a = Tabulated1D.from_ace(ace, idx) + a.y *= EV_PER_MEV # Advance index nr = int(ace.xss[idx]) ne = int(ace.xss[idx + 1 + 2*nr]) idx += 2 + 2*nr + 2*ne - # Energy-dependent b parameter + # Energy-dependent b parameter -- units are MeV^-1 b = Tabulated1D.from_ace(ace, idx) + b.y /= EV_PER_MEV # Advance index nr = int(ace.xss[idx]) @@ -614,7 +619,7 @@ class WattEnergy(EnergyDistribution): idx += 2 + 2*nr + 2*ne # Restriction energy - u = ace.xss[idx] + u = ace.xss[idx]*EV_PER_MEV return cls(a, b, u) @@ -887,7 +892,7 @@ class DiscretePhoton(EnergyDistribution): """ primary_flag = int(ace.xss[idx]) - energy = ace.xss[idx + 1] + energy = ace.xss[idx + 1]*EV_PER_MEV return cls(primary_flag, energy, ace.atomic_weight_ratio) @@ -983,7 +988,8 @@ class LevelInelastic(EnergyDistribution): Level inelastic scattering distribution """ - threshold, mass_ratio = ace.xss[idx:idx + 2] + threshold = ace.xss[idx]*EV_PER_MEV + mass_ratio = ace.xss[idx + 1] return cls(threshold, mass_ratio) @@ -1221,7 +1227,7 @@ class ContinuousTabular(EnergyDistribution): # Incoming energies at which distributions exist idx += 2*n_regions + 1 - energy = ace.xss[idx:idx + n_energy_in] + energy = ace.xss[idx:idx + n_energy_in]*EV_PER_MEV # Location of distributions idx += n_energy_in @@ -1244,12 +1250,13 @@ class ContinuousTabular(EnergyDistribution): intt = 2 n_energy_out = int(ace.xss[idx + 1]) - data = ace.xss[idx + 2:idx + 2 + 3*n_energy_out] + data = ace.xss[idx + 2:idx + 2 + 3*n_energy_out].copy() data.shape = (3, n_energy_out) + data[0,:] *= EV_PER_MEV # Create continuous distribution eout_continuous = Tabular(data[0][n_discrete_lines:], - data[1][n_discrete_lines:], + data[1][n_discrete_lines:]/EV_PER_MEV, INTERPOLATION_SCHEME[intt]) eout_continuous.c = data[2][n_discrete_lines:] diff --git a/openmc/data/fission_Q_data_endfb71.h5 b/openmc/data/fission_Q_data_endfb71.h5 index 7cc5a86b5..6e74e90aa 100644 Binary files a/openmc/data/fission_Q_data_endfb71.h5 and b/openmc/data/fission_Q_data_endfb71.h5 differ diff --git a/openmc/data/fission_energy.py b/openmc/data/fission_energy.py index 1746d62c8..5ce9f47d5 100644 --- a/openmc/data/fission_energy.py +++ b/openmc/data/fission_energy.py @@ -6,22 +6,20 @@ import sys import h5py import numpy as np -from .data import ATOMIC_SYMBOL +from .data import ATOMIC_SYMBOL, EV_PER_MEV from .endf import get_cont_record, get_list_record, Evaluation from .function import Function1D, Tabulated1D, Polynomial, Sum import openmc.checkvalue as cv from openmc.mixin import EqualityMixin -def _extract_458_data(ev, units='eV'): +def _extract_458_data(ev): """Read an ENDF file and extract the MF=1, MT=458 values. Parameters ---------- ev : openmc.data.Evaluation ENDF evaluation - units : {'eV', 'MeV'} - The units that are used in values returned. Returns ------- @@ -38,7 +36,6 @@ def _extract_458_data(ev, units='eV'): """ cv.check_type('evaluation', ev, Evaluation) - cv.check_value('energy units', units, ('eV', 'MeV')) if not ev.target['fissionable']: # This nuclide isn't fissionable. @@ -84,17 +81,10 @@ def _extract_458_data(ev, units='eV'): # If we found the error, reduce all 2nd-order coeffs by 10**6. if error_present: - for coeffs in value.values(): coeffs[2] *= 1e-6 - for coeffs in uncertainty.values(): coeffs[2] *= 1e-6 - - # Convert eV to MeV. - if units == 'MeV': - for coeffs in value.values(): - for i in range(len(coeffs)): - coeffs[i] *= 10**(-6 + 6*i) - for coeffs in uncertainty.values(): - for i in range(len(coeffs)): - coeffs[i] *= 10**(-6 + 6*i) + for coeffs in value.values(): + coeffs[2] /= EV_PER_MEV + for coeffs in uncertainty.values(): + coeffs[2] /= EV_PER_MEV return value, uncertainty @@ -161,7 +151,7 @@ def write_compact_458_library(endf_files, output_name='fission_Q_data.h5', continue # Get the important bits. - data = _extract_458_data(ev, 'MeV') + data = _extract_458_data(ev) if data is None: continue value, uncertainty = data @@ -356,7 +346,7 @@ class FissionEnergyRelease(EqualityMixin): self._neutrinos = energy_release @classmethod - def _from_dictionary(cls, energy_release, incident_neutron, units='eV'): + def _from_dictionary(cls, energy_release, incident_neutron): """Generate fission energy release data from a dictionary. Parameters @@ -368,8 +358,6 @@ class FissionEnergyRelease(EqualityMixin): data, more for polynomial data. incident_neutron : openmc.data.IncidentNeutron Corresponding incident neutron dataset - units : {'eV', 'MeV'} - The energy units used in the returned object. Returns ------- @@ -377,8 +365,6 @@ class FissionEnergyRelease(EqualityMixin): Fission energy release data """ - cv.check_value('energy units', units, ('eV', 'MeV')) - out = cls() # How many coefficients are given for each component? If we only find @@ -429,28 +415,24 @@ class FissionEnergyRelease(EqualityMixin): raise ValueError('Ambiguous prompt/total nu value.') nu = nu[0] - if units == 'eV': - nu_const = 8.07e6 - else: - nu_const = 8.07 if isinstance(nu, Tabulated1D): ENP = deepcopy(nu) ENP.y = (energy_release['ENP'] + 1.307 * nu.x - - nu_const * (nu.y - nu.y[0])) + - 8.07e6 * (nu.y - nu.y[0])) elif isinstance(nu, Polynomial): if len(nu) == 1: ENP = Polynomial([energy_release['ENP'][0], 1.307]) else: ENP = Polynomial( - [energy_release['ENP'][0], 1.307 - nu_const*nu.coef[1]] - + [-nu_const*c for c in nu.coef[2:]]) + [energy_release['ENP'][0], 1.307 - 8.07e6*nu.coef[1]] + + [-8.07e6*c for c in nu.coef[2:]]) out.prompt_neutrons = ENP return out @classmethod - def from_endf(cls, ev, incident_neutron, units='eV'): + def from_endf(cls, ev, incident_neutron): """Generate fission energy release data from an ENDF file. Parameters @@ -459,8 +441,6 @@ class FissionEnergyRelease(EqualityMixin): ENDF evaluation incident_neutron : openmc.data.IncidentNeutron Corresponding incident neutron dataset - units : {'eV', 'MeV'} - The energy units used in the returned object. Returns ------- @@ -484,10 +464,10 @@ class FissionEnergyRelease(EqualityMixin): raise ValueError('The ENDF evaluation is not fissionable.') # Read the 458 data from the ENDF file. - value, uncertainty = _extract_458_data(ev, units) + value, uncertainty = _extract_458_data(ev) # Build the object. - return cls._from_dictionary(value, incident_neutron, units) + return cls._from_dictionary(value, incident_neutron) @classmethod def from_hdf5(cls, group): diff --git a/openmc/data/function.py b/openmc/data/function.py index ed338f803..e9ecf82c5 100644 --- a/openmc/data/function.py +++ b/openmc/data/function.py @@ -8,6 +8,7 @@ import numpy as np import openmc.data import openmc.checkvalue as cv from openmc.mixin import EqualityMixin +from .data import EV_PER_MEV INTERPOLATION_SCHEME = {1: 'histogram', 2: 'linear-linear', 3: 'linear-log', 4: 'log-linear', 5: 'log-log'} @@ -315,7 +316,7 @@ class Tabulated1D(Function1D): return cls(x, y, breakpoints, interpolation) @classmethod - def from_ace(cls, ace, idx=0): + def from_ace(cls, ace, idx=0, convert_units=True): """Create a Tabulated1D object from an ACE table. Parameters @@ -324,6 +325,9 @@ class Tabulated1D(Function1D): An ACE table idx : int Offset to read from in XSS array (default of zero) + convert_units : bool + If the abscissa represents energy, indicate whether to convert MeV + to eV. Returns ------- @@ -348,8 +352,11 @@ class Tabulated1D(Function1D): # Get (x,y) pairs idx += 2*n_regions + 1 - x = ace.xss[idx:idx + n_pairs] - y = ace.xss[idx + n_pairs:idx + 2*n_pairs] + x = ace.xss[idx:idx + n_pairs].copy() + y = ace.xss[idx + n_pairs:idx + 2*n_pairs].copy() + + if convert_units: + x *= EV_PER_MEV return Tabulated1D(x, y, breakpoints, interpolation) diff --git a/openmc/data/kalbach_mann.py b/openmc/data/kalbach_mann.py index e84e6a77a..de9809df3 100644 --- a/openmc/data/kalbach_mann.py +++ b/openmc/data/kalbach_mann.py @@ -8,6 +8,7 @@ import openmc.checkvalue as cv from openmc.stats import Tabular, Univariate, Discrete, Mixture from .function import Tabulated1D, INTERPOLATION_SCHEME from .angle_energy import AngleEnergy +from .data import EV_PER_MEV from .endf import get_list_record, get_tab2_record @@ -290,7 +291,7 @@ class KalbachMann(AngleEnergy): # Incoming energies at which distributions exist idx += 2*n_regions + 1 - energy = ace.xss[idx:idx + n_energy_in] + energy = ace.xss[idx:idx + n_energy_in]*EV_PER_MEV # Location of distributions idx += n_energy_in @@ -315,12 +316,13 @@ class KalbachMann(AngleEnergy): intt = 2 n_energy_out = int(ace.xss[idx + 1]) - data = ace.xss[idx + 2:idx + 2 + 5*n_energy_out] + data = ace.xss[idx + 2:idx + 2 + 5*n_energy_out].copy() data.shape = (5, n_energy_out) + data[0,:] *= EV_PER_MEV # Create continuous distribution eout_continuous = Tabular(data[0][n_discrete_lines:], - data[1][n_discrete_lines:], + data[1][n_discrete_lines:]/EV_PER_MEV, INTERPOLATION_SCHEME[intt], ignore_negative=True) eout_continuous.c = data[2][n_discrete_lines:] diff --git a/openmc/data/nbody.py b/openmc/data/nbody.py index b186c253a..4db9934b9 100644 --- a/openmc/data/nbody.py +++ b/openmc/data/nbody.py @@ -18,7 +18,7 @@ class NBodyPhaseSpace(AngleEnergy): atomic_weight_ratio : float Atomic weight ratio of target nuclide q_value : float - Q value for reaction in MeV or eV, depending on the data source. + Q value for reaction in eV Attributes ---------- @@ -29,7 +29,7 @@ class NBodyPhaseSpace(AngleEnergy): atomic_weight_ratio : float Atomic weight ratio of target nuclide q_value : float - Q value for reaction in MeV or eV, depending on the data source. + Q value for reaction in eV """ @@ -130,7 +130,7 @@ class NBodyPhaseSpace(AngleEnergy): Index in XSS array of the start of the energy distribution data (LDIS + LOCC - 1) q_value : float - Q-value for reaction in MeV + Q-value for reaction in eV Returns ------- diff --git a/openmc/data/neutron.py b/openmc/data/neutron.py index 4ce560860..fd9501389 100644 --- a/openmc/data/neutron.py +++ b/openmc/data/neutron.py @@ -10,7 +10,7 @@ import numpy as np import h5py from .ace import Table, get_table -from .data import ATOMIC_SYMBOL, K_BOLTZMANN +from .data import ATOMIC_SYMBOL, K_BOLTZMANN, EV_PER_MEV from .fission_energy import FissionEnergyRelease from .function import Tabulated1D, Sum, ResonancesWithBackground from .endf import Evaluation, SUM_RULES @@ -110,7 +110,7 @@ class IncidentNeutron(EqualityMixin): Atomic mass ratio of the target nuclide. kTs : Iterable of float List of temperatures of the target nuclide in the data set. - The temperatures have units of MeV. + The temperatures have units of eV. Attributes ---------- @@ -121,7 +121,7 @@ class IncidentNeutron(EqualityMixin): atomic_weight_ratio : float Atomic weight ratio of the target nuclide. energy : dict of numpy.ndarray - The energy values (MeV) at which reaction cross-sections are tabulated. + The energy values (eV) at which reaction cross-sections are tabulated. They keys of the dict are the temperature string ('294K') for each set of energies fission_energy : None or openmc.data.FissionEnergyRelease @@ -148,7 +148,7 @@ class IncidentNeutron(EqualityMixin): rounded to the nearest integer; e.g., '294K' kTs : Iterable of float List of temperatures of the target nuclide in the data set. - The temperatures have units of MeV. + The temperatures have units of eV. urr : dict Dictionary whose keys are temperatures (e.g., '294K') and values are unresolved resonance region probability tables. @@ -546,7 +546,7 @@ class IncidentNeutron(EqualityMixin): _get_metadata(int(zaid), metastable_scheme) # Assign temperature to the running list - kTs = [ace.temperature] + kTs = [ace.temperature*EV_PER_MEV] data = cls(name, Z, mass_number, metastable, ace.atomic_weight_ratio, kTs) @@ -556,7 +556,7 @@ class IncidentNeutron(EqualityMixin): # Read energy grid n_energy = ace.nxs[3] - energy = ace.xss[ace.jxs[1]:ace.jxs[1] + n_energy] + energy = ace.xss[ace.jxs[1]:ace.jxs[1] + n_energy]*EV_PER_MEV data.energy[strT] = energy total_xs = ace.xss[ace.jxs[1] + n_energy:ace.jxs[1] + 2 * n_energy] absorption_xs = ace.xss[ace.jxs[1] + 2 * n_energy:ace.jxs[1] + diff --git a/openmc/data/reaction.py b/openmc/data/reaction.py index c724474c9..23b864bf3 100644 --- a/openmc/data/reaction.py +++ b/openmc/data/reaction.py @@ -14,7 +14,7 @@ from openmc.stats import Uniform, Tabular, Legendre from .angle_distribution import AngleDistribution from .angle_energy import AngleEnergy from .correlated import CorrelatedAngleEnergy -from .data import ATOMIC_SYMBOL, K_BOLTZMANN +from .data import ATOMIC_SYMBOL, K_BOLTZMANN, EV_PER_MEV from .endf import get_head_record, get_tab1_record, get_list_record, \ get_tab2_record, get_cont_record from .energy_distribution import EnergyDistribution, LevelInelastic, \ @@ -222,7 +222,9 @@ def _get_fission_products_ace(ace): if LNU == 1: # Polynomial function form of nu NC = int(ace.xss[idx+1]) - coefficients = ace.xss[idx+2 : idx+2+NC] + coefficients = ace.xss[idx+2 : idx+2+NC].copy() + for i in range(coefficients.size): + coefficients[i] *= EV_PER_MEV**(-i) neutron.yield_ = Polynomial(coefficients) elif LNU == 2: # Tabular data form of nu @@ -241,7 +243,9 @@ def _get_fission_products_ace(ace): if LNU == 1: # Polynomial function form of nu NC = int(ace.xss[idx+1]) - coefficients = ace.xss[idx+2 : idx+2+NC] + coefficients = ace.xss[idx+2 : idx+2+NC].copy() + for i in range(coefficients.size): + coefficients[i] *= EV_PER_MEV**(-i) prompt_neutron.yield_ = Polynomial(coefficients) elif LNU == 2: # Tabular data form of nu @@ -257,7 +261,9 @@ def _get_fission_products_ace(ace): if LNU == 1: # Polynomial function form of nu NC = int(ace.xss[idx+1]) - coefficients = ace.xss[idx+2 : idx+2+NC] + coefficients = ace.xss[idx+2 : idx+2+NC].copy() + for i in range(coefficients.size): + coefficients[i] *= EV_PER_MEV**(-i) total_neutron.yield_ = Polynomial(coefficients) elif LNU == 2: # Tabular data form of nu @@ -521,7 +527,7 @@ def _get_photon_products_ace(ace, rx): threshold_idx = int(ace.xss[idx]) - 1 n_energy = int(ace.xss[idx + 1]) energy = ace.xss[ace.jxs[1] + threshold_idx: - ace.jxs[1] + threshold_idx + n_energy] + ace.jxs[1] + threshold_idx + n_energy]*EV_PER_MEV # Get photon production cross section photon_prod_xs = ace.xss[idx + 2:idx + 2 + n_energy] @@ -697,7 +703,7 @@ class Reaction(EqualityMixin): mt : int The ENDF MT number for this reaction. q_value : float - The Q-value of this reaction in MeV or eV, depending on the data source. + The Q-value of this reaction in eV. xs : dict of str to openmc.data.Function1D Microscopic cross section for this reaction as a function of incident energy; these cross sections are provided in a dictionary where the key @@ -861,18 +867,18 @@ class Reaction(EqualityMixin): def from_ace(cls, ace, i_reaction): # Get nuclide energy grid n_grid = ace.nxs[3] - grid = ace.xss[ace.jxs[1]:ace.jxs[1] + n_grid] + grid = ace.xss[ace.jxs[1]:ace.jxs[1] + n_grid]*EV_PER_MEV # Convert data temperature to a "300.0K" number for indexing # temperature data - strT = str(int(round(ace.temperature / K_BOLTZMANN))) + "K" + strT = str(int(round(ace.temperature*EV_PER_MEV / K_BOLTZMANN))) + "K" if i_reaction > 0: mt = int(ace.xss[ace.jxs[3] + i_reaction - 1]) rx = cls(mt) # Get Q-value of reaction - rx.q_value = ace.xss[ace.jxs[4] + i_reaction - 1] + rx.q_value = ace.xss[ace.jxs[4] + i_reaction - 1]*EV_PER_MEV # ================================================================== # CROSS SECTION diff --git a/openmc/data/thermal.py b/openmc/data/thermal.py index 90aaa1e6e..23c852f65 100644 --- a/openmc/data/thermal.py +++ b/openmc/data/thermal.py @@ -8,7 +8,7 @@ import h5py import openmc.checkvalue as cv from openmc.mixin import EqualityMixin -from .data import K_BOLTZMANN, ATOMIC_SYMBOL +from .data import K_BOLTZMANN, ATOMIC_SYMBOL, EV_PER_MEV from .ace import Table, get_table from .angle_energy import AngleEnergy from .function import Tabulated1D @@ -69,14 +69,14 @@ class CoherentElastic(EqualityMixin): Parameters ---------- bragg_edges : Iterable of float - Bragg edge energies in MeV + Bragg edge energies in eV factors : Iterable of float Partial sum of structure factors, :math:`\sum\limits_{i=1}^{E_i nuclides(i_nuclide)) ! Check to see if there is multipole data present at this energy use_mp = .false. if (nuc % mp_present) then - if (E >= nuc % multipole % start_E/1.0e6_8 .and. & - E <= nuc % multipole % end_E/1.0e6_8) then + if (E >= nuc % multipole % start_E .and. & + E <= nuc % multipole % end_E) then use_mp = .true. end if end if @@ -585,14 +585,13 @@ contains ! sections in the resolved resonance regions !=============================================================================== - subroutine multipole_eval(multipole, Emev, sqrtkT_, sigT, sigA, sigF) + subroutine multipole_eval(multipole, E, sqrtkT, sigT, sigA, sigF) type(MultipoleArray), intent(in) :: multipole ! The windowed multipole ! object to process. - real(8), intent(in) :: Emev ! The energy at which to + real(8), intent(in) :: E ! The energy at which to ! evaluate the cross section - ! in MeV - real(8), intent(in) :: sqrtkT_ ! The temperature in the form - ! sqrt(kT (in MeV)), at which + real(8), intent(in) :: sqrtkT ! The temperature in the form + ! sqrt(kT), at which ! to evaluate the XS. real(8), intent(out) :: sigT ! Total cross section real(8), intent(out) :: sigA ! Absorption cross section @@ -608,8 +607,6 @@ contains real(8) :: invE ! 1/E, eV real(8) :: dopp ! sqrt(atomic weight ratio / kT) = 1 / (2 sqrt(xi)) real(8) :: temp ! real temporary value - real(8) :: E ! energy, eV - real(8) :: sqrtkT ! sqrt(kT (in eV)) integer :: i_pole ! index of pole integer :: i_poly ! index of curvefit integer :: i_window ! index of window @@ -619,10 +616,6 @@ contains ! ========================================================================== ! Bookkeeping - ! Convert to eV. - E = Emev * 1.0e6_8 - sqrtkT = sqrtkT_ * 1.0e3_8 - ! Define some frequently used variables. sqrtE = sqrt(E) invE = ONE / E diff --git a/src/doppler.F90 b/src/doppler.F90 index 85ab6da3c..56c07c50e 100644 --- a/src/doppler.F90 +++ b/src/doppler.F90 @@ -41,7 +41,7 @@ contains real(8) :: a, b ! values of x(k)-y and x(k+1)-y real(8) :: sigma ! broadened cross section at one point - ! Determine alpha parameter -- have to convert k to MeV/K + ! Determine alpha parameter -- have to convert k to eV/K alpha = A_target/(K_BOLTZMANN * T) ! Allocate memory for x and assign values diff --git a/src/geometry_header.F90 b/src/geometry_header.F90 index 9f4be90b9..60499fcfa 100644 --- a/src/geometry_header.F90 +++ b/src/geometry_header.F90 @@ -144,7 +144,7 @@ module geometry_header integer :: distribcell_index ! Index corresponding to this cell in ! distribcell arrays real(8), allocatable :: sqrtkT(:) ! Square root of k_Boltzmann * - ! temperature in MeV. Multiple for + ! temperature in eV. Multiple for ! distribcell ! Rotation matrix and translation vector diff --git a/src/input_xml.F90 b/src/input_xml.F90 index 2cefd76f6..a402022a1 100644 --- a/src/input_xml.F90 +++ b/src/input_xml.F90 @@ -612,8 +612,8 @@ contains allocate(Watt :: external_source(i)%energy) select type(energy => external_source(i)%energy) type is (Watt) - energy%a = 0.988_8 - energy%b = 2.249_8 + energy%a = 0.988e6_8 + energy%b = 2.249e-6_8 end select end if end if @@ -4994,7 +4994,7 @@ contains if (nuclides(i) % grid(1) % energy(size(nuclides(i) % grid(1) % energy)) & == energy_max_neutron) then call write_message("Maximum neutron transport energy: " // & - trim(to_str(energy_max_neutron)) // " MeV for " // & + trim(to_str(energy_max_neutron)) // " eV for " // & trim(adjustl(nuclides(i) % name)), 6) exit end if diff --git a/src/mgxs_data.F90 b/src/mgxs_data.F90 index 857b2ded0..0535adf6c 100644 --- a/src/mgxs_data.F90 +++ b/src/mgxs_data.F90 @@ -200,7 +200,7 @@ contains end subroutine create_macro_xs !=============================================================================== -! GET_MAT_kTs returns a list of temperatures (in MeV) that each +! GET_MAT_kTs returns a list of temperatures (in eV) that each ! material appears at in the model. !=============================================================================== @@ -209,7 +209,7 @@ contains integer :: i, j integer :: i_material ! Index in materials array - real(8) :: kT ! temperature in MeV + real(8) :: kT ! temperature in eV allocate(kTs(size(materials))) diff --git a/src/mgxs_header.F90 b/src/mgxs_header.F90 index feb4d46a8..98b2565c1 100644 --- a/src/mgxs_header.F90 +++ b/src/mgxs_header.F90 @@ -53,7 +53,7 @@ module mgxs_header type, abstract :: Mgxs character(len=MAX_WORD_LEN) :: name ! name of dataset, e.g. UO2 real(8) :: awr ! Atomic Weight Ratio - real(8), allocatable :: kTs(:) ! temperature in MeV (k*T) + real(8), allocatable :: kTs(:) ! temperature in eV (k*T) ! Fission information logical :: fissionable ! mgxs object is fissionable? @@ -242,7 +242,7 @@ module mgxs_header do i = 1, size(dset_names) ! Read temperature value call read_dataset(temps_available(i), kT_group, trim(dset_names(i))) - ! Convert MeV to Kelvin + ! Convert eV to Kelvin temps_available(i) = temps_available(i) / K_BOLTZMANN end do call sort(temps_available) @@ -1239,7 +1239,7 @@ module mgxs_header subroutine mgxsiso_combine(this, temps, mat, nuclides, groups, max_order, & tolerance, method) class(MgxsIso), intent(inout) :: this ! The Mgxs to initialize - type(VectorReal), intent(in) :: temps ! Temperatures to obtain [MeV] + type(VectorReal), intent(in) :: temps ! Temperatures to obtain [eV] type(Material), pointer, intent(in) :: mat ! base material type(MgxsContainer), intent(in) :: nuclides(:) ! List of nuclides to harvest from integer, intent(in) :: groups ! Number of E groups @@ -2079,12 +2079,12 @@ module mgxs_header !=============================================================================== ! MGXS_FIND_TEMPERATURE sets the temperature index for the given -! sqrt(temperature), (with temperature in units of MeV) +! sqrt(temperature), (with temperature in units of eV) !=============================================================================== subroutine mgxs_find_temperature(this, sqrtkT) class(Mgxs), intent(inout) :: this - real(8), intent(in) :: sqrtkT ! Temperature (in units of of MeV) + real(8), intent(in) :: sqrtkT ! Temperature (in units of eV) this % index_temp = minloc(abs(this % kTs - (sqrtkT * sqrtkT)), dim=1) diff --git a/src/nuclide_header.F90 b/src/nuclide_header.F90 index 63bd4417b..e57d7da62 100644 --- a/src/nuclide_header.F90 +++ b/src/nuclide_header.F90 @@ -53,7 +53,7 @@ module nuclide_header integer :: A ! mass number integer :: metastable ! metastable state real(8) :: awr ! Atomic Weight Ratio - real(8), allocatable :: kTs(:) ! temperature in MeV (k*T) + real(8), allocatable :: kTs(:) ! temperature in eV (k*T) ! Fission information logical :: fissionable = .false. ! nuclide is fissionable? @@ -115,8 +115,8 @@ module nuclide_header type Nuclide0K character(10) :: nuclide ! name of nuclide, e.g. U238 character(16) :: scheme = 'ares' ! target velocity sampling scheme - real(8) :: E_min = 0.01e-6_8 ! lower cutoff energy for res scattering - real(8) :: E_max = 1000.0e-6_8 ! upper cutoff energy for res scattering + real(8) :: E_min = 0.01_8 ! lower cutoff energy for res scattering + real(8) :: E_max = 1000.0_8 ! upper cutoff energy for res scattering end type Nuclide0K !=============================================================================== @@ -146,7 +146,7 @@ module nuclide_header ! Information for Doppler broadening real(8) :: last_sqrtkT = ZERO ! Last temperature in sqrt(Boltzmann - ! constant * temperature (MeV)) + ! constant * temperature (eV)) end type NuclideMicroXS !=============================================================================== diff --git a/src/particle_header.F90 b/src/particle_header.F90 index 53a503ce2..32ad6adfc 100644 --- a/src/particle_header.F90 +++ b/src/particle_header.F90 @@ -87,7 +87,7 @@ module particle_header integer :: last_material ! index for last material ! Temperature of the current cell - real(8) :: sqrtkT ! sqrt(k_Boltzmann * temperature) in MeV + real(8) :: sqrtkT ! sqrt(k_Boltzmann * temperature) in eV real(8) :: last_sqrtKT ! last temperature ! Statistical data diff --git a/src/physics.F90 b/src/physics.F90 index a7ace877b..813aadf41 100644 --- a/src/physics.F90 +++ b/src/physics.F90 @@ -47,7 +47,7 @@ contains if (verbosity >= 10 .or. trace) then call write_message(" " // trim(reaction_name(p % event_MT)) & &// " with " // trim(adjustl(nuclides(p % event_nuclide) % name)) & - &// ". Energy = " // trim(to_str(p % E * 1e6_8)) // " eV.") + &// ". Energy = " // trim(to_str(p % E)) // " eV.") end if ! check for very low energy @@ -230,8 +230,8 @@ contains ! Check to see if we are in a windowed multipole range. WMP only supports ! the first fission reaction. if (nuc % mp_present) then - if (E >= nuc % multipole % start_E/1.0e6_8 .and. & - E <= nuc % multipole % end_E/1.0e6_8) then + if (E >= nuc % multipole % start_E .and. & + E <= nuc % multipole % end_E) then i_reaction = nuc % index_fission(1) return end if @@ -322,7 +322,7 @@ contains real(8) :: uvw_new(3) ! outgoing uvw for iso-in-lab scattering real(8) :: uvw_old(3) ! incoming uvw for iso-in-lab scattering real(8) :: phi ! azimuthal angle for iso-in-lab scattering - real(8) :: kT ! temperature in MeV + real(8) :: kT ! temperature in eV type(Nuclide), pointer :: nuc ! copy incoming direction @@ -436,7 +436,7 @@ contains subroutine elastic_scatter(i_nuclide, rxn, kT, E, uvw, mu_lab, wgt) integer, intent(in) :: i_nuclide type(Reaction), intent(in) :: rxn - real(8), intent(in) :: kT ! temperature in MeV + real(8), intent(in) :: kT ! temperature in eV real(8), intent(inout) :: E real(8), intent(inout) :: uvw(3) real(8), intent(out) :: mu_lab @@ -785,7 +785,7 @@ contains real(8), intent(in) :: v_neut(3) ! neutron velocity real(8), intent(inout) :: wgt ! particle weight real(8), intent(in) :: xs_eff ! effective elastic xs at temperature T - real(8), intent(in) :: kT ! equilibrium temperature of target in MeV + real(8), intent(in) :: kT ! equilibrium temperature of target in eV real(8) :: awr ! target/neutron mass ratio real(8) :: E_rel ! trial relative energy @@ -1026,7 +1026,7 @@ contains real(8), intent(out) :: v_target(3) real(8), intent(in) :: E real(8), intent(in) :: uvw(3) - real(8), intent(in) :: kT ! equilibrium temperature of target in MeV + real(8), intent(in) :: kT ! equilibrium temperature of target in eV real(8) :: awr ! target/neutron mass ratio real(8) :: alpha ! probability of sampling f2 over f1 diff --git a/src/sab_header.F90 b/src/sab_header.F90 index bf81a5d90..1d64711b8 100644 --- a/src/sab_header.F90 +++ b/src/sab_header.F90 @@ -68,7 +68,7 @@ module sab_header type SAlphaBeta character(150) :: name ! name of table, e.g. lwtr.10t real(8) :: awr ! weight of nucleus in neutron masses - real(8), allocatable :: kTs(:) ! temperatures in MeV (k*T) + real(8), allocatable :: kTs(:) ! temperatures in eV (k*T) character(10), allocatable :: nuclides(:) ! List of valid nuclides integer :: secondary_mode ! secondary mode (equal/skewed/continuous) diff --git a/src/tally.F90 b/src/tally.F90 index c44d5f787..0e0c6dd7e 100644 --- a/src/tally.F90 +++ b/src/tally.F90 @@ -186,12 +186,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_8) * flux + / (sqrt(TWO * E / MASS_NEUTRON_EV) * C_LIGHT * 100.0_8) * flux 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_8) + score = flux / (sqrt(TWO * E / MASS_NEUTRON_EV) * C_LIGHT * 100.0_8) end if