ndiffusion.nearby_fixed_source¶
- ndiffusion.nearby_fixed_source(solver, mats, source, *, medium_map=None, edges_x=None, edges_y=None, geometry=None, mesh=None, bc=None, fit=None, return_nearby=True)[source]¶
Run the method of nearby problems for a fixed-source diffusion solve.
- Parameters:
solver (FixedSourceSolver / FixedSourceSolver2D / FixedSourceSolverUnstructured2D) – A constructed solver whose
.solve(source)returns aFixedSourceResult.mats (Materials) – The same cross sections the solver was built with.
source (array-like) – Flat volumetric source
[n_cells * G](public layout).medium_map – Geometry descriptor (the solver does not expose its own). Use
(medium_map, edges_x, geometry)for 1-D,(medium_map, edges_x, edges_y, geometry)for 2-D structured, ormesh=for the unstructured FVM mesh.edges_x – Geometry descriptor (the solver does not expose its own). Use
(medium_map, edges_x, geometry)for 1-D,(medium_map, edges_x, edges_y, geometry)for 2-D structured, ormesh=for the unstructured FVM mesh.edges_y – Geometry descriptor (the solver does not expose its own). Use
(medium_map, edges_x, geometry)for 1-D,(medium_map, edges_x, edges_y, geometry)for 2-D structured, ormesh=for the unstructured FVM mesh.geometry – Geometry descriptor (the solver does not expose its own). Use
(medium_map, edges_x, geometry)for 1-D,(medium_map, edges_x, edges_y, geometry)for 2-D structured, ormesh=for the unstructured FVM mesh.mesh – Geometry descriptor (the solver does not expose its own). Use
(medium_map, edges_x, geometry)for 1-D,(medium_map, edges_x, edges_y, geometry)for 2-D structured, ormesh=for the unstructured FVM mesh.bc (list of BoundaryCondition, optional) – Unstructured mesh only: the tag-indexed boundary conditions the solver was built with. Given
bc, the curve fit is the constrained spline fit; without it, the per-cell polynomial fit.fit ({None, "spline", "local"}) – Force the unstructured curve fit;
Nonepicks"spline"whenbcis given.return_nearby (bool, default True) – If True, also solve the nearby problem and return the error estimate.
- Returns:
numerical(raw solver result),curve_fit,residual, and - whenreturn_nearby-nearby(raw solver result) anderror_estimate = nearby.flux - curve_fit, which estimatesphi_num - phi_exact. The arrays are shaped(n_cells, G), like the solver flux.- Return type: