-
Notifications
You must be signed in to change notification settings - Fork 39
/
ImplicitAndUpdateVX.F90
81 lines (68 loc) · 2.29 KB
/
ImplicitAndUpdateVX.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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! FILE: ImplicitAndUpdateVX.F90 !
! CONTAINS: subroutine ImplicitAndUpdateVX !
! !
! PURPOSE: Compute the linear terms associated to !
! the velocity in the X (vertical) direction and call !
! the implicit solver. After this routine, the !
! vertical velocity has been updated to the new !
! timestep !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine ImplicitAndUpdateVX
use param
use local_arrays, only: vx,rhs,rux,qcap,pr
use decomp_2d, only: xstart,xend
implicit none
integer :: jc,kc
integer :: km,kp,ic
real :: alre,udx3
real :: amm,acc,app,dxp,dxxvx
alre=al/ren
!$OMP PARALLEL DO &
!$OMP DEFAULT(none) &
!$OMP SHARED(xstart,xend,nxm,vx,pr) &
!$OMP SHARED(kmv,kpv,am3ck,ac3ck,ap3ck) &
!$OMP SHARED(al,ga,ro,alre,dt,qcap) &
!$OMP SHARED(udx3c,rhs,rux) &
!$OMP PRIVATE(ic,jc,kc,km,kp) &
!$OMP PRIVATE(amm,acc,app,udx3) &
!$OMP PRIVATE(dxxvx,dxp)
do ic=xstart(3),xend(3)
do jc=xstart(2),xend(2)
do kc=2,nxm
km=kc-1
kp=kc+1
udx3 = al*udx3c(kc)
amm=am3ck(kc)
acc=ac3ck(kc)
app=ap3ck(kc)
! Second derivative in x-direction of vx
!
dxxvx=vx(kp,jc,ic)*app &
+vx(kc,jc,ic)*acc &
+vx(km,jc,ic)*amm
! component of grad(pr) along x direction
!
dxp=(pr(kc,jc,ic)-pr(km,jc,ic))*udx3
! Calculate right hand side of Eq. 5 (VO96)
!
rhs(kc,jc,ic)=(ga*qcap(kc,jc,ic)+ro*rux(kc,jc,ic) &
+alre*dxxvx-dxp)*dt
! Store the non-linear terms for the calculation of
! the next timestep
rux(kc,jc,ic)=qcap(kc,jc,ic)
enddo
enddo
enddo
!$OMP END PARALLEL DO
! Solve equation and update velocity
call SolveImpEqnUpdate_X
! Set boundary conditions on the vertical velocity at top
! and bottom plates. This seems necessary.
vx(1,:,:)=0.0d0
vx(nx,:,:)=0.0d0
return
end
!