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

Improper resetting of pandf during jacobian calculation #14

Open
jguterl opened this issue Apr 1, 2020 · 0 comments
Open

Improper resetting of pandf during jacobian calculation #14

jguterl opened this issue Apr 1, 2020 · 0 comments

Comments

@jguterl
Copy link
Contributor

jguterl commented Apr 1, 2020

There are two variables in pandf subroutine which are not reinitalized between each call:

  • the variable resmo in the following block for neutral species (zi(ifld)=0). I suggest to add an "else" statement to set resmo to zero when zi=0 (see cJG:suggested correction). The residual of the momentum for the gas species is thus wrong when nusp>1 which is the case when nhsp>1.

      do 99 iy = j2, j5
         do 98 ix = i2, i5
            ix2 = ixp1(ix,iy)
            if (zi(ifld) .ne. 0) then  # additions only for charged ions
               dp1 =  cngmom(ifld)*(1/fac2sp)*
                        ( ng(ix2,iy,1)*tg(ix2,iy,1)-
                          ng(ix ,iy,1)*tg(ix ,iy,1) )
               resmo(ix,iy,ifld) = 0.
               resmo(ix,iy,ifld) =
                    smoc(ix,iy,ifld)
                  + smov(ix,iy,ifld) * up(ix,iy,ifld)
                  - cfneut * cfneutsor_mi * sx(ix,iy) * rrv(ix,iy) * dp1
                  - cfneut * cfneutsor_mi * cmwall(ifld)*0.5*(ng(ix,iy,1)+ng(ix2,iy,1))
                        * mi(ifld)*up(ix,iy,ifld)*0.5
                        *(nucx(ix,iy,1)+nucx(ix2,iy,1))*volv(ix,iy)
                  + cmneut * cmneutsor_mi * uesor_up(ix,iy,ifld)
                  + cfmsor*(msor(ix,iy,ifld) + msorxr(ix,iy,ifld)) #### IJ 2017: needs *cfneut for multi-charge state ions & MC neutrals?
                  + volmsor(ix,iy,ifld)
                  + cfvisxneov*visvol_v(ix,iy,ifld)
                  + cfvisxneoq*visvol_q(ix,iy,ifld)
    c  Add drag with cold, stationary impurity neutrals
               if (ifld > nhsp) then
                 resmo(ix,iy,ifld) = resmo(ix,iy,ifld) - cfupimpg*
                      0.25*mi(ifld)*(ni(ix,iy,ifld)+ni(ix2,iy,ifld))*
                       ( nucxi(ix,iy,ifld)+nucxi(ix2,iy,ifld)+
                        nueli(ix,iy,ifld)+nueli(ix2,iy,ifld) )*
                         up(ix,iy,ifld)*volv(ix,iy)
                endif
     cJG: suggest correction
            else
               resmo(ix,iy,ifld) = 0
            endif
    
  • the electron power background variable pwrebkg is not reset properly when xinc!=0 or yinc!=0. That should not be a problem though as it is to prevent small values of pwrebkg. But that should be fixed for the pupose of code validation.

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

No branches or pull requests

1 participant