-
Notifications
You must be signed in to change notification settings - Fork 39
/
ImplicitAndUpdateVZ.F90
75 lines (63 loc) · 2.14 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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! FILE: ImplicitAndUpdateVZ.F90 !
! CONTAINS: subroutine ImplicitAndUpdateVZ !
! !
! PURPOSE: Compute the linear terms associated to !
! the velocity in the z (horizontal) dimension !
! and call the implicit solver. !
! After this routine, the velocity field in z has !
! been updated to the new timestep !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine ImplicitAndUpdateVZ
use param
use local_arrays, only: vz,dq,ruz,rhs,pr
use decomp_2d, only: xstart,xend
implicit none
integer :: kc,jc,ic,imm
integer :: kmm,kpp
real :: alre,amm,acc,app,udz
real :: dxxvz,dzp
alre=al/ren
udz=dz*al
!$OMP PARALLEL DO &
!$OMP DEFAULT(none) &
!$OMP SHARED(xstart,xend,nxm,vz,pr) &
!$OMP SHARED(kmv,kpv,am3sk,ac3sk,ap3sk) &
!$OMP SHARED(dz,al,ga,ro,alre,dt,dq) &
!$OMP SHARED(udx3m,rhs,ruz) &
!$OMP PRIVATE(ic,jc,kc,imm,kmm,kpp) &
!$OMP PRIVATE(amm,acc,app) &
!$OMP PRIVATE(dxxvz,dzp)
do ic=xstart(3),xend(3)
imm=ic-1
do jc=xstart(2),xend(2)
do kc=1,nxm
kmm=kmv(kc)
kpp=kpv(kc)
amm=am3sk(kc)
acc=ac3sk(kc)
app=ap3sk(kc)
! Second derivative in x-direction of vz
!
dxxvz=vz(kpp,jc,ic)*app &
+vz(kc,jc,ic)*acc &
+vz(kmm,jc,ic)*amm
! component of grad(pr) along z direction
!
dzp=(pr(kc,jc,ic)-pr(kc,jc,imm))*dz*al
! Calculate right hand side of Eq. 5 (VO96)
!
rhs(kc,jc,ic)=(ga*dq(kc,jc,ic)+ro*ruz(kc,jc,ic) &
+alre*dxxvz-dzp)*dt
! Store the non-linear terms for the calculation of
! the next timestep
ruz(kc,jc,ic)=dq(kc,jc,ic)
enddo
enddo
enddo
!$OMP END PARALLEL DO
call SolveImpEqnUpdate_YZ(vz,rhs)
return
end