📄 select.for
字号:
* SELECT.FOR
*
SUBROUTINE SELECT
*--selects a potential collision pair and calculates the product of the
*--collision cross-section and relative speed
*
INCLUDE 'dsmc0.h'
COMMON /ELAST / VRC(3),VRR,VR,L,M,LS,MS,CVR,MM,NN,N
*
K=INT(RF(0)*(IC(2,N,NN)-0.0001))+IC(1,N,NN)+1
L=IR(K)
*--the first molecule L has been chosen at random from group NN in cell
100 MSC=IPL(L)
IF ((NN.EQ.MM.AND.ISCG(2,MSC,MM).EQ.1).OR.
& (NN.NE.MM.AND.ISCG(2,MSC,MM).EQ.0)) THEN
*--if MSC has no type MM molecule find the nearest sub-cell with one
NST=1
NSG=1
150 INC=NSG*NST
NSG=-NSG
NST=NST+1
MSC=MSC+INC
IF (MSC.LT.1.OR.MSC.GT.MNSC) GO TO 150
IF (ISC(MSC).NE.N.OR.ISCG(2,MSC,MM).LT.1) GO TO 150
END IF
*--the second molecule M is now chosen at random from the group MM
*--molecules that are in the sub-cell MSC
K=INT(RF(0)*(ISCG(2,MSC,MM)-0.0001))+ISCG(1,MSC,MM)+1
M=IR(K)
IF (L.EQ.M) GO TO 100
*--choose a new second molecule if the first is again chosen
DO 200 K=1,3
VRC(K)=PV(K,L)-PV(K,M)
200 CONTINUE
*--VRC(1 to 3) are the components of the relative velocity
VRR=VRC(1)**2+VRC(2)**2+VRC(3)**2
VR=SQRT(VRR)
*--VR is the relative speed
LS=IPS(L)
MS=IPS(M)
CVR=VR*SPM(1,LS,MS)*((2.*BOLTZ*SPM(2,LS,MS)/(SPM(5,LS,MS)*VRR))
& **(SPM(3,LS,MS)-0.5))/SPM(6,LS,MS)
*--the collision cross-section is based on eqn (4.63)
RETURN
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -