@@ -21,8 +21,9 @@ module foreseer_riemann_solver_compressible_hllc
21
21
! < @note This is the implemention for [[conservative_compressible]] Riemann states.
22
22
contains
23
23
! public deferred methods
24
- procedure , pass(self) :: initialize ! < Initialize solver.
25
- procedure , pass(self) :: solve ! < Solve Riemann Problem.
24
+ procedure , pass(self) :: initialize ! < Initialize solver.
25
+ procedure , pass(lhs) :: riem_assign_riem ! < `=` operator.
26
+ procedure , pass(self) :: solve ! < Solve Riemann Problem.
26
27
endtype riemann_solver_compressible_hllc
27
28
28
29
contains
@@ -37,6 +38,14 @@ subroutine initialize(self, config)
37
38
! call self%solver_pvl%initialize(config=config_)
38
39
end subroutine initialize
39
40
41
+ pure subroutine riem_assign_riem (lhs , rhs )
42
+ ! < `=` operator.
43
+ ! <
44
+ ! < @TODO Update this if solver is updated.
45
+ class(riemann_solver_compressible_hllc), intent (inout ) :: lhs ! < Left hand side.
46
+ class(riemann_solver_object), intent (in ) :: rhs ! < Right hand side.
47
+ end subroutine riem_assign_riem
48
+
40
49
subroutine solve (self , eos_left , state_left , eos_right , state_right , normal , fluxes )
41
50
! < Solve Riemann Problem.
42
51
! <
@@ -49,15 +58,15 @@ subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, flu
49
58
type (vector), intent (in ) :: normal ! < Normal (versor) of face where fluxes are given.
50
59
class(conservative_object), intent (inout ) :: fluxes ! < Fluxes of the Riemann Problem solution.
51
60
type (conservative_compressible) :: state23 ! < Intermediate states.
52
- type (conservative_compressible), pointer :: state_left_ ! < Left Riemann state, local variable.
53
- type (conservative_compressible), pointer :: state_right_ ! < Right Riemann state, local variable.
61
+ type (conservative_compressible) :: state_left_ ! < Left Riemann state, local variable.
62
+ type (conservative_compressible) :: state_right_ ! < Right Riemann state, local variable.
54
63
type (riemann_pattern_compressible_pvl) :: pattern ! < Riemann (states) PVL pattern solution.
55
64
real (R8 P) :: u23 ! < Maximum wave speed estimation.
56
65
57
- call pattern% initialize(eos_left= eos_left, state_left= state_left, eos_right= eos_right, state_right= state_right, normal= normal)
66
+ state_left_ = state_left ; call state_left_% normalize(eos= eos_left, normal= normal)
67
+ state_right_ = state_right ; call state_right_% normalize(eos= eos_right, normal= normal)
68
+ call pattern% initialize(eos_left= eos_left, state_left= state_left_, eos_right= eos_right, state_right= state_right_, normal= normal)
58
69
call pattern% compute_waves_extrema
59
- state_left_ = > conservative_compressible_pointer(to = state_left)
60
- state_right_ = > conservative_compressible_pointer(to = state_right)
61
70
associate(r_1= >pattern% r_1, u_1= >pattern% u_1, p_1= >pattern% p_1, g_1= >pattern% eos_1% g(), &
62
71
r_4= >pattern% r_4, u_4= >pattern% u_4, p_4= >pattern% p_4, g_4= >pattern% eos_4% g(), &
63
72
s_1= >pattern% s_1, s_4= >pattern% s_4, &
@@ -66,35 +75,35 @@ subroutine solve(self, eos_left, state_left, eos_right, state_right, normal, flu
66
75
(r_4 * (s_4 - u_4) - r_1 * (s_1 - u_1))
67
76
select case (minloc ([- s_1, s_1 * u23, u23 * s_4, s_4], dim= 1 ))
68
77
case (1 )
69
- call state_left % compute_fluxes(eos= eos_left, normal= normal, fluxes= fluxes)
78
+ call state_left_ % compute_fluxes(eos= eos_left, normal= normal, fluxes= fluxes)
70
79
case (2 )
71
- call state_left % compute_fluxes(eos= eos_left, normal= normal, fluxes= fluxes)
80
+ call state_left_ % compute_fluxes(eos= eos_left, normal= normal, fluxes= fluxes)
72
81
state23% density = r_1 * (s_1 - u_1) / (s_1 - u23)
73
82
state23% momentum = state23% density * u23 * normal
74
83
state23% energy = state23% density * (E_1 + (u23 - u_1) * (u23 + p_1 / (r_1 * (s_1 - u_1))))
75
84
select type (fluxes)
76
85
type is (conservative_compressible)
77
86
#ifdef __GFORTRAN__
78
- fluxes = fluxes + s_1 * (state23 - state_left_)
87
+ fluxes = fluxes + ( s_1 * (state23 - state_left_) )
79
88
#else
80
89
error stop ' error: Intel fortran still does not support abstract math!'
81
90
#endif
82
91
endselect
83
92
case (3 )
84
- call state_right % compute_fluxes(eos= eos_right, normal= normal, fluxes= fluxes)
93
+ call state_right_ % compute_fluxes(eos= eos_right, normal= normal, fluxes= fluxes)
85
94
state23% density = r_4 * (s_4 - u_4) / (s_4 - u23)
86
95
state23% momentum = state23% density * u23 * normal
87
96
state23% energy = state23% density * (E_4 + (u23 - u_4) * (u23 + p_4 / (r_4 * (s_4 - u_4))))
88
97
select type (fluxes)
89
98
type is (conservative_compressible)
90
99
#ifdef __GFORTRAN__
91
- fluxes = fluxes + s_4 * (state23 - state_right_)
100
+ fluxes = fluxes + ( s_4 * (state23 - state_right_) )
92
101
#else
93
102
error stop ' error: Intel fortran still does not support abstract math!'
94
103
#endif
95
104
endselect
96
105
case (4 )
97
- call state_right % compute_fluxes(eos= eos_right, normal= normal, fluxes= fluxes)
106
+ call state_right_ % compute_fluxes(eos= eos_right, normal= normal, fluxes= fluxes)
98
107
endselect
99
108
endassociate
100
109
endsubroutine solve
0 commit comments