Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IBM Slip tests #791

Merged
merged 7 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion src/pre_process/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,10 @@ contains
call MPI_BCAST(patch_ib(i)%model_spc, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)

#:for VAR in [ 'x_centroid', 'y_centroid', 'z_centroid', &
& 'length_x', 'length_y', 'length_z', 'radius', 'c', 'p', 't', 'm', 'theta', 'slip']
& 'length_x', 'length_y', 'length_z', 'radius', 'c', 'p', 't', 'm', 'theta']
call MPI_BCAST(patch_ib(i)%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr)
#:endfor
call MPI_BCAST(patch_ib(i)%slip, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr)

#:for VAR in [ 'model_translate', 'model_scale', 'model_rotate']
call MPI_BCAST(patch_ib(i)%${VAR}$, size(patch_ib(i)%${VAR}$), mpi_p, 0, MPI_COMM_WORLD, ierr)
Expand Down
13 changes: 8 additions & 5 deletions src/simulation/m_ibm.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ contains
@:ALLOCATE(ib_markers%sf(-gp_layers:m+gp_layers, &
-gp_layers:n+gp_layers, -gp_layers:p+gp_layers))
@:ALLOCATE(levelset%sf(-gp_layers:m+gp_layers, &
-gp_layers:n+gp_layers, -gp_layers:p+gp_layers, num_ibs))
-gp_layers:n+gp_layers, -gp_layers:p+gp_layers, 1:num_ibs))
@:ALLOCATE(levelset_norm%sf(-gp_layers:m+gp_layers, &
-gp_layers:n+gp_layers, -gp_layers:p+gp_layers, num_ibs, 3))
-gp_layers:n+gp_layers, -gp_layers:p+gp_layers, 1:num_ibs, 1:3))
else
@:ALLOCATE(ib_markers%sf(-gp_layers:m+gp_layers, &
-gp_layers:n+gp_layers, 0:0))
@:ALLOCATE(levelset%sf(-gp_layers:m+gp_layers, &
-gp_layers:n+gp_layers, 0:0, num_ibs))
-gp_layers:n+gp_layers, 0:0, 1:num_ibs))
@:ALLOCATE(levelset_norm%sf(-gp_layers:m+gp_layers, &
-gp_layers:n+gp_layers, 0:0, num_ibs, 3))
-gp_layers:n+gp_layers, 0:0, 1:num_ibs, 1:3))
end if

@:ACC_SETUP_SFs(ib_markers)
@:ACC_SETUP_SFs(levelset)
@:ACC_SETUP_SFs(levelset_norm)

!$acc enter data copyin(num_gps, num_inner_gps)

Expand All @@ -80,6 +81,8 @@ contains
integer :: i, j, k

!$acc update device(ib_markers%sf)
!$acc update device(levelset%sf)
!$acc update device(levelset_norm%sf)

! Get neighboring IB variables from other processors
call s_mpi_sendrecv_ib_buffers(ib_markers, gp_layers)
Expand Down Expand Up @@ -207,7 +210,7 @@ contains

! Calculate velocity of ghost cell
if (gp%slip) then
norm = levelset_norm%sf(gp%loc(1), gp%loc(2), gp%loc(3), gp%ib_patch_id, :)
norm(1:3) = levelset_norm%sf(gp%loc(1), gp%loc(2), gp%loc(3), gp%ib_patch_id, 1:3)
buf = sqrt(sum(norm**2))
norm = norm/buf
vel_norm_IP = sum(vel_IP*norm)*norm
Expand Down
150 changes: 150 additions & 0 deletions tests/0387594F/golden-metadata.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/0387594F/golden.txt

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions tests/07D9EBD1/golden-metadata.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions tests/16574715/golden-metadata.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading