ndiffusion.KEigenSolver2D

class ndiffusion.KEigenSolver2D

Matrix-free 2-D multigroup neutron diffusion k-eigenvalue solver on a structured Cartesian or RZ mesh.

result.flux has shape (nx*ny, n_groups); reshape(nx, ny, n_groups) gives the grid.

Robin BCs, one per group: bc_x on the right (x=nx) edge, bc_y on the top (y=ny), bc_x_left on the left (x=0) and bc_y_bottom on the bottom (y=0). The last two default to reflective; in RZ bc_y_bottom must stay reflective when the mesh starts on the axis.

__init__(self: ndiffusion._core.KEigenSolver2D, mats: ndiffusion._core.Materials, medium_map: numpy.ndarray[int32], edges_x: numpy.ndarray[float64], edges_y: numpy.ndarray[float64], geom: ndiffusion._core.Geometry2D, bc_x: collections.abc.Sequence[ndiffusion._core.BoundaryCondition], bc_y: collections.abc.Sequence[ndiffusion._core.BoundaryCondition], epsilon: SupportsFloat | SupportsIndex = 1e-08, max_outer: SupportsInt | SupportsIndex = 200, max_inner: SupportsInt | SupportsIndex = 1000, verbose: bool = False, use_cg: bool | None = None, bc_x_left: collections.abc.Sequence[ndiffusion._core.BoundaryCondition] = [], bc_y_bottom: collections.abc.Sequence[ndiffusion._core.BoundaryCondition] = []) → None

Methods

__init__(self, mats, medium_map, edges_x, ...)

set_use_cg(self, use_cg)

Select the within-group inner solver: False = line-TDMA Gauss-Seidel; True = matrix-free Jacobi-preconditioned CG.

solve(self)

Run power iteration and return a DiffusionResult.

Attributes

property n_cells
property n_groups
set_use_cg(self: ndiffusion._core.KEigenSolver2D, use_cg: bool) → None

Select the within-group inner solver: False = line-TDMA Gauss-Seidel; True = matrix-free Jacobi-preconditioned CG. Also a constructor argument; the NDIFFUSION_KEIG_CG env var sets the default when neither is given.

solve(self: ndiffusion._core.KEigenSolver2D) → ndiffusion._core.DiffusionResult

Run power iteration and return a DiffusionResult.