Skip to content

Senichi/time dependent speed up - #32

Open
senichenkov wants to merge 12 commits into
iterorganization:feature/wg-releasefrom
senichenkov:senichi/time_dependent_speed-up
Open

Senichi/time dependent speed up#32
senichenkov wants to merge 12 commits into
iterorganization:feature/wg-releasefrom
senichenkov:senichi/time_dependent_speed-up

Conversation

@senichenkov

Copy link
Copy Markdown
Contributor

These changes were suggested by Lisa K 'with her outstanding great wisdom'. Briefly speaking, sometimes it is necessary to keep terms like Ted(ne)/d(dt) (which are available only with 'b2mndt_style=2', but simultaneously do not care about true time-dependent mode - e.g. apply the speed-up by increasing dtee, dtei, dtmo in some regions. In such case it is worth to replace error messages with warning ones.
Additionally, for such cases a treatment of terms like Te
d(ne)/d(dt) is changed to speed-up the internal energy (or full momentum) even if dtee*rxf .ne. 1.0. Actually, a 'third' option from my User Forum presentation is implemented.

Comment thread src/equations/b2npht.F Outdated
Comment thread src/user/b2mod_wrsrt.F Outdated
write(hlp_frm,'(a,i3,a,i3,a,i3,a)') '(a1,6x,a4,5x,',
, nr_tmp*nrg_tmp,'(4x,a8,i2.2),',
, ns_tmp*nsp_tmp,'(4x,a8,a2),1x,',
, ns_tmp*nsp_tmp,'(4x,a8,a2),',

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.

Can you show me an example of the file before and after this format change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just want to better align the column headers with the data themselves. Please compare the original and new tracing files (slightly renamed to upload them to GitHub)
intshrt_new.trc.txt

intshrt_original.trc.txt

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 agree that your alignment looks better if you list the numbers with two-digit exponents, but since having three digit exponents is a required feature, and that is what the original alignment was doing, you MUST revert this change and also the other change on line 367 where you wrongfully changed the format from e12.4 to e12.4e3.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK, my mistake with the exponent formatting is now clear, thank you. However, I'm confused with what is wrong with 'e12.4', or with 'e12.4e3', and which one is correct. May I simply copy the last several lines from what is on 'feature/wg_release' branch, like following?

c Create a format string for the column headers
if (nfl_tmp.gt.0) then
write(hlp_frm,'(a,i3,a,i3,a,i3,a)') '(a1,6x,a4,4x,',
, nr_tmpnrg_tmp,'(4x,a8,i2.2),',
, ns_tmp
nsp_tmp,'(4x,a8,a2),1x,',
, na_tmpnrg_tmpnsp_tmp,'(1x,a8,i2.2,''_'',a2))'
#ifdef DBG
c print *,'%%%b2wrsrt: nsp_tmp,nfl_tmp= ',nsp_tmp,nfl_tmp
print *,'hlp_frm:'
print *,trim(hlp_frm)
#endif
endif
if (nfl_tmp.gt.0) then
write(lun,hlp_frm) '#','time',
, ((hlp_hr(j),i,i=1,nrg_tmp),j=1,nr_tmp),
, ((hlp_hs(j),species_list(i),i=1,nsp_tmp),j=1,ns_tmp),
, (((hlp_ha(k),j,species_list(i),j=1,nrg_tmp),
, i=1,nsp_tmp),k=1,na_tmp)
end if

  end if

  if (nfl_tmp.gt.0) then
    write(hlp_frm,'(a,i3,a)') '(1p,e16.7,',
 +   nr_tmp*nrg_tmp + ns_tmp*nsp_tmp + na_tmp*nrg_tmp*nsp_tmp,
 +  '(2x,e12.4e3))'
  end if

#ifdef DBG
print *,'hlp_frm:' !###
print *,trim(hlp_frm) !###
#endif
return
c=======================================================================

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.

The REQUIREMENT is very simple. The output of reals must have the format ending with E+123. Your proposal of using a string to create the format looks fine.

Comment thread src/user/b2mod_wrsrt.F
Comment thread src/modules/b2mod_numerics_namelist.F
Comment thread src/user/b2mod_wrsrt.F
@senichenkov

Copy link
Copy Markdown
Contributor Author

Regarding the time-dependent mode and 'b2mndt_style.eq.2'. Generally, they are not the same, because only with 'b2mndt_style.eq.2' the essential terms like te * d ne /dt are included into equations. So, if one (Lisa K) wants to solve balance equations with these terms, he(she) have to activate 'b2mndt_style.eq.2'. However, even with these terms activated, Lisa K may want to use other features of the code, like time multipliers (e.g. DTEE to speed-up the evolution of electron internal energy) or solve total energy balance equations (to avoid numerical instabilities causes by electron-ion heat exchange term under high collisionality conditions) . Lisa K believes that settings like these should be available, therefore she suggested replacing code termination with warning messages saying that the time-dependent mode is not activated correctly.

@hrdoktorx

Copy link
Copy Markdown
Collaborator

I understand the rationale. Thank you. I therefore expect a parallel PR on the main SOLPS-ITER repository that will modify the explanations in the Manual about the dynamic mode on these restrictions and that can be lifted and under what circumstances.

@hrdoktorx

Copy link
Copy Markdown
Collaborator

@senichenkov I'm still waiting on a parallel PR at the SOLPS-ITER level to clarify the text in the Manual to explain this new option for running the code.

@senichenkov

Copy link
Copy Markdown
Contributor Author

I'm sorry for delay. I'm busy with many other activities, and I have to install 3.0.10 branch somewhere which I do not plan to use for computation - it seems I fully switched to WG.

@hrdoktorx

Copy link
Copy Markdown
Collaborator

Since this is a PR for the WG code, the change is to be made in the WG manual, so no need for a 3.0.10-based PR.

@senichenkov

Copy link
Copy Markdown
Contributor Author

I modified the b2input.xml, but you expect corresponding updates to solps.tex. Ok, that's easier. Sorry for misunderstanding

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