Skip to content

Commit 3a07bed

Browse files
authored
Merge branch 'develop' into Sensitivity-Analysis
2 parents 5204829 + 7fda3eb commit 3a07bed

57 files changed

Lines changed: 1983 additions & 347 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,8 @@ list(APPEND libopenmc_SOURCES
414414
src/tallies/filter_material.cpp
415415
src/tallies/filter_materialfrom.cpp
416416
src/tallies/filter_mesh.cpp
417-
src/tallies/filter_meshborn.cpp
417+
src/tallies/filter_meshborn.cpp
418+
src/tallies/filter_meshmaterial.cpp
418419
src/tallies/filter_meshsurface.cpp
419420
src/tallies/filter_mu.cpp
420421
src/tallies/filter_musurface.cpp

docs/source/methods/energy_deposition.rst

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,38 @@ KERMA (Kinetic Energy Release in Materials) [Mack97]_ coefficients for reaction
2525
:math:`\times` cross-section (e.g., eV-barn) and can be used much like a reaction
2626
cross section for the purpose of tallying energy deposition.
2727

28-
KERMA coefficients can be computed using the energy-balance method with
29-
a nuclear data processing code like NJOY, which performs the following
30-
iteration over all reactions :math:`r` for all isotopes :math:`i`
31-
requested
28+
KERMA coefficients can be computed using the energy-balance method with a
29+
nuclear data processing code like NJOY, which estimates the KERMA coefficients
30+
using the following equation:
3231

3332
.. math::
3433
35-
k_{i, r}(E) = \left(E + Q_{i, r} - \bar{E}_{i, r, n}
34+
k_{i, r}(E) = \left(E + Q_{i, r} - \sum\limits_x \bar{E}_{i, r, x}
35+
\right)\sigma_{i, r}(E),
36+
37+
where the summation is over each secondary particle type :math:`x`. This
38+
equation states that the energy deposited is equal to the energy of the incident
39+
particle plus the reaction :math:`Q` value less the energy of secondary
40+
particles that are transported away from the reaction site. For neutron
41+
interactions, the energy-balance KERMA coefficient is
42+
43+
.. math::
44+
45+
k_{i, r}(E) = \left(E + Q_{i, r} - \sum\limits_x \bar{E}_{i, r, n}
3646
- \bar{E}_{i, r, \gamma}\right)\sigma_{i, r}(E),
3747
38-
removing the energy of neutral particles (neutrons and photons) that are
39-
transported away from the reaction site :math:`\bar{E}`, and the reaction
40-
:math:`Q` value.
48+
where :math:`\bar{E}_{i, r, n}` is the average energy of secondary neutrons and
49+
:math:`\bar{E}_{i, r, \gamma}` is the average energy of secondary photons. For
50+
photon and charged particle interactions the KERMA coefficient is
51+
52+
.. math::
53+
:label: energy-balance-photon
54+
55+
k_{i, r}(E) = \left(E + Q_{i, r} - \sum\limits_x \bar{E}_{i, r, x}
56+
\right)\sigma_{i, r}(E).
57+
58+
where the :math:`Q` value is zero for all interactions except for pair
59+
production and positron annihilation.
4160

4261
-------
4362
Fission
@@ -120,7 +139,7 @@ run with :math:`N918` reflecting fission heating computed from NJOY.
120139
This modified heating data is stored as the MT=901 reaction and will be scored
121140
if ``heating-local`` is included in :attr:`openmc.Tally.scores`.
122141

123-
Coupled neutron-photon transport
142+
Coupled Neutron-Photon Transport
124143
--------------------------------
125144

126145
Here, OpenMC instructs ``heatr`` to assume that energy from photons is not
@@ -138,6 +157,50 @@ Let :math:`N301` represent the total heating number returned from this
138157
This modified heating data is stored as the MT=301 reaction and will be scored
139158
if ``heating`` is included in :attr:`openmc.Tally.scores`.
140159

160+
Photons and Charged Particles
161+
-----------------------------
162+
163+
In OpenMC, energy deposition from photons or charged particles is scored using
164+
the energy balance method based on Equation :eq:`energy-balance-photon`. Special
165+
consideration is given to electrons and positrons as described below.
166+
167+
+++++++++++++++++
168+
Charged Particles
169+
+++++++++++++++++
170+
171+
OpenMC tracks photons interaction by interaction so the energy deposited in each
172+
collision is easily attributed back to the nuclide and reaction for which the
173+
photon interacted with. Charged particles (electrons and photons) aren't tracked
174+
in the same way. For charged particles, OpenMC assumes that all their energy
175+
(less the energy of bremsstrahlung radiation) is deposited in the material in
176+
which they were born. In this way it is harder to trace how much energy should
177+
be attributed in each nuclide.
178+
179+
According to the CSDA approximation (see :ref:`ttb`) the energy deposited by a
180+
charged particle with kinetic energy :math:`T` in the :math:`i`-th element can
181+
be calculated as:
182+
183+
.. math::
184+
185+
E_{i} = \int_{0}^{R(T)} w_{i}S_{\text{col,i}} dx
186+
187+
where :math:`R(T)` is the CSDA range of the charged particle,
188+
:math:`S_{\text{col},i}` is the collision stopping power of the charged particle
189+
in the :math:`i`-th element and :math:`w_i` is the mass fraction of the
190+
:math:`i`-th element. According to the Bethe formula the collision stopping
191+
power of the :math:`i`-th element is proportional to :math:`Z_i/A_i`, so the
192+
fractional collision stopping power from the :math:`i`-th element is:
193+
194+
.. math::
195+
196+
\frac{w_{i}S_{\text{col},i}(T)}{S_{\text{col}}(T)} =
197+
\frac{\frac{w_{i}Z_{i}}{A_{i}}}{\sum_{i}\frac{w_{i}Z_{i}}{A_{i}}} =
198+
\frac{\gamma_i Z_{i}}{\sum_{i}\gamma_i Z_{i}}.
199+
200+
where :math:`\gamma_i` is the atomic fraction of the :math:`i`-th element.
201+
Therefore, the energy deposited by charged particles should be attributed to
202+
a given element according to its fractional charge density.
203+
141204
----------
142205
References
143206
----------

docs/source/pythonapi/base.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Constructing Tallies
130130
openmc.MeshFilter
131131
openmc.MeshBornFilter
132132
openmc.ImportanceFilter
133+
openmc.MeshMaterialFilter
133134
openmc.MeshSurfaceFilter
134135
openmc.EnergyFilter
135136
openmc.EnergyoutFilter

docs/source/pythonapi/deplete.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,15 @@ total system energy.
206206
The :class:`openmc.deplete.IndependentOperator` uses inner classes subclassed
207207
from those listed above to perform similar calculations.
208208

209-
The following classes are used to define transfer rates to model continuous
210-
removal or feed of nuclides during depletion.
209+
The following classes are used to define external source rates or transfer rates
210+
to model continuous removal or feed of nuclides during depletion.
211211

212212
.. autosummary::
213213
:toctree: generated
214214
:nosignatures:
215215
:template: myclass.rst
216216

217+
transfer_rates.ExternalSourceRates
217218
transfer_rates.TransferRates
218219

219220
Intermediate Classes

docs/source/usersguide/data.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ responsible for specifying one or more of the following:
3030
Each of the above files can specified in several ways. In the Python API, a
3131
:ref:`runtime configuration variable <usersguide_data_runtime>`
3232
:data:`openmc.config` can be used to specify any of the above and is initialized
33-
using a set of environment variables.
33+
using a set of environment variables. Data configuration paths set in
34+
:data:`openmc.config` will be expanded to absolute paths.
3435

3536
.. _usersguide_data_runtime:
3637

docs/source/usersguide/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Prerequisites
221221
OpenMC's built-in plotting capabilities use the libpng library to produce
222222
compressed PNG files. In the absence of this library, OpenMC will fallback
223223
to writing PPM files, which are uncompressed and only supported by select
224-
image viewers. libpng can be installed on Ddebian derivates with::
224+
image viewers. libpng can be installed on Debian derivates with::
225225

226226
sudo apt install libpng-dev
227227

include/openmc/boundary_condition.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ class PeriodicBC : public BoundaryCondition {
111111

112112
std::string type() const override { return "periodic"; }
113113

114+
int i_surf() const { return i_surf_; }
115+
116+
int j_surf() const { return j_surf_; }
117+
114118
protected:
115119
int i_surf_;
116120
int j_surf_;

include/openmc/material.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ class Material {
107107
//! \return Density in [g/cm^3]
108108
double density_gpcc() const { return density_gpcc_; }
109109

110+
//! Get charge density in [e/b-cm]
111+
//! \return Charge density in [e/b-cm]
112+
double charge_density() const { return charge_density_; };
113+
110114
//! Get name
111115
//! \return Material name
112116
const std::string& name() const { return name_; }
@@ -177,6 +181,7 @@ class Material {
177181
xt::xtensor<double, 1> atom_density_; //!< Nuclide atom density in [atom/b-cm]
178182
double density_; //!< Total atom density in [atom/b-cm]
179183
double density_gpcc_; //!< Total atom density in [g/cm^3]
184+
double charge_density_; //!< Total charge density in [e/b-cm]
180185
double volume_ {-1.0}; //!< Volume in [cm^3]
181186
vector<bool> p0_; //!< Indicate which nuclides are to be treated with
182187
//!< iso-in-lab scattering

include/openmc/particle_data.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,8 @@ class ParticleData : public GeometryState {
584584
bool& fission() { return fission_; } // true if implicit fission
585585
int& event_nuclide() { return event_nuclide_; } // index of collision nuclide
586586
const int& event_nuclide() const { return event_nuclide_; }
587-
int& event_mt() { return event_mt_; } // MT number of collision
587+
int& event_mt() { return event_mt_; } // MT number of collision
588+
const int& event_mt() const { return event_mt_; }
588589
int& delayed_group() { return delayed_group_; } // delayed group
589590
const int& parent_nuclide() const { return parent_nuclide_; }
590591
int& parent_nuclide() { return parent_nuclide_; } // Parent nuclide

include/openmc/tallies/filter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ enum class FilterType {
3434
MESH,
3535
MESHBORN,
3636
IMPORTANCE,
37+
MESH_MATERIAL,
3738
MESH_SURFACE,
3839
MU,
3940
MUSURFACE,

0 commit comments

Comments
 (0)