Skip to content

Commit d92e58c

Browse files
committed
All test cases pass with m_viscous and m_monopole on CPUs
1 parent 4a93def commit d92e58c

File tree

144 files changed

+2034
-2005
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+2034
-2005
lines changed

src/simulation/m_rhs.f90

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ module m_rhs
144144

145145
type(int_bounds_info) :: is1, is2, is3
146146

147+
type(int_bounds_info) :: ixt, iyt, izt
148+
147149
!> @name Bubble dynamic source terms
148150
!> @{
149151
real(kind(0d0)), allocatable, dimension(:, :, :) :: bub_adv_src
@@ -238,6 +240,10 @@ subroutine s_initialize_rhs_module() ! ---------------------------------
238240
!$acc iz%beg:iz%end))
239241
end if
240242

243+
ixt = ix
244+
iyt = iy
245+
izt = iz
246+
241247
allocate (q_cons_qp%vf(1:sys_size))
242248
allocate (q_prim_qp%vf(1:sys_size))
243249
!$acc enter data create(q_cons_qp%vf(1:sys_size),q_prim_qp%vf(1:sys_size))
@@ -838,6 +844,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
838844
call nvtxStartRange("RHS-MPI")
839845
call s_populate_conservative_variables_buffers()
840846
call nvtxEndRange
847+
841848
! ==================================================================
842849

843850
! Converting Conservative to Primitive Variables ==================
@@ -870,7 +877,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
870877
gm_alpha_qp%vf, &
871878
ix, iy, iz)
872879
call nvtxEndRange
873-
880+
874881
if (t_step == t_step_stop) return
875882
! ==================================================================
876883

@@ -887,7 +894,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
887894
dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp, gm_vel_qp, &
888895
ix, iy, iz)
889896
call nvtxEndRange()
890-
897+
891898
! Dimensional Splitting Loop =======================================
892899
do id = 1, num_dims
893900

@@ -899,7 +906,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
899906
ix%end = m - ix%beg; iy%end = n - iy%beg; iz%end = p - iz%beg
900907
! ===============================================================
901908
! Reconstructing Primitive/Conservative Variables ===============
902-
909+
903910
if (all(Re_size == 0)) then
904911
iv%beg = 1; iv%end = sys_size
905912
!call nvtxStartRange("RHS-WENO")
@@ -987,7 +994,6 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
987994
flux_gsrc_n(id)%vf, &
988995
id, ix, iy, iz)
989996
call nvtxEndRange
990-
991997
! iv%beg = 1; iv%end = sys_size
992998

993999
! ===============================================================
@@ -1704,14 +1710,14 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
17041710
dq_prim_dy_qp%vf(mom_idx%beg:mom_idx%end), &
17051711
dq_prim_dz_qp%vf(mom_idx%beg:mom_idx%end), &
17061712
tau_Re_vf, &
1707-
ix, iy, iz)
1713+
ixt, iyt, izt)
17081714
else
17091715
call s_compute_viscous_stress_tensor(q_prim_qp%vf, &
17101716
dq_prim_dx_qp%vf(mom_idx%beg:mom_idx%end), &
17111717
dq_prim_dy_qp%vf(mom_idx%beg:mom_idx%end), &
17121718
dq_prim_dy_qp%vf(mom_idx%beg:mom_idx%end), &
17131719
tau_Re_vf, &
1714-
ix, iy, iz)
1720+
ixt, iyt, izt)
17151721
end if
17161722
!$acc parallel loop collapse(3) gang vector default(present)
17171723
do l = 0, p

src/simulation/m_viscous.f90

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ module m_viscous
2020
real(kind(0d0)), allocatable, dimension(:, :) :: Res
2121
!$acc declare create(Res)
2222

23+
integer :: momxb, momxe
24+
integer :: contxb, contxe
25+
2326
contains
2427

2528
subroutine s_initialize_viscous_module()
@@ -46,6 +49,12 @@ subroutine s_initialize_viscous_module()
4649
!$acc update device(Res, Re_idx, Re_size)
4750
end if
4851

52+
53+
momxb = mom_idx%beg
54+
momxe = mom_idx%end
55+
contxb = cont_idx%beg
56+
contxe = cont_idx%end
57+
4958
end subroutine s_initialize_viscous_module
5059

5160
!> The purpose of this subroutine is to compute the viscous
@@ -64,7 +73,7 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
6473
type(scalar_field), dimension(sys_size), intent(IN) :: q_prim_vf
6574
type(scalar_field), dimension(num_dims), intent(IN) :: grad_x_vf, grad_y_vf, grad_z_vf
6675

67-
type(scalar_field), allocatable, dimension(:) :: tau_Re_vf
76+
type(scalar_field), dimension(1:sys_size) :: tau_Re_vf
6877

6978
real(kind(0d0)) :: rho_visc, gamma_visc, pi_inf_visc, alpha_visc_sum !< Mixture variables
7079
real(kind(0d0)), dimension(2) :: Re_visc
@@ -76,12 +85,27 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
7685

7786
type(int_bounds_info) :: ix, iy, iz
7887

79-
ix%beg = -buff_size; iy%beg = 0; iz%beg = 0
80-
if (n > 0) iy%beg = -buff_size; if (p > 0) iz%beg = -buff_size
81-
ix%end = m - ix%beg; iy%end = n - iy%beg; iz%end = p - iz%beg
88+
!ix%beg = -buff_size; iy%beg = 0; iz%beg = 0
89+
!if (n > 0) iy%beg = -buff_size; if (p > 0) iz%beg = -buff_size
90+
!ix%end = m - ix%beg; iy%end = n - iy%beg; iz%end = p - iz%beg
8291

8392
!$acc update device(ix, iy, iz)
8493

94+
do i = 1, num_dims
95+
allocate (tau_Re_vf(cont_idx%end + i)%sf(ix%beg:ix%end, &
96+
iy%beg:iy%end, &
97+
iz%beg:iz%end))
98+
!$acc enter data create(tau_Re_vf(cont_idx%end + i)%sf(ix%beg:ix%end, &
99+
!$acc iy%beg:iy%end, &
100+
!$acc iz%beg:iz%end))
101+
end do
102+
allocate (tau_Re_vf(E_idx)%sf(ix%beg:ix%end, &
103+
iy%beg:iy%end, &
104+
iz%beg:iz%end))
105+
!$acc enter data create (tau_Re_vf(E_idx)%sf(ix%beg:ix%end, &
106+
!$acc iy%beg:iy%end, &
107+
!$acc iz%beg:iz%end))
108+
85109
!$acc parallel loop collapse(3) gang vector default(present)
86110
do l = iz%beg, iz%end
87111
do k = iy%beg, iy%end
@@ -99,13 +123,13 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
99123
do l = iz%beg, iz%end
100124
do k = -1, 1
101125
do j = ix%beg, ix%end
102-
126+
103127
!$acc loop seq
104128
do i = 1, num_fluids
105129
alpha_rho_visc(i) = q_prim_vf(i)%sf(j, k, l)
106130
alpha_visc(i) = q_prim_vf(E_idx + i)%sf(j, k, l)
107131
end do
108-
132+
109133
if (bubbles) then
110134
rho_visc = 0d0
111135
gamma_visc = 0d0
@@ -173,21 +197,21 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
173197
end do
174198
end if
175199
end if
176-
200+
177201
tau_Re(2, 1) = (grad_y_vf(1)%sf(j, k, l) + &
178202
grad_x_vf(2)%sf(j, k, l))/ &
179203
Re_visc(1)
180-
204+
181205
tau_Re(2, 2) = (4d0*grad_y_vf(2)%sf(j, k, l) &
182206
- 2d0*grad_x_vf(1)%sf(j, k, l) &
183207
- 2d0*q_prim_vf(momxb + 1)%sf(j, k, l)/y_cc(k))/ &
184-
(3d0*Re_visc(1))
208+
(3d0*Re_visc(1))
185209
!$acc loop seq
186210
do i = 1, 2
187211
tau_Re_vf(contxe + i)%sf(j, k, l) = &
188212
tau_Re_vf(contxe + i)%sf(j, k, l) - &
189213
tau_Re(2, i)
190-
214+
191215
tau_Re_vf(E_idx)%sf(j, k, l) = &
192216
tau_Re_vf(E_idx)%sf(j, k, l) - &
193217
q_prim_vf(contxe + i)%sf(j, k, l)*tau_Re(2, i)
@@ -496,7 +520,6 @@ subroutine s_compute_viscous_stress_tensor(q_prim_vf, grad_x_vf, grad_y_vf, grad
496520
end do
497521
end do
498522
end if
499-
500523
end subroutine s_compute_viscous_stress_tensor ! ----------------------------------------
501524

502525
!> Computes the scalar gradient fields via finite differences
@@ -705,11 +728,11 @@ subroutine s_get_viscous(qL_prim_rsx_vf_flat, qL_prim_rsy_vf_flat, qL_prim_rsz_v
705728
qL_prim_rsy_vf_flat, qR_prim_rsy_vf_flat, &
706729
qL_prim_rsz_vf_flat, qR_prim_rsz_vf_flat
707730

708-
type(vector_field), allocatable, dimension(:) :: qL_prim, qR_prim
731+
type(vector_field), dimension(sys_size) :: qL_prim, qR_prim
709732

710733
type(vector_field) :: q_prim_qp
711734

712-
type(vector_field), allocatable, dimension(:), &
735+
type(vector_field), dimension(sys_size), &
713736
intent(INOUT) :: dqL_prim_dx_n, dqR_prim_dx_n, &
714737
dqL_prim_dy_n, dqR_prim_dy_n, &
715738
dqL_prim_dz_n, dqR_prim_dz_n

tests/043B535A/golden.txt

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

tests/07C33719/golden.txt

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)