131 integer :: n_stats = 40
156 type(
coef_t),
target,
optional :: coef
157 type(
mean_field_t),
target,
intent(inout) :: u_mf, v_mf, w_mf, p_mf
160 this%u_mean => u_mf%mf
161 this%v_mean => v_mf%mf
162 this%w_mean => w_mf%mf
163 this%p_mean => p_mf%mf
169 call this%stats_work%init(this%u%dof,
'stats')
170 call this%stats_u%init(this%u%dof,
'u temp')
171 call this%stats_v%init(this%u%dof,
'v temp')
172 call this%stats_w%init(this%u%dof,
'w temp')
173 call this%stats_p%init(this%u%dof,
'p temp')
175 call this%dudx%init(this%u%dof,
'dudx')
176 call this%dudy%init(this%u%dof,
'dudy')
177 call this%dudz%init(this%u%dof,
'dudz')
178 call this%dvdx%init(this%u%dof,
'dvdx')
179 call this%dvdy%init(this%u%dof,
'dvdy')
180 call this%dvdz%init(this%u%dof,
'dvdz')
181 call this%dwdx%init(this%u%dof,
'dwdx')
182 call this%dwdy%init(this%u%dof,
'dwdy')
183 call this%dwdz%init(this%u%dof,
'dwdz')
185 call this%uu%init(this%stats_u,
'uu')
186 call this%vv%init(this%stats_v,
'vv')
187 call this%ww%init(this%stats_w,
'ww')
188 call this%uv%init(this%stats_work,
'uv')
189 call this%uw%init(this%stats_work,
'uw')
190 call this%vw%init(this%stats_work,
'vw')
191 call this%uuu%init(this%stats_work,
'uuu')
192 call this%vvv%init(this%stats_work,
'vvv')
193 call this%www%init(this%stats_work,
'www')
194 call this%uuv%init(this%stats_work,
'uuv')
195 call this%uuw%init(this%stats_work,
'uuw')
196 call this%uvv%init(this%stats_work,
'uvv')
197 call this%uvw%init(this%stats_work,
'uvw')
198 call this%vvw%init(this%stats_work,
'vvw')
199 call this%uww%init(this%stats_work,
'uww')
200 call this%vww%init(this%stats_work,
'vww')
201 call this%uuuu%init(this%stats_work,
'uuuu')
202 call this%vvvv%init(this%stats_work,
'vvvv')
203 call this%wwww%init(this%stats_work,
'wwww')
205 call this%pp%init(this%stats_p,
'pp')
206 call this%ppp%init(this%stats_work,
'ppp')
207 call this%pppp%init(this%stats_work,
'pppp')
209 call this%pu%init(this%stats_work,
'pu')
210 call this%pv%init(this%stats_work,
'pv')
211 call this%pw%init(this%stats_work,
'pw')
213 call this%pdudx%init(this%stats_work,
'pdudx')
214 call this%pdudy%init(this%stats_work,
'pdudy')
215 call this%pdudz%init(this%stats_work,
'pdudz')
216 call this%pdvdx%init(this%stats_work,
'pdvdx')
217 call this%pdvdy%init(this%stats_work,
'pdvdy')
218 call this%pdvdz%init(this%stats_work,
'pdvdz')
219 call this%pdwdx%init(this%stats_work,
'pdwdx')
220 call this%pdwdy%init(this%stats_work,
'pdwdy')
221 call this%pdwdz%init(this%stats_work,
'pdwdz')
223 call this%e11%init(this%stats_work,
'e11')
224 call this%e22%init(this%stats_work,
'e22')
225 call this%e33%init(this%stats_work,
'e33')
226 call this%e12%init(this%stats_work,
'e12')
227 call this%e13%init(this%stats_work,
'e13')
228 call this%e23%init(this%stats_work,
'e23')
230 allocate(this%stat_fields%fields(this%n_stats))
232 this%stat_fields%fields(1)%f => this%pp%mf
233 this%stat_fields%fields(2)%f => this%uu%mf
234 this%stat_fields%fields(3)%f => this%vv%mf
235 this%stat_fields%fields(4)%f => this%ww%mf
236 this%stat_fields%fields(5)%f => this%uv%mf
237 this%stat_fields%fields(6)%f => this%uw%mf
238 this%stat_fields%fields(7)%f => this%vw%mf
239 this%stat_fields%fields(8)%f => this%uuu%mf
240 this%stat_fields%fields(9)%f => this%vvv%mf
241 this%stat_fields%fields(10)%f => this%www%mf
242 this%stat_fields%fields(11)%f => this%uuv%mf
243 this%stat_fields%fields(12)%f => this%uuw%mf
244 this%stat_fields%fields(13)%f => this%uvv%mf
245 this%stat_fields%fields(14)%f => this%uvw%mf
246 this%stat_fields%fields(15)%f => this%vvw%mf
247 this%stat_fields%fields(16)%f => this%uww%mf
248 this%stat_fields%fields(17)%f => this%vww%mf
249 this%stat_fields%fields(18)%f => this%uuuu%mf
250 this%stat_fields%fields(19)%f => this%vvvv%mf
251 this%stat_fields%fields(20)%f => this%wwww%mf
252 this%stat_fields%fields(21)%f => this%ppp%mf
253 this%stat_fields%fields(22)%f => this%pppp%mf
254 this%stat_fields%fields(23)%f => this%pu%mf
255 this%stat_fields%fields(24)%f => this%pv%mf
256 this%stat_fields%fields(25)%f => this%pw%mf
258 this%stat_fields%fields(26)%f => this%pdudx%mf
259 this%stat_fields%fields(27)%f => this%pdudy%mf
260 this%stat_fields%fields(28)%f => this%pdudz%mf
261 this%stat_fields%fields(29)%f => this%pdvdx%mf
262 this%stat_fields%fields(30)%f => this%pdvdy%mf
263 this%stat_fields%fields(31)%f => this%pdvdz%mf
264 this%stat_fields%fields(32)%f => this%pdwdx%mf
265 this%stat_fields%fields(33)%f => this%pdwdy%mf
266 this%stat_fields%fields(34)%f => this%pdwdz%mf
267 this%stat_fields%fields(35)%f => this%e11%mf
268 this%stat_fields%fields(36)%f => this%e22%mf
269 this%stat_fields%fields(37)%f => this%e33%mf
270 this%stat_fields%fields(38)%f => this%e12%mf
271 this%stat_fields%fields(39)%f => this%e13%mf
272 this%stat_fields%fields(40)%f => this%e23%mf
280 real(kind=rp),
intent(in) :: k
285 associate(stats_work => this%stats_work, stats_u => this%stats_u,&
286 stats_v => this%stats_v, stats_w => this%stats_w, stats_p => this%stats_p)
287 n = stats_work%dof%size()
292 call device_col3(stats_u%x_d,this%u%x_d, this%u%x_d,n)
293 call device_col3(stats_v%x_d,this%v%x_d, this%v%x_d,n)
294 call device_col3(stats_w%x_d,this%w%x_d, this%w%x_d,n)
295 call device_col3(stats_p%x_d,this%p%x_d, this%p%x_d,n)
297 call this%uu%update(k)
298 call this%vv%update(k)
299 call this%ww%update(k)
300 call this%pp%update(k)
302 call device_col3(stats_work%x_d,this%u%x_d, this%v%x_d,n)
303 call this%uv%update(k)
304 call device_col3(stats_work%x_d,this%u%x_d, this%w%x_d,n)
305 call this%uw%update(k)
306 call device_col3(stats_work%x_d,this%v%x_d, this%w%x_d,n)
307 call this%vw%update(k)
310 call this%uvw%update(k)
311 call device_col3(stats_work%x_d,this%stats_u%x_d, this%u%x_d,n)
312 call this%uuu%update(k)
313 call device_col3(stats_work%x_d,this%stats_v%x_d, this%v%x_d,n)
314 call this%vvv%update(k)
315 call device_col3(stats_work%x_d,this%stats_w%x_d, this%w%x_d,n)
316 call this%www%update(k)
317 call device_col3(stats_work%x_d,this%stats_u%x_d, this%v%x_d,n)
318 call this%uuv%update(k)
319 call device_col3(stats_work%x_d,this%stats_u%x_d, this%w%x_d,n)
320 call this%uuw%update(k)
321 call device_col3(stats_work%x_d,this%stats_v%x_d, this%u%x_d,n)
322 call this%uvv%update(k)
323 call device_col3(stats_work%x_d,this%stats_v%x_d, this%w%x_d,n)
324 call this%vvw%update(k)
325 call device_col3(stats_work%x_d,this%stats_w%x_d, this%u%x_d,n)
326 call this%uww%update(k)
327 call device_col3(stats_work%x_d,this%stats_w%x_d, this%v%x_d,n)
328 call this%vww%update(k)
330 call device_col3(stats_work%x_d,this%stats_u%x_d, this%stats_u%x_d,n)
331 call this%uuuu%update(k)
332 call device_col3(stats_work%x_d,this%stats_v%x_d, this%stats_v%x_d,n)
333 call this%vvvv%update(k)
334 call device_col3(stats_work%x_d,this%stats_w%x_d, this%stats_w%x_d,n)
335 call this%wwww%update(k)
337 call device_col3(stats_work%x_d,this%stats_p%x_d, this%p%x_d,n)
338 call this%ppp%update(k)
339 call device_col3(stats_work%x_d,this%stats_p%x_d, this%stats_p%x_d,n)
340 call this%pppp%update(k)
342 call device_col3(stats_work%x_d,this%p%x_d, this%u%x_d,n)
343 call this%pu%update(k)
344 call device_col3(stats_work%x_d,this%p%x_d, this%v%x_d,n)
345 call this%pv%update(k)
346 call device_col3(stats_work%x_d,this%p%x_d, this%w%x_d,n)
347 call this%pw%update(k)
351 call col3(stats_u%x,this%u%x, this%u%x,n)
352 call col3(stats_v%x,this%v%x, this%v%x,n)
353 call col3(stats_w%x,this%w%x, this%w%x,n)
354 call col3(stats_p%x,this%p%x, this%p%x,n)
356 call this%uu%update(k)
357 call this%vv%update(k)
358 call this%ww%update(k)
359 call this%pp%update(k)
361 call col3(stats_work%x,this%u%x, this%v%x,n)
362 call this%uv%update(k)
363 call col3(stats_work%x,this%u%x, this%w%x,n)
364 call this%uw%update(k)
365 call col3(stats_work%x,this%v%x, this%w%x,n)
366 call this%vw%update(k)
368 call col2(stats_work%x, this%u%x,n)
369 call this%uvw%update(k)
370 call col3(stats_work%x,this%stats_u%x, this%u%x,n)
371 call this%uuu%update(k)
372 call col3(stats_work%x,this%stats_v%x, this%v%x,n)
373 call this%vvv%update(k)
374 call col3(stats_work%x,this%stats_w%x, this%w%x,n)
375 call this%www%update(k)
376 call col3(stats_work%x,this%stats_u%x, this%v%x,n)
377 call this%uuv%update(k)
378 call col3(stats_work%x,this%stats_u%x, this%w%x,n)
379 call this%uuw%update(k)
380 call col3(stats_work%x,this%stats_v%x, this%u%x,n)
381 call this%uvv%update(k)
382 call col3(stats_work%x,this%stats_v%x, this%w%x,n)
383 call this%vvw%update(k)
384 call col3(stats_work%x,this%stats_w%x, this%u%x,n)
385 call this%uww%update(k)
386 call col3(stats_work%x,this%stats_w%x, this%v%x,n)
387 call this%vww%update(k)
389 call col3(stats_work%x,this%stats_u%x, this%stats_u%x,n)
390 call this%uuuu%update(k)
391 call col3(stats_work%x,this%stats_v%x, this%stats_v%x,n)
392 call this%vvvv%update(k)
393 call col3(stats_work%x,this%stats_w%x, this%stats_w%x,n)
394 call this%wwww%update(k)
396 call col3(stats_work%x,this%stats_p%x, this%p%x,n)
397 call this%ppp%update(k)
398 call col3(stats_work%x,this%stats_p%x, this%stats_p%x,n)
399 call this%pppp%update(k)
401 call col3(stats_work%x,this%p%x, this%u%x,n)
402 call this%pu%update(k)
403 call col3(stats_work%x,this%p%x, this%v%x,n)
404 call this%pv%update(k)
405 call col3(stats_work%x,this%p%x, this%w%x,n)
406 call this%pw%update(k)
410 call opgrad(this%dudx%x,this%dudy%x, this%dudz%x,this%u%x,this%coef)
411 call opgrad(this%dvdx%x,this%dvdy%x, this%dvdz%x,this%v%x,this%coef)
412 call opgrad(this%dwdx%x,this%dwdy%x, this%dwdz%x,this%w%x,this%coef)
415 call device_col3(stats_work%x_d,this%dudx%x_d, this%p%x_d,n)
416 call this%pdudx%update(k)
417 call device_col3(stats_work%x_d,this%dudy%x_d, this%p%x_d,n)
418 call this%pdudy%update(k)
419 call device_col3(stats_work%x_d,this%dudz%x_d, this%p%x_d,n)
420 call this%pdudz%update(k)
422 call device_col3(stats_work%x_d,this%dvdx%x_d, this%p%x_d,n)
423 call this%pdvdx%update(k)
424 call device_col3(stats_work%x_d,this%dvdy%x_d, this%p%x_d,n)
425 call this%pdvdy%update(k)
426 call device_col3(stats_work%x_d,this%dvdz%x_d, this%p%x_d,n)
427 call this%pdvdz%update(k)
429 call device_col3(stats_work%x_d,this%dwdx%x_d, this%p%x_d,n)
430 call this%pdwdx%update(k)
431 call device_col3(stats_work%x_d,this%dwdy%x_d, this%p%x_d,n)
432 call this%pdwdy%update(k)
433 call device_col3(stats_work%x_d,this%dwdz%x_d, this%p%x_d,n)
434 call this%pdwdz%update(k)
436 call device_col3(this%stats_work%x_d,this%dudx%x_d, this%dudx%x_d,n)
437 call device_addcol3(this%stats_work%x_d,this%dudy%x_d, this%dudy%x_d,n)
438 call device_addcol3(this%stats_work%x_d,this%dudz%x_d, this%dudz%x_d,n)
439 call this%e11%update(k)
440 call device_col3(this%stats_work%x_d,this%dvdx%x_d, this%dvdx%x_d,n)
441 call device_addcol3(this%stats_work%x_d,this%dvdy%x_d, this%dvdy%x_d,n)
442 call device_addcol3(this%stats_work%x_d,this%dvdz%x_d, this%dvdz%x_d,n)
443 call this%e22%update(k)
444 call device_col3(this%stats_work%x_d,this%dwdx%x_d, this%dwdx%x_d,n)
445 call device_addcol3(this%stats_work%x_d,this%dwdy%x_d, this%dwdy%x_d,n)
446 call device_addcol3(this%stats_work%x_d,this%dwdz%x_d, this%dwdz%x_d,n)
447 call this%e33%update(k)
448 call device_col3(this%stats_work%x_d,this%dudx%x_d, this%dvdx%x_d,n)
449 call device_addcol3(this%stats_work%x_d,this%dudy%x_d, this%dvdy%x_d,n)
450 call device_addcol3(this%stats_work%x_d,this%dudz%x_d, this%dvdz%x_d,n)
451 call this%e12%update(k)
452 call device_col3(this%stats_work%x_d,this%dvdx%x_d, this%dwdx%x_d,n)
453 call device_addcol3(this%stats_work%x_d,this%dvdy%x_d, this%dwdy%x_d,n)
454 call device_addcol3(this%stats_work%x_d,this%dvdz%x_d, this%dwdz%x_d,n)
455 call this%e23%update(k)
459 call col3(stats_work%x,this%dudx%x, this%p%x,n)
460 call this%pdudx%update(k)
461 call col3(stats_work%x,this%dudy%x, this%p%x,n)
462 call this%pdudy%update(k)
463 call col3(stats_work%x,this%dudz%x, this%p%x,n)
464 call this%pdudz%update(k)
466 call col3(stats_work%x,this%dvdx%x, this%p%x,n)
467 call this%pdvdx%update(k)
468 call col3(stats_work%x,this%dvdy%x, this%p%x,n)
469 call this%pdvdy%update(k)
470 call col3(stats_work%x,this%dvdz%x, this%p%x,n)
471 call this%pdvdz%update(k)
473 call col3(stats_work%x,this%dwdx%x, this%p%x,n)
474 call this%pdwdx%update(k)
475 call col3(stats_work%x,this%dwdy%x, this%p%x,n)
476 call this%pdwdy%update(k)
477 call col3(stats_work%x,this%dwdz%x, this%p%x,n)
478 call this%pdwdz%update(k)
480 call col3(this%stats_work%x,this%dudx%x, this%dudx%x,n)
481 call addcol3(this%stats_work%x,this%dudy%x, this%dudy%x,n)
482 call addcol3(this%stats_work%x,this%dudz%x, this%dudz%x,n)
483 call this%e11%update(k)
484 call col3(this%stats_work%x,this%dvdx%x, this%dvdx%x,n)
485 call addcol3(this%stats_work%x,this%dvdy%x, this%dvdy%x,n)
486 call addcol3(this%stats_work%x,this%dvdz%x, this%dvdz%x,n)
487 call this%e22%update(k)
488 call col3(this%stats_work%x,this%dwdx%x, this%dwdx%x,n)
489 call addcol3(this%stats_work%x,this%dwdy%x, this%dwdy%x,n)
490 call addcol3(this%stats_work%x,this%dwdz%x, this%dwdz%x,n)
491 call this%e33%update(k)
492 call col3(this%stats_work%x,this%dudx%x, this%dvdx%x,n)
493 call addcol3(this%stats_work%x,this%dudy%x, this%dvdy%x,n)
494 call addcol3(this%stats_work%x,this%dudz%x, this%dvdz%x,n)
495 call this%e12%update(k)
496 call col3(this%stats_work%x,this%dvdx%x, this%dwdx%x,n)
497 call addcol3(this%stats_work%x,this%dvdy%x, this%dwdy%x,n)
498 call addcol3(this%stats_work%x,this%dvdz%x, this%dwdz%x,n)
499 call this%e23%update(k)
512 call this%stats_work%free()
513 call this%stats_u%free()
514 call this%stats_v%free()
515 call this%stats_w%free()
525 call this%dUdx%free()
526 call this%dUdy%free()
527 call this%dUdz%free()
528 call this%dVdx%free()
529 call this%dVdy%free()
530 call this%dVdz%free()
531 call this%dWdx%free()
532 call this%dWdy%free()
533 call this%dWdz%free()
547 call this%uuu%reset()
548 call this%vvv%reset()
549 call this%www%reset()
550 call this%uuv%reset()
551 call this%uuw%reset()
552 call this%uvv%reset()
553 call this%uvw%reset()
554 call this%vvw%reset()
555 call this%uww%reset()
556 call this%vww%reset()
557 call this%uuuu%reset()
558 call this%vvvv%reset()
559 call this%wwww%reset()
562 call this%ppp%reset()
563 call this%pppp%reset()
569 call this%pdudx%reset()
570 call this%pdudy%reset()
571 call this%pdudz%reset()
572 call this%pdvdx%reset()
573 call this%pdvdy%reset()
574 call this%pdvdz%reset()
575 call this%pdwdx%reset()
576 call this%pdwdy%reset()
577 call this%pdwdz%reset()
579 call this%e11%reset()
580 call this%e22%reset()
581 call this%e33%reset()
582 call this%e12%reset()
583 call this%e13%reset()
584 call this%e23%reset()
591 n =
size(this%coef%B)
592 if (neko_bcknd_device .eq. 1)
then
593 call device_cfill(this%stats_work%x_d, 1.0_rp,n)
594 call device_invcol2(this%stats_work%x_d, this%coef%B_d,n)
595 call device_col2(this%pdudx%mf%x_d, this%stats_work%x_d, n)
596 call device_col2(this%pdudy%mf%x_d, this%stats_work%x_d, n)
597 call device_col2(this%pdudz%mf%x_d, this%stats_work%x_d, n)
598 call device_col2(this%pdvdx%mf%x_d, this%stats_work%x_d, n)
599 call device_col2(this%pdvdy%mf%x_d, this%stats_work%x_d, n)
600 call device_col2(this%pdvdz%mf%x_d, this%stats_work%x_d, n)
601 call device_col2(this%pdwdx%mf%x_d, this%stats_work%x_d, n)
602 call device_col2(this%pdwdy%mf%x_d, this%stats_work%x_d, n)
603 call device_col2(this%pdwdz%mf%x_d, this%stats_work%x_d, n)
605 call device_col2(this%stats_work%x_d, this%stats_work%x_d,n)
606 call device_col2(this%e11%mf%x_d,this%stats_work%x_d, n)
607 call device_col2(this%e22%mf%x_d,this%stats_work%x_d, n)
608 call device_col2(this%e33%mf%x_d,this%stats_work%x_d, n)
609 call device_col2(this%e12%mf%x_d,this%stats_work%x_d, n)
610 call device_col2(this%e13%mf%x_d,this%stats_work%x_d, n)
611 call device_col2(this%e23%mf%x_d,this%stats_work%x_d, n)
615 call invers2(this%stats_work%x, this%coef%B,n)
616 call col2(this%pdudx%mf%x, this%stats_work%x, n)
617 call col2(this%pdudy%mf%x, this%stats_work%x, n)
618 call col2(this%pdudz%mf%x, this%stats_work%x, n)
619 call col2(this%pdvdx%mf%x, this%stats_work%x, n)
620 call col2(this%pdvdy%mf%x, this%stats_work%x, n)
621 call col2(this%pdvdz%mf%x, this%stats_work%x, n)
622 call col2(this%pdwdx%mf%x, this%stats_work%x, n)
623 call col2(this%pdwdy%mf%x, this%stats_work%x, n)
624 call col2(this%pdwdz%mf%x, this%stats_work%x, n)
626 call col2(this%stats_work%x, this%stats_work%x,n)
627 call col2(this%e11%mf%x,this%stats_work%x, n)
628 call col2(this%e22%mf%x,this%stats_work%x, n)
629 call col2(this%e33%mf%x,this%stats_work%x, n)
630 call col2(this%e12%mf%x,this%stats_work%x, n)
631 call col2(this%e13%mf%x,this%stats_work%x, n)
632 call col2(this%e23%mf%x,this%stats_work%x, n)
639 pressure_skewness, skewness_tensor, mean_vel_grad, dissipation_tensor)
641 type(field_list_t),
intent(inout),
optional :: mean
642 type(field_list_t),
intent(inout),
optional :: reynolds
643 type(field_list_t),
intent(inout),
optional :: pressure_skewness
644 type(field_list_t),
intent(inout),
optional :: pressure_flatness
645 type(field_list_t),
intent(inout),
optional :: skewness_tensor
646 type(field_list_t),
intent(inout),
optional :: mean_vel_grad
647 type(field_list_t),
intent(inout),
optional :: dissipation_tensor
650 if (
present(mean))
then
651 n = mean%fields(1)%f%dof%size()
652 call copy(mean%fields(1)%f%x,this%u_mean%x,n)
653 call copy(mean%fields(2)%f%x,this%v_mean%x,n)
654 call copy(mean%fields(3)%f%x,this%w_mean%x,n)
655 call copy(mean%fields(4)%f%x,this%p_mean%x,n)
658 if (
present(reynolds))
then
659 n = reynolds%fields(1)%f%dof%size()
660 call copy(reynolds%fields(1)%f%x,this%pp%mf%x,n)
661 call subcol3(reynolds%fields(1)%f%x,this%p_mean%x,this%p_mean%x,n)
663 call copy(reynolds%fields(2)%f%x,this%uu%mf%x,n)
664 call subcol3(reynolds%fields(2)%f%x,this%u_mean%x,this%u_mean%x,n)
666 call copy(reynolds%fields(3)%f%x,this%vv%mf%x,n)
667 call subcol3(reynolds%fields(3)%f%x,this%v_mean%x,this%v_mean%x,n)
669 call copy(reynolds%fields(4)%f%x,this%ww%mf%x,n)
670 call subcol3(reynolds%fields(4)%f%x,this%w_mean%x,this%w_mean%x,n)
672 call copy(reynolds%fields(5)%f%x,this%uv%mf%x,n)
673 call subcol3(reynolds%fields(5)%f%x,this%u_mean%x,this%v_mean%x,n)
675 call copy(reynolds%fields(6)%f%x,this%uw%mf%x,n)
676 call subcol3(reynolds%fields(6)%f%x,this%u_mean%x,this%w_mean%x,n)
678 call copy(reynolds%fields(7)%f%x,this%vw%mf%x,n)
679 call subcol3(reynolds%fields(7)%f%x,this%v_mean%x,this%w_mean%x,n)
681 if (
present(pressure_skewness))
then
683 call neko_warning(
'Presssure skewness stat not implemented in fluid_stats yet, please help!')
687 if (
present(pressure_flatness))
then
688 call neko_warning(
'Presssure flatness stat not implemented yet, please help!')
692 if (
present(skewness_tensor))
then
693 call neko_warning(
'Skewness tensor stat not implemented yet, please help!')
696 if (
present(mean_vel_grad))
then
698 n = mean_vel_grad%fields(1)%f%dof%size()
699 if (neko_bcknd_device .eq. 1)
then
700 call device_memcpy(this%u_mean%x, this%u_mean%x_d, n, &
701 host_to_device, sync=.false.)
702 call device_memcpy(this%v_mean%x, this%v_mean%x_d, n, &
703 host_to_device, sync=.false.)
704 call device_memcpy(this%w_mean%x, this%w_mean%x_d, n, &
705 host_to_device, sync=.false.)
706 call opgrad(this%dudx%x, this%dudy%x, this%dudz%x, &
707 this%u_mean%x, this%coef)
708 call opgrad(this%dvdx%x, this%dvdy%x, this%dvdz%x, &
709 this%v_mean%x, this%coef)
710 call opgrad(this%dwdx%x, this%dwdy%x, this%dwdz%x, &
711 this%w_mean%x, this%coef)
712 call device_memcpy(this%dudx%x, this%dudx%x_d, n, &
713 device_to_host, sync=.false.)
714 call device_memcpy(this%dvdx%x, this%dvdx%x_d, n, &
715 device_to_host, sync=.false.)
716 call device_memcpy(this%dwdx%x, this%dwdx%x_d, n, &
717 device_to_host, sync=.false.)
718 call device_memcpy(this%dudy%x, this%dudy%x_d, n, &
719 device_to_host, sync=.false.)
720 call device_memcpy(this%dvdy%x, this%dvdy%x_d, n, &
721 device_to_host, sync=.false.)
722 call device_memcpy(this%dwdy%x, this%dwdy%x_d, n, &
723 device_to_host, sync=.false.)
724 call device_memcpy(this%dudz%x, this%dudz%x_d, n, &
725 device_to_host, sync=.false.)
726 call device_memcpy(this%dvdz%x, this%dvdz%x_d, n, &
727 device_to_host, sync=.false.)
728 call device_memcpy(this%dwdz%x, this%dwdz%x_d, n, &
729 device_to_host, sync=.true.)
731 call opgrad(this%dudx%x,this%dudy%x, this%dudz%x,this%u_mean%x,this%coef)
732 call opgrad(this%dvdx%x,this%dvdy%x, this%dvdz%x,this%v_mean%x,this%coef)
733 call opgrad(this%dwdx%x,this%dwdy%x, this%dwdz%x,this%w_mean%x,this%coef)
735 call invers2(this%stats_work%x, this%coef%B,n)
736 call col3(mean_vel_grad%fields(1)%f%x, this%dudx%x,this%stats_work%x, n)
737 call col3(mean_vel_grad%fields(2)%f%x, this%dudy%x,this%stats_work%x, n)
738 call col3(mean_vel_grad%fields(3)%f%x, this%dudz%x,this%stats_work%x, n)
739 call col3(mean_vel_grad%fields(4)%f%x, this%dvdx%x,this%stats_work%x, n)
740 call col3(mean_vel_grad%fields(5)%f%x, this%dvdy%x,this%stats_work%x, n)
741 call col3(mean_vel_grad%fields(6)%f%x, this%dvdz%x,this%stats_work%x, n)
742 call col3(mean_vel_grad%fields(7)%f%x, this%dwdx%x,this%stats_work%x, n)
743 call col3(mean_vel_grad%fields(8)%f%x, this%dwdy%x,this%stats_work%x, n)
744 call col3(mean_vel_grad%fields(9)%f%x, this%dwdz%x,this%stats_work%x, n)
748 if (
present(dissipation_tensor))
then
subroutine, public device_addcol3(a_d, b_d, c_d, n)
subroutine, public device_col2(a_d, b_d, n)
subroutine, public device_col3(a_d, b_d, c_d, n)
Device abstraction, common interface for various accelerators.
Defines a registry for storing solution fields.
Computes various statistics for the fluid fields. We use the Reynolds decomposition for a field u = ...
subroutine fluid_stats_init(this, coef, u_mf, v_mf, w_mf, p_mf)
Initialize the fields associated with fluid_stats.
subroutine fluid_stats_reset(this)
Initialize a mean flow field.
subroutine fluid_stats_make_strong_grad(this)
subroutine fluid_stats_update(this, k)
Updates all fields.
subroutine fluid_stats_free(this)
Deallocates a mean flow field.
subroutine fluid_stats_post_process(this, mean, reynolds, pressure_flatness, pressure_skewness, skewness_tensor, mean_vel_grad, dissipation_tensor)
subroutine, public addcol3(a, b, c, n)
Returns .
subroutine, public col2(a, b, n)
Vector multiplication .
subroutine, public col3(a, b, c, n)
Vector multiplication with 3 vectors .
Collection of vector field operations operating on and . Note that in general the indices and ....
integer, parameter neko_bcknd_device
subroutine, public opgrad(ux, uy, uz, u, coef, es, ee)
Compute the gradient of a scalar field.
Defines a statistical quantity.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
field_list_t, To be able to group fields together
Abstract type defining a statistical quantity.