pyopensn.solver.PowerIterationKEigenSolver

class pyopensn.solver.PowerIterationKEigenSolver

Power iteration k-eigenvalue solver.

Wrapper of opensn::PowerIterationKEigenSolver.

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.

  • outflow_rate: Global outgoing boundary contribution accumulated from face outflow tallies.

  • 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.

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.

__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 relative change of the k-eigenvalue between power iterations. The iteration converges when the change is below k_tol in two consecutive iterations. Values below 1.0e-12 are treated as 1.0e-12.

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

Notes

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.