Skip to content

Commit 80bd4b5

Browse files
Handeled passing variables more elegantly and resolved a broken merge change
1 parent 1ba6ca5 commit 80bd4b5

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/simulation/m_ibm.fpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -999,9 +999,10 @@ contains
999999
! by Archana Sridhar and Jesse Capecelatro
10001000
subroutine s_compute_ib_forces(pressure)
10011001
1002-
real(wp), dimension(idwbuff(1)%beg:idwbuff(1)%end, &
1003-
idwbuff(2)%beg:idwbuff(2)%end, &
1004-
idwbuff(3)%beg:idwbuff(3)%end), intent(in) :: pressure
1002+
! real(wp), dimension(idwbuff(1)%beg:idwbuff(1)%end, &
1003+
! idwbuff(2)%beg:idwbuff(2)%end, &
1004+
! idwbuff(3)%beg:idwbuff(3)%end), intent(in) :: pressure
1005+
type(scalar_field), intent(in) :: pressure
10051006
10061007
integer :: i, j, k, l, ib_idx
10071008
real(wp), dimension(num_ibs, 3) :: forces, torques
@@ -1029,14 +1030,14 @@ contains
10291030
dy = y_cc(j + 1) - y_cc(j)
10301031
10311032
! use a finite difference to compute the 2D components of the gradient of the pressure and cell volume
1032-
pressure_divergence(1) = (pressure(i + 1, j, k) - pressure(i - 1, j, k))/(2._wp*dx)
1033-
pressure_divergence(2) = (pressure(i, j + 1, k) - pressure(i, j - 1, k))/(2._wp*dy)
1033+
pressure_divergence(1) = (pressure%sf(i + 1, j, k) - pressure%sf(i - 1, j, k))/(2._wp*dx)
1034+
pressure_divergence(2) = (pressure%sf(i, j + 1, k) - pressure%sf(i, j - 1, k))/(2._wp*dy)
10341035
cell_volume = dx*dy
10351036
10361037
! add the 3D component, if we are working in 3 dimensions
10371038
if (num_dims == 3) then
10381039
dz = z_cc(k + 1) - z_cc(k)
1039-
pressure_divergence(3) = (pressure(i, j, k + 1) - pressure(i, j, k - 1))/(2._wp*dz)
1040+
pressure_divergence(3) = (pressure%sf(i, j, k + 1) - pressure%sf(i, j, k - 1))/(2._wp*dz)
10401041
cell_volume = cell_volume*dz
10411042
else
10421043
pressure_divergence(3) = 0._wp

src/simulation/m_time_steppers.fpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,6 @@ contains
611611
if (ib) then
612612
! check if any IBMS are moving, and if so, update the markers, ghost points, levelsets, and levelset norms
613613
if (moving_immersed_boundary_flag) then
614-
call s_compute_ib_forces(q_prim_vf(E_idx)%sf) ! compute the force and torque on the IB from the fluid
615-
616614
do i = 1, num_ibs
617615
if (s == 1) then
618616
patch_ib(i)%step_vel = patch_ib(i)%vel
@@ -629,7 +627,7 @@ contains
629627

630628
if (patch_ib(i)%moving_ibm == 2) then ! if we are using two-way coupling, apply force and torque
631629
! compute the force and torque on the IB from the fluid
632-
call s_compute_ib_forces(q_prim_vf(E_idx)%sf(0:m, 0:n, 0:p))
630+
call s_compute_ib_forces(q_prim_vf(E_idx))
633631

634632
! update the velocity from the force value
635633
patch_ib(i)%vel = patch_ib(i)%vel + rk_coef(s, 3)*dt*(patch_ib(i)%force/patch_ib(i)%mass)/rk_coef(s, 4)

0 commit comments

Comments
 (0)