From 22500733da2e881155961bf609fd77869be00fbe Mon Sep 17 00:00:00 2001 From: Stephen Copplestone Date: Wed, 28 Jun 2023 19:52:52 +0200 Subject: [PATCH] up --- src/particles/dsmc/dsmc_chemical_reactions.f90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/particles/dsmc/dsmc_chemical_reactions.f90 b/src/particles/dsmc/dsmc_chemical_reactions.f90 index 18efdbde1..642c4b41e 100644 --- a/src/particles/dsmc/dsmc_chemical_reactions.f90 +++ b/src/particles/dsmc/dsmc_chemical_reactions.f90 @@ -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 @@ -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) @@ -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.