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

PPL opacity models #678

Merged
merged 48 commits into from
Jul 24, 2024
Merged

PPL opacity models #678

merged 48 commits into from
Jul 24, 2024

Conversation

chongchonghe
Copy link
Contributor

@chongchonghe chongchonghe commented Jul 22, 2024

Description

Main updates:

  • Defined three opacity models described in Paper III: piecewise constant (piecewise_constant_opacity), piecewise powerlaw with fixed slope (PPL_opacity_fixed_slope_spectrum), piecewise powerlaw with full spectrum fitting (PPL_opacity_full_spectrum).

  • Added tests for each of these methods.

    • RadhydroBB tests the PC method's ability to resolve the Doppler-shifted spectrum in a moving blackbody.
    • RadMarshakVaytet tests the ability of all three methods (by default PPL_opacity_full_spectrum) to deal with frequency-dependent velocities within an energy bin.
    • RadTube tests that in the special case of opacity being independent of frequency, the PPL_opacity_fixed_slope_spectrum method provides the same result as the single-group method.
    • RadhydroShockMultigroup tests PPL_opacity_full_spectrum in the special case of constant opacity.

More updates:

  • Removed ComputePlanckOpacityTempDerivative
  • Defined ComputeDiffusionFluxMeanOpacity and removed the calculation of component-specific flux-mean opacity. See Paper III.
  • Defined ComputeBinCenterOpacity to use when opacity_model_ == OpacityModel::PPL_opacity_full_spectrum and use_diffuse_flux_mean_opacity = false.
  • Changed the structure of the Newton-Raphson iteration loop. We check the residuals first, then calculate opacities and the Jacobian.
  • Fixed a bug in the Newton iteration where the calculation of alpha_E uses Erad0Vec but EradVec_guess should be used.
  • More robust break condition for the Newton iteration.
  • Stop updating alpha_E and alpha_B after max_ite_to_update_alpha_E steps in the Newton iteration.
  • Set reconstructionOrder_=3 in the RadTube and RadhydroShockMultigroup tests to avoid "erroneous arithmetic" error after using -DCMAKE_CXX_FLAGS=-ffp-exception-behavior=strict.

Checklist

Before this pull request can be reviewed, all of these tasks should be completed. Denote completed tasks with an x inside the square brackets [ ] in the Markdown source below:

Defined three models: piecewise_constant_opacity, PPL_opacity_fixed_slope_spectrum, PPL_opacity_full_spectrum
@chongchonghe
Copy link
Contributor Author

It looks like the CUDA version does not successfully compile: https://dev.azure.com/quokka-code/quokka-CI/_build/results?buildId=10712&view=logs&j=655dacad-9e02-5f72-e0cf-043ebfb7cecc&t=e95f4446-ac23-5f52-1703-4ff6a9656172

Yes, I know. I'm working on it.

src/radiation_system.hpp Fixed Show resolved Hide resolved
@chongchonghe
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@chongchonghe
Copy link
Contributor Author

🍻 All tests passed!
@markkrumholz @BenWibking Can you review this PR?

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 24, 2024
@chongchonghe
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@chongchonghe chongchonghe added this pull request to the merge queue Jul 24, 2024
Merged via the queue into development with commit 4686c6a Jul 24, 2024
21 checks passed
@chongchonghe chongchonghe deleted the chongchong/PPL-opacity branch July 24, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants