Skip to content

Commit

Permalink
checked drifts and mirror. Individually working
Browse files Browse the repository at this point in the history
  • Loading branch information
Georgia Acton committed Mar 25, 2024
1 parent 2b99860 commit 7e77cd0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 0 additions & 2 deletions init_g.f90
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,6 @@ subroutine ginit_default
end do
end if
end if

phi(1,1,:) = 0.0

! need better way to initialise for full flux surface cases
ia = 1
Expand Down
12 changes: 6 additions & 6 deletions mirror_terms.f90
Original file line number Diff line number Diff line change
Expand Up @@ -214,21 +214,21 @@ subroutine init_invert_mirror_operator

!> corresponds to sign of mirror term positive on RHS of equation
a(2:, 1) = -0.5 * (1.0 - 2.0 * vpa_upwind) / dvpa
b(1:, 1) = -2.0 * vpa_upwind / dvpa
c(1:nvpa - 1, 1) = 0.5 * (1.0 + 2.0 * vpa_upwind) / dvpa
b(2:, 1) = -2.0 * vpa_upwind / dvpa
c(2:nvpa - 1, 1) = 0.5 * (1.0 + 2.0 * vpa_upwind) / dvpa
!> must treat boundary carefully
!> assumes fully upwinded at outgoing boundary
!b(1, 1) = -1.0 / dvpa
!c(1, 1) = 1.0 / dvpa
b(1, 1) = -1.0 / dvpa
c(1, 1) = 1.0 / dvpa

!> corresponds to sign of mirror term negative on RHS of equation
a(2:nvpa, -1) = -0.5 * (1.0 + 2.0 * vpa_upwind) / dvpa
b(:nvpa, -1) = 2.0 * vpa_upwind / dvpa
c(:nvpa - 1, -1) = 0.5 * (1.0 - 2.0 * vpa_upwind) / dvpa
!> must treat boundary carefully
!> assumes fully upwinded at outgoing boundary
!a(nvpa, -1) = -1.0 / dvpa
!b(nvpa, -1) = 1.0 / dvpa
a(nvpa, -1) = -1.0 / dvpa
b(nvpa, -1) = 1.0 / dvpa

!> time_upwind = 0.0 corresponds to centered in time
!> time_upwind = 1.0 corresponds to fully implicit (upwinded)
Expand Down
1 change: 1 addition & 0 deletions time_advance.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,7 @@ subroutine advance_wstar_explicit(phi, gout)

!> calculate d<phi>/dy in k-space
call get_dgdy(g_gyro, g0)

!> transform d<phi>/dy from ky-space to y-space
do ivmu = vmu_lo%llim_proc, vmu_lo%ulim_proc
do iz = -nzgrid, nzgrid
Expand Down

0 comments on commit 7e77cd0

Please sign in to comment.