-
Notifications
You must be signed in to change notification settings - Fork 0
/
getmat.f90
76 lines (62 loc) · 2.59 KB
/
getmat.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
74
75
!-----------------------------------------------------------------------------
subroutine getmat(t, rmu, rlm, con, &
dmu, d2mu, dlm, d2lm, dcon, d2con)
!.... Calculate the Navier-Stokes material properties
use stuff
implicit none
real t(:), rmu(:), rlm(:), con(:), dmu(:), d2mu(:)
real dlm(:), d2lm(:), dcon(:), d2con(:)
if (mattyp .eq. 0) then ! constant visc
rmu = datmat(1)
dmu = 0.0
d2mu = 0.0
dlm = 0.0
d2lm = 0.0
else ! Sutherland's law
rmu = datmat(1) * (t)/datmat(2) * sqrt((t)/datmat(2)) * &
(datmat(2) + datmat(3)) / (t + datmat(3))
dmu = (datmat(1) * (3.0*datmat(3)+t)*(datmat(3)+datmat(2)) * &
sqrt(t/datmat(2)))/(2.0 * (datmat(3)+t)**2 * datmat(2))
d2mu = (datmat(1) * (3.0*datmat(3)**2 - 6.0*datmat(3)*t - t**2) * &
(datmat(3)+datmat(2)))/(4.0*(datmat(3)+t)**3 * &
sqrt(t/datmat(2)) * datmat(2)**2)
end if
con = rmu * cp / Pr
dcon = dmu * cp / Pr
d2con = d2mu * cp / Pr
rlm = -pt66 * rmu
dlm = -pt66 * dmu
d2lm = -pt66 * d2mu
return
end
!-----------------------------------------------------------------------------
subroutine sgetmat(t, rmu, rlm, con, &
dmu, d2mu, dlm, d2lm)
!.... Calculate the Navier-Stokes material properties
use stuff
implicit none
real t, rmu, rlm, con, dmu, d2mu
real dlm, d2lm, dcon, d2con
if (mattyp .eq. 0) then ! constant visc
rmu = datmat(1)
dmu = 0.0
d2mu = 0.0
dlm = 0.0
d2lm = 0.0
else ! Sutherland's law
rmu = datmat(1) * (t)/datmat(2) * sqrt((t)/datmat(2)) * &
(datmat(2) + datmat(3)) / (t + datmat(3))
dmu = (datmat(1) * (3.0*datmat(3)+t)*(datmat(3)+datmat(2)) * &
sqrt(t/datmat(2)))/(2.0 * (datmat(3)+t)**2 * datmat(2))
d2mu = (datmat(1) * (3.0*datmat(3)**2 - 6.0*datmat(3)*t - t**2) * &
(datmat(3)+datmat(2)))/(4.0*(datmat(3)+t)**3 * &
sqrt(t/datmat(2)) * datmat(2)**2)
end if
con = rmu * cp / Pr
dcon = dmu * cp / Pr
d2con = d2mu * cp / Pr
rlm = -pt66 * rmu
dlm = -pt66 * dmu
d2lm = -pt66 * d2mu
return
end