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.
Various issues were found in trying to determine (with @mjberger) why radially-symmetric initial data does not lead to symmetric solutions (to machine accuracy). This PR has several modifications that might change the results obtained, so do not merge until it is more carefully tested and compared with previous results on some real-world problems.
Switch to using Jacobian from left or right state, not Roe average, in determining wave speeds and eigenvectors.
The original used
ql, qr
to compute Roe averages, but since the transverse solver splits up a left-goingasdq
(ifimp==1
) or a right-goingasdq
(ifimp==2
) into up-going and down-going components, there is not good justification for using the state from the other side of the normal solve that generatedasdq
. Now it uses the Jacobian matrix from the appropriate side.Ideally we would also use
q
in the row of cells above or below, similar to what is done for variable-coefficient acoustics, but in that case the necessary info is in theaux
arrays and we do passaux
from above and below intorpt2
asaux3
andaux1
respectively. But we do not pass inq
from above and below.In addition, a bug in the second component of the eigenvectors was fixed. It should be the orthogonal component of velocity to the one that defines
s(2)
.Finally, when s(2) is close to zero this component of the flux difference is now split equally between bmasdq and bpasdq to improve symmetry. The cutoff is when
abs(s(2)) < 0.001 * sqrt(g*hlr)
wherehlr
is nowh
on the proper side. Not clear if this is the best tolerance.Note that indentation is screwy in this routine and should also be cleaned up, but for now I left alone to highlight the lines that changed more substantially.