Commit graph

9978 commits

Author SHA1 Message Date
Patrick Shriwise
81bf0a67da Implementing intersection and union operators for BoundingBox. 2019-07-18 13:54:24 -05:00
Andrew Johnson
d0d4a05c75
Add a dictionary to map local to global burnable materials
Removes the need to call self.burnable_mats.index
for every local material at every depletion step
2019-07-18 13:13:13 -05:00
Patrick Shriwise
07c9083446 Using default constructor when returning unbounded boxes. 2019-07-18 13:02:08 -05:00
Patrick Shriwise
6d97188413 Creating a default virtual definition for a surfce bounding box and removing redundant definitions of surfaces with unbounded boxes. 2019-07-18 12:57:23 -05:00
Andrew Johnson
15c2bc2de3
Use correct material index in operator unpacking
Fix a bug introduced where the material iteration index,

        for i, mat in enumerate(self.local_mats):

was used for the global __material__ index. The value of i
was used to extract reaction rate tallies for that material.
This causes an issue with multiple operators on MPI processes,
where an Operator`s material i does not equal the i-th burnable
material.
2019-07-18 12:39:05 -05:00
Patrick Shriwise
520b07a131 Using C-types only in capi function definitions. 2019-07-18 12:29:30 -05:00
Patrick Shriwise
54df651888 Adding Material accessors for name. 2019-07-18 12:25:53 -05:00
Patrick Shriwise
df379471dd Adding Cell accessors for name. 2019-07-18 12:19:13 -05:00
Andrew Johnson
d3a7e73320
Update transfer volumes test with PredictorIntegrator 2019-07-18 08:37:17 -05:00
Andrew Johnson
dae48b77e0
Remove cf4 function for deplete.CF4Integrator
The function openmc.deplete.cf4 has been removed in favor
of openmc.deplete.CF4Integrator. The CF4 integration scheme
can be peformed with

>>> from openmc.deplete import CF4Integrator
>>> CF4Integrator(operator, time, power).integrate()
2019-07-17 17:18:56 -05:00
Andrew Johnson
769f903dbc
Remove celi, leqi functions for CELIIntegrator, LEQIIntegrator
The depletion functions openmc.deplete.celi and
openmc.deplete.leqi hvae been removed in favor of a class-based
approach. The following syntax will replicate the behavior
of the integration schemes:

>>> from openmc.deplete import CELIIntegrator
>>> celi = CELIIntegrator(operator, time, power)
>>> celi.integrate()

The expression can be reduced to a single line:

>>> LEQIIntegrator(operator, time, power).integrate()
2019-07-17 16:46:30 -05:00
Andrew Johnson
1d791a16c9
Pass iteration index to Integrator.__call__
For the higher order methods, like LEQI, a lower order
method may be called for the first few steps. The LEQI
method, with no restart data, will call CELI for the first
iteration. To aid this, concrete Integrator classes will be
passed an integer for the current iteration.

Some methods, like the CECM and CELI, do not need this information.
To maintain a consistent API, the iteration is an optional value
to be passed to CECM.__call__, but will not be used. The default
value in the call signature is ``_i=-1``, with documentation repeating
that the value is not used nor needed.
2019-07-17 16:29:55 -05:00
Andrew Johnson
f0bb600271
Remove predictor function for deplete.PredictorIntegrator
The depletion function openmc.deplete.predictor has been removed
in favor of a class-based approach. The following syntax will
replicate the behavior of the predictor integration scheme:

>>> from openmc.deplete import PredictorIntegrator
>>> predictor = PredictorIntegrator(operator, time, power)
>>> predictor.integrate()`

The expression can be reduced to a single line:

>>> PredictorIntegrator(operator, time, power).integrate()
2019-07-17 13:39:05 -05:00
Paul Romano
1f0e0bfcec
Merge pull request #1294 from drewejohnson/capt-branch-tol
Add a litle tolerance for capture branching ratios
2019-07-16 22:10:54 -05:00
Patrick Shriwise
08e78a3215 Removing unecessary forward declaration. 2019-07-16 17:09:44 -05:00
Andrew Johnson
676b8d48a3
Add a litle tolerance for capture branching ratios
When adding capture branching ratios to a ``Chain``,
the sum of ratios for a given parent nuclide was allowed to be no
greater than 1.0. This limit is very tight, and does not allow
for minor floating point precision differences, like
1.0000000002.

The maximum value the sum of branching ratios from a single
parent is now 1.00001, with no equality check. This has
been added to the method docstring for transparency.

Some content was removed from the docstring that implied that
``branch_ratios`` would be modified in place. This is not the case,
and thus the content was removed.
2019-07-16 16:54:14 -05:00
Patrick Shriwise
d79a5edb8a Small formatting fixes. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
7409ad4632 Some doc strings for new capi functions. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
b373fd5931 Finalizing the capi after the complex cell test. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
3e0dc41ea1 Adding documentation to CAPI bounding box function. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
1d02c87466 Some self-review. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
9fab83c70c Style fix in capi core. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
77d40effb1 Adding a test for complex cell bounding boxes. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
d223046b30 Adding complement operator back into internal cell RPN. Updating complex_cell bounding box algorithm to parse existing RPN. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
e9ac007367 Removing complement from internal RPN. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
542ce3f15e Adding material/cell name tests. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
1d075cefdd Adding name property to CAPI cell/material classes. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
a105702455 Updates to CAPI bounding box methods. Addition of global bounding box method. Adding tests for PWR pincell model. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
2ac505814e Adding test for universe bounding box. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
ecbf7596c0 Corrections to surface bounding boxes based on sign. Corrections to cell/universe bounding boxes and capi exposure. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
08239a98d2 Adding a bounding box method to the universe class. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
470e26c783 Adding bbox defs for cells. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
446e78cb87 Updating bounding box definitions for all surfaces. 2019-07-16 16:52:30 -05:00
Patrick Shriwise
b68e7ca902 Adding bounding box methods to all Surface types. 2019-07-16 16:50:33 -05:00
Amanda Lund
61c911cffd
Merge pull request #1286 from paulromano/api-improvements
Improve C++ interface for tallies, filters, materials
2019-07-16 13:19:28 -05:00
Andrew Johnson
f432be0c05
Remove cecm function for deplete.CECMIntegrator
The cecm function has been removed from the python api.
In order to use the cecm integration scheme,
the following class based approach is now expected:

>>> from openmc.deplete import CECMIntegrator
>>> cecm = CECMIntegrator(operator, timesteps, power)
>>> cecm.integrate()

if the integrator is not needed, this above expression can be
one-lined with

>>> CECMIntegrator(operator, timesteps, power).integrate()

Unit tests have been updated to no longer use the cecm function,
and cecm has been removed from documentation.
The CECMIntegrator has been added to documentation.
2019-07-16 11:07:49 -05:00
Paul Romano
86dcdf75ed
Fix type in SphericalHarmonicsFilter::set_cosine
Co-Authored-By: Amanda Lund <alund@anl.gov>
2019-07-16 11:01:36 -05:00
Paul Romano
88b28c6ff4 Respond to @amandalund comments on #1286 2019-07-16 06:21:42 -05:00
Paul Romano
ff4c70c477
Merge pull request #1284 from drewejohnson/feat-capture-branch
Chain get/set capture branching ratios
2019-07-15 12:52:30 -05:00
Andrew Johnson
3b8d9758bf
Improve array filling/accessing for Operator.__call__
When possible, replaced ``x[:, :, :] = y`` with  ``x.fill(y)``.
Simple performance tests showed the approaches to be identical
with respect to process time. The latter maintains more
flexibility; whatever the shape of x becomes, no changes
need to be made, so long as x has a ``fill`` method.

Replaced ``rates[i, :, :] = ...`` with ``rates[i]`` per
reviewer comments
2019-07-15 11:55:08 -05:00
Andrew Johnson
d23fa7cf65
Improve documentation for Operator helpers 2019-07-15 11:39:05 -05:00
Andrew Johnson
f762803513
DirectRxnRateHelper -> DirectReactionRateHelper 2019-07-15 11:15:29 -05:00
Andrew Johnson
0aebbc1379
Document nuclides attributes for Operator helpers
Remove some pass statements for abstract methods as well
2019-07-15 11:13:45 -05:00
Andrew Johnson
ec2b181610
Fix all_meta logic in Chain.set_capture_branches 2019-07-15 09:12:29 -05:00
Andrew Johnson
a8dc9dd562
Use warnings.warn when setting capture branching ratios
Remove calls to print for the following cases:
1) Parent nuclides not found in chain
2) Nuclides with requested branching ratios did not have capture
reactions
3) Product nuclides not found in chain
2019-07-15 09:10:13 -05:00
Paul Romano
1f0fde281c
Merge pull request #1281 from drewejohnson/fix-material-get-temp
Read in material temperatures from xml subelement
2019-07-15 08:10:10 -05:00
Paul Romano
a55ff7539a
Merge pull request #1276 from drewejohnson/feat-pin
Add openmc.model.pin convenience function
2019-07-15 07:21:35 -05:00
Andrew Johnson
768949a972
Add support for non-Materials to be used in pin function
Anything that can be filled by a cell can be passed to
openmc.model.pin, including Universes and lattices.
Checks are included for the volume division, as not
all supported items, like Lattice instances, have volume
attributes.

A test was added to check this capability, where a universe
is used as one of the interior elements for the pin.

Various cosmetic changes to address reviewer comments.
2019-07-12 17:08:47 -05:00
Andrew Johnson
0cebc507a9
Add support for Universe kwargs to openmc.model.pin 2019-07-12 16:45:48 -05:00
Andrew Johnson
60d92f89d2
Add temperatures to statepoints, Material.from_hdf5
Also include material attributes to summary format documentation
2019-07-12 14:23:55 -05:00