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.Initializemust be called first. Solver classes that do not implement stepping leave the state unchanged and log thatAdvanceis 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, approximatelyintegral sigma_a * phi dVsummed over groups and the full domain.production_rate: Global volumetric production/source rate used by the solver, approximatelyintegral Q dVsummed 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; usecsda_particle_balanceinstead.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 byproduction_rate + inflow_rate. Zero gain gives zero for a zero residual and signed infinity otherwise.csda_energy_production_rate,csda_energy_inflow_rate, andcsda_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_rateequals the integral of thecsda_energy_depositionfield 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 bycsda_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 orSetXSMap) are validated before they are used.Initializemust be called beforeExecute.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
ValueErrorotherwise. Setup and post-setup validation must both succeed. CallingInitializeagain 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 duringInitialize(). If it was constructed withoptions={'restart_writes_enabled': True, ...}, a restart dump is written afterExecute()completes.Restart files are rank-layout specific. A restart written with
NMPI ranks must be read with the same rank count and a compatible problem definition.