Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/common/m_boundary_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
type(scalar_field), dimension(:, :), allocatable :: bc_buffers
!$acc declare create(bc_buffers)

type(boundary_flags) :: bc_flag
type(boundary_bounds) :: bc_bound

#ifdef MFC_MPI
integer, dimension(1:3, -1:1) :: MPI_BC_TYPE_TYPE, MPI_BC_BUFFER_TYPE
Expand All @@ -34,7 +34,7 @@
s_populate_capillary_buffers, &
s_finalize_boundary_common_module

public :: bc_buffers, bc_flag
public :: bc_buffers, bc_bound

#ifdef MFC_MPI
public :: MPI_BC_TYPE_TYPE, MPI_BC_BUFFER_TYPE
Expand All @@ -44,7 +44,7 @@

impure subroutine s_initialize_boundary_common_module()

bc_flag%xb = bc_x%beg; bc_flag%xe = bc_x%end; bc_flag%yb = bc_y%beg; bc_flag%ye = bc_y%end; bc_flag%zb = bc_z%beg; bc_flag%ze = bc_z%end
bc_bound%xb = bc_x%beg; bc_bound%xe = bc_x%end; bc_bound%yb = bc_y%beg; bc_bound%ye = bc_y%end; bc_bound%zb = bc_z%beg; bc_bound%ze = bc_z%end

@:ALLOCATE(bc_buffers(1:num_dims, -1:1))

Expand All @@ -71,17 +71,17 @@
!> The purpose of this procedure is to populate the buffers
!! of the primitive variables, depending on the selected
!! boundary conditions.
impure subroutine s_populate_variables_buffers(q_prim_vf, pb, mv, bc_type, bc_flag)
impure subroutine s_populate_variables_buffers(q_prim_vf, pb, mv, bc_type, bc_bound)

type(scalar_field), dimension(sys_size), intent(inout) :: q_prim_vf
real(wp), dimension(idwbuff(1)%beg:, idwbuff(2)%beg:, idwbuff(3)%beg:, 1:, 1:), intent(inout) :: pb, mv
type(integer_field), dimension(1:num_dims, -1:1), intent(in) :: bc_type
type(boundary_flags), intent(in) :: bc_flag
type(boundary_bounds), intent(in) :: bc_bound

integer :: k, l

! Population of Buffers in x-direction
if (bc_flag%xb >= 0) then
if (bc_bound%xb >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, pb, mv, 1, -1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -105,7 +105,7 @@
end do
end if

if (bc_flag%xe >= 0) then
if (bc_bound%xe >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, pb, mv, 1, 1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand Down Expand Up @@ -133,7 +133,7 @@

if (n == 0) return

if (bc_flag%yb >= 0) then
if (bc_bound%yb >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, pb, mv, 2, -1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -159,7 +159,7 @@
end do
end if

if (bc_flag%ye >= 0) then
if (bc_bound%ye >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, pb, mv, 2, 1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand Down Expand Up @@ -187,7 +187,7 @@

if (p == 0) return

if (bc_flag%zb >= 0) then
if (bc_bound%zb >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, pb, mv, 3, -1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -211,7 +211,7 @@
end do
end if

if (bc_flag%ze >= 0) then
if (bc_bound%ze >= 0) then
call s_mpi_sendrecv_variables_buffers(q_prim_vf, pb, mv, 3, 1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand Down Expand Up @@ -1157,16 +1157,16 @@

end subroutine s_qbmm_extrapolation

impure subroutine s_populate_capillary_buffers(c_divs, bc_type, bc_flag)
impure subroutine s_populate_capillary_buffers(c_divs, bc_type, bc_bound)

type(scalar_field), dimension(num_dims + 1), intent(inout) :: c_divs
type(integer_field), dimension(1:num_dims, -1:1), intent(in) :: bc_type
type(boundary_flags), intent(in) :: bc_flag
type(boundary_bounds), intent(in) :: bc_bound

integer :: k, l

!< x-direction
if (bc_flag%xb >= 0) then
if (bc_bound%xb >= 0) then

Check warning on line 1169 in src/common/m_boundary_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_common.fpp#L1169

Added line #L1169 was not covered by tests
call s_mpi_sendrecv_capilary_variables_buffers(c_divs, 1, -1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -1184,7 +1184,7 @@
end do
end if

if (bc_flag%xe >= 0) then
if (bc_bound%xe >= 0) then

Check warning on line 1187 in src/common/m_boundary_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_common.fpp#L1187

Added line #L1187 was not covered by tests
call s_mpi_sendrecv_capilary_variables_buffers(c_divs, 1, 1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -1205,7 +1205,7 @@
if (n == 0) return

!< y-direction
if (bc_flag%yb >= 0) then
if (bc_bound%yb >= 0) then

Check warning on line 1208 in src/common/m_boundary_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_common.fpp#L1208

Added line #L1208 was not covered by tests
call s_mpi_sendrecv_capilary_variables_buffers(c_divs, 2, -1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -1223,7 +1223,7 @@
end do
end if

if (bc_flag%ye >= 0) then
if (bc_bound%ye >= 0) then

Check warning on line 1226 in src/common/m_boundary_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_common.fpp#L1226

Added line #L1226 was not covered by tests
call s_mpi_sendrecv_capilary_variables_buffers(c_divs, 2, 1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -1244,7 +1244,7 @@
if (p == 0) return

!< z-direction
if (bc_flag%zb >= 0) then
if (bc_bound%zb >= 0) then

Check warning on line 1247 in src/common/m_boundary_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_common.fpp#L1247

Added line #L1247 was not covered by tests
call s_mpi_sendrecv_capilary_variables_buffers(c_divs, 3, -1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand All @@ -1262,7 +1262,7 @@
end do
end if

if (bc_flag%ze >= 0) then
if (bc_bound%ze >= 0) then

Check warning on line 1265 in src/common/m_boundary_common.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_boundary_common.fpp#L1265

Added line #L1265 was not covered by tests
call s_mpi_sendrecv_capilary_variables_buffers(c_divs, 3, 1)
else
!$acc parallel loop collapse(2) gang vector default(present)
Expand Down
4 changes: 2 additions & 2 deletions src/common/m_derived_types.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ module m_derived_types
end type mpi_io_airfoil_ib_var

!> Derived type for boundary flags
type boundary_flags
type boundary_bounds
real(wp) :: xb, xe, yb, ye, zb, ze
end type boundary_flags
end type boundary_bounds

!> Derived type annexing integral regions
type integral_parameters
Expand Down
4 changes: 2 additions & 2 deletions src/pre_process/m_perturbation.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contains

impure subroutine s_initialize_perturbation_module()

bc_flag%xb = bc_x%beg; bc_flag%xe = bc_x%end; bc_flag%yb = bc_y%beg; bc_flag%ye = bc_y%end; bc_flag%zb = bc_z%beg; bc_flag%ze = bc_z%end
bc_bound%xb = bc_x%beg; bc_bound%xe = bc_x%end; bc_bound%yb = bc_y%beg; bc_bound%ye = bc_y%end; bc_bound%zb = bc_z%beg; bc_bound%ze = bc_z%end

if (mixlayer_perturb) then
mixlayer_bc_fd = 2
Expand Down Expand Up @@ -624,7 +624,7 @@ contains
do q = 1, elliptic_smoothing_iters

! Communication of buffer regions and apply boundary conditions
call s_populate_variables_buffers(q_prim_vf, pb%sf, mv%sf, bc_type, bc_flag)
call s_populate_variables_buffers(q_prim_vf, pb%sf, mv%sf, bc_type, bc_bound)

! Perform smoothing and store in temp array
if (n == 0) then
Expand Down
54 changes: 27 additions & 27 deletions src/simulation/m_cbc.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ module m_cbc
!$acc declare create(is1, is2, is3)

integer :: dj
type(boundary_flags) :: bc_flag !< Boundary flags
type(boundary_bounds) :: bc_bound !< Boundary flags
integer :: cbc_dir, cbc_loc
integer :: flux_cbc_index
!$acc declare create(dj, bc_flag, cbc_dir, cbc_loc, flux_cbc_index)
!$acc declare create(dj, bc_bound, cbc_dir, cbc_loc, flux_cbc_index)

!! GRCBC inputs for subsonic inflow and outflow conditions consisting of
!! inflow velocities, pressure, density and void fraction as well as
Expand Down Expand Up @@ -392,23 +392,23 @@ contains
! Associating the procedural pointer to the appropriate subroutine
! that will be utilized in the conversion to the mixture variables

bc_flag%xb = bc_x%beg
bc_flag%xe = bc_x%end
bc_bound%xb = bc_x%beg
bc_bound%xe = bc_x%end

!$acc update device(bc_flag)
!$acc update device(bc_bound)

if (n > 0) then
bc_flag%yb = bc_y%beg
bc_flag%ye = bc_y%end
bc_bound%yb = bc_y%beg
bc_bound%ye = bc_y%end

!$acc update device(bc_flag)
!$acc update device(bc_bound)
end if

if (p > 0) then
bc_flag%zb = bc_z%beg
bc_flag%ze = bc_z%end
bc_bound%zb = bc_z%beg
bc_bound%ze = bc_z%end

!$acc update device(bc_flag)
!$acc update device(bc_bound)
end if

! Allocate GRCBC inputs
Expand Down Expand Up @@ -911,14 +911,14 @@ contains

Ma = vel(dir_idx(1))/c

if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_SLIP_WALL) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_SLIP_WALL)) then
if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_SLIP_WALL) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_SLIP_WALL)) then
call s_compute_slip_wall_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_NR_SUB_BUFFER) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_NR_SUB_BUFFER)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_NR_SUB_BUFFER) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_NR_SUB_BUFFER)) then
call s_compute_nonreflecting_subsonic_buffer_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds, dYs_ds)
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_NR_SUB_INFLOW) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_NR_SUB_INFLOW)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_NR_SUB_INFLOW) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_NR_SUB_INFLOW)) then
call s_compute_nonreflecting_subsonic_inflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
! Add GRCBC for Subsonic Inflow
if (bc_${XYZ}$%grcbc_in) then
Expand All @@ -938,8 +938,8 @@ contains
end do
L(advxe) = rho*c**2._wp*(1._wp + Ma)*(vel(dir_idx(1)) + vel_in(${CBC_DIR}$, dir_idx(1))*sign(1, cbc_loc))/Del_in(${CBC_DIR}$) + c*(1._wp + Ma)*(pres - pres_in(${CBC_DIR}$))/Del_in(${CBC_DIR}$)
end if
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_NR_SUB_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_NR_SUB_OUTFLOW)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_NR_SUB_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_NR_SUB_OUTFLOW)) then
call s_compute_nonreflecting_subsonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds, dYs_ds)
! Add GRCBC for Subsonic Outflow (Pressure)
if (bc_${XYZ}$%grcbc_out) then
Expand All @@ -950,17 +950,17 @@ contains
L(advxe) = L(advxe) + rho*c**2._wp*(1._wp - Ma)*(vel(dir_idx(1)) + vel_out(${CBC_DIR}$, dir_idx(1))*sign(1, cbc_loc))/Del_out(${CBC_DIR}$)
end if
end if
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_FF_SUB_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_FF_SUB_OUTFLOW)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_FF_SUB_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_FF_SUB_OUTFLOW)) then
call s_compute_force_free_subsonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_CP_SUB_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_CP_SUB_OUTFLOW)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_CP_SUB_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_CP_SUB_OUTFLOW)) then
call s_compute_constant_pressure_subsonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_SUP_INFLOW) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_SUP_INFLOW)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_SUP_INFLOW) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_SUP_INFLOW)) then
call s_compute_supersonic_inflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds)
else if ((cbc_loc == -1 .and. bc_flag%${XYZ}$b == BC_CHAR_SUP_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_flag%${XYZ}$e == BC_CHAR_SUP_OUTFLOW)) then
else if ((cbc_loc == -1 .and. bc_bound%${XYZ}$b == BC_CHAR_SUP_OUTFLOW) .or. &
(cbc_loc == 1 .and. bc_bound%${XYZ}$e == BC_CHAR_SUP_OUTFLOW)) then
call s_compute_supersonic_outflow_L(lambda, L, rho, c, mf, dalpha_rho_ds, dpres_ds, dvel_ds, dadv_ds, dYs_ds)
end if

Expand Down
35 changes: 11 additions & 24 deletions src/simulation/m_ibm.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,29 +97,29 @@

! Initialize the ip component of each ghost point
do i = 1, num_gps
allocate (ghost_points(i)%ip%alpha_rho(num_fluids))
allocate (ghost_points(i)%ip%alpha(num_fluids))
@:ALLOCATE(ghost_points(i)%ip%alpha_rho(num_fluids))
@:ALLOCATE(ghost_points(i)%ip%alpha(num_fluids))
ghost_points(i)%ip%vel = 0.0_wp
ghost_points(i)%ip%pressure = 0.0_wp

if (surface_tension) then
ghost_points(i)%ip%c = 0.0_wp

Check warning on line 106 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L106

Added line #L106 was not covered by tests
end if

if (bubbles_euler) then
allocate (ghost_points(i)%ip%r(nb))
allocate (ghost_points(i)%ip%v(nb))
@:ALLOCATE(ghost_points(i)%ip%r(nb))
@:ALLOCATE(ghost_points(i)%ip%v(nb))

Check warning on line 111 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L110-L111

Added lines #L110 - L111 were not covered by tests
if (.not. polytropic) then
allocate (ghost_points(i)%ip%pb(nb))
allocate (ghost_points(i)%ip%mv(nb))
@:ALLOCATE(ghost_points(i)%ip%pb(nb))
@:ALLOCATE(ghost_points(i)%ip%mv(nb))

Check warning on line 114 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L113-L114

Added lines #L113 - L114 were not covered by tests
end if
end if

if (qbmm) then
allocate (ghost_points(i)%ip%nmom(nb*nmom))
@:ALLOCATE(ghost_points(i)%ip%nmom(nb*nmom))

Check warning on line 119 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L119

Added line #L119 was not covered by tests
if (.not. polytropic) then
allocate (ghost_points(i)%ip%presb(nb*nnode))
allocate (ghost_points(i)%ip%massv(nb*nnode))
@:ALLOCATE(ghost_points(i)%ip%presb(nb*nnode))
@:ALLOCATE(ghost_points(i)%ip%massv(nb*nnode))

Check warning on line 122 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L121-L122

Added lines #L121 - L122 were not covered by tests
end if
end if
end do
Expand Down Expand Up @@ -192,11 +192,11 @@

!Interpolate primitive variables at image point associated w/ GP
if (bubbles_euler .and. .not. qbmm) then
call s_interpolate_image_point(q_prim_vf, gp)

Check warning on line 195 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L195

Added line #L195 was not covered by tests
else if (qbmm .and. polytropic) then
call s_interpolate_image_point(q_prim_vf, gp)

Check warning on line 197 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L197

Added line #L197 was not covered by tests
else if (qbmm .and. .not. polytropic) then
call s_interpolate_image_point(q_prim_vf, gp, pb, mv)

Check warning on line 199 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L199

Added line #L199 was not covered by tests
else
call s_interpolate_image_point(q_prim_vf, gp)
end if
Expand All @@ -211,17 +211,17 @@
end do

if (surface_tension) then
q_prim_vf(c_idx)%sf(j, k, l) = gp%ip%c

Check warning on line 214 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L214

Added line #L214 was not covered by tests
end if

if (model_eqns /= 4) then
! If in simulation, use acc mixture subroutines
if (elasticity) then
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, &
gp%ip%alpha, gp%ip%alpha_rho, Re_K, j, k, l, G_K, Gs)

Check warning on line 221 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L221

Added line #L221 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one advantage of this strategy of using more derived types is that we can just pass in gp%ip (for ibm) or state%L (or something like this) for riemann solvers. basically gathering all the data that could exist at a given point and lumping it into a derived type, and then the argument list becomes very short. for example, you just pass in

call s_routine(state)

where

subroutine s_routine(mystate)
	type(state) :: mystate
	
	[...]
	
	mystate%rho = [......]
end subroutine

else if (bubbles_euler) then
call s_convert_species_to_mixture_variables_bubbles_acc(rho, gamma, pi_inf, qv_K, &
gp%ip%alpha, gp%ip%alpha_rho, Re_K, j, k, l)

Check warning on line 224 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L224

Added line #L224 was not covered by tests
else
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, &
gp%ip%alpha, gp%ip%alpha_rho, Re_K, j, k, l)
Expand Down Expand Up @@ -255,36 +255,36 @@

! Set color function
if (surface_tension) then
q_cons_vf(c_idx)%sf(j, k, l) = gp%ip%c

Check warning on line 258 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L258

Added line #L258 was not covered by tests
end if

! Set Energy
if (bubbles_euler) then
q_cons_vf(E_idx)%sf(j, k, l) = (1 - gp%ip%alpha(1))*(gamma*gp%ip%pressure + pi_inf + dyn_pres)

Check warning on line 263 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L263

Added line #L263 was not covered by tests
else
q_cons_vf(E_idx)%sf(j, k, l) = gamma*gp%ip%pressure + pi_inf + dyn_pres
end if

! Set bubble vars
if (bubbles_euler .and. .not. qbmm) then
call s_comp_n_from_prim(gp%ip%alpha(1), gp%ip%r, nbub, weight)

Check warning on line 270 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L270

Added line #L270 was not covered by tests
do q = 1, nb
if (polytropic) then
q_cons_vf(bubxb + (q - 1)*2)%sf(j, k, l) = nbub*gp%ip%r(q)
q_cons_vf(bubxb + (q - 1)*2 + 1)%sf(j, k, l) = nbub*gp%ip%v(q)

Check warning on line 274 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L272-L274

Added lines #L272 - L274 were not covered by tests
else
q_cons_vf(bubxb + (q - 1)*4)%sf(j, k, l) = nbub*gp%ip%r(q)
q_cons_vf(bubxb + (q - 1)*4 + 1)%sf(j, k, l) = nbub*gp%ip%v(q)
q_cons_vf(bubxb + (q - 1)*4 + 2)%sf(j, k, l) = nbub*gp%ip%pb(q)
q_cons_vf(bubxb + (q - 1)*4 + 3)%sf(j, k, l) = nbub*gp%ip%mv(q)

Check warning on line 279 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L276-L279

Added lines #L276 - L279 were not covered by tests
end if
end do
end if

if (qbmm) then
nbub = gp%ip%nmom(1)

Check warning on line 285 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L285

Added line #L285 was not covered by tests
do q = 1, nb*nmom
q_cons_vf(bubxb + q - 1)%sf(j, k, l) = nbub*gp%ip%nmom(q)

Check warning on line 287 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L287

Added line #L287 was not covered by tests
end do
do q = 1, nb
q_cons_vf(bubxb + (q - 1)*nmom)%sf(j, k, l) = nbub
Expand All @@ -293,8 +293,8 @@
if (.not. polytropic) then
do q = 1, nb
do r = 1, nnode
pb(j, k, l, r, q) = gp%ip%presb((q - 1)*nnode + r)
mv(j, k, l, r, q) = gp%ip%massv((q - 1)*nnode + r)

Check warning on line 297 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L296-L297

Added lines #L296 - L297 were not covered by tests
end do
end do
end if
Expand Down Expand Up @@ -329,16 +329,16 @@

!$acc loop seq
do q = 1, num_fluids
q_prim_vf(q)%sf(j, k, l) = gp%ip%alpha_rho(q)
q_prim_vf(advxb + q - 1)%sf(j, k, l) = gp%ip%alpha(q)

Check warning on line 333 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L332-L333

Added lines #L332 - L333 were not covered by tests
end do

if (surface_tension) then
q_prim_vf(c_idx)%sf(j, k, l) = gp%ip%c

Check warning on line 337 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L337

Added line #L337 was not covered by tests
end if

call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, gp%ip%alpha, &
gp%ip%alpha_rho, Re_K, j, k, l)

Check warning on line 341 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L341

Added line #L341 was not covered by tests

dyn_pres = 0._wp

Expand Down Expand Up @@ -757,7 +757,7 @@

!> Function that uses the interpolation coefficients and the current state
!! at the cell centers in order to estimate the state at the image point
pure subroutine s_interpolate_image_point(q_prim_vf, gp, pb, mv)

Check warning on line 760 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L760

Added line #L760 was not covered by tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an good example of what i was talking about above... for removing so many arguments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup yup I see that

!$acc routine seq
type(scalar_field), &
dimension(sys_size), &
Expand Down Expand Up @@ -788,19 +788,19 @@
if (surface_tension) gp%ip%c = 0._wp

if (bubbles_euler) then
gp%ip%r = 0._wp
gp%ip%v = 0._wp

Check warning on line 792 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L791-L792

Added lines #L791 - L792 were not covered by tests
if (.not. polytropic) then
gp%ip%pb = 0._wp
gp%ip%mv = 0._wp

Check warning on line 795 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L794-L795

Added lines #L794 - L795 were not covered by tests
end if
end if

if (qbmm) then
gp%ip%nmom = 0._wp

Check warning on line 800 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L800

Added line #L800 was not covered by tests
if (.not. polytropic) then
gp%ip%presb = 0._wp
gp%ip%massv = 0._wp

Check warning on line 803 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L802-L803

Added lines #L802 - L803 were not covered by tests
end if
end if

Expand All @@ -814,52 +814,52 @@
coeff = gp%interp_coeffs(i - i1 + 1, j - j1 + 1, k - k1 + 1)

gp%ip%pressure = gp%ip%pressure + coeff* &
q_prim_vf(E_idx)%sf(i, j, k)

Check warning on line 817 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L817

Added line #L817 was not covered by tests

!$acc loop seq
do q = momxb, momxe
gp%ip%vel(q + 1 - momxb) = gp%ip%vel(q + 1 - momxb) + coeff* &
q_prim_vf(q)%sf(i, j, k)

Check warning on line 822 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L821-L822

Added lines #L821 - L822 were not covered by tests
end do

!$acc loop seq
do l = contxb, contxe
gp%ip%alpha_rho(l) = gp%ip%alpha_rho(l) + coeff* &
q_prim_vf(l)%sf(i, j, k)
gp%ip%alpha(l) = gp%ip%alpha(l) + coeff* &
q_prim_vf(advxb + l - 1)%sf(i, j, k)

Check warning on line 830 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L827-L830

Added lines #L827 - L830 were not covered by tests
end do

if (surface_tension) then
gp%ip%c = gp%ip%c + coeff*q_prim_vf(c_idx)%sf(i, j, k)

Check warning on line 834 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L834

Added line #L834 was not covered by tests
end if

if (bubbles_euler .and. .not. qbmm) then
!$acc loop seq
do l = 1, nb
if (polytropic) then
gp%ip%r(l) = gp%ip%r(l) + coeff*q_prim_vf(bubxb + (l - 1)*2)%sf(i, j, k)
gp%ip%v(l) = gp%ip%v(l) + coeff*q_prim_vf(bubxb + 1 + (l - 1)*2)%sf(i, j, k)

Check warning on line 842 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L841-L842

Added lines #L841 - L842 were not covered by tests
else
gp%ip%r(l) = gp%ip%r(l) + coeff*q_prim_vf(bubxb + (l - 1)*4)%sf(i, j, k)
gp%ip%v(l) = gp%ip%v(l) + coeff*q_prim_vf(bubxb + 1 + (l - 1)*4)%sf(i, j, k)
gp%ip%pb(l) = gp%ip%pb(l) + coeff*q_prim_vf(bubxb + 2 + (l - 1)*4)%sf(i, j, k)
gp%ip%mv(l) = gp%ip%mv(l) + coeff*q_prim_vf(bubxb + 3 + (l - 1)*4)%sf(i, j, k)

Check warning on line 847 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L844-L847

Added lines #L844 - L847 were not covered by tests
end if
end do
end if

if (qbmm) then
do l = 1, nb*nmom
gp%ip%nmom(l) = gp%ip%nmom(l) + coeff*q_prim_vf(bubxb - 1 + l)%sf(i, j, k)

Check warning on line 854 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L854

Added line #L854 was not covered by tests
end do
if (.not. polytropic) then
do q = 1, nb
do l = 1, nnode
gp%ip%presb((q - 1)*nnode + l) = gp%ip%presb((q - 1)*nnode + l) + &
coeff*pb(i, j, k, l, q)
gp%ip%massv((q - 1)*nnode + l) = gp%ip%massv((q - 1)*nnode + l) + &
coeff*mv(i, j, k, l, q)

Check warning on line 862 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L859-L862

Added lines #L859 - L862 were not covered by tests
end do
end do
end if
Expand All @@ -872,27 +872,14 @@

!> Subroutine to deallocate memory reserved for the IBM module
impure subroutine s_finalize_ibm_module()
integer :: i

if (allocated(ghost_points)) then
do i = 1, size(ghost_points)
if (allocated(ghost_points(i)%ip%alpha_rho)) deallocate (ghost_points(i)%ip%alpha_rho)
if (allocated(ghost_points(i)%ip%alpha)) deallocate (ghost_points(i)%ip%alpha)
if (allocated(ghost_points(i)%ip%r)) deallocate (ghost_points(i)%ip%r)
if (allocated(ghost_points(i)%ip%v)) deallocate (ghost_points(i)%ip%v)
if (allocated(ghost_points(i)%ip%pb)) deallocate (ghost_points(i)%ip%pb)
if (allocated(ghost_points(i)%ip%mv)) deallocate (ghost_points(i)%ip%mv)
if (allocated(ghost_points(i)%ip%nmom)) deallocate (ghost_points(i)%ip%nmom)
if (allocated(ghost_points(i)%ip%presb)) deallocate (ghost_points(i)%ip%presb)
if (allocated(ghost_points(i)%ip%massv)) deallocate (ghost_points(i)%ip%massv)
end do
end if

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abbotts

Do you mind checking out this line?
I suspect it to be causing all IBM cases to fail.

if (allocated(ghost_points)) deallocate(ghost_points)

@:DEALLOCATE(ib_markers%sf)
@:DEALLOCATE(levelset%sf)
@:DEALLOCATE(levelset_norm%sf)
@:DEALLOCATE(ghost_points)
@:DEALLOCATE(inner_points)

Check warning on line 882 in src/simulation/m_ibm.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_ibm.fpp#L881-L882

Added lines #L881 - L882 were not covered by tests

end subroutine s_finalize_ibm_module

Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_rhs.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ contains
call nvtxEndRange

call nvtxStartRange("RHS-COMMUNICATION")
call s_populate_variables_buffers(q_prim_qp%vf, pb, mv, bc_type, bc_flag)
call s_populate_variables_buffers(q_prim_qp%vf, pb, mv, bc_type, bc_bound)
call nvtxEndRange

call nvtxStartRange("RHS-ELASTIC")
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_surface_tension.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ contains
end do
end do

call s_populate_capillary_buffers(c_divs, bc_type, bc_flag)
call s_populate_capillary_buffers(c_divs, bc_type, bc_bound)

iv%beg = 1; iv%end = num_dims + 1

Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_time_steppers.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ contains

elseif (bubbles_lagrange) then

call s_populate_variables_buffers(q_prim_vf, pb_ts(1)%sf, mv_ts(1)%sf, bc_type, bc_flag)
call s_populate_variables_buffers(q_prim_vf, pb_ts(1)%sf, mv_ts(1)%sf, bc_type, bc_bound)
call s_compute_bubble_EL_dynamics(q_cons_ts(1)%vf, q_prim_vf, t_step, rhs_vf, stage)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this correct? looks like a breaking change to the subroutine call? or maybe this is from a merge conflict you fixed

call s_transfer_data_to_tmp()
call s_smear_voidfraction()
Expand Down
Loading