-
Notifications
You must be signed in to change notification settings - Fork 11
/
MODULE_STIFFNESSGAS.f90
61 lines (54 loc) · 2.59 KB
/
MODULE_STIFFNESSGAS.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
!=================================================================================================
!> CARTESIAN ADAPTIVE FIVE EQUATION MODEL
!> AUTHOR: VAN-DAT THANG
!> E-MAIL: [email protected]
!> E-MAIL: [email protected]
!> SOURCE CODE LINK: https://github.com/dattv/2D_CARFIVE
!=================================================================================================
MODULE MODULE_STIFFNESSGAS
use MODULE_PRECISION
use MODULE_CONSTANTS
contains
!==================================================================================================
function compute_gamma_mixture(a1, a2, gamma1, gamma2) result(res)
implicit none
real(rp), intent(in) :: a1, a2, gamma1, gamma2
real(rp) :: res
res = one/(a1/(gamma1 - one) + a2/(gamma2 - one)) + one
return
end function compute_gamma_mixture
!==================================================================================================
function compute_pi_mixture(a1, a2, pi1, pi2, gamma1, gamma2) result(res)
implicit none
real(rp), intent(in) :: a1, a2, pi1, pi2, gamma1, gamma2
real(rp) :: res, gamma_mix
gamma_mix = compute_gamma_mixture(a1, a2, gamma1, gamma2)
res = (a1*pi1*gamma1/(gamma1 - one) + a2*pi2*gamma2/(gamma2 - one))*(gamma_mix - one)/gamma_mix
return
end function compute_pi_mixture
!==================================================================================================
function compute_rhoE(P, gamma_mix, pi_mix) result(res)
implicit none
real(rp), intent(in) :: P, gamma_mix, pi_mix
real(rp) :: res
res = (P + gamma_mix*pi_mix)/(gamma_mix - one)
return
end function compute_rhoE
!==================================================================================================
function compute_P(gamma_mix, rho_e, pi_mix) result(res)
implicit none
real(rp), intent(in) :: gamma_mix, rho_e, pi_mix
real(rp) :: res
res = (gamma_mix - one)*rho_e - gamma_mix*pi_mix
return
end function compute_P
!==================================================================================================
function compute_c_mixture(gamma_mix, rho, p, pi_mix) result(res)
implicit none
real(rp), intent(in) :: gamma_mix, rho, p, pi_mix
real(rp) :: res
res = sqrt(gamma_mix*(p + pi_mix)/rho)
return
end function compute_c_mixture
!==================================================================================================
END MODULE MODULE_STIFFNESSGAS