Python API¶
Everything listed here is importable from the top-level ndiffusion package.
The solver classes, Materials, the mesh and the result types are compiled
from C++; the rest is pure Python.
Solvers¶
Matrix-free 1-D multigroup neutron diffusion k-eigenvalue solver. |
|
Matrix-free 1-D multigroup neutron diffusion fixed-source solver. |
|
1-D multigroup time-dependent neutron diffusion solver. |
|
Matrix-free 2-D multigroup neutron diffusion k-eigenvalue solver on a structured Cartesian or RZ mesh. |
|
Matrix-free 2-D multigroup neutron diffusion fixed-source solver on a structured Cartesian or RZ mesh. |
|
2-D multigroup time-dependent neutron diffusion solver on a structured Cartesian or RZ mesh. |
|
Matrix-free 2-D multigroup neutron diffusion k-eigenvalue solver on an unstructured polygonal mesh. |
|
Matrix-free 2-D multigroup neutron diffusion fixed-source solver on an unstructured polygonal mesh. |
|
2-D multigroup time-dependent neutron diffusion solver on an unstructured polygonal mesh. |
Inputs and results¶
Cross-section data for all materials and energy groups. |
|
Robin BC on one edge of the domain: A*phi + B*(dphi/dn) = 0, with n the outward normal, so the coefficients mean the same thing on every edge. |
|
Delayed neutron precursor data for the time-dependent solvers. |
|
Coordinate system for 1-D problems. |
|
Coordinate system for 2-D structured mesh problems. |
|
2-D unstructured mesh of polygonal cells. |
|
Issued when a solver stops at its iteration cap before meeting its tolerance. |
Building inputs¶
Build a configured Materials object from a list of cross-section dicts. |
|
Build a |
|
Convert one material's transport cross sections to diffusion ones. |
|
Build a flat medium_map list from a compact region specification. |
|
Compute Robin boundary condition coefficients. |
|
Return a new |
|
Build a |
|
Return a copy of mats with |
|
Standard 6-group delayed neutron parameters for thermal fission in U-235 (Keepin, Physics of Nuclear Kinetics, 1965). |
Meshes¶
Load a Gmsh .msh file into an UnstructuredMesh2D. |
|
Paint material indices onto an existing mesh. |
|
Return an independent copy of mesh, including any attached names. |
|
Raise ValueError unless the mesh connectivity is structurally sound: matching vx/vy lengths, cell_offsets starting at 0 and stepping by at least 3 per cell up to len(cell_vertices), vertex indices in range, paired bface_v0/bface_v1, and no zero-area cells. |
|
Return (cx, cy) cell centroids, each of length n_cells. |
|
Return the area of each cell, length n_cells. |
Post-processing¶
Cell volumes, in the same order as the solver's cells. |
|
Reaction rate density |
|
Fission power density |
|
Scale flux so the fission power integrates to total_power. |
|
Integrate a per-cell density over regions. |
|
Peak-to-average ratio of a power density. |
|
Write a solver result to an |
|
Read a result written by |
|
Recoverable energy per fission (J), the usual 200 MeV for U-235. |
|
Neutrons per thermal fission of U-235. |
Solution verification¶
Run the method of nearby problems for a fixed-source diffusion solve. |
|
Run the method of nearby problems for a k-eigenvalue diffusion solve. |
|
Discretization error of normalized quantities of interest. |
|
Assemble the sparse operator of the unstructured FVM solvers. |
|
Public helper: fission production |
|
Sparse unstructured FVM operator. |