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+
u(
i1,
i2+1,
i3-1,c)-
u(
i1,
i2-1,
i3-1,c))*dsi*.125
41 ! Coefficients of
the artificial diffusion
for the momentum equations
50 admzzR(
i1,
i2,
i3)=
ad21+
cd22*( abs(
uxmzzR(
i1,
i2,
i3,uc))+abs(
uxmzzR(
i1,
i2,
i3,vc))+abs(
uxmzzR(
i1,
i2,
i3,
wc))+
54 adzmzR(
i1,
i2,
i3)=
ad21+
cd22*( abs(
uxzmzR(
i1,
i2,
i3,uc))+abs(
uxzmzR(
i1,
i2,
i3,vc))+abs(
uxzmzR(
i1,
i2,
i3,
wc))+
58 adzzmR(
i1,
i2,
i3)=
ad21+
cd22*( abs(
uxzzmR(
i1,
i2,
i3,uc))+abs(
uxzzmR(
i1,
i2,
i3,vc))+abs(
uxzzmR(
i1,
i2,
i3,
wc))+
62 admzC(
i1,
i2,
i3)=
ad21+
cd22*( abs(
udmzC(
i1,
i2,
i3,0,uc))+abs(
udmzC(
i1,
i2,
i3,0,vc))+
65 adzmC(
i1,
i2,
i3)=
ad21+
cd22*( abs(
udzmC(
i1,
i2,
i3,0,uc))+abs(
udzmC(
i1,
i2,
i3,0,vc))+
69 admzzC(
i1,
i2,
i3)=
ad21+
cd22*( abs(
udmzzC(
i1,
i2,
i3,0,uc))+abs(
udmzzC(
i1,
i2,
i3,0,vc))+abs(
udmzzC(
i1,
i2,
i3,0,
wc))+
70 & abs(
udmzzC(
i1,
i2,
i3,1,uc))+abs(
udmzzC(
i1,
i2,
i3,1,vc))+abs(
udmzzC(
i1,
i2,
i3,1,
wc))+
71 & abs(
udmzzC(
i1,
i2,
i3,2,uc))+abs(
udmzzC(
i1,
i2,
i3,2,vc))+abs(
udmzzC(
i1,
i2,
i3,2,
wc)) )
73 adzmzC(
i1,
i2,
i3)=
ad21+
cd22*( abs(
udzmzC(
i1,
i2,
i3,0,uc))+abs(
udzmzC(
i1,
i2,
i3,0,vc))+abs(
udzmzC(
i1,
i2,
i3,0,
wc))+
74 & abs(
udzmzC(
i1,
i2,
i3,1,uc))+abs(
udzmzC(
i1,
i2,
i3,1,vc))+abs(
udzmzC(
i1,
i2,
i3,1,
wc))+
75 & abs(
udzmzC(
i1,
i2,
i3,2,uc))+abs(
udzmzC(
i1,
i2,
i3,2,vc))+abs(
udzmzC(
i1,
i2,
i3,2,
wc)) )
77 adzzmC(
i1,
i2,
i3)=
ad21+
cd22*( abs(
udzzmC(
i1,
i2,
i3,0,uc))+abs(
udzzmC(
i1,
i2,
i3,0,vc))+abs(
udzzmC(
i1,
i2,
i3,0,
wc))+
78 & abs(
udzzmC(
i1,
i2,
i3,1,uc))+abs(
udzzmC(
i1,
i2,
i3,1,vc))+abs(
udzzmC(
i1,
i2,
i3,1,
wc))+
79 & abs(
udzzmC(
i1,
i2,
i3,2,uc))+abs(
udzzmC(
i1,
i2,
i3,2,vc))+abs(
udzzmC(
i1,
i2,
i3,2,
wc)) )
81 ! Coefficients of
the artificial diffusion
for the SA turbulence model
86 admzzRSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
uxmzzR(
i1,
i2,
i3,
nc))+abs(
uymzzR(
i1,
i2,
i3,
nc))+abs(
uzmzzR(
i1,
i2,
i3,
nc)) )
87 adzmzRSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
uxzmzR(
i1,
i2,
i3,
nc))+abs(
uyzmzR(
i1,
i2,
i3,
nc))+abs(
uzzmzR(
i1,
i2,
i3,
nc)) )
88 adzzmRSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
uxzzmR(
i1,
i2,
i3,
nc))+abs(
uyzzmR(
i1,
i2,
i3,
nc))+abs(
uzzzmR(
i1,
i2,
i3,
nc)) )
90 admzCSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
udmzC(
i1,
i2,
i3,0,
nc))+abs(
udmzC(
i1,
i2,
i3,1,
nc)) )
91 adzmCSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
udzmC(
i1,
i2,
i3,0,
nc))+abs(
udzmC(
i1,
i2,
i3,1,
nc)) )
93 admzzCSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
udmzzC(
i1,
i2,
i3,0,
nc))+abs(
udmzzC(
i1,
i2,
i3,1,
nc))+abs(
udmzzC(
i1,
i2,
i3,2,
nc)))
94 adzmzCSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
udzmzC(
i1,
i2,
i3,0,
nc))+abs(
udzmzC(
i1,
i2,
i3,1,
nc))+abs(
udzmzC(
i1,
i2,
i3,2,
nc)))
95 adzzmCSA(
i1,
i2,
i3)=ad21n+cd22n*( abs(
udzzmC(
i1,
i2,
i3,0,
nc))+abs(
udzzmC(
i1,
i2,
i3,1,
nc))+abs(
udzzmC(
i1,
i2,
i3,2,
nc)))
98 ! Here are
the parts of
the artificial diffusion that are
explicit (appear on
the RHS)
100 adE1(
i1,
i2,
i3,c) = cdmz*
u(i1-1,i2,i3,c)+cdpz*
u(i1+1,i2,i3,c)
101 adE2(i1,i2,i3,c) = 0.
103 adE3d0(i1,i2,i3,c) = cdzmz*
u(i1,i2-1,i3,c)+cdzpz*
u(i1,i2+1,i3,c)+cdzzm*
u(i1,i2,i3-1,c)+cdzzp*
u(i1,i2,i3+1,c)
104 adE3d1(i1,i2,i3,c) = cdmzz*
u(i1-1,i2,i3,c)+cdpzz*
u(i1+1,i2,i3,c)+cdzzm*
u(i1,i2,i3-1,c)+cdzzp*
u(i1,i2,i3+1,c)
105 adE3d2(i1,i2,i3,c) = cdmzz*
u(i1-1,i2,i3,c)+cdpzz*
u(i1+1,i2,i3,c)+cdzmz*
u(i1,i2-1,i3,c)+cdzpz*
u(i1,i2+1,i3,c)
107 ad2f(i1,i2,i3,
m)= -cdDiag*
u(i1,i2,i3,
m)+cdmz*
u(i1-1,i2,i3,
m)+cdpz*
u(i1+1,i2,i3,
m)+
108 & cdzm*
u(i1,i2-1,i3,
m)+cdzp*
u(i1,i2+1,i3,
m)
110 ad3f(i1,i2,i3,
m)= -cdDiag*
u(i1,i2,i3,
m)+cdmzz*
u(i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