Fix convergence stall in IMPTOTAL solver with REF1 and JGS_TERMINATE_DIFFERENCE on unstructured grids#1608
Open
leahcicon wants to merge 1 commit into
Open
Fix convergence stall in IMPTOTAL solver with REF1 and JGS_TERMINATE_DIFFERENCE on unstructured grids#1608leahcicon wants to merge 1 commit into
leahcicon wants to merge 1 commit into
Conversation
…DIFFERENCE on unstructured grids
Collaborator
|
Matrix Comparison tests were performed on Ursa-Intel. Known non-identical cases Unexpected differs |
Collaborator
|
@leahcicon In your PR description, you mentioned 'No changes expected in existing regression tests since this code path is only active with JGS_TERMINATE_DIFFERENCE = T and REF1 on unstructured grids.' However, our regression testing shows a number of unexpected result changes. Could you help explain why these changes are occurring and confirm whether they are expected? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Summary
Fix convergence stall in IMPTOTAL solver with REF1 and JGS_TERMINATE_DIFFERENCE on unstructured grids.
Description
This PR fixes a bug in PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK in w3profsmd_pdlib.F90 where the implicit solver (IMPTOTAL) fails to exit early when using JGS_BLOCK_GAUSS_SEIDEL = T, JGS_TERMINATE_DIFFERENCE = T, and the REF1 switch on unstructured grids. Instead of converging early, the solver stalls at approximately 16% converged nodes and runs to the maximum number of iterations. The number of converged nodes will change depending on the amount of grid nodes affected by REF1.
Root Cause:
The convergence metric was computed as:
Where ACLOC is the previous spectrum and eSum is the newly computed value. However, when REF1 is active, after eSum is assigned to VA, certain bins of VA are overwritten with VAOLD:
On the next iteration, ACLOC picks up these restored values. The result is that the interior nodes converge normally but the REF1 boundary bins never change between iterations. The residual |ACLOC - eSum| remains nonzero for those bins because eSum does not include the REF1 overwrite. prop_conv stalls at approximately the fraction of non-REF1 nodes and the JGS_TERMINATE_DIFFERENCE condition is never satisfied, causing the solver to run to maximum iterations.
Fix:
The convergence metric is changed to compare against VA after the REF1 overwrite has been applied, rather than eSum before it:
With this fix, for REF1 bins ACLOC - VA = 0, so those bins no longer pollute the convergence metric and the solver exits normally once the interior nodes converge.
Labels: bug
Answer changes: No change in answers is expected, the changes just allow for the early exit to happen.
Issue(s) addressed
Commit Message
Fix convergence stall in IMPTOTAL solver with REF1 and JGS_TERMINATE_DIFFERENCE on unstructured grids. The convergence metric in PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK in w3profsmd_pdlib.F90 now compares against VA after REF1 overwrite is applied rather than eSum before it, preventing REF1 boundary bins from polluting the residual and stalling prop_conv.
Check list
Testing
How were these changes tested? Preliminary runs with the fix applied show the solver exiting early around ~70 iterations as expected, rather than running to the maximum iteration count.
Are the changes covered by regression tests? Not currently. A regression test covering IMPTOTAL with REF1 on an unstructured grid with JGS_TERMINATE_DIFFERENCE = T would be needed to fully cover this fix.
Have the matrix regression tests been run? No
Expected changes in regression test output: No changes expected in existing regression tests since this code path is only active with JGS_TERMINATE_DIFFERENCE = T and REF1 on unstructured grids.
matrix.comp output: Not available.