rice-solar-physics / HYDRAD

HYDrodynamics and RADiation Code for computing solutions to field-aligned hydrodynamic equations in coronal loops
MIT License
9 stars 4 forks source link

VAL heating changing with time? #106

Closed jwreep closed 1 month ago

jwreep commented 1 month ago

I don't recall the reasoning -- why does the VAL heating vary with time? The idea of the heating is that it was to balance the radiative losses at time zero so that if no other heating were introduced, the chromosphere would remain static.

Would it be worth considering fixing the chromospheric background heating in time?

I have a few issues in mind: 1) Coronal rain formation. VAL heating can switch on in the corona when it cools to chromospheric temperatures, which seems somewhat spurious. 2) Heat reaching deeper levels of the chromosphere can lead to unexpected changes in the VAL heating there, which sometimes leads to unphysical temperature spikes if it exceeds OPTICALLY_THICK_TEMPERATURE and the radiation switches to the thin losses.
3) The "knee" that sometimes forms at $T_{e} =$ OPTICALLY_THICK_TEMPERATURE particularly at the base of the transition region, which artificially holds the temperature fixed.

I've experimented a bit with this, and it seems a bit more stable with time-fixed VAL heating (don't need to reduce SAFETY_RADIATION as much).

Any thoughts?

sjbradshaw commented 1 month ago

The VAL heating is a precalculated look-up table calculated with the initial conditions, and loaded by HYDRAD once when it starts. So, there's no way the VAL heating is time-dependent.There is some heating applied to the isothermal atmosphere that returns it to the set temperature when, for example, a strong expansion cools it. Perhaps this is being inadvertently used in the mess of #ifdefs that comprise the radiation calculation in eqns.cppRegarding the corona: if it is cool and dense (e.g. a prominence) then there's no reason it should behave any differently, radiatively speaking, than plasma with the same properties, but at lower altitude.Sent from my Galaxy -------- Original message --------From: Jeffrey Reep @.> Date: 7/15/24 21:43 (GMT-06:00) To: rice-solar-physics/HYDRAD @.> Cc: Subscribed @.***> Subject: [rice-solar-physics/HYDRAD] VAL heating changing with time? (Issue #106) I don't recall the reasoning -- why does the VAL heating vary with time? The idea of the heating is that it was to balance the radiative losses at time zero so that if no other heating were introduced, the chromosphere would remain static. Would it be worth considering fixing the chromospheric background heating in time? I have a few issues in mind:

Coronal rain formation. VAL heating can switch on in the corona when it cools to chromospheric temperatures, which seems somewhat spurious. Heat reaching deeper levels of the chromosphere can lead to unexpected changes in the VAL heating there, which sometimes leads to unphysical temperature spikes if it exceeds OPTICALLY_THICKTEMPERATURE and the radiation switches to the thin losses. The "knee" that sometimes forms at $T{e} =$ OPTICALLY_THICK_TEMPERATURE particularly at the base of the transition region, which artificially holds the temperature fixed.

I've experimented a bit with this, and it seems a bit more stable with time-fixed VAL heating (don't need to reduce SAFETY_RADIATION as much). Any thoughts?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

jwreep commented 1 month ago

Perhaps there's a bug or unintended functionality then?

The look-up table is a function of the column density: https://github.com/rice-solar-physics/HYDRAD/blob/0fa1f9949540e6b9379548c72a030621fdee381d/Heating_Model/source/heat.cpp#L509

This is recalculated at every time step, so changes to the density stratification do change the VAL heating rate: https://github.com/rice-solar-physics/HYDRAD/blob/0fa1f9949540e6b9379548c72a030621fdee381d/HYDRAD/source/eqns.cpp#L2506

sjbradshaw commented 1 month ago

Follow up:

In my version of the code (also the “official” GitHub version) there is one line that calls the VAL heating function (CalculateVALHeating()l; code below). The column depth (spatially-integrated mass density at that spatial location) is passed to it and obviously this changes as the atmosphere evolves, which would introduce some apparent time-dependence, but that was always the intention. As the atmosphere returns to equilibrium then the heating profile returns to what it was at t = 0, and maintains it.

ifdef OPTICALLY_THICK_RADIATION

    if( CellProperties.T[ELECTRON] < OPTICALLY_THICK_TEMPERATURE )

    {

        CellProperties.TE_KE_term[4][ELECTRON] += pHeat->CalculateVALHeating( log10(CellProperties.rho_c ) );

        CellProperties.TE_KE_term[5][ELECTRON] -= pHI->GetVolumetricLossRate( log10(CellProperties.T[ELECTRON]), log10((4e-14)*CellProperties.HI_c), CellProperties.n[ELECTRON] * CellProperties.rho[1] );

        CellProperties.TE_KE_term[5][ELECTRON] -= pMgII->GetVolumetricLossRate( log10(CellProperties.T[ELECTRON]), log10(CellProperties.rho_c), CellProperties.n[ELECTRON] * CellProperties.rho[1] );

        CellProperties.TE_KE_term[5][ELECTRON] -= pCaII->GetVolumetricLossRate( log10(CellProperties.T[ELECTRON]), log10(CellProperties.rho_c), CellProperties.n[ELECTRON] * CellProperties.rho[1] );

// RADIATION TIME STEP

        CellProperties.radiation_delta_t = ( SAFETY_RADIATION * CellProperties.TE_KE[1][ELECTRON] ) / fabs( CellProperties.TE_KE_term[5][ELECTRON] );

// RADIATION TIME STEP

    }

    else

    {

        term1 = 1.0;

else // OPTICALLY_THICK_RADIATION

From: Jeffrey Reep @.> Sent: Monday, July 15, 2024 9:43 PM To: rice-solar-physics/HYDRAD @.> Cc: Subscribed @.***> Subject: [rice-solar-physics/HYDRAD] VAL heating changing with time? (Issue #106)

I don't recall the reasoning -- why does the VAL heating vary with time? The idea of the heating is that it was to balance the radiative losses at time zero so that if no other heating were introduced, the chromosphere would remain static.

Would it be worth considering fixing the chromospheric background heating in time?

I have a few issues in mind:

  1. Coronal rain formation. VAL heating can switch on in the corona when it cools to chromospheric temperatures, which seems somewhat spurious.
  2. Heat reaching deeper levels of the chromosphere can lead to unexpected changes in the VAL heating there, which sometimes leads to unphysical temperature spikes if it exceeds OPTICALLY_THICK_TEMPERATURE and the radiation switches to the thin losses.
  3. The "knee" that sometimes forms at $T_{e} =$ OPTICALLY_THICK_TEMPERATURE particularly at the base of the transition region, which artificially holds the temperature fixed.

I've experimented a bit with this, and it seems a bit more stable with time-fixed VAL heating (don't need to reduce SAFETY_RADIATION as much).

Any thoughts?

— Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/106 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7RIOERLTM72OQZ7LSLZMSCDBAVCNFSM6AAAAABK5VC4YWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYTAMBWGQ3DQOI . You are receiving this because you are subscribed to this thread. https://github.com/notifications/beacon/ACC6C7VV2AM4N7RW4SBH6HLZMSCDBA5CNFSM6AAAAABK5VC4YWWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHI7JVLGE.gif Message ID: @. @.> >

sjbradshaw commented 1 month ago

Looks like we’ve just said the same thing, but this was very much intended functionality.

From: Jeffrey Reep @.> Sent: Monday, July 15, 2024 10:21 PM To: rice-solar-physics/HYDRAD @.> Cc: sjbradshaw @.>; Comment @.> Subject: Re: [rice-solar-physics/HYDRAD] VAL heating changing with time? (Issue #106)

Perhaps there's a bug or unintended functionality then?

The look-up table is a function of the column density: https://github.com/rice-solar-physics/HYDRAD/blob/0fa1f9949540e6b9379548c72a030621fdee381d/Heating_Model/source/heat.cpp#L509

This is recalculated at every time step, so changes to the density stratification do change the VAL heating rate: https://github.com/rice-solar-physics/HYDRAD/blob/0fa1f9949540e6b9379548c72a030621fdee381d/HYDRAD/source/eqns.cpp#L2506

— Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/106#issuecomment-2229926659 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7T4FHV2TO5P5HELRMDZMSGSFAVCNFSM6AAAAABK5VC4YWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRZHEZDMNRVHE . You are receiving this because you commented. https://github.com/notifications/beacon/ACC6C7UI5BUS7IUEQLH5TWLZMSGSFA5CNFSM6AAAAABK5VC4YWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUE5H5QG.gif Message ID: @. @.> >

jwreep commented 1 month ago

Yup, but that's my original question -- why not fix this in time completely? It would save calculation time and should be (seems to be) more stable numerically.

I suppose I don't understand the motivation behind the choice to have it vary in time (whether physics or numerics).

sjbradshaw commented 1 month ago

A radiative transfer calculation produces heating and cooling, depending on whether the absorption or emission dominates in a particular volume. The approximation to optically-thick radiative cooling depends on the column depth, so I presume our original thinking was that heating due to (e.g.) photo-absorption should behave similarly. If, at t = 0, emission and absorption are balanced (such that dT/dt = 0), then heating and radiative cooling must scale in a similar manner in an effort to maintain that condition. For example, a small fluctuation in the column depth that increases cooling should also increase heating to compensate, thereby stabilizing the system.

Obviously during a flare simulation, with strong beam energy deposition, then the relationship between heating and cooling is driven so far out of equilibrium that it hardly matters what the VAL heating does (similar to how background heating doesn’t matter in a coronal nanoflare simulation); but, as quiescent conditions begin to reassert themselves then re-establishing the original relationship ought to help drive the system back towards equilibrium.

The VAL heating uses the column depth calculated for the optically-thick radiation, so I don’t think much in the way of computational effort would be saved. Ultimately, if fixing the VAL heating in time seems to be advantageous for your purpose then I see no problem with it; again it’s essentially the equivalent of background heating in the coronal nanoflare case.

From: Jeffrey Reep @.> Sent: Monday, July 15, 2024 10:46 PM To: rice-solar-physics/HYDRAD @.> Cc: sjbradshaw @.>; Comment @.> Subject: Re: [rice-solar-physics/HYDRAD] VAL heating changing with time? (Issue #106)

Yup, but that's my original question -- why not fix this in time completely? It would save calculation time and should be (seems to be) more stable numerically.

I suppose I don't understand the motivation behind the choice to have it vary in time (whether physics or numerics).

— Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/106#issuecomment-2229951342 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7T2FV7VQUQUT6DYKQ3ZMSJPFAVCNFSM6AAAAABK5VC4YWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRZHE2TCMZUGI . You are receiving this because you commented. https://github.com/notifications/beacon/ACC6C7VKSXSIHS2S3AHGGHTZMSJPFA5CNFSM6AAAAABK5VC4YWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUE5JNW4.gif Message ID: @. @.> >

jwreep commented 1 month ago

Thanks, Steve. That reasoning makes sense.

I can't say with certainty why it's producing somewhat stabler runs, but issues seem to arise with heating deeper in the chromosphere. The radiation-heating balance might become too disrupted, perhaps? As always, reducing the radiative timescale also helps.

sjbradshaw commented 1 month ago

One thing I have discovered over the years is that any sink/source terms in the hydro. equations (e.g. radiation and heating) that somehow depend on density will definitely cause trouble in high-density regions of the domain. Fundamentally, it’s because there’s no rigorous way of choosing the time-step to guarantee stability, except for using the cell width over the speed of light which is far too limiting to be useful.

In the case of HYDRAD and heating at high density, I suspect what is happening is that a sudden, large increase in the column depth causes a huge amount of energy to be chucked into the plasma and, of course, in low altitude and high density regions this would be particularly severe, which then drives the temperature up to a point where we have incredibly strong optically-thin radiation. If the time-step isn’t sufficiently reduced then the temperature drops precipitously (even below absolute zero) and problems arise.

One can add various checks and limiters to deal with this, but ultimately all it introduces are a bunch more parameters (read: fudge-factors) to have to tune and justify. If you can find a (relatively) simple way to deal with these issues, that allows you to perform the simulations you want, then that is probably the best approach overall. When people are describing their codes (as requested) at Jim and Sherry’s upcoming ISWAT meeting, I will be very interested to see which participants are scrupulously honest about the numerical tricks and fixes they are forced to employ to run their simulations. Of course, the most honest approach is to make the code publicly available so that anyone who is sufficiently motivated can examine it line-by-line…

Incidentally, I’ve started specifying heating in per-particle terms (erg/s), rather than volumetrically (erg/s/cm^3), in a MHD code I’ve developed because the additional degrees of freedom allow for greater plasma expansion at the heating location, which quickly reduces the local density, leading to strong and spurious heating if it is specified volumetrically because as the density drops the energy per particle rockets upward and thus does the temperature. Specifying the energy per particle probably makes more physical sense too, given that the particles themselves (or, at least, their abundance) must to some extent mediate the mechanism by which they are energized (e.g. the ion cyclotron mechanism Shah and I have advocated).

From: Jeffrey Reep @.> Sent: Tuesday, July 16, 2024 6:45 PM To: rice-solar-physics/HYDRAD @.> Cc: sjbradshaw @.>; Comment @.> Subject: Re: [rice-solar-physics/HYDRAD] VAL heating changing with time? (Issue #106)

Thanks, Steve. That reasoning makes sense.

I can't say with certainty why it's producing somewhat stabler runs, but issues seem to arise with heating deeper in the chromosphere. The radiation-heating balance might become too disrupted, perhaps? As always, reducing the radiative timescale also helps.

— Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/106#issuecomment-2232002401 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7RN6MOA4VHZLDF6SHDZMWWBFAVCNFSM6AAAAABK5VC4YWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMZSGAYDENBQGE . You are receiving this because you commented. https://github.com/notifications/beacon/ACC6C7URBDIOZ5IJQHXLB53ZMWWBFA5CNFSM6AAAAABK5VC4YWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUFBGTWC.gif Message ID: @. @.> >