openmc.search_for_keff¶
- openmc.search_for_keff(model_builder, initial_guess=None, target=1.0, bracket=None, model_args=None, tol=None, bracketed_method='bisect', print_iterations=False, run_args=None, **kwargs)[source]¶
Function to perform a keff search by modifying a model parametrized by a single independent variable.
- Parameters
model_builder (collections.Callable) – Callable function which builds a model according to a passed parameter. This function must return an openmc.model.Model object.
initial_guess (Real, optional) – Initial guess for the parameter to be searched in model_builder. One of guess or bracket must be provided.
target (Real, optional) – keff value to search for, defaults to 1.0.
bracket (None or Iterable of Real, optional) – Bracketing interval to search for the solution; if not provided, a generic non-bracketing method is used. If provided, the brackets are used. Defaults to no brackets provided. One of guess or bracket must be provided. If both are provided, the bracket will be preferentially used.
model_args (dict, optional) – Keyword-based arguments to pass to the model_builder method. Defaults to no arguments.
tol (float) – Tolerance to pass to the search method
bracketed_method ({'brentq', 'brenth', 'ridder', 'bisect'}, optional) – Solution method to use; only applies if bracket is set, otherwise the Secant method is used. Defaults to ‘bisect’.
print_iterations (bool) – Whether or not to print the guess and the result during the iteration process. Defaults to False.
run_args (dict, optional) –
Keyword arguments to pass to
openmc.Model.run()
. Defaults to no arguments.New in version 0.13.1.
**kwargs – All remaining keyword arguments are passed to the root-finding method.
- Returns
zero_value (float) – Estimated value of the variable parameter where keff is the targeted value
guesses (List of Real) – List of guesses attempted by the search
results (List of 2-tuple of Real) – List of keffs and uncertainties corresponding to the guess attempted by the search