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

Move power law opacity into its own module #725

Merged
merged 20 commits into from
Jan 5, 2020
Merged

Conversation

maximumcats
Copy link
Member

@maximumcats maximumcats commented Jan 3, 2020

PR summary

This PR unifies the approach to opacities in the radiation code, so that ca_compute_planck, ca_compute_rosseland, and ca_compute_scattering are the only entry points to getting the opacities. These work for single-group or multi-group problems. To do this, we moved the power-law opacity to its own module in Castro/Microphysics, rad_power_law, replacing the powerlaw-example case, and now have the problems point to the new opacity directory rather than null. (The null directory has been removed, to prevent people from accidentally trying to continue using the old setup.) All of the corresponding inputs parameters for the power law opacity have been moved to the probin file (in the extern namelist).

We now always expect the user to pick a specific opacity implementation, so the parameter radiation.use_opacity_table_module has been removed.

The multigroup solver was previously forcing the Rosseland opacity to be equal to the Planck opacity if the latter was set but the former was not. There was similar unintuitive behavior for the behavior of the scattering parameter. Now you will get exactly what you ask for in the probin file, given the defaults in the _parameters file for the rad_power_law opacity. By default the constant coefficients for both are negative, which is invalid, so both must be set to a non-negative value for the code to work. Problems that were previously setting const_kappa_p but not const_kappa_r should set the latter equal to the former to maintain the same code behavior. The analogous thing should be done for the exponents (kappa_p_exp_m, kappa_p_exp_n, and kappa_p_exp_p).

PR checklist

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

@maximumcats maximumcats marked this pull request as ready for review January 4, 2020 21:08
# mechanism used to set kappa_r. (In an ideal code this floor would
# be nondimensionalized using a characteristic length (domain size?).
# In the present implementation the Marshak b.c. includes a factor of
# delta x which can cause ill-conditioning if delta x is not O(1).)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some useful info in these comments that is getting deleted (not just this problem). Perhaps we can move them to a README?

@zingale zingale merged commit 3728c98 into development Jan 5, 2020
@maximumcats maximumcats deleted the opacity_power_law branch February 13, 2020 15:13
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