-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathCalcPlateNu.F90
57 lines (49 loc) · 1.73 KB
/
CalcPlateNu.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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! FILE: CalcPlateNu.F90 !
! CONTAINS: subroutine CalcPlateNu !
! !
! PURPOSE: Calculate the Nusselt number at the top !
! and bottom plates and output to a file. !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine CalcPlateNu
use param
use local_arrays, only: temp
use mpih
use decomp_2d, only: xstart,xend
implicit none
integer :: j,i
real :: nuslow, nusupp
real :: del,deln
nuslow = 0.d0
nusupp = 0.d0
del = 1.0/(xc(2)-xc(1))
deln = 1.0/(xc(nx)-xc(nxm))
!$OMP PARALLEL DO &
!$OMP DEFAULT(none) &
!$OMP SHARED(xstart,xend,temp,del,deln) &
!$OMP SHARED(nxm,nx) &
!$OMP PRIVATE(i,j) &
!$OMP REDUCTION(+:nuslow) &
!$OMP REDUCTION(+:nusupp)
do i=xstart(3),xend(3)
do j=xstart(2),xend(2)
nuslow = nuslow + (temp(1,j,i)-temp(2,j,i))*del
nusupp = nusupp + (temp(nxm,j,i)-temp(nx,j,i))*deln
enddo
end do
!$OMP END PARALLEL DO
nuslow = nuslow / (nzm*nym)
nusupp = nusupp / (nzm*nym)
call MpiSumRealScalar(nuslow)
call MpiSumRealScalar(nusupp)
if(ismaster) then
open(97,file="nu_plate.out",status='unknown', &
access='sequential',position='append')
write(97,546) time, nuslow, nusupp
546 format(4(1x,e14.6))
close(97)
endif
return
end