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 Piecewise Parabolic Method discretization method #239

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

aditya-sengupta
Copy link

Reference: https://www.sciencedirect.com/science/article/pii/0021999184901438?via%3Dihub

Currently tests/demo_ppm_runs.jl shows that it's usable as a substitute for WENO, and tests/demo_parker_singular.jl shows that it can create a SingularException that I'd like to try and chase down.

PPM is explicitly dependent on the timestep, so only fixed-timestep methods should be used. I think the best ones are forward/implicit Euler, since that's what past astro codes that use PPM have used.

PPM is also compatible with varying dx, which I'd like to try out with the Parker wind problem (which has a logarithmic x axis that I analytically transformed to be uniform) once the fixed-dx case works.

@aditya-sengupta aditya-sengupta marked this pull request as draft February 8, 2023 23:52
@aditya-sengupta
Copy link
Author

I realized I was missing some steps before (those involving the dependence on uΔt) so I added those in. The hyperparameter is now Cx (Courant number times the spacing dx, or uΔt), which existing PPM solvers have access to but we don't. It's probably a good choice to set Cx <= min(dx), but it's hard to give more heuristics than this without further testing. It seems to work best with forward/implicit Euler, which can be slow, and it runs into stability issues with changes to solvers or significant variation to Cx - I don't think this is a useful scheme in the MTK framework as is.

The problems seem theoretical, as it's hard to guarantee the interpolation is useful without knowing the exact uΔt, so it may be useful to come up with a new discretization scheme based on the same parabolic interpolation idea but without being so prescriptive about the timestep/needing to know the advection rate. The "incomplete" version I had before (at cd78d1d), which is just the best linear combination of surrounding points that match a parabola, may honestly be closer to what I want, but that has stability problems so we need some new adaptations that fulfill the role of what I've added in here. I'll think about this/talk to some people and give it another shot soon!

@ChrisRackauckas
Copy link
Member

Useful is for benchmarks to determine. Libraries should have both useful and non-useful methods if they are to be a good research tool in the methods themselves!

@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Merging #239 (6a688b7) into master (eaddda2) will decrease coverage by 4.99%.
The diff coverage is 7.76%.

@@            Coverage Diff             @@
##           master     #239      +/-   ##
==========================================
- Coverage   78.81%   73.82%   -4.99%     
==========================================
  Files          39       41       +2     
  Lines        1987     2086      +99     
==========================================
- Hits         1566     1540      -26     
- Misses        421      546     +125     
Impacted Files Coverage Δ
src/MethodOfLines.jl 0.00% <ø> (ø)
...discretization/generate_finite_difference_rules.jl 82.60% <0.00%> (-12.40%) ⬇️
src/discretization/schemes/PPM/PPM.jl 0.00% <0.00%> (ø)
...hemes/centered_difference/centered_diff_weights.jl 100.00% <ø> (ø)
src/interface/scheme_types.jl 72.72% <0.00%> (-27.28%) ⬇️
src/scalar_discretization.jl 71.15% <44.44%> (-6.12%) ⬇️
src/MOL_discretization.jl 63.97% <50.00%> (-11.03%) ⬇️
...scretization/schemes/fornberg_calculate_weights.jl 100.00% <100.00%> (ø)
src/discretization/schemes/half_offset_weights.jl 100.00% <100.00%> (ø)
src/interface/MOLFiniteDifference.jl 90.00% <100.00%> (ø)
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aditya-sengupta
Copy link
Author

aditya-sengupta commented Feb 10, 2023

For sure, these are more notes on what I'd like to implement that'd be useful for my own research (and others' work hopefully) than on inherently how useful the method is

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

Successfully merging this pull request may close these issues.

2 participants