Skip to content

Commit

Permalink
BEAMS3D: eval bg plasma at ptcl pos instead of GC
Browse files Browse the repository at this point in the history
  • Loading branch information
kudav committed Dec 2, 2024
1 parent 748f00b commit c6fa416
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions BEAMS3D/Sources/beams3d_physics_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ MODULE beams3d_physics_mod
!-----------------------------------------------------------------
! Module PARAMETERS
!-----------------------------------------------------------------

DOUBLE PRECISION :: q2(6), qtemp(4)
DOUBLE PRECISION, PRIVATE, PARAMETER :: electron_mass = 9.10938356D-31 !m_e
DOUBLE PRECISION, PRIVATE, PARAMETER :: e_charge = 1.60217662E-19 !e_c
DOUBLE PRECISION, PRIVATE, PARAMETER :: sqrt_pi = 1.7724538509 !pi^(1/2)
Expand Down Expand Up @@ -257,12 +257,15 @@ SUBROUTINE beams3d_physics_gc(t, q)
!--------------------------------------------------------------

ier = 0

CALL beams3d_MODB(q,modb)
qtemp=q
CALL beams3d_neutralize_gc(qtemp)
lneut=.false.
! Setup position in a vll arrays
r_temp = q(1)
phi_temp = MODULO(q(2), phimax)
r_temp = qtemp(1)
phi_temp = MODULO(qtemp(2), phimax)
IF (phi_temp < 0) phi_temp = phi_temp + phimax
z_temp = q(3)
z_temp = qtemp(3)
vll = q(4)

! Initialize values
Expand All @@ -286,10 +289,10 @@ SUBROUTINE beams3d_physics_gc(t, q)
yparam = (phi_temp - phiaxis(j)) * hpi(j)
zparam = (z_temp - zaxis(k)) * hzi(k)
! Evaluate the Splines
CALL R8HERM3FCN(ict,1,1,fval,i,j,k,xparam,yparam,zparam,&
hr(i),hri(i),hp(j),hpi(j),hz(k),hzi(k),&
MODB4D(1,1,1,1),nr,nphi,nz)
modb = fval(1)
! CALL R8HERM3FCN(ict,1,1,fval,i,j,k,xparam,yparam,zparam,&
! hr(i),hri(i),hp(j),hpi(j),hz(k),hzi(k),&
! MODB4D(1,1,1,1),nr,nphi,nz)
! modb = fval(1)
CALL R8HERM3FCN(ict,1,1,fval,i,j,k,xparam,yparam,zparam,&
hr(i),hri(i),hp(j),hpi(j),hz(k),hzi(k),&
TE4D(1,1,1,1),nr,nphi,nz)
Expand Down

0 comments on commit c6fa416

Please sign in to comment.