Skip to content
Projects

Convergence checks

The equations of opencr.solvers.diagnostics, declared on the code that implements them and checked by the tests.

relative_residual

functionsource

Return max_i |R_i| / (sum_r |N_ir| w_r), the residual relative to the gross flow.

residual
ϵR=max⁡i∣Ri∣∑r∣νir∣ wr\epsilon_R = \max_i \frac{|R_i|}{\sum_r |\nu_{ir}|\, w_r}
conservation
ϵe=∣∑iceini−Ne∣Ne\epsilon_e = \frac{\big|\sum_i c_{ei} n_i - N_e\big|}{N_e}
Assumes
  • the residual over the gross flow through state ii (1 where there is none)
  • the conservation error is reported (and enters the continuation's stopping test), but never raises on its own