-
Notifications
You must be signed in to change notification settings - Fork 2
/
LES_Filtering_setup.f90
165 lines (141 loc) · 9.09 KB
/
LES_Filtering_setup.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
!------------------------------------------------------------------------------!
! !
! PROGRAM : LES_Filtering_setup.f90 !
! !
! PURPOSE : Setup for LES-filter the DNS data for turbulent channel flow. !
! !
! 2016.12.07 K.Noh !
! !
!------------------------------------------------------------------------------!
SUBROUTINE SETUP
USE LES_FILTERING_module, &
ONLY : N, Nx, Ny, Nz, dx, dz, FW, pi, tol, &
file_name, dir_name, path_name, VS_CASE, FILTER_OX, &
VS_ONLY, Y_ORDER
USE LES_FILTERING_module, &
ONLY : X, Y, Z, dy, U, V, W, U_Fil, V_Fil, W_Fil, &
Resi_T, S_T, S_T_Fil, NU_R, O_T, O_T_Fil, VS, &
L_T, M_T, U_Fil_2, V_Fil_2, W_Fil_2, S_T_Fil_2, Cs, YP
IMPLICIT NONE
INTEGER :: i,j,k
pi = atan(1.0)*4
!------------------------------------------------------------------!
! Make & Initialize Result folder !
!------------------------------------------------------------------!
! file_name = 'instantaneous_velocity_field_re644.plt'
file_name = 'INSU_XYZ.plt'
dir_name = 'RESULT'
CALL SYSTEM('mkdir '//TRIM(dir_name))
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/U')
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/RESIDUAL_STRESS')
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/STRAIN_RATE')
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/ROTATION_RATE')
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/EDDY_VISCOSITY')
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/VORTICAL_STRUCTURE')
CALL SYSTEM('mkdir '//TRIM(dir_name)//'/SMARGORINSKY_COEFFICIENT')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/U'//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/RESI'//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/STRAIN_RATE'//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/ROTATION_RATE'//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/EDDY_VISCOSITY'//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/VORTICAL_STRUCTURE'//'/*.plt')
CALL SYSTEM('rm -rf ./'//TRIM(dir_name)//'/SMARGORINSKY_COEFFICIENT'//'/*.plt')
!------------------------------------------------------------------!
! Statistic type !
! !
! (a) All Statistic : 0 !
! - U, STRAIN_RATE, ROTATION_RATE, RESIDUAL_STRESS !
! - EDDY_VISCOSITY, SMARGORINSKY_COEFFICIENT !
! - VORTICAL_STRUCTURE !
! (b) Excpet Vortical Structure : 1 !
! (c) Only Vortical Structure : 2 !
! !
!------------------------------------------------------------------!
VS_ONLY = 2
!------------------------------------------------------------------!
! Vortical Structure methods !
! !
! (a) Q-criteria : 1 !
! (b) Lambda_2 criteria : 2 !
! (c) Lambda_ci criteria : 3 !
! !
!------------------------------------------------------------------!
VS_CASE = 2
!------------------------------------------------------------------!
! The number of Filter !
! !
! (a) No-Filter : 0 !
! (b) First Filter : 1 !
! (c) Second Filter : 2 !
! !
!------------------------------------------------------------------!
FILTER_OX = 0
!------------------------------------------------------------------!
! Y sorting order !
! !
! (a) Ascending Order : 0 !
! (b) Descending Order : 1 !
! !
!------------------------------------------------------------------!
Y_ORDER = 0
!------------------------------------------------------------------!
! Statistic Slice Point !
! !
! N : Total Number of Slice Point !
! YP : Slice Point Position of Y+ !
! !
!------------------------------------------------------------------!
N = 3
ALLOCATE( YP(1:N) )
YP = [5,30,200]
!------------------------------------------------------------------!
! Constants for LES filtering !
!------------------------------------------------------------------!
Nx = 128
Ny = 191
Nz = 159
FW = 4 ! Filter width constant
tol = 1e-8 ! Tolerance for the number of nodes in x,z directions
!------------------------------------------------------------------!
! Allocate variables !
!------------------------------------------------------------------!
ALLOCATE( X(1:Nx),Y(1:Ny),Z(1:Nz),dy(1:Ny-1) )
ALLOCATE( U(1:Nx,1:Ny,1:Nz), V(1:Nx,1:Ny,1:Nz), W(1:Nx,1:Ny,1:Nz) )
ALLOCATE( U_Fil(1:Nx,1:Ny,1:Nz), V_Fil(1:Nx,1:Ny,1:Nz), &
W_Fil(1:Nx,1:Ny,1:Nz), VS(1:Nx,1:Ny,1:Nz), &
U_Fil_2(1:Nx,1:Ny,1:Nz), V_Fil_2(1:Nx,1:Ny,1:Nz), &
W_Fil_2(1:Nx,1:Ny,1:Nz), Cs(1:Nx,1:Ny,1:Nz) )
ALLOCATE(Resi_T(1:Nx,1:Ny,1:Nz,1:3,1:3),NU_R(1:Nx,1:Ny,1:Nz,1:3,1:3))
ALLOCATE(S_T(1:Nx,1:Ny,1:Nz,1:3,1:3),S_T_Fil(1:Nx,1:Ny,1:Nz,1:3,1:3))
ALLOCATE(O_T(1:Nx,1:Ny,1:Nz,1:3,1:3),O_T_Fil(1:Nx,1:Ny,1:Nz,1:3,1:3))
ALLOCATE(S_T_Fil_2(1:Nx,1:Ny,1:Nz,1:3,1:3))
ALLOCATE(M_T(1:Nx,1:Ny,1:Nz,1:3,1:3),L_T(1:Nx,1:Ny,1:Nz,1:3,1:3))
!------------------------------------------------------------------!
! Initial Conditions !
!------------------------------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