Skip to content

Commit 8531946

Browse files
Added feedback for if variables are not the same in non-MPI
1 parent a4967c9 commit 8531946

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/common/m_mpi_common.fpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@ contains
492492
mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr)
493493
end if
494494
495+
#else
496+
var_glb = var_loc
495497
#endif
496498
497499
end subroutine s_mpi_allreduce_vectors_sum

src/simulation/m_ibm.fpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,10 +1017,11 @@ contains
10171017
ib_idx = ib_markers%sf(i, j, k)
10181018
if (ib_idx /= 0) then ! only need to compute the gradient for cells inside a IB
10191019
if (patch_ib(ib_idx)%moving_ibm == 2) then ! make sure that this IB has 2-way coupling enabled
1020+
! get the vector pointing to the grid cell from the IB centroid
10201021
if (num_dims == 3) then
1021-
radial_vector = [x_cc(i), y_cc(j), z_cc(k)] - [patch_ib(ib_idx)%x_centroid, patch_ib(ib_idx)%y_centroid, patch_ib(ib_idx)%z_centroid] ! get the vector pointing to the grid cell
1022+
radial_vector = [x_cc(i), y_cc(j), z_cc(k)] - [patch_ib(ib_idx)%x_centroid, patch_ib(ib_idx)%y_centroid, patch_ib(ib_idx)%z_centroid]
10221023
else
1023-
radial_vector = [x_cc(i), y_cc(j), 0._wp] - [patch_ib(ib_idx)%x_centroid, patch_ib(ib_idx)%y_centroid, 0._wp] ! get the vector pointing to the grid cell
1024+
radial_vector = [x_cc(i), y_cc(j), 0._wp] - [patch_ib(ib_idx)%x_centroid, patch_ib(ib_idx)%y_centroid, 0._wp]
10241025
end if
10251026
10261027
! use a finite difference to compute the 2D components of the gradient of the pressure and cell volume
@@ -1040,7 +1041,7 @@ contains
10401041
$:GPU_ATOMIC(atomic='update')
10411042
forces(ib_idx, :) = forces(ib_idx, :) - (pressure_divergence*cell_volume)
10421043
$:GPU_ATOMIC(atomic='update')
1043-
torques(ib_idx, :) = torques(ib_idx, :) + (cross_product(radial_vector, pressure_divergence)*cell_volume)
1044+
torques(ib_idx, :) = torques(ib_idx, :) - (cross_product(radial_vector, pressure_divergence)*cell_volume)
10441045
end if
10451046
end if
10461047
end do

0 commit comments

Comments
 (0)