Skip to content

Commit

Permalink
Correct normalization factor for Electric field
Browse files Browse the repository at this point in the history
- Use 1 instead of -IQ(NP) to convert E field from V/cm to 1/cm.
- Use RM instead of hard-coded 0.511 for the electron rest mass.
  • Loading branch information
mainegra authored and ftessier committed Jan 20, 2016
1 parent aadebb9 commit 9e18712
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions HEN_HOUSE/src/emf_macros.mortran
Original file line number Diff line number Diff line change
Expand Up @@ -420,10 +420,10 @@ REPLACE {$GET-POTENTIAL(#,#,#,#);} WITH {;
"***********************************************"
REPLACE {$GET-EM-FIELD(#,#,#,#,#);} WITH {;
"fixed e-field normalization below--factor of 10^6 must be in denominator!--BW"
fbtemp=-IQ(NP)/(RM*10**6);
fbtemp= 1.0/(RM*10**6);
{P1}X0=ExIN*fbtemp;{P1}Y0=EyIN*fbtemp;{P1}Z0=EzIN*fbtemp;
fbtemp=3.0/0.511;
{P2}X0=BxIN*fbtemp;{P2}Y0=ByIN*fbtemp;{P2}Z0=BzIN*fbtemp;
fbtemp=3.0/RM;
{P2}X0=Bx*fbtemp;{P2}Y0=By*fbtemp;{P2}Z0=Bz*fbtemp;
}
;
"REPLACE {$SET-TUSTEP-EM-FIELD;} WITH {;}"
Expand Down

1 comment on commit 9e18712

@ftessier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit introduced a bug by changing the electromagnetic field component variable names on line 426. This causes any code using emf_macros.mortran to fail compilation. This bug is fixed in commit 2a36e18.

Please sign in to comment.