Skip to content

Commit

Permalink
Move drift heating back to original loop
Browse files Browse the repository at this point in the history
  • Loading branch information
holm10 committed Nov 9, 2024
1 parent f5a62be commit a1354c4
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions bbb/oderhs.m
Original file line number Diff line number Diff line change
Expand Up @@ -4667,6 +4667,22 @@ ccc call volave(nx, ny, j2, j5, i2, i5, ixp1(0,0), ixm1(0,0),
. + seak(ix,iy)
. + sead(ix,iy)
. + seadh(ix,iy)

upgcc = 0.5*(up(ix,iy,iigsp)+up(ix1,iy,iigsp))
vycc = (cfnidhgy**0.5)*0.5*(vy(ix,iy,iigsp)+vy(ix1,iy,iigsp))
v2cc = (cfnidhg2**0.5)*0.5*(v2(ix,iy,iigsp)+v2(ix1,iy,iigsp))

c Atom kinetic energy source from mol. drift heating
reseg(ix,iy,1) = reseg(ix,iy,1)
. + cfnidh*cfnidhdis*0.5*mg(1)* (upgcc**2 + vycc**2 + v2cc**2)
. * psordis(ix,iy,2)

c Ion energy source from mol. drift heating
resei(ix,iy) = resei(ix,iy)
. + cftiexclg * cfneut * cfneutsor_ei * cnsor * cfnidhdis
. * 0.5*mg(1)*(upgcc**2 + vycc**2 + v2cc**2) * psordis(ix,iy,2)


else
resei(ix,iy) = resei(ix,iy) + w0(ix,iy)
. + cfneut * cfneutsor_ei * ctsor*1.25e-1*mi(1)*
Expand Down Expand Up @@ -7892,21 +7908,6 @@ call fd2tra (nx,ny,floxge(0:nx+1,0:ny+1,igsp),
c Should scale with cftiexclg to conserve energy when transitioning?


upgcc = 0.5*(up(ix,iy,iigsp)+up(ix1,iy,iigsp))
vycc = (cfnidhgy**0.5)*0.5*(vy(ix,iy,iigsp)+vy(ix1,iy,iigsp))
v2cc = (cfnidhg2**0.5)*0.5*(v2(ix,iy,iigsp)+v2(ix1,iy,iigsp))

c Atom kinetic energy source from mol. drift heating
reseg(ix,iy,1) = reseg(ix,iy,1)
. + cfnidh*cfnidhdis*0.5*mg(1)* (upgcc**2 + vycc**2 + v2cc**2)
. * psordis(ix,iy,2)

c Ion energy source from mol. drift heating
seic(ix,iy) = seic(ix,iy)
. + cftiexclg * cfneut * cfneutsor_ei * cnsor * cfnidhdis
. * 0.5*mg(1)*(upgcc**2 + vycc**2 + v2cc**2) * psordis(ix,iy,2)


* ------------------------------------------------------------
* GAS-GAS TERMS
* ------------------------------------------------------------
Expand Down

0 comments on commit a1354c4

Please sign in to comment.