Skip to content
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

Open
wants to merge 18 commits into
base: development
Choose a base branch
from

Conversation

zingale
Copy link
Member

@zingale zingale commented May 30, 2023

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

  • test suite needs to be run on this PR
  • this PR will change answers in the test suite to more than roundoff level
  • all newly-added functions have docstrings as per the coding conventions
  • the CHANGES file has been updated, if appropriate
  • if appropriate, this change is described in the docs

@zingale
Copy link
Member Author

zingale commented May 30, 2023

addresses #809

@zingale zingale added the hydro label Oct 2, 2023
@zingale zingale mentioned this pull request Jul 24, 2024
14 tasks
@zingale
Copy link
Member Author

zingale commented Jul 26, 2024

test suite diffs are about as expected:
http://groot.astro.sunysb.edu/Castro/test-suite/gfortran/2024-07-26-001/index.html

@zingale
Copy link
Member Author

zingale commented Jul 27, 2024

this seems to cause problems with the massive_star setup after only 24 steps.

@zingale
Copy link
Member Author

zingale commented Jul 27, 2024

I have the pressure source wrong

@zingale
Copy link
Member Author

zingale commented Jul 27, 2024

updated tests with this PR, after fixing the pressure source:
http://groot.astro.sunysb.edu/Castro/test-suite/gfortran/2024-07-27-003/index.html

@zingale
Copy link
Member Author

zingale commented Jul 29, 2024

Here's a comparison of flame_wave run for > 90,000 steps with this PR and development:

development:

flame_wave_1000Hz_25cm_smallplt95305_slice_development

this PR:

flame_wave_1000Hz_25cm_smallplt96452_slice_tracing

@zingale
Copy link
Member Author

zingale commented Jul 29, 2024

Here's a massive star comparison:

development:

all_massive_star_smallplt12034_w0 10_development

tracing:

all_massive_star_smallplt12034_w0 10_tracing

@zingale zingale changed the title [WIP] add geometric source terms to the PPM tracing add geometric source terms to the PPM tracing Jul 29, 2024
@zhichen3
Copy link
Collaborator

I think there will be geometric source terms for velocity equations? Even though those depend on velocity in phi direction.

@zingale
Copy link
Member Author

zingale commented Sep 19, 2024

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.

@zhichen3
Copy link
Collaborator

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?

@zingale
Copy link
Member Author

zingale commented Sep 19, 2024

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);
Copy link
Collaborator

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 ?

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants