Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
scopplestone committed Jun 28, 2023
1 parent 22a1ff6 commit 2250073
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/particles/dsmc/dsmc_chemical_reactions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,7 @@ END FUNCTION GetRandomVectorInPlane

FUNCTION GetRotatedVector(VeloVec,NormVec)
!===================================================================================================================================
! Rotate the vector in the plane set up by VeloVec and NormVec by choosing an angle from a 4.0 / PI * COS(Theta_temp)**2
! Rotate the vector in the plane set up by VeloVec and NormVec by choosing an angle from a 4.0 / PI * COS(Theta)**2
! distribution via the ARM
!===================================================================================================================================
! MODULES
Expand All @@ -1921,7 +1921,7 @@ FUNCTION GetRotatedVector(VeloVec,NormVec)
REAL :: RandVal, v(1:3)
REAL :: Theta, Theta_temp
REAL :: PDF_temp
REAL, PARAMETER :: PDF_max=4./ACOS(-1.)
REAL, PARAMETER :: PDF_max=4./PI
LOGICAL :: ARM_SEE_PDF
!===================================================================================================================================
v = UNITVECTOR(VeloVec)
Expand All @@ -1931,7 +1931,7 @@ FUNCTION GetRotatedVector(VeloVec,NormVec)
ARM_SEE_PDF=.TRUE.
DO WHILE(ARM_SEE_PDF)
CALL RANDOM_NUMBER(RandVal)
Theta_temp = RandVal * 0.5 * PI
Theta_temp = PI*(RandVal-0.5)
PDF_temp = 4.0 / PI * COS(Theta_temp)**2
CALL RANDOM_NUMBER(RandVal)
IF ((PDF_temp/PDF_max).GT.RandVal) ARM_SEE_PDF = .FALSE.
Expand Down

0 comments on commit 2250073

Please sign in to comment.