-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmod_flux_kfvs.f90
61 lines (37 loc) · 1015 Bytes
/
mod_flux_kfvs.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
module mod_flux_kfvs
contains
function fluxp(rho,ux,uy,e,p,t,a,b,nx,ny)
implicit none
real(8), intent(in) :: rho,ux,uy,e,p,t,a,b,nx,ny
real(8), dimension(1:4) :: fluxp
real(8) :: un,ut,f1,f2,f3,f4
un=nx*ux+ny*uy
ut=-ny*ux+nx*uy
if (un>=b) then
f1=rho*un
f2=rho*un**2+p
f3=ut*f1
f4=(e+p)*un
elseif (un<=-b) then
f1=0.0d0
f2=0.0d0
f3=0.0d0
f4=0.0d0
else
f1=2.0d0*a*b**2*(un+b)**2
f2=4.0d0/3.0d0*a*b**2*(un+b)**3
f3=ut*f1
f4=a*b**2/2.0d0*(un+b)**2*(un**2+2.0d0*un*b+2*ut**2+7.0d0/3.0d0*b**2)
end if
fluxp(1)=f1
fluxp(2)=nx*f2-ny*f3
fluxp(3)=ny*f2+nx*f3
fluxp(4)=f4
end function fluxp
function fluxm(rho,ux,uy,e,p,t,a,b,nx,ny)
implicit none
real(8), intent(in) :: rho,ux,uy,e,p,t,a,b,nx,ny
real(8), dimension(1:4) :: fluxm
fluxm=-fluxp(rho,ux,uy,e,p,t,a,b,-nx,-ny)
end function fluxm
end module mod_flux_kfvs