-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main_Sem.f90
65 lines (56 loc) · 2.31 KB
/
Main_Sem.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
!==============================================================================!
program Synthetic_Eddy
!------------------------------------------------------------------------------!
! To make inflow generation by using sem (synthetic eddy method) !
!
! References: https://goo.gl/eEgVpV, https://goo.gl/4B24AC
!------------------------------------------------------------------------------!
!----------------------------------[Modules]-----------------------------------!
use Eddy_Mod
use Prof_Mod
use Mesh_Mod
use Flow_Mod
!------------------------------------------------------------------------------!
implicit none
!----------------------------------[Calling]-----------------------------------!
include 'Save_Vtk.int'
!-----------------------------------[Locals]-----------------------------------!
type(Eddy_Type) :: eddy
type(Prof_Type) :: prof
type(Mesh_Type) :: mesh
type(Flow_Type) :: flow
integer :: ts
!------------------------------[Local parameters]------------------------------!
integer, parameter :: N_DT = 12000
real, parameter :: DT = 5.0e-3
!==============================================================================!
!------------------!
! Constructors !
!------------------!
call Mesh_Mod_Create_Cartesian(mesh, 97, 257) ! node numbers
! call Mesh_Mod_Create_From_File(mesh, "circle.vtk") ! mesh
call Flow_Mod_Create(flow, mesh) ! flow
call Prof_Mod_Create(prof, 'input_line_tmp.dat') ! profile
call Eddy_Mod_Create(eddy, mesh, 1024, 0.2) ! eddies
! Copy DNS profiles to numerical mesh, and plot what you obtained
call Flow_Mod_Fetch_Profile(flow, prof)
call Save_Vtk(flow, 'dns-from-file', dns=.true.)
!---------------!
! Time loop !
!---------------!
do ts = 1, N_DT
write(*,'(a,i5,a,i5)') ' # Time step ', ts, ' from ', n_dt
call Generate_Fluctuations(flow, eddy)
call Scale_Fluctuations (flow)
call Convect_Eddy (flow, eddy, DT)
call Statistics (flow, ts)
! For making movies
if(mod(ts,10) .eq. 0) then
call Save_Vtk(flow, 'com-and-raw', ts=ts, com=.true., raw=.true.)
end if
! To see statistics
if(mod(ts,1000) .eq. 0) then
call Save_Vtk(flow, 'avg-and-dns', ts=ts, avg=.true., dns=.true.)
end if
end do
end program