Skip to content

Commit df76051

Browse files
authored
Fix slip BCs for IBM (#789)
1 parent 6c69026 commit df76051

File tree

6 files changed

+11
-21
lines changed

6 files changed

+11
-21
lines changed

.github/workflows/phoenix/submit-bench.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ sbatch_cpu_opts="\
2121

2222
sbatch_gpu_opts="\
2323
#SBATCH -CV100
24+
#SBATCH --ntasks-per-node=4 # Number of cores per node required
2425
#SBATCH -G2\
2526
"
2627

.github/workflows/phoenix/submit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ sbatch_cpu_opts="\
2121

2222
sbatch_gpu_opts="\
2323
#SBATCH -p gpu-v100,gpu-a100,gpu-h100,gpu-l40s
24+
#SBATCH --ntasks-per-node=4 # Number of cores per node required
2425
#SBATCH -G2\
2526
"
2627

src/common/m_constants.fpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module m_constants
2424
integer, parameter :: num_patches_max = 10
2525
integer, parameter :: pathlen_max = 400
2626
integer, parameter :: nnode = 4 !< Number of QBMM nodes
27+
integer, parameter :: gp_layers = 3 !< Number of ghost point layers for IBM
2728
real(wp), parameter :: capillary_cutoff = 1e-6 !< color function gradient magnitude at which to apply the surface tension fluxes
2829
real(wp), parameter :: acoustic_spatial_support_width = 2.5_wp !< Spatial support width of acoustic source, used in s_source_spatial
2930
real(wp), parameter :: dflt_vcfl_dt = 100._wp !< value of vcfl_dt when viscosity is off for computing adaptive timestep size

src/common/m_derived_types.fpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,15 +367,13 @@ module m_derived_types
367367
368368
!> Ghost Point for Immersed Boundaries
369369
type ghost_point
370-
371-
real(wp), dimension(3) :: loc !< Physical location of the ghost point
370+
integer, dimension(3) :: loc !< Physical location of the ghost point
372371
real(wp), dimension(3) :: ip_loc !< Physical location of the image point
373372
integer, dimension(3) :: ip_grid !< Top left grid point of IP
374373
real(wp), dimension(2, 2, 2) :: interp_coeffs !< Interpolation Coefficients of image point
375374
integer :: ib_patch_id !< ID of the IB Patch the ghost point is part of
376375
logical :: slip
377376
integer, dimension(3) :: DB
378-
379377
end type ghost_point
380378
381379
!> Species parameters

src/simulation/m_ibm.fpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ module m_ibm
1818

1919
use m_helper
2020

21+
use m_constants
22+
2123
implicit none
2224

2325
private :: s_compute_image_points, &
@@ -39,7 +41,6 @@ module m_ibm
3941
type(ghost_point), dimension(:), allocatable :: inner_points
4042
!$acc declare create(ghost_points, inner_points)
4143

42-
integer :: gp_layers !< Number of ghost point layers
4344
integer :: num_gps !< Number of ghost points
4445
integer :: num_inner_gps !< Number of ghost points
4546
!$acc declare create(gp_layers, num_gps, num_inner_gps)
@@ -49,8 +50,6 @@ contains
4950
!> Allocates memory for the variables in the IBM module
5051
subroutine s_initialize_ibm_module()
5152

52-
gp_layers = 3
53-
5453
if (p > 0) then
5554
@:ALLOCATE(ib_markers%sf(-gp_layers:m+gp_layers, &
5655
-gp_layers:n+gp_layers, -gp_layers:p+gp_layers))
@@ -69,9 +68,8 @@ contains
6968

7069
@:ACC_SETUP_SFs(ib_markers)
7170
@:ACC_SETUP_SFs(levelset)
72-
! @:ALLOCATE(ib_markers%sf(0:m, 0:n, 0:p))
7371

74-
!$acc enter data copyin(gp_layers, num_gps, num_inner_gps)
72+
!$acc enter data copyin(num_gps, num_inner_gps)
7573

7674
end subroutine s_initialize_ibm_module
7775

@@ -209,7 +207,9 @@ contains
209207

210208
! Calculate velocity of ghost cell
211209
if (gp%slip) then
212-
norm = levelset_norm%sf(j, k, l, patch_id, :)
210+
norm = levelset_norm%sf(gp%loc(1), gp%loc(2), gp%loc(3), gp%ib_patch_id, :)
211+
buf = sqrt(sum(norm**2))
212+
norm = norm/buf
213213
vel_norm_IP = sum(vel_IP*norm)*norm
214214
vel_g = vel_IP - vel_norm_IP
215215
else
@@ -417,6 +417,7 @@ contains
417417
integer :: i, j, k, l, q !< Iterator variables
418418

419419
num_gps = 0
420+
num_inner_gps = 0
420421

421422
do i = 0, m
422423
do j = 0, n

src/simulation/m_weno.fpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ module m_weno
4040
!! of the characteristic decomposition are stored in custom-constructed WENO-
4141
!! stencils (WS) that are annexed to each position of a given scalar field.
4242
!> @{
43-
4443
real(wp), allocatable, dimension(:, :, :, :) :: v_rs_ws_x, v_rs_ws_y, v_rs_ws_z
4544
!> @}
4645

@@ -52,52 +51,41 @@ module m_weno
5251
!! second dimension identifies the position of its coefficients and the last
5352
!! dimension denotes the cell-location in the relevant coordinate direction.
5453
!> @{
55-
5654
real(wp), target, allocatable, dimension(:, :, :) :: poly_coef_cbL_x
5755
real(wp), target, allocatable, dimension(:, :, :) :: poly_coef_cbL_y
5856
real(wp), target, allocatable, dimension(:, :, :) :: poly_coef_cbL_z
59-
6057
real(wp), target, allocatable, dimension(:, :, :) :: poly_coef_cbR_x
6158
real(wp), target, allocatable, dimension(:, :, :) :: poly_coef_cbR_y
6259
real(wp), target, allocatable, dimension(:, :, :) :: poly_coef_cbR_z
63-
64-
! real(wp), pointer, dimension(:, :, :) :: poly_coef_L => null()
65-
! real(wp), pointer, dimension(:, :, :) :: poly_coef_R => null()
6660
!> @}
6761

6862
!> @name The ideal weights at the left and the right cell-boundaries and at the
6963
!! left and the right quadrature points, in x-, y- and z-directions. Note
7064
!! that the first dimension of the array identifies the weight, while the
7165
!! last denotes the cell-location in the relevant coordinate direction.
7266
!> @{
73-
7467
real(wp), target, allocatable, dimension(:, :) :: d_cbL_x
7568
real(wp), target, allocatable, dimension(:, :) :: d_cbL_y
7669
real(wp), target, allocatable, dimension(:, :) :: d_cbL_z
7770

7871
real(wp), target, allocatable, dimension(:, :) :: d_cbR_x
7972
real(wp), target, allocatable, dimension(:, :) :: d_cbR_y
8073
real(wp), target, allocatable, dimension(:, :) :: d_cbR_z
81-
! real(wp), pointer, dimension(:, :) :: d_L => null()
82-
! real(wp), pointer, dimension(:, :) :: d_R => null()
8374
!> @}
8475

8576
!> @name Smoothness indicator coefficients in the x-, y-, and z-directions. Note
8677
!! that the first array dimension identifies the smoothness indicator, the
8778
!! second identifies the position of its coefficients and the last denotes
8879
!! the cell-location in the relevant coordinate direction.
8980
!> @{
90-
9181
real(wp), target, allocatable, dimension(:, :, :) :: beta_coef_x
9282
real(wp), target, allocatable, dimension(:, :, :) :: beta_coef_y
9383
real(wp), target, allocatable, dimension(:, :, :) :: beta_coef_z
94-
! real(wp), pointer, dimension(:, :, :) :: beta_coef => null()
9584
!> @}
9685

9786
! END: WENO Coefficients
9887

9988
integer :: v_size !< Number of WENO-reconstructed cell-average variables
100-
10189
!$acc declare create(v_size)
10290

10391
!> @name Indical bounds in the s1-, s2- and s3-directions

0 commit comments

Comments
 (0)