-
Notifications
You must be signed in to change notification settings - Fork 4
/
RANS_setup.f90
73 lines (60 loc) · 2.91 KB
/
RANS_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
!-----------------------------------------------------------------------------------!
!
! PROGRAM : RANS_setup.f90
!
! PURPOSE : Setup the 1D turbulent channel flow for RANS model
!
! 2016.11.17 K.Noh
!
!-----------------------------------------------------------------------------------!
SUBROUTINE SETUP
USE RANS_module, &
ONLY : Ny, del, dy, Re_tau, nu, u_tau, &
Cm, Ce1, Ce2, Sk, Se, alpha, beta, itmax, resi, tol
USE RANS_module, &
ONLY : U, U_exac, U_new, Y, k, k_new, dis, dis_new, nu_T, prod
IMPLICIT NONE
INTEGER :: i,j
!-----------------------------------------------------------!
! Constants for simulation
!-----------------------------------------------------------!
itmax = 10000000 ! maximum interation number
resi = 0 ! criteria for convergence
tol = 1e-12 ! tolerance for convergence
Ny = 360 ! the number of grid cells
del = 1 ! the channel-half height
dy = (2*del)/Ny ! grid size
Re_tau = 180 ! Reynolds number based on friction velocity
nu = 3.5000e-4 ! Kinematic viscosity of reference data
u_tau = Re_tau*nu/del ! Friction velocity
!-----------------------------------------------------------!
! Constants for k-e model
!-----------------------------------------------------------!
Cm = 0.09
Ce1 = 1.44
Ce2 = 1.92
Sk = 1.0
Se = 1.3
!-----------------------------------------------------------!
! Relaxation factors
!-----------------------------------------------------------!
alpha = 0.1
beta = 0.4
ALLOCATE( U(0:NY),U_new(0:Ny),U_exac(0:Ny),Y(0:Ny),prod(0:Ny) )
ALLOCATE( k(0:Ny),k_new(0:Ny),dis(0:Ny),dis_new(0:Ny),nu_T(0:Ny) )
!-----------------------------------------------------------!
! Initial Conditions
!-----------------------------------------------------------!
DO j = 0,Ny
Y(j) = j*dy
U(j) = 0
k(j) = 0.1000
dis(j) = 0.0300
nu_T(j) = 0
prod(j) = 0
k_new(j) = 0
U_new(j) = 0
dis_new(j) = 0
U_exac(j) = -(nu/(2*del))*(Re_tau/del)**2 * Y(j) * (Y(j)-2*del)
END DO
END SUBROUTINE SETUP