pyopensn.solver.PowerIterationKEigenSolver

class pyopensn.solver.PowerIterationKEigenSolver

Power iteration k-eigenvalue solver.

Wrapper of opensn::PowerIterationKEigenSolver.

The eigenvector is returned with an arbitrary scale that depends on the solver, the acceleration method, and the starting flux. Normalize absolute quantities (power, reaction rates, leakage, balance rates) explicitly, e.g. with power_normalization_target.

Advance(self: pyopensn.solver.Solver) → None

Advance the solver by one step.

Changes made to the problem since the last step are checked as in Execute. Initialize must be called first. Solver classes that do not implement stepping leave the state unchanged and log that Advance is unsupported.

For MPI transport solvers, this is a collective operation and must be called on all ranks.

ComputeBalanceTable(self: pyopensn.solver.PowerIterationKEigenSolver) → dict

Compute and return the global balance table using the solver’s normalization. This is a collective operation and must be called on all ranks.

Returns:

Dictionary with the following entries:

  • absorption_rate: Global absorption rate, approximately integral sigma_a * phi dV summed over groups and the full domain.

  • production_rate: Global volumetric production/source rate used by the solver, approximately integral Q dV summed over groups and the full domain.

  • inflow_rate: Global incoming boundary contribution integrated over incoming angular flux on boundaries. On reflecting boundaries the outgoing partial current is counted as the incoming one, so reflecting faces add equal amounts to inflow_rate and outflow_rate and cancel in balance.

  • outflow_rate: Global outgoing boundary contribution accumulated from face outflow tallies, including reflecting boundaries (see inflow_rate).

  • uncollided_outflow_rate: Present only for a problem with an uncollided flux. The outflow of the uncollided flux, which outflow_rate includes and ComputeLeakage() does not.

  • balance: Rate balance, production_rate + inflow_rate - absorption_rate - outflow_rate.

Return type:

dict

Notes

For k-eigenvalue balance reporting, this solver scales the production term by 1 / k_eff before forming both production_rate and balance.

Execute(self: pyopensn.solver.Solver) → None

Execute the solver.

The problem’s current state and the solver’s requirements are checked first, so changes made to the problem after Initialize (for example a mode switch or SetXSMap) are validated before they are used. Initialize must be called before Execute.

For MPI transport solvers, this is a collective operation and must be called on all ranks.

GetEigenvalue(self: pyopensn.solver.PowerIterationKEigenSolver) → float

Return the current k-eigenvalue.

GetFissionSourceChange(self: pyopensn.solver.PowerIterationKEigenSolver) → float

Return the root-mean-square relative change of the normalized cell fission sources in the last power iteration of Execute(). Returns 0 when fission_source_tol is 0.

GetNumPowerIterations(self: pyopensn.solver.PowerIterationKEigenSolver) → int

Return the number of completed power iterations.

GetNumSweeps(self: pyopensn.solver.PowerIterationKEigenSolver) → int

Return the total number of transport sweeps applied by all WGS solvers.

Initialize(self: pyopensn.solver.Solver) → None

Initialize the solver.

Solvers check that the problem is in a supported state (for example, steady-state mode without external sources for the k-eigenvalue solvers) and raise ValueError otherwise. Setup and post-setup validation must both succeed. Calling Initialize again clears the previous initialized state first.

For MPI transport solvers, this is a collective operation and must be called on all ranks.

IsConverged(self: pyopensn.solver.PowerIterationKEigenSolver) → bool

Return True if the last Execute() met the convergence criteria.

Convergence requires the k-eigenvalue test on k_tol and, unless fission_source_tol is 0, the fission-source test on fission_source_tol to pass and, when an acceleration method is attached, its own convergence check (CMFD requires that the last correction was not skipped) to pass. Returns False if max_iters was reached first.

__init__(self: pyopensn.solver.PowerIterationKEigenSolver, **kwargs) → None

Construct a power iteration k-eigen solver.

Parameters:
  • problem (pyopensn.solver.DiscreteOrdinatesProblem) – Existing DiscreteOrdinatesProblem instance.

  • acceleration (pyopensn.solver.DiscreteOrdinatesKEigenAcceleration) – Optional DiscreteOrdinatesKEigenAcceleration instance for acceleration. It must be created for the same problem. Initialize() checks the requirements of the acceleration method against the problem and raises a ValueError listing every violation.

  • max_iters (int, default = 1000) – Maximum power iterations allowed.

  • k_tol (float, default = 1.0e-10) – Tolerance on the estimated relative error of the k-eigenvalue. The iteration converges when the relative change of k between power iterations is below k_tol * (1 - rho) in two consecutive iterations, where rho is the convergence rate estimated from the change of the production-normalized flux. Values below 1.0e-12 are treated as 1.0e-12.

  • fission_source_tol (float, default = 1.0e-6) – Tolerance on the estimated error of the fission-source shape. Each fissionable cell’s fission production is divided by the total production, and the root-mean-square relative change of these cell sources between power iterations must be below fission_source_tol * (1 - rho), with rho as for k_tol, or below the round-off level 100 * eps (about 2.2e-14), which also passes. A cell whose previous source is not positive adds nothing to the sum but counts as a cell. This test is applied in addition to the k_tol test, because k can settle while the flux shape still changes. It needs a positive, finite fission production: a starting flux without one, such as a zero flux with reset_phi0=False, raises an error when Execute() starts. 0 disables it.

  • sweeps_per_update (int, default = 0) – Maximum number of within-group iterations of each groupset in each across-groupset (AGS) pass of a power iteration. A power iteration makes one AGS pass unless max_ags_iterations is set. The number of sweeps depends on the within-group method: an iteration is one sweep with classic_richardson, and the PETSc methods make additional sweeps, for the right-hand side and to rebuild the angular flux. 0 selects 1, or the deprecated update_wgs_max_its of pyopensn.solver.CMFDAcceleration when that is given. Use 2: it changes the total sweeps little and can make the power iteration converge where one iteration oscillates. Applies only with pyopensn.solver.CMFDAcceleration; other acceleration methods reject it.

  • reset_phi0 (bool, default=True) – If true, reinitializes scalar fluxes to 1.0.

  • compute_balance (bool, default=False) – If true, print the balance table, with production scaled by 1/k_eff, after Execute() completes.

Notes

With more than one groupset, each power iteration makes one across-groupset pass unless the problem sets max_ags_iterations.

If the problem was constructed with options={'read_restart_path': ...}, restart data is read during Initialize(). If it was constructed with options={'restart_writes_enabled': True, ...}, timed restart dumps may be written during the outer iteration loop and a final restart dump is written when execution completes.