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

[WIP] MLABecLaplacian spherical 2d support. #4258

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

Conversation

zhichen3
Copy link
Contributor

@zhichen3 zhichen3 commented Dec 7, 2024

Summary

add support spherical 2d support for MLABecLaplacian.

Additional background

I'm trying to get add spherical 2d geometry support for MLABecLaplacian for MLMG since Castro uses the apply() function in MLMG to compute thermal diffusion source term. I think I mainly need to change applyMetricTerms() and unapplyMetricTerms().

I think the logic of the current code is to use applyMetricTerms() within applyMetricTermsCoeffs to modify the coefficients by the extra geometric term from divergence, i.e. $r^2$ for spherical in r-dir, and r for cylindrical in r-dir. Then unapplyMetricTerms is applied to the entire $L(\phi)$ after everything is calculated, which corresponds to the 1/r^2 and 1/r outside of the derivative in divergence.

My current logic is to modify the coefficient by $r^2 \sin(\theta)$ when dir=0 and $\sin(\theta)$ when dir=1, and when we unapply we divide by $\frac{1}{r^2\sin(\theta)}$ altogether, so that it is consistent with the divergence calculation.

I think I should also make sure compResidual(), getFluxes(), and getGradSolution() to work although it doesn't affect the apply() function.

getGradSolution() probably works since I modified compGrad().

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

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.

1 participant