ndiffusion.KEigenSolverUnstructured2D

class ndiffusion.KEigenSolverUnstructured2D

Matrix-free 2-D multigroup neutron diffusion k-eigenvalue solver on an unstructured polygonal mesh.

Uses cell-centered finite-volume method with point Gauss-Seidel.

result.flux has shape (n_cells, n_groups).

bc has size n_bc_types * n_groups; bc[tag*G+g] is the BC for tag ‘tag’, group g. Boundary faces with no matching bc_tag use tag 0.

An epsilon tighter than round-off allows on the mesh cannot be met; the inner sweeps stop once their change stops shrinking, so such a solve ends at max_outer with a ConvergenceWarning instead of grinding through max_inner sweeps every outer iteration.

__init__(self: ndiffusion._core.KEigenSolverUnstructured2D, mats: ndiffusion._core.Materials, mesh: ndiffusion._core.UnstructuredMesh2D, bc: 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) → None

Methods

__init__(self, mats, mesh, bc[, epsilon, ...])

set_use_cg(self, use_cg)

Select the within-group inner solver: False = point 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.KEigenSolverUnstructured2D, use_cg: bool) → None

Select the within-group inner solver: False = point 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.KEigenSolverUnstructured2D) → ndiffusion._core.DiffusionResult

Run power iteration and return a DiffusionResult.