Commit graph

2835 commits

Author SHA1 Message Date
Paul Romano
bc09d1ef55 adding back files to be reviewed 2019-10-28 11:55:45 -05:00
Paul Romano
ae28233110 deleting all files to prepare for review 2019-10-28 11:48:19 -05:00
Paul Romano
e07fe06323 Remove -dev tag from version number. Small updates to release notes 2019-10-07 10:33:45 -05:00
Paul Romano
1c1fca3d70 Respond to @drewejohnson comments on #1371 2019-10-07 07:40:56 -05:00
Paul Romano
e869d8eef1 Fix documentation build (deplete module was causing issues) 2019-10-04 12:48:23 -05:00
Paul Romano
c18f845712 Fix broken links in documentation 2019-10-04 09:33:20 -05:00
Paul Romano
829f12b1b5 Move thermal scattering MAT number bug fixes into a dedicated function 2019-10-03 11:49:56 -05:00
Paul Romano
92d410ed77 Ensure all thermal scattering evals from ENDF/B-VIII.0 and JEFF 3.3 work 2019-10-02 21:35:51 -05:00
Paul Romano
e510064b9c Make sure heating is calculated correctly with threshold fission
When trying to process Pa233 from ENDF/B-VIII.0, which has a threshold fission
reaction, I discovered that calculating heating numbers crashed because we were
trying to do arithmetic on arrays of different sizes. Re-evaluting the fission
cross section on the proper energy grid does the trick here.
2019-10-02 21:35:51 -05:00
Paul Romano
db8cdff1c5
Merge pull request #1357 from drewejohnson/internal-tally
Create and use internal tallies for depletion
2019-10-01 08:26:12 -05:00
Paul Romano
ed7123f4e7
Merge pull request #1356 from drewejohnson/dep-solver-class
Provide class-based depletion solvers
2019-09-30 13:23:29 -05:00
Andrew Johnson
7a1a424d0f
Tally.writeable -> Tally.writable
Oops

Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
2019-09-26 20:34:11 -04:00
Andrew Johnson
d112eddbc3
openmc.deplete.cram.IPFCramSolver accepts coefficients at init
Moved from deplete.abc into openmc.deplete.cram. CRAM16 and CRAM48
are aliases to __call__ methods for two instances of
IPFCramSolver: Cram16Solver and Cram48Solver, created using
16th and 48th order coefficients
2019-09-26 20:31:04 -04:00
Paul Romano
60f17ea466 Make sure from_ace classmethods get correct type of ACE table 2019-09-25 12:36:47 -05:00
Paul Romano
a8d90844a3
Merge pull request #1361 from pshriwise/io_fixes
I/O Fixes
2019-09-25 10:19:52 -05:00
Patrick Shriwise
c1d746164f Writing empty groups for nuclides/atoms in volume calc if no entries are found. 2019-09-23 12:00:24 -05:00
Patrick Shriwise
0055ecbb3a Read materials from summary.h5 if using DagMC geometry. 2019-09-20 14:22:28 -05:00
Andrew Johnson
72212f60a2
Use internal tallies to compute quantities for depletion
Tallies created by internal depletion helpers are marked
as internal using the openmc.lib.Tally.writeable property.
This is done to resolve issue #1327 where statepoint files could
grow to be quite large after tallying reaction rates across many
burnable materials for all nuclides of interest.

A check is added in the depletion regression test to ensure that
no additional tallies are loaded to the StatePoint.
2019-09-20 10:50:38 -05:00
Andrew Johnson
4b688e5efa
Teach openmc.StatePoint about internal tallies
When reading tally data from the statepoint file,
tallies that are marked as internal are not created nor added
to the StatePoint.tallies property
2019-09-20 10:31:56 -05:00
Andrew Johnson
66593fd7e1
Expose tally.writeable_ through openmc.lib
Add two functions to capi.h:
openmc_tally_set_writeable and openmc_tally_get_writeable
which are exposed to the Python API through the
openmc.lib.Tally.writeable property. These functions are very
similar to the set/get active counterparts as both act on a boolean
Tally attribute

A new unit test test_tally_writeable has been added that toggles
the writeable state of a tally. It is important to note that the
writeable state must be reset, otherwise tallies in subsequent
tests will be skewed. This is because the test_tally_writeable
function requires the capi_simulation_init fixture and the tallies
are shared by those functions that use the capi_run fixture
2019-09-20 10:13:26 -05:00
Andrew Johnson
07d3207d88
Provide class-based CRAM solvers
CRAM16 and CRAM48 are now aliases for __call__ methods
on two new classes: openmc.deplete.cram.Cram16Solver
and Cram48Solver. These are two concrete subclasses of
openmc.deplete.abc.IPFCramSolver and
openmc.deplete.abc.DepSystemSolver abstract classes.

The primary benefit of the class based approach is that the
16th and 48th order have nearly identical implementations. The only
differences are the alpha, theta, and alpha_0 coefficients used.
This allows both the Cram16Solver and Cram48Solver to have unique
sets of coefficient vectors, while relying on the IPFSolver base
class implementation.

The implementation of IPF CRAM has been cleaned up. The NxN identity
matrix is not re-created each iteration. Given the alpha and
theta attributes on the IPFCramSolver instances, one can
iterate through the orders using a zip command. By forcing concrete
classes to declared alpha and theta vectors, the need to re-declare
the vectors at each entrance into CRAM48 is also removed.

Using these classes, a 10% speedup is observed depleting up to 500
materials on a single MPI process. The function-based approach
took 62s, while the new classes required 52s.
2019-09-19 16:44:13 -05:00
Paul Romano
384954b099
Merge pull request #1352 from drewejohnson/dep-namespace-cleanup
Cleaner depletion module documentation and namespace
2019-09-19 09:42:12 -05:00
Paul Romano
7fe2055b43
Merge pull request #1339 from rockfool/white
White Boundary Condition Implementation
2019-09-18 13:21:53 -05:00
Paul Romano
8f2b0a01b6
Merge pull request #1332 from drewejohnson/depletion-example-notebook
Depletion example notebook
2019-09-18 13:21:34 -05:00
Andrew Johnson
b3c5d98454
Cleaner openmc.deplete namespace with __all__
Provide explicit __all__ lists for files in openmc/deplete
containing classes that should be brought into the "primary"
API. This prevents cluttering the openmc.deplete namespace
caused by the wildcard imports
```
from .nuclide import *
...
```

The abc, cram, and helpers modules are imported simply as
```
from . import abc
from . import cram
from . import helpers
```
2019-09-17 16:24:54 -05:00
Andrew Johnson
2ab3ad7b78
Minor tweaks to Operator, EnergyScoreHelper
Per reviewer comments
2019-09-17 12:18:51 -05:00
Andrew Johnson
cfbd4f2fd6
Operator aborts in unpacking, not call, if no energy produced 2019-09-17 12:17:49 -05:00
rockfool
7bf455d722 add white boundary in surface.py 2019-09-17 12:36:43 -04:00
Andrew Johnson
6b386f8447
Use string score names for EnergyScoreHelper
Operator defaults to using "heating-local" if not running
in coupled photon transport.
2019-09-17 11:34:20 -05:00
rockfool
bfba0e6b1b Merge remote-tracking branch 'upstream/develop' into white 2019-09-17 11:30:58 -04:00
Andrew Johnson
952cd2a3cf
Doc fix for ResultsList.get_depletion_time 2019-09-16 16:49:23 -05:00
Andrew Johnson
452ad5ac7d
Avoid zero division when normalizing reaction rates
If the system energy is found to be zero, then
Operator.__call__ will exit the simulation using
comm.Abort / sys.exit if no mpi4py. Without this, the
reaction rates will be scaled by power / 0, causing errors
downstream in setting material compositions.
2019-09-16 16:41:51 -05:00
Andrew Johnson
74e48521a8
Pass MT301 or MT901 to EnergyHelper from Operator
Depending on settings.photon_transport, obtain the total
system energy from the 301 [heating] or 901 [heating-local]
scores. The former is used in coupled neutron-photon transport,
as this does not include any energy from neutrons or
photons, assuming these particles deposit their energy along
their life. MT901 is used for neutron transport and is the default,
e.g. if scores is None. This score includes energy from
prompt and delayed photons taken from MT458 data.

Related PR: #1344 - Ability to generate KERMAs assuming local
photon energy deposition
2019-09-16 15:24:06 -05:00
Andrew Johnson
ca410a82fe
Ensure strings when setting openmc.lib.Tally.scores
In using lists of containing integer reactions as
the scores, e.g.
```
t = openmc.lib.Tally()
t.scores = [901]
```
The setter would fail as the integers do not have an
encode method. This converts all incoming scores
to strings prior to passing values to the shared library.
2019-09-16 15:12:42 -05:00
Andrew Johnson
016fc0e43e
Use energy deposition score for depletion
Introduce a new subclass of EnergyHelper, EnergyScoreHelper,
that computes the system energy using the energy-deposition score.
This energy is fed back to the Operator to normalize reaction rates.

The energy from the tally is only stored on the helper on the
MPI process 0 as to avoid scaling the system energy by the number
of processes. During the Operator unpacking, the energy reported
by each process is reduced, as the previous implementations took
fission reaction rates from the "local materials", e.g. the
materials each process is responsible for depleting.
The tally results are shared across all processes and only
contains a single quantity, the tallied energy deposition across
all materials.

This mode is controlled by passing the "energy_mode" argument passed
to the Operator. The two options are "fission-q" [default and previous
behavior] and "energy-deposition" [new features]. If energy_mode indicates using
the energy deposition score, the user-supplied fission-q dictionary is not used.

(cherry picked from commit d566f3080f)
2019-09-16 14:04:12 -05:00
rockfool
c88f013795 add white in surface.py 2019-09-16 14:23:31 -04:00
rockfool
d0eb84dd4e fix the conflict in surface.py 2019-09-16 14:12:54 -04:00
rockfool
fbaa780731 remove the surface.py first 2019-09-16 14:03:05 -04:00
Paul Romano
348dd74dcc Merge branch 'develop' into local-photon-heating 2019-09-16 11:00:33 -05:00
Sterling Harper
c76b75ce33
Merge pull request #1345 from paulromano/capi-to-lib
Rename openmc.capi to openmc.lib
2019-09-16 09:28:02 -04:00
Paul Romano
dc3ab07ced Make sure no heating adjustments are made if HEATR is not run 2019-09-13 10:59:18 -05:00
Paul Romano
bbb0b78383 Rename openmc.capi -> openmc.lib 2019-09-13 10:38:26 -05:00
Paul Romano
7b8709e1a1
Merge pull request #1343 from drewejohnson/default-dict-weighted-yields
Use defaultdict when weighting fission yields
2019-09-13 09:54:19 -05:00
Paul Romano
fe731b7f19 Fix bug with IncidentNeutron.temperatures for ENDF files 2019-09-13 09:31:12 -05:00
Paul Romano
d84c379007 Fix up heating tally scores 2019-09-13 09:31:08 -05:00
Paul Romano
fe7a968819 Run HEATR twice to get kermas including local photon energy deposition 2019-09-13 07:10:43 -05:00
Paul Romano
d630047f4c Allow IncidentNeutron.from_endf to work on heatr output files 2019-09-13 07:10:43 -05:00
Andrew Johnson
99dfa1f053
Return defaultdict(dict) from Chain.get_default_fission_yields 2019-09-11 10:42:16 -05:00
Andrew Johnson
1a4bbb9068
Chain.get_thermal_fission_yields -> Chain.get_default_fission_yields 2019-09-11 10:41:58 -05:00
Paul Romano
0a14a5b7d8
Merge pull request #1341 from drewejohnson/fission-heating-bug
Fission heating fixes - mark redundant, consistent energy grid
2019-09-11 10:41:23 -05:00