Commit graph

365 commits

Author SHA1 Message Date
Paul Romano
aa89604f78 Add CellInstanceFilter to documentation 2019-12-12 06:59:01 -06:00
Ethan Peterson
15c7148331 Adding SphericalIndependent source type
Applied suggestions from code review

Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
2019-11-11 10:50:38 -05:00
Paul Romano
5b195b6e9f Various fixes and updates in documentation 2019-10-04 14:00:22 -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
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
Andrew Johnson
df387e87dc
Document concrete and abstract depletion solvers 2019-09-19 16:51:38 -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
Andrew Johnson
7a2b52dd84
Apply suggestions from code review
Co-Authored-By: Paul Romano <paul.k.romano@gmail.com>
2019-09-19 08:05:30 -05:00
Andrew Johnson
72471d249f
Expand openmc.deplete documentation: minimal example and ABCs
Slight reformatting of the depletion documentation. The "Primary API"
is presented at the top, including integrators and the Operator.
This section is followed by a "Minimal Example" that demonstrates
how one might instantiate an Operator, and use it for depletion.
The comm communicator is moved into the "Internal Classes and Functions"
section, as the end-user is less likely to interact with this directly.
Lastly, a section on "Abstract Base Classes" is provided and expanded,
documenting the purpose of specific ABCs.
2019-09-17 14:56:31 -05:00
Andrew Johnson
2428702fb6
Improved documentation for depletion module
* __call__ methods for Operator documented
* CRAM16 and CRAM48 are closer to the top of the page
* Document deplete and timed_deplete functions
* Abstract integrators documented as part of abc submodule
* Abstract operator helpers documented as part of abc submodule
2019-09-17 13:38:23 -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
Paul Romano
bbb0b78383 Rename openmc.capi -> openmc.lib 2019-09-13 10:38:26 -05:00
Andrew Johnson
aa86aa5262
Improve documentation for FissionYieldHelpers
Add a separate section in the documentation describing
the helpers.

Reword purpose of mat_indexes in generate_tallies
2019-08-15 09:18:56 -05:00
Andrew Johnson
454e6cc6b6
Add AveragedFissionYieldHelper operator helper
Computes the effective fission yields for nuclides
with multiple sets of yields by
1) Tallying fission rate and energy-weighted fission rate
2) Determining average energy at which fission events occur
3) Interpolating [lin-lin] between adjacent fission yields based
   on this average energy

Uses a second tally with an EnergyFunctionFilter to tally
E * sigma_f * phi.

Added unit tests with the proxy-style class that doesn't use the
C API to generate tallies but tests all other aspects of the
implementation. Tests cover three possible average energies
(below minimum supplied yield energy, above max supplied yield energy,
and between two)

The Operator uses fission_yield_mode="average" to select this helper.
The helper also has a from_operator class method.
2019-08-14 17:39:57 -05:00
Andrew Johnson
f82dc83473
Add FissionYieldCutoffHelper for weighting yields by a cutoff energy
This helper performs the following tasks to weight fission yields:
1) Determine a set of "fast" and "thermal" yields
based on a user specified cutoff energy,
2) Tally fission rates above and below the cutoff, and
3) Compute the effective yield by weighting the fast and
thermal yields by the fraction of fast and thermal fissions
for all nuclides in all burnable materials.

The user is allowed to specify the cutoff energy and energies
preferred for the fast and thermal yields. By default, the
cutoff is 112 eV, chosen as it is the logarithmic mean of
0.0253 eV and 500 keV. These two values are the default energies
for thermal and fast yields.

Tests are added to check for failure in constructing this
helper (thermal energy > cutoff, non-real values passed, etc.),
selection of yields given a range of user data, and
a proxy class that emulates a variety of thermal and fast splits
to check the eventual computed yield libraries.
2019-08-13 16:38:24 -05:00
Andrew Johnson
ca435b0bda
Add TalliedFissionYieldHelper abstract helper
Designed to be subclassed by helpers that aim to compute
effective fission yields with tallied data.
Constructs a tally in all burnable materials, scoring the
fission rate in all nuclides that have non-zero density
(as reported by the Operator) and have multiple sets of yields.
For nuclides with non-zero densities and a single set of
yields, those yields are assumed to be constant across incident
neutron energies.

The unpack method is now abstract, as each subclass should have
its own data layout, some with different energy structures
perhaps?? Maybe some weighting functions?
2019-08-13 16:20:55 -05:00
Andrew Johnson
d8b9f5db54
Add ConstantFissionYieldHelper concrete class
Given a requested energy, will take fission yields from that
energy on all nuclides and hold them as constant throughout
the simulation. If the requested energy is not found for a specific
nuclide, then the closest energy is used. The default is to
take the thermal 0.0253 eV yields.

This is now the helper attached to the Operator. The user can
select what energy of yields they would like to use.
2019-08-13 16:01:50 -05:00
Andrew Johnson
2cfbb21858
Provide abstract FissionYieldHelper class
API used by the Operator:
- generate_tallies
- weighted_yields [abstract]
- update_nuclides_from_operator
- unpack

generate_tallies and unpack are empty methods, provided
so that a consistent API can be found on helpers
with tallies.

Sorts nuclides into two dictionaries: those with a single
set of fission yields, and those with multiple sets.
The former can is exposed through the
constant_yields property, returning a copy of the fission
yield dictionary {parent: {product: yield}}

The Operator now looks for/uses the weighted_yields and
update_nuclides_from_operator methods instead of the old
compute_yields and set_fissionable_nuclides methods
2019-08-13 15:30:14 -05:00
Andrew Johnson
fab859982f
Document openmc.deplete.nuclide.FissionYield 2019-08-13 10:13:04 -05:00
Andrew Johnson
d10b83e064
Document FissionYieldDistribution
Pretty internal, but people may be curious
2019-08-08 08:59:45 -05:00
Andrew Johnson
0bc7800a92
Move openmc.deplete.integrator into openmc.deplete
Much of the previous API is intact, with the major change
being CRAM functions are imported from openmc.deplete.cram
in the test_deplete_cram.

The integrator abstract classes are placed in
openmc/deplete/abc.py with all concrete classes going in to
openmc/deplete/integrators.py

Documentation updated accordingly
2019-08-07 11:04:37 -05:00
Andrew Johnson
5adc3b5816
Document special and abstract methods for Integrators 2019-08-07 09:13:14 -05:00
Andrew Johnson
18c4d5f432
Document init parameters and attributes for Integrators 2019-08-07 09:01:43 -05:00
Andrew Johnson
1bd663daf6
Rename integrator classes to be PEP8 complaint
Changes:
- EPC_RK4_Integrator -> EPCRK4Integrator
- SI_Integrator -> SIIntegrator
- SI_CELI_Integrator -> SICELIIntegrator
- SI_LEQI_Integrator -> SICELIIntegrator
2019-08-07 08:55:40 -05:00
Andrew Johnson
b9683dbdba
Merge branch 'develop' into integrator-class
Need new travis.yml to pass CI
2019-07-30 15:58:49 -05:00
Andrew Johnson
62865b3a55
Documentation fixes for pin func, depletion helpers 2019-07-29 15:57:29 -05:00
Andrew Johnson
1f3e7fdac1
Remove si_leqi in favor of SI_LEQI_Integrator
The depletion function openmc.deplete.si_leqi has been
removed in favor of the SI_LEQI_Integrator class. The same
depletion scheme can be obtained with the following commands:

   >>> leqi = openmc.deplete.SI_LEQI_Integrator(operator, dt, power)
   >>> leqi.integrate()

The expression can be onlined for compactness.

The si_celi_inner function has been removed completely now,
as the SI_CELI iteration is performed by directly calling
SI_CELI_Integrator.__call__ through the SI_LEQI_Integrator.
This is similar to how the LEQIIntegrator handles the initial steps.

Tests have been updated to use this class, and the class has been
added to the documentation. No pure-function integration
schemes exist anymore.
2019-07-29 10:34:59 -05:00
Andrew Johnson
d28546bcd6
Add SI_Integrator, SI_CELI_Integrator classes; remove si_celi
The si_celi depletion function has been removed. The
SI-CELI method can be implemented with
    >>> from openmc.deplete import SI_CELI_Integrator
    >>> SI_CELI_Integrator(op, dt, power, stages).integrate()

The stages parameter is optional, and defaults to 10 to
be consistent with the previous default for si_celi.

The SI_CELI_Integrator inherits from the new abstract base class
SI_Integrator. There are a few differences in how the SI-based
methods perform the integration.

- The initial, t=0.0, i=0, no restart transport solution is scaled
  by the number of stages.
- The SI methods also do not perform a new transport solution at
  each successive iteration [t>0, i>0]. Instead, the reaction
  rates are pulled from the last stage of the previous step.
- There is no final transport solution once all the depletion
  steps have been taken. The final reaction rates are saved as
  those from the last stage of the last depletion step.

The si_celi function has been removed from documentation and testing,
and replaced with the SI_CELI_Integrator.
2019-07-26 16:58:51 -05:00
Andrew Johnson
39b4d8a1fe
Remove epc_rk4 for EPC_RK4_Integrator class
The function openmc.deplete.epc_rk4 has been removed
in favor of openmc.deplete.EPC_RK4_Integrator. The scheme
can be used with::

    >>> from openmc.deplete import EPC_RK4_Integrator
    >>> EPC_RK4_Integrator(op, dt, power).integrate()

epc_rk4 has been removed from the documentation, and the
EPC_RK4_Integrator class has been added to the depletion
API documentation
2019-07-26 09:49:58 -05:00
Paul Romano
b4b063482e
Merge pull request #1278 from drewejohnson/feat-dep-tally-op
Tally and Q value helper for depletion Operators
2019-07-24 10:54:33 -05:00
Andrew Johnson
9f41dce1d2
Return energy in J/s/source neutron for EnergyHelper
Addressing comments in review for #1278

- Documentation cleanup
- Better naming convention regarding ReactionRateHelper
  results cache
- The power in Operator tally unpacking and normalizing is
  no longer converted to eV/s, since the EnergyHelper.energy
  property is now returned in J/s/source neutron
2019-07-23 08:32:31 -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
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
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
Andrew Johnson
87fea93714
Add opemc.model.pin to python api documentation 2019-07-09 20:25:34 -05:00
Andrew Johnson
9cbbc6e6b9
Document abstract and concrete operator helpers 2019-07-05 13:37:12 -05:00
Paul Romano
d9b27cca53 Respond to @nelsonag comments on #1271 2019-07-01 07:09:10 -05:00
Paul Romano
51c8c2e0bc Refactor classes in openmc.data.ThermalScattering 2019-06-25 07:31:53 -05:00
Paul Romano
da5f7440b1 Remove get_ from get_hexagonal_prism, get_rectangular_prism 2019-06-18 06:17:54 -05:00
Paul Romano
52293dae83 Improve display of Python API in generated HTML documentation 2019-06-14 14:35:39 -05:00
Paul Romano
ea92cc1800 Fix name of capi.RegularMesh in documentation 2019-06-14 12:13:34 -05:00
Sterling Harper
9ddd8b3067 Change Python Mesh class to RegularMesh 2019-06-07 08:51:09 -04:00
Sterling Harper
7cf1822410 Add RectilinearMesh to documentation 2019-05-29 22:02:43 -04:00
Paul Romano
2943e38a81 Add Plane.from_points and cylinder_from_points convenience functions 2019-03-06 15:38:22 -06:00
Paul Romano
ed0b8808fa Merge branch 'develop' into cpp-material 2019-01-31 23:10:50 -06:00
liangjg
760baa43d6 address review comments from @paulromano 2019-01-31 12:01:55 -05:00
Paul Romano
d790cdfb46 Update list of publications, fix documentation for CMFD 2019-01-30 22:15:48 -06:00
liangjg
6f3aeed89a fix test error 2019-01-23 16:53:31 -05:00