ndiffusion.nearby_k_eigenvalue¶
- ndiffusion.nearby_k_eigenvalue(keig_solver, fixed_solver, mats, *, medium_map=None, edges_x=None, edges_y=None, geometry=None, mesh=None, bc=None, fit=None, adjoint_solver=None, nearby=True, method='iterative', tol=1e-08, max_iter=200)[source]¶
Run the method of nearby problems for a k-eigenvalue diffusion solve.
The nearby problem
M phi = (1/k) F phi + ris solved by a power iteration. Withmethod="iterative"each outer step is afixed_solversolve (it inverts the same loss+scatter operatorMas the k-eigenvalue solver). Withmethod="direct"(unstructured mesh andbc=only)Mis assembled byunstructured_operator()and factorized once, which is much faster, andfixed_solvermay be None.- Parameters:
keig_solver (KEigenSolver / KEigenSolver2D / KEigenSolverUnstructured2D) – Solver whose
.solve()returns aDiffusionResult(flux + keff).fixed_solver (matching FixedSource* solver, or None with
method="direct") – Built with the same materials, mesh, and boundary conditions.mats (Materials)
medium_map – Geometry descriptor, as in
nearby_fixed_source().edges_x – Geometry descriptor, as in
nearby_fixed_source().edges_y – Geometry descriptor, as in
nearby_fixed_source().geometry – Geometry descriptor, as in
nearby_fixed_source().mesh – Geometry descriptor, as in
nearby_fixed_source().bc – The unstructured curve fit, as in
nearby_fixed_source().fit – The unstructured curve fit, as in
nearby_fixed_source().adjoint_solver (matching KEigen* solver, optional) – Built on
make_adjoint_materials()ofmats(same mesh and boundary conditions). Its flux gives the one-shot eigenvalue error estimatek_error_adjointand its per-cell contributionsk_error_cells. Withmethod="direct"the adjoint is instead the exact discrete one, from the assembled operator, and this is ignored.nearby (bool, default True) – Run the nearby power iteration. With
nearby=Falseonly the fit and the one-shot estimate are formed;nearby_fluxandk_nearbyare then None.method ({"iterative", "direct"}) – How the nearby problem and the adjoint are solved (see above).
tol (float) – Convergence tolerance on the flux change and
|dk|.max_iter (int) – Maximum nearby power-iteration steps.
- Returns:
numerical(raw k result),curve_fit,k_curve_fit,nearby_flux,k_nearby,residual, andnearby_rate(the curve-fit fission production integral). The arrays are shaped(n_cells, G), like the solver flux.k_nearby - k_curve_fitestimates the eigenvalue discretization error, and so doesk_error_adjointwhen an adjoint is available (k_error_cellssums to it). On layouts whose error contributions cancel - material corners, small inclusions -k_error_cellsand the local error are more reliable than the net eigenvalue estimate; the sum ofabs(k_error_cells)is a (loose) bound.fitis the constrained spline fit (SplineFit) when one was used andoperatorthe assembled operator withmethod="direct"; both feednearby_qoi().- Return type: