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

Properly include Compton processes in k-packet machinery #1053

Open
jhmatthews opened this issue Feb 16, 2024 · 2 comments
Open

Properly include Compton processes in k-packet machinery #1053

jhmatthews opened this issue Feb 16, 2024 · 2 comments
Assignees

Comments

@jhmatthews
Copy link
Collaborator

Currently, (see #1050) we don't properly include Compton processes in the k-packet machinery. Specifically, prior to #1050 being merged, we include Compton and induced Compton heating as a contributor to kpkt_abs, although we don't actually allow r->k transitions from Compton, or k->r transitions. This means the ionization cycles were sort of doing things "correctly" in that they aren't modelling the flow of energy through the thermal pool from Compton processes (correctly in the case that they are dominant and roughly balance each other, or are both negligible). However, in the spectral cycles we have all this extra energy in kpkt_abs which has to come out somewhere, so it comes out in all the free-free and bound-free processes and so on.

When #1050 is merged, the code will work correctly in the limits that Compton processes approximately balance, or Compton processes are not particularly important.

We DO reweight photons upon Compton scatters. In non-macro atom mode, this should all be being done consistently in asymptotic limits (see #295).

A possible approach is to allow Compton heating to create k-packets (in both ion and spectral cycles) and then include Compton cooling as a sink term in kpkt. The steps needed to do this are:

  • Allow k-packets to be created upon Compton scatters
    • in scatter(), if the interaction is an electron scatter, call Compton scatter. If the weight increases during the Compton scatter, allow this increase. If the weight decreases from $w_1$ to $w_2$, then create a kpkt with probability $(w_1-w_2)/w_1$, and reset the weight to $w_1$.
  • Allow k-packets to be created from Compton heating in spectral cycles
    • revert to the old behaviour of incrementing kpkt_abs when Compton heating occurs.
  • Allow k-packets to be destroyed by Compton cooling
    • add an additional cooling_compton variable to mplasma.
    • add a channel in kpkt() that samples this variable and destroys the kpkt() similarly to adiabatic processes
    • Include Compton cooling in kpacket to rpacket rates in the macro-atom rate matrix
  • Ensure that the normalisation of the kpacket emissivity is correct in the spectral cycles. There is no need to include Compton cooling in the kpacket emissivity, because this can never "generate" a photon in the right frequency range when treated as a sink term.
  • Ensure that the rejection method in photo_gen_kpkt() is applying the correct rejection condition to the . Similar routines should be being followed for cooling_adiabatic and cooling_ff_lofreq.

I can probably code this up (I've done most of it already) but I don't know if I'll have time to test it thoroughly.

An aside, I don't think "reweighting" in an angular sense is done correctly in extract mode for Compton scattering at the moment.

@kslong
Copy link
Collaborator

kslong commented Feb 16, 2024

I am surprised by the last comment, given the detailed comparisons we have done with Sedona. Do you have a simple example that suggests this, hopefully a 1-d wind model that I can mimic in Sedona.

@jhmatthews
Copy link
Collaborator Author

This is largely done (or at least, what I think need to be done is done) in the compton_macro branch of my fork -- the changes can be seen by comparing to dev: agnwinds/python@dev...jhmatthews:python:compton_macro

It is still not clear to me if it is "working", and coming up with the right test is a bit hard, so I'm working on that.

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

No branches or pull requests

2 participants