arfc / moltres

Repository for Moltres, a code for simulating Molten Salt Reactors
GNU Lesser General Public License v2.1
66 stars 41 forks source link

Fix InScatter Jacobian term for Serpent cross sections #163

Closed smpark7 closed 3 years ago

smpark7 commented 3 years ago

Closes #160

This PR fixes the OffDiagJacobian formulation for the InScatter kernel. In particular, the OffDiagJacobian formulation for the derivative of the group flux scattering term with respect to temperature is wrong when running a simulation with Serpent cross sections. This is because the scattering matrix from Serpent is the transpose of the matrix from SCALE. The Residual formulation in InScatter reflects the correct indexing in the if loops.

For the new test concerning Serpent cross sections, I replicated the coupled neutronics/temperature test from twod_axi_coupled/auto_diff_rho.i. I copied the newt_msre_fuel_* and newt_msre_mod_* SCALE cross section txt files in property_file_dir and converted them to mimic cross section files from Serpent by:

  1. Renaming the postfixes of the filenames based on Serpent's naming convention, i.e. FISSE->KAPPA, FISSXS->FISS, RECIPVEL->INVV, DECAY_CONSTANT->LAMBDA, GTRANSFX->SP0.
  2. Transposing the scattering cross section matrix in SP0.

I created a new test input file auto_diff_rho_serpent.i from auto_diff_rho.i by changing the provided cross section file paths to the converted cross section files I placed in $MOLTRES/property_file_dir/newt_msre_converted_to_serpent.

auto_diff_rho.i is a transient simulation of a 2D MSRE-based geometry towards steady state with adaptive time-stepping. In the old auto_diff_rho.i, the simulation stops when it reaches an end_time of 10000s, long after steady state is reached at t\~1000s. However, the convergence criteria in the Executioner settings are too lenient to catch minor errors in Jacobian formulations. For example, the present error in the InScatter Jacobian formulation allows the simulation to trudge along with smaller timesteps (dt\~0.1s) towards t=10000s. Therefore, I changed the stop criteria by setting a maximum 80 timesteps allowed, reducing the optimal iterations to 5, and turned on automatic steady state detection. The new setup typically reaches steady state by the 67th timestep at t=1009.51s. Without the fix to InScatter, auto_diff_rho_serpent.i terminates after 80 timesteps at t\~7.96249s without reaching steady state.