@@ -54,7 +54,7 @@ module m_rhs
5454 s_compute_rhs, &
5555 s_pressure_relaxation_procedure, &
5656 s_populate_variables_buffers, &
57- s_finalize_rhs_module
57+ s_finalize_rhs_module, &
5858
5959
6060 type (vector_field) :: q_cons_qp ! <
@@ -913,15 +913,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
913913 if (qbmm) call s_mom_inv(q_prim_qp% vf, mom_sp, mom_3d, ix, iy, iz)
914914
915915 call nvtxStartRange(" Viscous" )
916- if (any (Re_size > 0 )) call s_get_viscous(qL_rsx_vf_flat, qL_rsy_vf_flat, qL_rsz_vf_flat, &
917- dqL_prim_dx_n, dqL_prim_dy_n, dqL_prim_dz_n, &
918- qL_prim, &
919- qR_rsx_vf_flat, qR_rsy_vf_flat, qR_rsz_vf_flat, &
920- dqR_prim_dx_n, dqR_prim_dy_n, dqR_prim_dz_n, &
921- qR_prim, &
922- q_prim_qp, &
923- dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp, gm_vel_qp, &
924- ix, iy, iz)
916+ if (any (Re_size > 0 )) call s_get_viscous()
925917 call nvtxEndRange()
926918
927919 ! Dimensional Splitting Loop =======================================
@@ -937,7 +929,7 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
937929 ! Reconstructing Primitive/Conservative Variables ===============
938930
939931 if (all (Re_size == 0 )) then
940- iv % beg = 1 ; iv% end = sys_size
932+ % beg = 1 ; iv% end = sys_size
941933 ! call nvtxStartRange("RHS-WENO")
942934 call nvtxStartRange(" RHS-WENO" )
943935 call s_reconstruct_cell_boundary_values_alt( &
@@ -2063,14 +2055,12 @@ subroutine s_compute_rhs(q_cons_vf, q_prim_vf, rhs_vf, t_step) ! -------
20632055 dq_prim_dx_qp% vf(mom_idx% beg:mom_idx% end), &
20642056 dq_prim_dy_qp% vf(mom_idx% beg:mom_idx% end), &
20652057 dq_prim_dz_qp% vf(mom_idx% beg:mom_idx% end), &
2066- tau_Re_vf, &
20672058 ix, iy, iz)
20682059 else
20692060 call s_compute_viscous_stress_tensor(q_prim_qp% vf, &
20702061 dq_prim_dx_qp% vf(mom_idx% beg:mom_idx% end), &
20712062 dq_prim_dy_qp% vf(mom_idx% beg:mom_idx% end), &
20722063 dq_prim_dy_qp% vf(mom_idx% beg:mom_idx% end), &
2073- tau_Re_vf, &
20742064 ix, iy, iz)
20752065 end if
20762066! $acc parallel loop collapse(3) gang vector default(present)
@@ -4671,6 +4661,107 @@ subroutine s_reconstruct_cell_boundary_values_alt(v_vf, vL_x_flat, vL_y_flat, vL
46714661 ! ==================================================================
46724662 end subroutine s_reconstruct_cell_boundary_values_alt ! --------------------
46734663
4664+ subroutine s_reconstruct_cell_boundary_values_visc (v_vf , vL_x_flat , vL_y_flat , vL_z_flat , vR_x_flat , vR_y_flat , vR_z_flat , & ! -
4665+ norm_dir , vL_prim_vf , vR_prim_vf )
4666+
4667+ type (scalar_field), dimension (iv% beg:iv% end), intent (IN ) :: v_vf
4668+ type (scalar_field), dimension (iv% beg:iv% end), intent (INOUT ) :: vL_prim_vf, vR_prim_vf
4669+
4670+ real (kind (0d0 )), dimension (startx:, starty:, startz:, 1 :), intent (INOUT ) :: vL_x_flat, vL_y_flat, vL_z_flat, vR_x_flat, vR_y_flat, vR_z_flat
4671+
4672+ integer , intent (IN ) :: norm_dir
4673+
4674+ integer :: weno_dir ! < Coordinate direction of the WENO reconstruction
4675+
4676+ integer :: i, j, k, l
4677+ ! Reconstruction in s1-direction ===================================
4678+
4679+ if (norm_dir == 1 ) then
4680+ is1 = ix; is2 = iy; is3 = iz
4681+ weno_dir = 1 ; is1% beg = is1% beg + weno_polyn
4682+ is1% end = is1% end - weno_polyn
4683+
4684+ elseif (norm_dir == 2 ) then
4685+ is1 = iy; is2 = ix; is3 = iz
4686+ weno_dir = 2 ; is1% beg = is1% beg + weno_polyn
4687+ is1% end = is1% end - weno_polyn
4688+
4689+ else
4690+ is1 = iz; is2 = iy; is3 = ix
4691+ weno_dir = 3 ; is1% beg = is1% beg + weno_polyn
4692+ is1% end = is1% end - weno_polyn
4693+
4694+ end if
4695+
4696+ ! $acc update device(is1, is2, is3, iv)
4697+
4698+ if (n > 0 ) then
4699+ if (p > 0 ) then
4700+
4701+ call s_weno_alt(v_vf(iv% beg:iv% end), &
4702+ vL_x_flat(:, :, :, iv% beg:iv% end), vL_y_flat(:, :, :, iv% beg:iv% end), vL_z_flat(:, :, :, iv% beg:iv% end), vR_x_flat(:, :, :, iv% beg:iv% end), vR_y_flat(:, :, :, iv% beg:iv% end), vR_z_flat(:, :, :, iv% beg:iv% end), &
4703+ norm_dir, weno_dir, &
4704+ is1, is2, is3)
4705+ else
4706+ call s_weno_alt(v_vf(iv% beg:iv% end), &
4707+ vL_x_flat(:, :, :, iv% beg:iv% end), vL_y_flat(:, :, :, iv% beg:iv% end), vL_z_flat(:, :, :, :), vR_x_flat(:, :, :, iv% beg:iv% end), vR_y_flat(:, :, :, iv% beg:iv% end), vR_z_flat(:, :, :, :), &
4708+ norm_dir, weno_dir, &
4709+ is1, is2, is3)
4710+ end if
4711+ else
4712+
4713+ call s_weno_alt(v_vf(iv% beg:iv% end), &
4714+ vL_x_flat(:, :, :, iv% beg:iv% end), vL_y_flat(:, :, :, :), vL_z_flat(:, :, :, :), vR_x_flat(:, :, :, iv% beg:iv% end), vR_y_flat(:, :, :, :), vR_z_flat(:, :, :, :), &
4715+ norm_dir, weno_dir, &
4716+ is1, is2, is3)
4717+ end if
4718+
4719+ if (any (Re_size > 0 )) then
4720+ if (weno_Re_flux) then
4721+ if (norm_dir == 2 ) then
4722+ ! $acc parallel loop collapse(4) gang vector default(present)
4723+ do i = iv% beg, iv% end
4724+ do l = is3% beg, is3% end
4725+ do j = is1% beg, is1% end
4726+ do k = is2% beg, is2% end
4727+ vL_prim_vf(i)% sf(k, j, l) = vL_y_flat(j, k, l, i)
4728+ vR_prim_vf(i)% sf(k, j, l) = vR_y_flat(j, k, l, i)
4729+ end do
4730+ end do
4731+ end do
4732+ end do
4733+ elseif (norm_dir == 3 ) then
4734+ ! $acc parallel loop collapse(4) gang vector default(present)
4735+ do i = iv% beg, iv% end
4736+ do j = is1% beg, is1% end
4737+ do k = is2% beg, is2% end
4738+ do l = is3% beg, is3% end
4739+ vL_prim_vf(i)% sf(l, k, j) = vL_z_flat(j, k, l, i)
4740+ vR_prim_vf(i)% sf(l, k, j) = vR_z_flat(j, k, l, i)
4741+ end do
4742+ end do
4743+ end do
4744+ end do
4745+ elseif (norm_dir == 1 ) then
4746+ ! $acc parallel loop collapse(4) gang vector default(present)
4747+ do i = iv% beg, iv% end
4748+ do l = is3% beg, is3% end
4749+ do k = is2% beg, is2% end
4750+ do j = is1% beg, is1% end
4751+ vL_prim_vf(i)% sf(j, k, l) = vL_x_flat(j, k, l, i)
4752+ vR_prim_vf(i)% sf(j, k, l) = vR_x_flat(j, k, l, i)
4753+ end do
4754+ end do
4755+ end do
4756+ end do
4757+ end if
4758+ end if
4759+ end if
4760+
4761+ ! ==================================================================
4762+
4763+ end subroutine s_reconstruct_cell_boundary_values_visc ! --------------------
4764+
46744765subroutine s_reconstruct_cell_boundary_values_visc_deriv (v_vf , vL_x_flat , vL_y_flat , vL_z_flat , vR_x_flat , vR_y_flat , vR_z_flat , & ! -
46754766 norm_dir , vL_prim_vf , vR_prim_vf )
46764767
0 commit comments