-
Notifications
You must be signed in to change notification settings - Fork 0
/
ImplicitAndUpdateVZ.F90
85 lines (62 loc) · 1.96 KB
/
ImplicitAndUpdateVZ.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
! -----------------------------------------------------
! -----------------------------------------------------
!
! File : ImplicitAndUpdateVZ.F90
! Contains : implicit terms and solve the approx. fact.
! equation
!
! -----------------------------------------------------
! -----------------------------------------------------
subroutine ImplicitAndUpdateVZ
use param
use local_arrays, only: vz,qcap,pr,ru3,rhs
implicit none
integer :: jc,kc,km,kp,jp,jm,ic,ip,im
real(DP) :: udx3
real(DP) :: dq32,dq33,dcq3,dpx33,dq31
real(DP) :: app,acc,amm
real(DP) :: alre,udx1q,udx2q
alre=al/ren
udx1q=dx1q
udx2q=dx2q
! compute the rhs of the factored equation
! everything at i+1/2,j+1/2,k
do kc=2,n3m
km=kmv(kc)
kp=kc+1
udx3 = al*udx3c(kc)
amm=am3ck(kc)
acc=ac3ck(kc)
app=ap3ck(kc)
do jc=1,n2m
jm=jmv(jc)
jp=jpv(jc)
do ic=1,n1m
im=imv(ic)
ip=ipv(ic)
! 11 second derivatives of q3 [for 3d case]
! 22 second derivatives of q3
dq32=(vz(ic,jm,kc) &
-2.d0*vz(ic,jc,kc) &
+vz(ic,jp,kc))*udx2q
! 33 second derivatives of q3
dq33=vz(ic,jc,kp)*app &
+vz(ic,jc,kc)*acc &
+vz(ic,jc,km)*amm
! viscous terms
dcq3=dq32+dq33! +dq31 for 3d case
! component of grad(pr) along x3 direction
dpx33=(pr(ic,jc,kc)-pr(ic,jc,km))*udx3
rhs(ic,jc,kc)=(ga*qcap(ic,jc,kc)+ro*ru3(ic,jc,kc) &
+alre*dcq3-dpx33)*dt
! updating of the non-linear terms
ru3(ic,jc,kc)=qcap(ic,jc,kc)
enddo
enddo
enddo
call SolveTridY (beta*al*dx2q)
call SolveTridZ
vz(:,:,1) = 0.0
vz(:,:,n3)= 0.0
return
end subroutine ImplicitAndUpdateVZ