Commit graph

353 commits

Author SHA1 Message Date
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
liangjg
952bddb61e update doc of openmc.deplete and openmc.Model.deplete 2019-01-21 00:00:05 -05:00
Paul Romano
3e3c9af0d0
Merge pull request #1131 from makeclean/muir_gauss
First commit of Muir/Gaussian sampling
2019-01-08 07:17:24 -06:00
Shikhar Kumar
c14680c26d Update documentation about C API dependence of CMFD and necessary import statements 2018-12-19 02:24:42 -05:00
Andrew Davis
a13d80e2bd Missing one review comment, and followed style for generic normal distribution from uniform distribuion 2018-12-13 15:37:47 +00:00
Shikhar Kumar
2874b4a2f9 Address @paulromano and @smharper comments 2018-12-11 18:00:06 -05:00
Shikhar Kumar
ee9a6ab065 So begins the CMFD Fortran purge :D (~3.6K lines) 2018-11-24 00:13:37 -05:00
amandalund
bbaad4ed93 Updated TRISO example notebook 2018-11-14 16:04:30 -06:00
Paul Romano
82f61a2a33 Get GROUP_STRUCTURES to show up in documentation 2018-11-07 07:36:08 -06:00
Will Boyd
a46aab8365 Made energy group structures a dict attached to the openmc.mgxs namespace; fixed typos for CASMO 70-group structure 2018-11-06 22:48:48 -05:00
Paul Romano
6847340f3b Remove references to compact fission energy release library (removed in #1032) 2018-09-26 10:22:57 -05:00
Zhuoran Han
dcf6cfe0a1 Change docs 2018-08-21 10:21:01 -05:00
Zhuoran Han
23f71ccfad Add Poly in docs 2018-08-17 16:40:17 -05:00