65 c_dyn, test_filter, mij, lij, num, den)
66 real(kind=
rp),
intent(in) :: t
67 integer,
intent(in) :: tstep
68 type(
coef_t),
intent(in) :: coef
69 type(
field_t),
intent(inout) :: nut
70 type(
field_t),
intent(in) :: delta
71 type(
field_t),
intent(inout) :: c_dyn
73 type(
field_t),
intent(inout) :: mij(6), lij(6)
74 type(
field_t),
intent(inout) :: num, den
76 type(
field_t),
pointer :: u, v, w
79 type(
field_t),
pointer :: s11, s22, s33, s12, s13, s23, s_abs
80 real(kind=
rp) :: alpha
81 integer :: temp_indices(7)
84 if (tstep .eq. 1)
then
103 call strain_rate(s11%x, s22%x, s33%x, s12%x, s13%x, s23%x, u, v, w, coef)
105 call coef%gs_h%op(s11%x, s11%dof%size(),
gs_op_add)
106 call coef%gs_h%op(s22%x, s11%dof%size(),
gs_op_add)
107 call coef%gs_h%op(s33%x, s11%dof%size(),
gs_op_add)
108 call coef%gs_h%op(s12%x, s11%dof%size(),
gs_op_add)
109 call coef%gs_h%op(s13%x, s11%dof%size(),
gs_op_add)
110 call coef%gs_h%op(s23%x, s11%dof%size(),
gs_op_add)
112 do concurrent(i = 1:s11%dof%size())
113 s11%x(i,1,1,1) = s11%x(i,1,1,1) * coef%mult(i,1,1,1)
114 s22%x(i,1,1,1) = s22%x(i,1,1,1) * coef%mult(i,1,1,1)
115 s33%x(i,1,1,1) = s33%x(i,1,1,1) * coef%mult(i,1,1,1)
116 s12%x(i,1,1,1) = s12%x(i,1,1,1) * coef%mult(i,1,1,1)
117 s13%x(i,1,1,1) = s13%x(i,1,1,1) * coef%mult(i,1,1,1)
118 s23%x(i,1,1,1) = s23%x(i,1,1,1) * coef%mult(i,1,1,1)
121 do concurrent(i = 1:u%dof%size())
122 s_abs%x(i,1,1,1) = sqrt(2.0_rp * (s11%x(i,1,1,1)*s11%x(i,1,1,1) + &
123 s22%x(i,1,1,1)*s22%x(i,1,1,1) + &
124 s33%x(i,1,1,1)*s33%x(i,1,1,1)) + &
125 4.0_rp * (s12%x(i,1,1,1)*s12%x(i,1,1,1) + &
126 s13%x(i,1,1,1)*s13%x(i,1,1,1) + &
127 s23%x(i,1,1,1)*s23%x(i,1,1,1)))
130 call compute_lij_cpu(lij, u, v, w, test_filter, u%dof%size(), u%msh%nelv)
132 s_abs, test_filter, delta, u%dof%size(), u%msh%nelv)
135 do concurrent(i =1:u%dof%size())
136 if (den%x(i,1,1,1) .gt. 0.0_rp)
then
137 c_dyn%x(i,1,1,1) = 0.5_rp * (num%x(i,1,1,1)/den%x(i,1,1,1))
139 c_dyn%x(i,1,1,1) = 0.0_rp
141 c_dyn%x(i,1,1,1) =
max(c_dyn%x(i,1,1,1),0.0_rp)
142 nut%x(i,1,1,1) = c_dyn%x(i,1,1,1) * delta%x(i,1,1,1)**2 * s_abs%x(i,1,1,1)
157 type(
field_t),
intent(inout) :: lij(6)
158 type(
field_t),
pointer,
intent(in) :: u, v, w
160 integer,
intent(in) :: n
161 integer,
intent(inout) :: nelv
164 real(kind=
rp),
dimension(u%dof%size()) :: fu, fv, fw
167 call test_filter%filter_3d(fu, u%x, nelv)
168 call test_filter%filter_3d(fv, v%x, nelv)
169 call test_filter%filter_3d(fw, w%x, nelv)
172 do concurrent(i = 1:n)
173 lij(1)%x(i,1,1,1) = fu(i) * fu(i)
174 lij(2)%x(i,1,1,1) = fv(i) * fv(i)
175 lij(3)%x(i,1,1,1) = fw(i) * fw(i)
176 lij(4)%x(i,1,1,1) = fu(i) * fv(i)
177 lij(5)%x(i,1,1,1) = fu(i) * fw(i)
178 lij(6)%x(i,1,1,1) = fv(i) * fw(i)
184 call col3(fu, u%x, u%x, n)
185 call test_filter%filter_3d(fv, fu, nelv)
186 call sub2(lij(1)%x, fv, n)
188 call col3(fu, v%x, v%x, n)
189 call test_filter%filter_3d(fv, fu, nelv)
190 call sub2(lij(2)%x, fv, n)
192 call col3(fu, w%x, w%x, n)
193 call test_filter%filter_3d(fv, fu, nelv)
194 call sub2(lij(3)%x, fv, n)
196 call col3(fu, u%x, v%x, n)
197 call test_filter%filter_3d(fv, fu, nelv)
198 call sub2(lij(4)%x, fv, n)
200 call col3(fu, u%x, w%x, n)
201 call test_filter%filter_3d(fv, fu, nelv)
202 call sub2(lij(5)%x, fv, n)
204 call col3(fu, v%x, w%x, n)
205 call test_filter%filter_3d(fv, fu, nelv)
206 call sub2(lij(6)%x, fv, n)
219 s_abs, test_filter, delta, n, nelv)
220 type(
field_t),
intent(inout) :: mij(6)
221 type(
field_t),
intent(inout) :: s11, s22, s33, s12, s13, s23, s_abs
223 type(
field_t),
intent(in) :: delta
224 integer,
intent(in) :: n
225 integer,
intent(inout) :: nelv
227 real(kind=
rp),
dimension(n) :: fs11, fs22, fs33, fs12, fs13, fs23, fs_abs
228 real(kind=
rp) :: delta_ratio2
230 real(kind=
rp) :: delta2
232 delta_ratio2 = ((test_filter%nx-1.0_rp)/(test_filter%nt-1.0_rp))**2
237 call test_filter%filter_3d(fs_abs, s_abs%x, nelv)
239 call test_filter%filter_3d(fs11, s11%x, nelv)
240 call col3(mij(1)%x, fs_abs, fs11, n)
241 call cmult(mij(1)%x, delta_ratio2, n)
243 call test_filter%filter_3d(fs22, s22%x, nelv)
244 call col3(mij(2)%x, fs_abs, fs22, n)
245 call cmult(mij(2)%x, delta_ratio2, n)
247 call test_filter%filter_3d(fs33, s33%x, nelv)
248 call col3(mij(3)%x, fs_abs, fs33, n)
249 call cmult(mij(3)%x, delta_ratio2, n)
251 call test_filter%filter_3d(fs12, s12%x, nelv)
252 call col3(mij(4)%x, fs_abs, fs12, n)
253 call cmult(mij(4)%x, delta_ratio2, n)
255 call test_filter%filter_3d(fs13, s13%x, nelv)
256 call col3(mij(5)%x, fs_abs, fs13, n)
257 call cmult(mij(5)%x, delta_ratio2, n)
259 call test_filter%filter_3d(fs23, s23%x, nelv)
260 call col3(mij(6)%x, fs_abs, fs23, n)
261 call cmult(mij(6)%x, delta_ratio2, n)
267 call col3(fs11, s_abs%x, s11%x, n)
268 call test_filter%filter_3d(fs22, fs11, nelv)
269 call sub2(mij(1)%x, fs22, n)
271 call col3(fs11, s_abs%x, s22%x, n)
272 call test_filter%filter_3d(fs22, fs11, nelv)
273 call sub2(mij(2)%x, fs22, n)
275 call col3(fs11, s_abs%x, s33%x, n)
276 call test_filter%filter_3d(fs22, fs11, nelv)
277 call sub2(mij(3)%x, fs22, n)
279 call col3(fs11, s_abs%x, s12%x, n)
280 call test_filter%filter_3d(fs22, fs11, nelv)
281 call sub2(mij(4)%x, fs22, n)
283 call col3(fs11, s_abs%x, s13%x, n)
284 call test_filter%filter_3d(fs22, fs11, nelv)
285 call sub2(mij(5)%x, fs22, n)
287 call col3(fs11, s_abs%x, s23%x, n)
288 call test_filter%filter_3d(fs22, fs11, nelv)
289 call sub2(mij(6)%x, fs22, n)
292 do concurrent(i = 1:n)
293 delta2 = delta%x(i,1,1,1)**2
294 mij(1)%x(i,1,1,1) = mij(1)%x(i,1,1,1) * delta2
295 mij(2)%x(i,1,1,1) = mij(2)%x(i,1,1,1) * delta2
296 mij(3)%x(i,1,1,1) = mij(3)%x(i,1,1,1) * delta2
297 mij(4)%x(i,1,1,1) = mij(4)%x(i,1,1,1) * delta2
298 mij(5)%x(i,1,1,1) = mij(5)%x(i,1,1,1) * delta2
299 mij(6)%x(i,1,1,1) = mij(6)%x(i,1,1,1) * delta2
311 type(
field_t),
intent(inout) :: num, den
312 type(
field_t),
intent(in) :: lij(6), mij(6)
313 real(kind=
rp),
intent(in) :: alpha
314 integer,
intent(in) :: n
316 real(kind=
rp),
dimension(n) :: num_curr, den_curr
319 do concurrent(i = 1:n)
320 num_curr(i) = mij(1)%x(i,1,1,1)*lij(1)%x(i,1,1,1) + &
321 mij(2)%x(i,1,1,1)*lij(2)%x(i,1,1,1) + &
322 mij(3)%x(i,1,1,1)*lij(3)%x(i,1,1,1) + &
323 2.0_rp*(mij(4)%x(i,1,1,1)*lij(4)%x(i,1,1,1) + &
324 mij(5)%x(i,1,1,1)*lij(5)%x(i,1,1,1) + &
325 mij(6)%x(i,1,1,1)*lij(6)%x(i,1,1,1))
326 den_curr(i) = mij(1)%x(i,1,1,1)*mij(1)%x(i,1,1,1) + &
327 mij(2)%x(i,1,1,1)*mij(2)%x(i,1,1,1) + &
328 mij(3)%x(i,1,1,1)*mij(3)%x(i,1,1,1) + &
329 2.0_rp*(mij(4)%x(i,1,1,1)*mij(4)%x(i,1,1,1) + &
330 mij(5)%x(i,1,1,1)*mij(5)%x(i,1,1,1) + &
331 mij(6)%x(i,1,1,1)*mij(6)%x(i,1,1,1))
335 do concurrent(i = 1:n)
336 num%x(i,1,1,1) = alpha * num%x(i,1,1,1) + (1.0_rp - alpha) * num_curr(i)
337 den%x(i,1,1,1) = alpha * den%x(i,1,1,1) + (1.0_rp - alpha) * den_curr(i)