sirocco-rt / sirocco

This is the repository for Sirocco, the radiative transfer code used to model winds in AGN and other systems
GNU General Public License v3.0
29 stars 24 forks source link

Incorrect radiated luminosity in simple atom mode #391

Closed kslong closed 6 years ago

kslong commented 6 years ago

With macro atoms, photons are created from external sources and escape the system with the same weights as initially. This assures that (in the absence of errors) that the luminosity of the system is that of the external sources.

With simple atoms, photons change their weights as they pass through the system through free-free, free-bound process, etc. To compensate for this, photons are created in the wind. The idea is that by balancing heating and cooling in the wind, we will make up the energy lost by creating additional photons in the wind that just compensate for absorption.

However, that is not currently happening. Instead in the cases I have been experimenting with, e.g.

simple.pf.txt

The radiated luminosity exceeds the luminosity of the (only) external source, the star, by a considerable amount. I have tried various permutations on this model, higher stellar temperature, more wind cells, etc. and though the percentage varies, the sense of the difference remains the same. This seems to me a fairly fundamental issue @ssim @Higginbottom @jhmatthews and I think we need to understand it. (I'm not sure why we have not noticed this previously, but I could imagine it has something to do with some of the problems we had with cells near the disk surface in the X-ray binary work. It came up now, because James and I have been looking more carefully at the effects of adiabatic cooling and extra heating on wind emission).

kslong commented 6 years ago

I was worried that the problem was obscure in the sense that there were a lot of contributing factors, but here is a clue to what is going on. This is for a temperatures 30,000 K for the star --> the system should have a radiated luminosity of 2.8e32.

screenshot_803

This model is well converged. Notice that the heating and cooling balance pretty well, but the absorbed flux and luminosity, do not. The luminosity is higher. (Note that the two quantities differ, because absorbed flux and luminosity include recombination edge energies, whereas heating and cooling, which refer to the heating and cooling of the electrons, do not.)

Specifically, here the star has a luminosity of 2.8e32 and the system has a luminosity of 4.2e32 or an excess of 1.4e32, this should be compared to the difference in wind luminosity (at photon creation) of 1.38e33 vs the absorbed flux of 1.22e33 or 1.6e32, which is slightly greater (and which would partially be lost photons escape the wind).

To me this suggests this may have something to do with how we are treating photoionization and recombination. I recall that we are using recombination rates that are derived from literature rather than detailed balance. Perhaps this is the root of the problem, since for simple atoms, recombination photons are all made to the ground state, whereas for the purpose of the rates we are using all of the levels. If we are not making some kind of correction to account for this, we may have a problem. @Higginbottom you are the expert on this.

Note that if you run the above model at other temperatures it is less obvious that recombination is the root cause of the problem.

Higginbottom commented 6 years ago

I wonder if it is auger ionisation. This would boost the heating, but we don't have dielectronic recombination properly implemented to balance it.

Higginbottom commented 6 years ago

OK, so I tried turning off auger - made did not fix. Also tried turning off adiabatic did not fix. Will now look in more detail - these were quick tests..

Higginbottom commented 6 years ago

Digging through the code to check for errors, I note something interesting (that we should know of course)...

The absorbed_flux number is from photons passing through the cells, all added up. The reported wind_luminosity is integrated over the frequency range 0.0 to VERY_BIG. So it is the total luminosity of the wind over all possible frequencies. If we generate photons over a restricted range of frequencies (not quite sure what the mode 0 does for banding, but we are bound to not be turning all the potential luminosity into photon packets).

Perhaps we should add a report of the generated luminosity.....

jhmatthews commented 6 years ago

Good spot - I note that in photon_gen we calculate both geo.f_wind (between f1 and f2 for the band we are about to use) and we calculate geo.lum_wind.

Higginbottom commented 6 years ago

Yeah - we should be able to easily generate a real lum wind - perhaps wind_radiated - by accessing the band structure to get the fmin and fmax in wind_updates2d.c I'm working on it as we speak.

Higginbottom commented 6 years ago

OK, so initial look reveals that this is not not problem - free free emission is much lower than the potential luminosity but the free-bound luminosity is the same in the truncated frequency range. The search continues...

jhmatthews commented 6 years ago

Thinking about it, isn't this is a red herring? I think it's wrong to think about this reported luminosity in the wind as the "escaping radiated luminosity". If I have a 1000 cells and I arrange for each of them to absorb all of the radiation from the star and re-emit it, then the reported wind luminosity would be 1000 times higher that the inputted star luminosity.

Higginbottom commented 6 years ago

Thats all correct, but if I’m understanding KSLs problem correctly, he suggests that when a model is converged, the absorbed flux should equal the wind radiation. Otherwise we are losing energy somewhere. Of course if there is significant adiabatic cooling, this could be a sink, but thats not the case here.

I want to work out which cells are ‘losing energy’, it may be that most of the model is fine, and odd things are happening is a few dense cells…

On 3 Jul 2018, at 12:29, James Matthews notifications@github.com wrote:

Thinking about it, isn't this is a red herring? I think it's wrong to think about this reported luminosity in the wind as the "escaping radiated luminosity". If I have a 1000 cells and I arrange for each of them to absorb all of the radiation from the star and re-emit it, then the reported wind luminosity would be 1000 times higher that the inputted star luminosity.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402120534, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvfXqayvOTmqTGc6KEFoGhPfrk9-yks5uC1WdgaJpZM4U-FP6.

jhmatthews commented 6 years ago

ah ok, my apologies. In which case, yes, I think it's probably reasonable that the temperature we arrive at by balancing the bound-free heating and cooling wouldn't necessarily ensure that you also have the right temperature for ensuring that the radiated luminosity matches the absorbed flux (due to e.g. Knox's suggestion above).

kslong commented 6 years ago

No. The emitted luminosity should equal the luminosity of the star, just as for macro atoms.

Sent from my iPhone

On Jul 3, 2018, at 7:54 AM, James Matthews notifications@github.com<mailto:notifications@github.com> wrote:

ah ok, my apologies. In which case, yes, I think it's probably reasonable that the temperature we arrive at by balancing the bound-free heating and cooling wouldn't necessarily ensure that you also have the right temperature for ensuring that the radiated luminosity matches the absorbed flux (due to e.g. Knox's suggestion above).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402129057, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVW2eph8bDAFb0fTQO6Z0WikkOwT_ks5uC1uMgaJpZM4U-FP6.

Higginbottom commented 6 years ago

Right, so what seems to be happening is that we are making lots of photons from recombinations to excited levels of hydrogen. The wind is very cold, and so there is no population of excited hydrogen to absorb this radiation - so it escapes - the wind is (to first order) transparent below 13.6eV and opaque above.

If I recall (and I need to check this) there used to be a check that didn't make recomb photons when the wind went below a certain temperature - I have a vague memory that it was removed.

I’ll post some graphs when I get in the office…

N

On 3 Jul 2018, at 20:45, Knox S. Long notifications@github.com wrote:

No. The emitted luminosity should equal the luminosity of the star, just as for macro atoms.

Sent from my iPhone

On Jul 3, 2018, at 7:54 AM, James Matthews notifications@github.com<mailto:notifications@github.com> wrote:

ah ok, my apologies. In which case, yes, I think it's probably reasonable that the temperature we arrive at by balancing the bound-free heating and cooling wouldn't necessarily ensure that you also have the right temperature for ensuring that the radiated luminosity matches the absorbed flux (due to e.g. Knox's suggestion above).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402129057, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVW2eph8bDAFb0fTQO6Z0WikkOwT_ks5uC1uMgaJpZM4U-FP6. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402272053, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvVKCC1OLUGUB_Pt1bg-iHmZxPGPdks5uC8nrgaJpZM4U-FP6.

ssim commented 6 years ago

...Silly question from me here - but maybe relevant - in the original treatment, when bf emission is put in, does it match the cooling energy only or cooling+recombination energy? Can this be relevant to this comparison?

On 4 Jul 2018, at 10:48, Higginbottom notifications@github.com wrote:

Right, so what seems to be happening is that we are making lots of photons from recombinations to excited levels of hydrogen. The wind is very cold, and so there is no population of excited hydrogen to absorb this radiation - so it escapes - the wind is (to first order) transparent below 13.6eV and opaque above.

If I recall (and I need to check this) there used to be a check that didn't make recomb photons when the wind went below a certain temperature - I have a vague memory that it was removed.

I’ll post some graphs when I get in the office…

N

On 3 Jul 2018, at 20:45, Knox S. Long notifications@github.com wrote:

No. The emitted luminosity should equal the luminosity of the star, just as for macro atoms.

Sent from my iPhone

On Jul 3, 2018, at 7:54 AM, James Matthews notifications@github.com<mailto:notifications@github.com> wrote:

ah ok, my apologies. In which case, yes, I think it's probably reasonable that the temperature we arrive at by balancing the bound-free heating and cooling wouldn't necessarily ensure that you also have the right temperature for ensuring that the radiated luminosity matches the absorbed flux (due to e.g. Knox's suggestion above).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402129057, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVW2eph8bDAFb0fTQO6Z0WikkOwT_ks5uC1uMgaJpZM4U-FP6. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402272053, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvVKCC1OLUGUB_Pt1bg-iHmZxPGPdks5uC8nrgaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402427270, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLZm4V9XnJvHnmxZrpaqGw_epG0AHks5uDI92gaJpZM4U-FP6.

Higginbottom commented 6 years ago

It certainly should just be the cooling energy - we have a couple of modes when we do the integrals - one includes the ionisation energy (used to compute the cooling rate) and one which subtracts the ionisation energy and is used to compute the emissivity…

N

On 4 Jul 2018, at 11:27, ssim notifications@github.com wrote:

...Silly question from me here - but maybe relevant - in the original treatment, when bf emission is put in, does it match the cooling energy only or cooling+recombination energy? Can this be relevant to this comparison?

On 4 Jul 2018, at 10:48, Higginbottom notifications@github.com wrote:

Right, so what seems to be happening is that we are making lots of photons from recombinations to excited levels of hydrogen. The wind is very cold, and so there is no population of excited hydrogen to absorb this radiation - so it escapes - the wind is (to first order) transparent below 13.6eV and opaque above.

If I recall (and I need to check this) there used to be a check that didn't make recomb photons when the wind went below a certain temperature - I have a vague memory that it was removed.

I’ll post some graphs when I get in the office…

N

On 3 Jul 2018, at 20:45, Knox S. Long notifications@github.com wrote:

No. The emitted luminosity should equal the luminosity of the star, just as for macro atoms.

Sent from my iPhone

On Jul 3, 2018, at 7:54 AM, James Matthews notifications@github.com<mailto:notifications@github.com> wrote:

ah ok, my apologies. In which case, yes, I think it's probably reasonable that the temperature we arrive at by balancing the bound-free heating and cooling wouldn't necessarily ensure that you also have the right temperature for ensuring that the radiated luminosity matches the absorbed flux (due to e.g. Knox's suggestion above).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402129057, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVW2eph8bDAFb0fTQO6Z0WikkOwT_ks5uC1uMgaJpZM4U-FP6. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402272053, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvVKCC1OLUGUB_Pt1bg-iHmZxPGPdks5uC8nrgaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402427270, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLZm4V9XnJvHnmxZrpaqGw_epG0AHks5uDI92gaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402437498, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvWw8oh8YLeGVxmr1W4OFY1Nb45dJks5uDJiRgaJpZM4U-FP6.

Higginbottom commented 6 years ago

Here is a plot of the created flux and the emitted flux from the model KSL attached above.

simple_created_vs_emitted The funny spikes below 1e15 Hz are the excited level recombination - as you can see they escape the wind.

Higginbottom commented 6 years ago

OK, so I reran the simple.pf run, but removed all topbase PI cross section from excited levels. I get

python: Total photon luminosity before transphot 1.263378241469e+33 python: Total photon luminosity after transphot 2.410673720466e+32 (absorbed/lost -1.022310869422e+33). Radiated luminosity 2.410672688453e+32

This compares with the stellar luminosity of 2.83e32 - so we are no longer emitting more than the star.

wind_update: Absorbed flux 1.01e+33 !!wind_update: Wind heating 5.96e+31 !!wind_update: Wind luminosity 9.90e+32 !!wind_update: Rad luminosity 9.80e+32 !!wind_update: Wind cooling 5.95e+31

absorbed flux and radiated luminosity are much closer.

The model still converges to rather cool temperatures - innermost cell is 1.3e4, outermost cell is just 573K. But this is a different question.

To answer the question as posed - I think that the reason KSLs model is radiating more than the star is because recombinations to excited state emission is high, and because the model is cold there is no absorption for these photons. We need to discuss this behaviour, decide if it is a bug (seems like it must be in some way incorrect simply due to the consequence) and see how to fix it. Maybe we should simply not create such photons, after all if recombination to excited levels is important, it really needs a macro atom approach.

kslong commented 6 years ago

Macro atoms ensure by design the correct luminosity but will not fix a radiative transfer problem. Someone should check what the spectrum looks like in the macro atom case, with the same input atomic data file as in the simple case. My guess when I stopped working on this to go on vacation was this might have to do with how we distributed photons for recombination due to using rates instead of detailed balance. Thank you all for taking this issue seriously. I do think it’s a problem we have to fully solve.

Sent from my iPhone

On Jul 4, 2018, at 8:40 AM, Higginbottom notifications@github.com<mailto:notifications@github.com> wrote:

OK, so I reran the simple.pf run, but removed all topbase PI cross section from excited levels. I get

python: Total photon luminosity before transphot 1.263378241469e+33 python: Total photon luminosity after transphot 2.410673720466e+32 (absorbed/lost -1.022310869422e+33). Radiated luminosity 2.410672688453e+32

This compares with the stellar luminosity of 2.83e32 - so we are no longer emitting more than the star.

wind_update: Absorbed flux 1.01e+33 !!wind_update: Wind heating 5.96e+31 !!wind_update: Wind luminosity 9.90e+32 !!wind_update: Rad luminosity 9.80e+32 !!wind_update: Wind cooling 5.95e+31

absorbed flux and radiated luminosity are much closer.

The model still converges to rather cool temperatures - innermost cell is 1.3e4, outermost cell is just 573K. But this is a different question.

To answer the question as posed - I think that the reason KSLs model is radiating more than the star is because recombinations to excited state emission is high, and because the model is cold there is no absorption for these photons. We need to discuss this behaviour, decide if it is a bug (seems like it must be in some way incorrect simply due to the consequence) and see how to fix it. Maybe we should simply not create such photons, after all if recombination to excited levels is important, it really needs a macro atom approach.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402467493, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVZzE_Y6JSJqrHjztJelGmomN8S1Cks5uDLfVgaJpZM4U-FP6.

Higginbottom commented 6 years ago

Hmmm, when I try to run it in macro atom mode I get lots of "trans_phot: Trying to scatter a photon in a cell with no wind volume” errors and even with only 1e5 photons, it runs painfully slowly. this is with H10_standard80

let me try setting it off on rubin with 24 cores and see if it gets anywhere by the time I gert home..

N

On 4 Jul 2018, at 14:41, Knox S. Long notifications@github.com wrote:

Macro atoms ensure by design the correct luminosity but will not fix a radiative transfer problem. Someone should check what the spectrum looks like in the macro atom case, with the same input atomic data file as in the simple case. My guess when I stopped working on this to go on vacation was this might have to do with how we distributed photons for recombination due to using rates instead of detailed balance. Thank you all for taking this issue seriously. I do think it’s a problem we have to fully solve.

Sent from my iPhone

On Jul 4, 2018, at 8:40 AM, Higginbottom notifications@github.com<mailto:notifications@github.com> wrote:

OK, so I reran the simple.pf run, but removed all topbase PI cross section from excited levels. I get

python: Total photon luminosity before transphot 1.263378241469e+33 python: Total photon luminosity after transphot 2.410673720466e+32 (absorbed/lost -1.022310869422e+33). Radiated luminosity 2.410672688453e+32

This compares with the stellar luminosity of 2.83e32 - so we are no longer emitting more than the star.

wind_update: Absorbed flux 1.01e+33 !!wind_update: Wind heating 5.96e+31 !!wind_update: Wind luminosity 9.90e+32 !!wind_update: Rad luminosity 9.80e+32 !!wind_update: Wind cooling 5.95e+31

absorbed flux and radiated luminosity are much closer.

The model still converges to rather cool temperatures - innermost cell is 1.3e4, outermost cell is just 573K. But this is a different question.

To answer the question as posed - I think that the reason KSLs model is radiating more than the star is because recombinations to excited state emission is high, and because the model is cold there is no absorption for these photons. We need to discuss this behaviour, decide if it is a bug (seems like it must be in some way incorrect simply due to the consequence) and see how to fix it. Maybe we should simply not create such photons, after all if recombination to excited levels is important, it really needs a macro atom approach.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402467493, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVZzE_Y6JSJqrHjztJelGmomN8S1Cks5uDLfVgaJpZM4U-FP6. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402482887, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvRIufe8NwfIjVqJeqybCGGJT1uezks5uDMYagaJpZM4U-FP6.

kslong commented 6 years ago

Perhaps but run with standard80 for a correct comparison. Changing then Atomic data file is cheating I’m not a direct comparison.

Higginbottom commented 6 years ago

But I can’t change to macro atom mode without macro atom data surely?

Sent from my iPhone

On 4 Jul 2018, at 18:36, Knox S. Long notifications@github.com wrote:

Perhaps but run with standard80 for a correct comparison. Changing then Atomic data file is cheating I’m not a direct comparison.

Sent from my iPhone

On Jul 4, 2018, at 10:35 AM, Higginbottom notifications@github.com<mailto:notifications@github.com> wrote:

Hmmm, when I try to run it in macro atom mode I get lots of "trans_phot: Trying to scatter a photon in a cell with no wind volume” errors and even with only 1e5 photons, it runs painfully slowly. this is with H10_standard80

let me try setting it off on rubin with 24 cores and see if it gets anywhere by the time I gert home..

N

On 4 Jul 2018, at 14:41, Knox S. Long notifications@github.com<mailto:notifications@github.com> wrote:

Macro atoms ensure by design the correct luminosity but will not fix a radiative transfer problem. Someone should check what the spectrum looks like in the macro atom case, with the same input atomic data file as in the simple case. My guess when I stopped working on this to go on vacation was this might have to do with how we distributed photons for recombination due to using rates instead of detailed balance. Thank you all for taking this issue seriously. I do think it’s a problem we have to fully solve.

Sent from my iPhone

On Jul 4, 2018, at 8:40 AM, Higginbottom notifications@github.com<mailto:notifications@github.commailto:notifications@github.com> wrote:

OK, so I reran the simple.pf run, but removed all topbase PI cross section from excited levels. I get

python: Total photon luminosity before transphot 1.263378241469e+33 python: Total photon luminosity after transphot 2.410673720466e+32 (absorbed/lost -1.022310869422e+33). Radiated luminosity 2.410672688453e+32

This compares with the stellar luminosity of 2.83e32 - so we are no longer emitting more than the star.

wind_update: Absorbed flux 1.01e+33 !!wind_update: Wind heating 5.96e+31 !!wind_update: Wind luminosity 9.90e+32 !!wind_update: Rad luminosity 9.80e+32 !!wind_update: Wind cooling 5.95e+31

absorbed flux and radiated luminosity are much closer.

The model still converges to rather cool temperatures - innermost cell is 1.3e4, outermost cell is just 573K. But this is a different question.

To answer the question as posed - I think that the reason KSLs model is radiating more than the star is because recombinations to excited state emission is high, and because the model is cold there is no absorption for these photons. We need to discuss this behaviour, decide if it is a bug (seems like it must be in some way incorrect simply due to the consequence) and see how to fix it. Maybe we should simply not create such photons, after all if recombination to excited levels is important, it really needs a macro atom approach.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402467493, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVZzE_Y6JSJqrHjztJelGmomN8S1Cks5uDLfVgaJpZM4U-FP6. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-402482887, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvRIufe8NwfIjVqJeqybCGGJT1uezks5uDMYagaJpZM4U-FP6.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402496822, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVZxXZ_RgW7Ss_zjqGHes_bsZCEDVks5uDNKwgaJpZM4U-FP6. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

kslong commented 6 years ago

Yes you can. I have run this model. Remember that everything that is not explicitly set to be a macro atom still uses the macro atom machinery. So even if there are no atoms with all the details of a multilevel atom, the code runs properly.

Higginbottom commented 6 years ago

Well well well.... This is everything the same, but line transfer set to macro-atom. The macro atom version is significantly hotter, min temperature is about 5000K as opposed to 250K in the outer shell in the non-macro atom version. This may be the reason for the lower opacity past 13.6eV. Lets talk about this before I poke around more..

simple_macro_created_vs_emitted

kslong commented 6 years ago

Great work, Nick. Tuesday through Friday next week work for me. Can one of you organize?

Sent from my iPhone

On Jul 5, 2018, at 6:57 AM, Higginbottom notifications@github.com<mailto:notifications@github.com> wrote:

Well well well.... This is everything the same, but line transfer set to macro-atom. The macro atom version is significantly hotter, min temperature is about 5000K as opposed to 250K in the outer shell in the non-macro atom version. This may be the reason for the lower opacity past 13.6eV. Lets talk about this before I poke around more..

[simple_macro_created_vs_emitted]https://user-images.githubusercontent.com/3329213/42319428-da1e9306-8049-11e8-9dab-0054df4a1399.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-402685460, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACaeVTUYCG1gsehEa8nK7RyuYjziHwwrks5uDfEPgaJpZM4U-FP6.

Higginbottom commented 6 years ago

Just as a final test - I set both macro and non macro to fixed temperatures in the wind. Just 1000K, so a bit hotter for non-macro and a bit cooler for macro...

simple_created_vs_emitted

simple_macro_created_vs_emitted

So its not just coz they get to different temperatures - well the absorption past the hydrogen edge is due to the cold gas, but the emission spikes aren't.

jhmatthews commented 6 years ago

Just a word of caution here. When one runs with "simple atoms" but with "indivisible packet" radiative transfer - which is what the simple_macro mode really is (i.e. line transfer mode 6/7 but standard atomic data) - then there are approximations made in the bound-free continuum. I can't recall exactly how this will effect things but my instinct is that the simple_macro model may not necessarily treat the bound-free continuum photons particularly well.

ssim commented 6 years ago

Yes, this is a good point. The way it enforces the scheme (I think) in the “simple_macro” model is to insist that every ionization is followed by a recombination in the same continuum as the ionization: i.e. it’s a sort of two-level atom approximation but applied to bf rather than bb processes. This would certainly mess up the SED if applied to an important continuum edge. Although I still think that the total radiative energy should be conserved - i.e. regarding the original issue at the start of the thread, I would expect that both full macro atoms and “simple macro atoms” ought to rigorously conserve the energy.

On 6 Jul 2018, at 12:36, James Matthews notifications@github.com wrote:

Just a word of caution here. When one runs with "simple atoms" but with "indivisible packet" radiative transfer - which is what the simple_macro mode really is (i.e. line transfer mode 6/7 but standard atomic data) - then there are approximations made in the bound-free continuum. I can't recall exactly how this will effect things but my instinct is that the simple_macro model may not necessarily treat the bound-free continuum photons particularly well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403008828, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLcmdPas--qMDt4IoWTzhGvZE0Nffks5uD0u8gaJpZM4U-FP6.

Higginbottom commented 6 years ago

Interesting - its continuum edges that are most important here in that the excess luminosity seems to be coming out in recombinations to excited states of hydrogen.

How is everyones availability next week for a telecon?

On 6 Jul 2018, at 13:05, ssim notifications@github.com wrote:

Yes, this is a good point. The way it enforces the scheme (I think) in the “simple_macro” model is to insist that every ionization is followed by a recombination in the same continuum as the ionization: i.e. it’s a sort of two-level atom approximation but applied to bf rather than bb processes. This would certainly mess up the SED if applied to an important continuum edge. Although I still think that the total radiative energy should be conserved - i.e. regarding the original issue at the start of the thread, I would expect that both full macro atoms and “simple macro atoms” ought to rigorously conserve the energy.

On 6 Jul 2018, at 12:36, James Matthews notifications@github.com wrote:

Just a word of caution here. When one runs with "simple atoms" but with "indivisible packet" radiative transfer - which is what the simple_macro mode really is (i.e. line transfer mode 6/7 but standard atomic data) - then there are approximations made in the bound-free continuum. I can't recall exactly how this will effect things but my instinct is that the simple_macro model may not necessarily treat the bound-free continuum photons particularly well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403008828, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLcmdPas--qMDt4IoWTzhGvZE0Nffks5uD0u8gaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403014572, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvemPfSelXRO5iQYogXsxCThswZshks5uD1KZgaJpZM4U-FP6.

ssim commented 6 years ago

I’d be available Mon pm or (pretty much) anytime on Tuesday of next week. Wed/Thurs could also work, although Mon pm or Tues would be better for me.

Are we teleconing today as well (usual time = 3pm?)?

On 6 Jul 2018, at 13:10, Higginbottom notifications@github.com wrote:

Interesting - its continuum edges that are most important here in that the excess luminosity seems to be coming out in recombinations to excited states of hydrogen.

How is everyones availability next week for a telecon?

On 6 Jul 2018, at 13:05, ssim notifications@github.com wrote:

Yes, this is a good point. The way it enforces the scheme (I think) in the “simple_macro” model is to insist that every ionization is followed by a recombination in the same continuum as the ionization: i.e. it’s a sort of two-level atom approximation but applied to bf rather than bb processes. This would certainly mess up the SED if applied to an important continuum edge. Although I still think that the total radiative energy should be conserved - i.e. regarding the original issue at the start of the thread, I would expect that both full macro atoms and “simple macro atoms” ought to rigorously conserve the energy.

On 6 Jul 2018, at 12:36, James Matthews notifications@github.com wrote:

Just a word of caution here. When one runs with "simple atoms" but with "indivisible packet" radiative transfer - which is what the simple_macro mode really is (i.e. line transfer mode 6/7 but standard atomic data) - then there are approximations made in the bound-free continuum. I can't recall exactly how this will effect things but my instinct is that the simple_macro model may not necessarily treat the bound-free continuum photons particularly well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403008828, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLcmdPas--qMDt4IoWTzhGvZE0Nffks5uD0u8gaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403014572, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvemPfSelXRO5iQYogXsxCThswZshks5uD1KZgaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403015501, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLcQoTsKXLG99rXK9sY6xYK3ZlzBoks5uD1ObgaJpZM4U-FP6.

lazygun37 commented 6 years ago

I also couldn't remember if we're teleconning ourselves today or not -- but it turns out I definitely can't now, cause on on salesperson duty all day for our Open Day here. Sorry, I didn't remember this was in the calendar until yesterday.

I should be free most days next week.

Cheers,

C

On 06/07/18 13:12, ssim wrote: I’d be available Mon pm or (pretty much) anytime on Tuesday of next week. Wed/Thurs could also work, although Mon pm or Tues would be better for me.

Are we teleconing today as well (usual time = 3pm?)?

On 6 Jul 2018, at 13:10, Higginbottom notifications@github.commailto:notifications@github.com wrote:

Interesting - its continuum edges that are most important here in that the excess luminosity seems to be coming out in recombinations to excited states of hydrogen.

How is everyones availability next week for a telecon?

On 6 Jul 2018, at 13:05, ssim notifications@github.commailto:notifications@github.com wrote:

Yes, this is a good point. The way it enforces the scheme (I think) in the “simple_macro” model is to insist that every ionization is followed by a recombination in the same continuum as the ionization: i.e. it’s a sort of two-level atom approximation but applied to bf rather than bb processes. This would certainly mess up the SED if applied to an important continuum edge. Although I still think that the total radiative energy should be conserved - i.e. regarding the original issue at the start of the thread, I would expect that both full macro atoms and “simple macro atoms” ought to rigorously conserve the energy.

On 6 Jul 2018, at 12:36, James Matthews notifications@github.commailto:notifications@github.com wrote:

Just a word of caution here. When one runs with "simple atoms" but with "indivisible packet" radiative transfer - which is what the simple_macro mode really is (i.e. line transfer mode 6/7 but standard atomic data) - then there are approximations made in the bound-free continuum. I can't recall exactly how this will effect things but my instinct is that the simple_macro model may not necessarily treat the bound-free continuum photons particularly well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403008828https://github.com/agnwinds/python/issues/391#issuecomment-403008828, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLcmdPas--qMDt4IoWTzhGvZE0Nffks5uD0u8gaJpZM4U-FP6https://github.com/notifications/unsubscribe-auth/AAwPLcmdPas--qMDt4IoWTzhGvZE0Nffks5uD0u8gaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403014572https://github.com/agnwinds/python/issues/391#issuecomment-403014572, or mute the thread https://github.com/notifications/unsubscribe-auth/ADLMvemPfSelXRO5iQYogXsxCThswZshks5uD1KZgaJpZM4U-FP6https://github.com/notifications/unsubscribe-auth/ADLMvemPfSelXRO5iQYogXsxCThswZshks5uD1KZgaJpZM4U-FP6.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/agnwinds/python/issues/391#issuecomment-403015501https://github.com/agnwinds/python/issues/391#issuecomment-403015501, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwPLcQoTsKXLG99rXK9sY6xYK3ZlzBoks5uD1ObgaJpZM4U-FP6https://github.com/notifications/unsubscribe-auth/AAwPLcQoTsKXLG99rXK9sY6xYK3ZlzBoks5uD1ObgaJpZM4U-FP6.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/agnwinds/python/issues/391#issuecomment-403016076, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEl8gPWBtld4OrTp9pwlRkVEvMrcnLnDks5uD1Q5gaJpZM4U-FP6.

--

Professor Christian Knigge Physics & Astronomy University of Southampton Southampton SO17 1BJ

kslong commented 6 years ago

I have split the issue of the recombination for simple atoms in macro atom mode off to a new issue #394 so that the two problems can be tracked separately.

Higginbottom commented 6 years ago

This is a complicated issue, which was investigated at length at Belfast 18. Essentially, the density of the model is such that we are at a tipping point. If the gas is neutral - the first cell has a huge optical depth to ionising photons. If it is ionised, then it is transparent. The reason for the excess flux is that the wind is very cold (much of it less than 1000K) but nonetheless ionised. It is ionised at least partly because in the original model, we use a dilute blackbody model for J_nu, which will likely put some energy past the hydrogen edge even if there is really none. The artificially ionised, cold plasma radiates very strongly in the recombination continua. An initial fix which involved changing the ionisation mode to mode 9 - where J_nu is modelled more carefully did not fix it, and this revealed a problem in radiation.c where photons are doppler shifted in a cell when edges etc are computed, but then the intrinsic frequency used for the model. This means that photons with a rest energy very slightly above 13.6eV can propagate through a cell because they are red shifted wrt the plasma. But then their rest frequency is used to make the model. Again we have cold but ionised plasma. This bug was fixed in pull #403 and with the wind off - in a h only plasma we get a plausible result. However, if the wind is turned on, we end up in a very complicated place where the winds own radiation ionises it, and once more we have cold cells that are highly ionised (now restricted to an area close in to the star because the ionising radiation can't 'sneak' through cells with a high optical depth) and once more we see the excess luminosity. Past a certain radius - which can be changed by making more photons - the plasma becomes neutral and hotter - no recombination radiation comes from these cells. aaaaanew_code_wind_on complete_te

aaaaanew_code_wind_on complete_density Reducing the density by an OOM means that the plasma is all ionised, so despite the still high densities, it is transparent to ionising photons and the model behaves itself. aaaaaold_code_wind_on_low_rho complete_density

So, the real issue here is probably not a bug, rather the issue of how python deals with cells behind a very dense cell which cannot transmit photons through it.