Skip to content

Fix total (plasma + kinetic neutral) deuterium particle balance: wall recombination (corr_neg and bcs(:) type) - #32

Open
Daniel-Maris wants to merge 20 commits into
iterorganization:developfrom
Daniel-Maris:bugfix/IMAS-5945-make-wall-recombination-corr-neg-from-kinetic-side-same-as-fluid-side
Open

Fix total (plasma + kinetic neutral) deuterium particle balance: wall recombination (corr_neg and bcs(:) type)#32
Daniel-Maris wants to merge 20 commits into
iterorganization:developfrom
Daniel-Maris:bugfix/IMAS-5945-make-wall-recombination-corr-neg-from-kinetic-side-same-as-fluid-side

Conversation

@Daniel-Maris

Copy link
Copy Markdown
Collaborator

This PR fixes the total deuterium particle balance (plasma + kinetic neutrals) by using the same correction on the particle side as on the fluid side for negative T and ne (corr_neg rather than previously used max(ne,1e16)), and by taking into account which boundary condition is locally on the fluid side through the bcs(:).

This breaks the reg test so those are updated.

This was already a PR before github, so for details see https://git.iter.org/projects/STAB/repos/jorek/pull-requests/1031/overview and https://jira.iter.org/browse/IMAS-5945 if you have access.

Daniel-Maris and others added 18 commits February 19, 2026 13:20
…ination-corr-neg-from-kinetic-side-same-as-fluid-side

updated regtests
…ination-corr-neg-from-kinetic-side-same-as-fluid-side
…ination-corr-neg-from-kinetic-side-same-as-fluid-side
…ination-corr-neg-from-kinetic-side-same-as-fluid-side
…ination-corr-neg-from-kinetic-side-same-as-fluid-side
…ination-corr-neg-from-kinetic-side-same-as-fluid-side

and updated regtests accordingly
…S-5945-make-wall-recombination-corr-neg-from-kinetic-side-same-as-fluid-side
…corr-neg-from-kinetic-side-same-as-fluid-side
@Daniel-Maris Daniel-Maris self-assigned this Aug 18, 2026
Comment thread diagnostics/mod_integrals3D.f90 Outdated
#endif
!>Lost to recombination (no Brehmstralung)
local_Prec = local_Prec + r0_corr*r0_corr*(T0_corr*Srec_T_ncs)*BigR *xjac* delta_phi *wst
local_Prec = local_Prec + r0_corr*r0_corr*(Te0_corr*Srec_T_ncs)*BigR *xjac* delta_phi *wst

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this should be the total temperature. Can you double check?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Hm, good catch, now I don't know to be honest.
@szmate00 could you check this?
I find these names all a bit confusing. I didn't expect Bremsstrahlung to be an important radiation mechanism for recombination, I thought it was mostly line radiation from the electron dropping down into a lower state. Is the term abused here, or where does it come from? Is it the 3rd electron in the 3 body recombination?

There are the ions and electrons getting neutral, so their energy leaving the plasma side. Now if that was all we cared about we could just use T0 here and be done, but to be consistent with the neutrals side, I think what is instead done is that the ion loss should be calculated here (so actually Ti0 should be used), while the electron losses are calculated separately in the line below (Prb). This is my understanding because there are equivalent terms in elt_matrix_fft (lines 1865, 1914, 2051 and 2054) of model600.

So @szmate00, it should be Ti0 here, right?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, Ti0, I think

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you,m can you correct it please?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, done. Thanks for the reminder

@Daniel-Maris
Daniel-Maris requested a review from N-Schwarz August 27, 2026 08:04
…corr-neg-from-kinetic-side-same-as-fluid-side

@N-Schwarz N-Schwarz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hi @Daniel-Maris , thanks. This looks good, just if you want to be consistent I think it would be better to apply the correction to the total temperature everywhere and also change it in mod_boundary_matrix_open.f90.

Comment thread particles/mod_fields.f90
if (present(T_e_raw)) T_e_raw = T_e_temp
T_e = max(T_e_temp, T_FLOOR)
if (present(T_e_raw)) T_e_raw = P(ii_Te) * T_norm
T_e = corr_neg_temp(P(ii_Te)) * T_norm

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think to be consistent, we should do the correction on the total temperature. Same below

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we discussed this before the move to github on the old PR page; I had already committed this but since it changes the underlying fluid mhd model, breaking many regtests in the process, we thought it would be better to do this in a separate PR to make it more clear what this PR is exactly doing and what that PR is exactly doing. If you now prefer to include this in this PR anyway please let me know. I'm planning to do that PR once this is finished to avoid conflicts with this PR

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry, I thought you meant to fix this already here.
We can do this in a later one.

Comment thread particles/mod_fields.f90
if(with_impurities) then
call fields%interp_PRZ(time,i_elm,[var_rho,var_Te,var_rhoimp,var_Ti],4,st(1),st(2),phi,P,P_s,P_t,P_phi,P_time,R,R_s,R_t,Z,Z_s,Z_t)
Ti = max(P(4)/(K_BOLTZ*MU_ZERO*central_density*1.d20), 1.d0)
Ti = corr_neg_temp(P(4))/(K_BOLTZ*MU_ZERO*central_density*1.d20)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here, the correction should be on the total temperature

@N-Schwarz

Copy link
Copy Markdown
Collaborator

@quietF , @szmate00 Can you have a look at this pull request?

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.

3 participants