Skip to content

Commit

Permalink
Merge pull request #77 from ORNL-Fusion/fix_analytical_fields_p
Browse files Browse the repository at this point in the history
Add check for Er0 == 0 in analytical_fields_p
  • Loading branch information
mbeidler3 authored Jan 15, 2025
2 parents 2fadda1 + 74e9651 commit a8b4014
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/korc_fields.f90
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,13 @@ subroutine analytical_fields_p(params,pchunk,F,X_X,X_Y,X_Z, &
!write(6,*) 'T_R ',T_R(cc)*params%cpp%length

Ezeta(cc) = -E0/( 1.0_rp + eta(cc)*cT(cc))
Er(cc) =Er0*(1/cosh((T_R(cc)-rrmn)/sigmaamn))

IF (Er0 == 0._rp) THEN
Er(cc) = 0._rp
ELSE
Er(cc) =Er0*(1/cosh((T_R(cc)-rrmn)/sigmaamn))
END IF

E_X(cc) = Ezeta(cc)*cZ(cc)+Er(cc)*cT(cc)*sZ(cc)
E_Y(cc) = -Ezeta(cc)*sZ(cc)+Er(cc)*cT(cc)*cZ(cc)
E_Z(cc) = Er(cc)*sT(cc)
Expand Down

0 comments on commit a8b4014

Please sign in to comment.