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, print_output=False, **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.
  • print_output (bool) – Whether or not to print the OpenMC output during the iterations. Defaults to False.
  • **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