-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add geometric source terms to the PPM tracing #2473
Conversation
addresses #809 |
test suite diffs are about as expected: |
this seems to cause problems with the massive_star setup after only 24 steps. |
I have the pressure source wrong |
updated tests with this PR, after fixing the pressure source: |
I think there will be geometric source terms for velocity equations? Even though those depend on velocity in phi direction. |
I don't think so -- those terms are handled as source terms outside of hydro. The terms here are only those that exist for the area factors in the divergence for the normal direction. |
Ah, okay. I think I get it now. We get out normal conserved states from the primitive states and we're simply adding extra terms that came out after expanding the divergence in the normal direction, otherwise those "corrections" go missing after we convert back to the "hat" conserved states. And all the external sources including geometric sources that appear in the conserved variable equations are still added separately after we get the normal conserved states. Is that correct? |
yes, that's correct |
|
||
// note: this is assumed to be working only in the x-direction | ||
|
||
s[im2] += -dloga(i-2,j,k) * q_arr(i-2,j,k,QRHO) * q_arr(i-2,j,k,QU); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we not multiplying the source by dt/2 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just adding the geometric sources to the other hydrodynamic sources. Then we reconstruct and integrate under the parabola, and then the dt2 is applied when we add it to the jumps that are accumulated to the interfaces
PR summary
Add the geometric source terms to the primitive variable sources so they can be
included in the tracing.
We can't simply add them in src_to_prim, since the sources depend on the
direction of the reconstruction. We also can't just add them in the trace_ppm
to srcQ immediately at the start and then do the reconstruction since we need
the geometric source terms in the ghost cells for the reconstruction. Therefore
we add these geometric sources to the 5-point stencil that will be traced just
before the tracing. This requires some redundant calculation, but it is not too
bad.
PR motivation
PR checklist
CHANGES
file has been updated, if appropriate