discrete1.utils.manufactured module

Functions for manufactured solutions.

Provides solutions for given steady state and time-dependent problems. Includes functions to calculate the order of accuracy.

discrete1.utils.manufactured.order_accuracy(error1, error2, ratio)[source]

Calculate order of accuracy.

Finding the order of accuracy between errors on different grids where error2 is the refined grid.

Parameters:
  • error1 (float) – Error between an approximate solution and the reference solution on the same grid.

  • error2 (float) – Error between an approximate solution and the reference solution on a more refined grid.

  • ratio (float) – Ratio between the spatial cell width of the error1 grid and the error2 grid (delta x1 / delta x2).

Returns:

Order of accuracy.

Return type:

float

discrete1.utils.manufactured.solution_ss_01(x, angle_x)[source]

One material, single direction.

discrete1.utils.manufactured.solution_ss_02(x, angle_x)[source]

One material, angular dependent.

discrete1.utils.manufactured.solution_ss_03(x, angle_x)[source]

One material, angular dependent, with source.

discrete1.utils.manufactured.solution_ss_04(x, angle_x)[source]

Two materials, angular independent.

discrete1.utils.manufactured.solution_ss_05(x, angle_x)[source]

Two materials, angular dependent.

discrete1.utils.manufactured.solution_td_01(x, angle_x, edges_t)[source]

One material, time dependent, angular independent.

discrete1.utils.manufactured.solution_td_02(x, angle_x, edges_t)[source]

One material, time dependent, angular dependent.

discrete1.utils.manufactured.spatial_error(approx, reference, ndims=1)[source]

Calculate the spatial error between approximate and reference solutions.

Parameters:
  • approx (numpy.ndarray) – Approximate flux.

  • reference (numpy.ndarray) – Reference flux.

  • ndims (int) – Number of spatial dimensions for flux (1 or 2).

Returns:

L2 error normalized for the number of spatial cells.

Return type:

float

discrete1.utils.manufactured.wynn_epsilon(lst, rank)[source]

Perform Wynn Epsilon Convergence Algorithm.

Parameters:
  • lst (list) – List of float type. Values for convergence.

  • rank (int) – Rank of system.

Returns:

2D array with float type of shape (2 * rank + 2, 2 * rank + 2). Diagonal is convergence.

Return type:

numpy.ndarray