-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathImplicitAndUpdateVY.F90
78 lines (65 loc) · 2.18 KB
/
ImplicitAndUpdateVY.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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! FILE: ImplicitAndUpdateVY.F90 !
! CONTAINS: subroutine ImplicitAndUpdateVY !
! !
! PURPOSE: Compute the linear terms associated to !
! the velocity in the y (horizontal) dimension !
! and call the implicit solver !
! After this routine, the velocity field in y has !
! been updated to the new timestep !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine ImplicitAndUpdateVY
use param
use local_arrays, only: vy,ruy,pr,rhs,dph
use decomp_2d, only: xstart,xend
implicit none
integer :: kc,jmm,jc,ic
integer :: kpp,kmm
real :: alre,udy
real :: amm,acc,app
real :: dyp,dxxvy
alre=al/ren
udy=dy*al
!$OMP PARALLEL DO &
!$OMP DEFAULT(none) &
!$OMP SHARED(xstart,xend,nxm,vy,pr) &
!$OMP SHARED(kmv,kpv,am3sk,ac3sk,ap3sk) &
!$OMP SHARED(dy,al,ga,ro,alre,dt,dph) &
!$OMP SHARED(udy,udx3m,rhs,ruy) &
!$OMP PRIVATE(ic,jc,kc,kmm,kpp,jmm) &
!$OMP PRIVATE(amm,acc,app) &
!$OMP PRIVATE(dyp,dxxvy)
do ic=xstart(3),xend(3)
do jc=xstart(2),xend(2)
jmm=jc-1
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 vy
!
!
dxxvy=vy(kpp,jc,ic)*app &
+vy(kc,jc,ic)*acc &
+vy(kmm,jc,ic)*amm
! component of grad(pr) along y direction
!
dyp=(pr(kc,jc,ic)-pr(kc,jmm,ic))*udy
! Calculate right hand side of Eq. 5 (VO96)
!
rhs(kc,jc,ic)=(ga*dph(kc,jc,ic)+ro*ruy(kc,jc,ic) &
+alre*dxxvy-dyp)*dt
! Store the non-linear terms for the calculation of
! the next timestep
ruy(kc,jc,ic)=dph(kc,jc,ic)
enddo
enddo
enddo
! Solve equation and update velocity
call SolveImpEqnUpdate_YZ(vy,rhs)
return
end