pyopensn.solver.SteadyStateSourceSolver

class pyopensn.solver.SteadyStateSourceSolver

Steady state solver.

Wrapper of opensn::SteadyStateSourceSolver.

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.SteadyStateSourceSolver) → 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. Omitted when CSDA is enabled, because it does not include CSDA particle deposition; use csda_particle_balance instead.

  • csda_particle_deposition_rate: Present only when CSDA is enabled. Rate at which particles slow down out of the lowest-energy group of each charged-particle block. Electron and positron contributions are both counted as positive.

  • csda_particle_balance: Present only when CSDA is enabled. Signed relative particle residual: production_rate + inflow_rate - absorption_rate - outflow_rate - csda_particle_deposition_rate, divided by production_rate + inflow_rate. Zero gain gives zero for a zero residual and signed infinity otherwise.

  • csda_energy_production_rate, csda_energy_inflow_rate, and csda_energy_outflow_rate: Present only when CSDA is enabled. Production, boundary inflow, and boundary outflow rates, each weighted by group-midpoint energy. For a converged solve, csda_energy_production_rate + csda_energy_inflow_rate - csda_energy_outflow_rate equals the integral of the csda_energy_deposition field function.

  • csda_energy_balance: Present only when CSDA is enabled. Signed relative energy residual: energy production plus boundary inflow, minus boundary outflow, collision energy loss, and CSDA continuous energy loss, all weighted by group-midpoint energy, divided by csda_energy_production_rate + csda_energy_inflow_rate. Zero gain gives zero for a zero residual and signed infinity otherwise.

Return type:

dict

Notes

This solver applies no extra normalization to the balance table. CSDA balance entries are convergence-sensitive and should be interpreted only after the linear solve has converged to the requested tolerance.

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.

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.SteadyStateSourceSolver, **kwargs) → None

Construct a steady state solver.

Parameters:

problem (pyopensn.solver.DiscreteOrdinatesProblem) – Existing discrete ordinates problem instance.

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, ...}, a restart dump is written after Execute() completes.

Restart files are rank-layout specific. A restart written with N MPI ranks must be read with the same rank count and a compatible problem definition.