-
Notifications
You must be signed in to change notification settings - Fork 0
/
Scale_Fluctuations.f90
73 lines (63 loc) · 2.76 KB
/
Scale_Fluctuations.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
!==============================================================================!
subroutine Scale_Fluctuations(flw)
!------------------------------------------------------------------------------!
! Combine slice mean,rms data with generated fluctuation variables !
!------------------------------------------------------------------------------!
!----------------------------------[Modules]-----------------------------------!
use Flow_Mod, only: Flow_Type
use Prof_Mod, only: Prof_Type
use Mesh_Mod, only: Mesh_Type
!------------------------------------------------------------------------------!
implicit none
!---------------------------------[Arguments]----------------------------------!
type(Flow_Type) :: flw
!-----------------------------------[Locals]-----------------------------------!
integer :: c
real :: r_loc(4,4), a(4,4), &
u_ins(4), u_mean(4), &
u_fluc(4), u_tmp(4)
type(Mesh_Type), target :: msh
!==============================================================================!
! Take mesh pointer
msh = flw % pnt_mesh
! Browse through all cells
do c = 1, msh % n_cells
a (:,:) = 0.0
r_loc (:,:) = 0.0
u_ins (:) = 0.0
u_fluc(:) = 0.0
u_mean(:) = 0.0
u_tmp (:) = 0.0
u_mean(1:4) = (/ flw % u_avg % dns(c), &
flw % v_avg % dns(c), &
flw % w_avg % dns(c), &
flw % t_avg % dns(c) /)
u_tmp (1:4) = (/ flw % u % raw(c), &
flw % v % raw(c), &
flw % w % raw(c), &
flw % t % raw(c) /)
r_loc(1,1:4) = (/ flw % uu_avg % dns(c), &
flw % uv_avg % dns(c), &
flw % uw_avg % dns(c), &
flw % ut_avg % dns(c) /)
r_loc(2,1:4) = (/ flw % uv_avg % dns(c), &
flw % vv_avg % dns(c), &
flw % vw_avg % dns(c), &
flw % vt_avg % dns(c) /)
r_loc(3,1:4) = (/ flw % uw_avg % dns(c), &
flw % vw_avg % dns(c), &
flw % ww_avg % dns(c), &
flw % wt_avg % dns(c) /)
r_loc(4,1:4) = (/ flw % ut_avg % dns(c), &
flw % vt_avg % dns(c), &
flw % wt_avg % dns(c), &
flw % tt_avg % dns(c) /)
call Cholesky(a, r_loc, 4)
call Mat_Mul(a, u_tmp, u_fluc, 4, 1, 4)
u_ins(1:4) = u_mean(1:4) + u_fluc(1:4)
flw % u % com(c) = u_ins(1)
flw % v % com(c) = u_ins(2)
flw % w % com(c) = u_ins(3)
flw % t % com(c) = u_ins(4)
end do
end subroutine