-
Notifications
You must be signed in to change notification settings - Fork 39
/
ExplicitTermsVX.F90
110 lines (101 loc) · 2.74 KB
/
ExplicitTermsVX.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! FILE: ExplicitTermsVX.F90 !
! CONTAINS: subroutine ExplicitTermsVX !
! !
! PURPOSE: Compute the non-linear terms associated to !
! the velocity in the x (vertical) dimension !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine ExplicitTermsVX
use param
use local_arrays, only: vz,vy,vx,temp,qcap
use decomp_2d, only: xstart,xend
implicit none
integer :: jc,kc
integer :: km,kp,jmm,jpp,ic,imm,ipp
real :: hxx,hxy,hxz
real :: udz,udy,tempit
real :: udzq,udyq
real :: dzzvx,dyyvx
udy=dy*0.25
udz=dz*0.25
udyq=dyq/ren
udzq=dzq/ren
!$OMP PARALLEL DO &
!$OMP DEFAULT(none) &
!$OMP SHARED(xstart,xend,nxm,vz,vy,vx,dz,dy) &
!$OMP SHARED(kmv,kpv,am3sk,ac3sk,ap3sk,udz) &
!$OMP SHARED(udy,udzq,udyq,udx3c,qcap,temp) &
!$OMP PRIVATE(ic,jc,kc,imm,ipp,km,kp) &
!$OMP PRIVATE(jmm,jpp,tempit) &
!$OMP PRIVATE(hxx,hxy,hxz,dzzvx,dyyvx)
do ic=xstart(3),xend(3)
imm=ic-1
ipp=ic+1
do jc=xstart(2),xend(2)
jmm=jc-1
jpp=jc+1
do kc=2,nxm
km=kc-1
kp=kc+1
!
! vx vz term
!
!
! d q_x q_t
! -----------
! d t
!
!
hxz=(((vz(kc,jc,ipp)+vz(km,jc,ipp)) &
*(vx(kc,jc,ipp)+vx(kc,jc,ic))) &
-((vz(kc,jc,ic)+vz(km,jc,ic)) &
*(vx(kc,jc,ic)+vx(kc,jc,imm))))*udz
!
! vx vy term
!
!
! d q_x q_r
! -----------
! d r
!
hxy=(((vy(kc,jpp,ic)+vy(km,jpp,ic)) &
*(vx(kc,jpp,ic)+vx(kc,jc,ic))) &
-((vy(kc,jc,ic)+vy(km,jc,ic)) &
*(vx(kc,jc,ic)+vx(kc,jmm,ic))))*udy
!
! vx vx term
!
!
! d q_x q_x
! -----------
! d x
!
hxx=((vx(kp,jc,ic)+vx(kc,jc,ic))*(vx(kp,jc,ic)+vx(kc,jc,ic)) &
-(vx(kc,jc,ic)+vx(km,jc,ic))*(vx(kc,jc,ic)+vx(km,jc,ic)) &
)*udx3c(kc)*0.25d0
!
! add the buoyancy term
!
tempit=temp(kc,jc,ic)
!
! z second derivatives of vx
!
dzzvx=(vx(kc,jc,imm) &
-2.0*vx(kc,jc,ic) &
+vx(kc,jc,ipp))*udzq
!
! y second derivatives of vx
!
dyyvx=(vx(kc,jmm,ic) &
-2.0*vx(kc,jc,ic) &
+vx(kc,jpp,ic))*udyq
qcap(kc,jc,ic) =-(hxx+hxy+hxz)+dyyvx+dzzvx+tempit
enddo
enddo
enddo
!$OMP END PARALLEL DO
return
end
!