Skip to content

Commit 2eedfe6

Browse files
Found my 3D sphere error
1 parent a216ed4 commit 2eedfe6

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/simulation/m_ibm.fpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ contains
198198

199199
! set the Moving IBM interior Pressure Values
200200
$:GPU_PARALLEL_LOOP(private='[i,j,k]', copyin='[E_idx]', collapse=3)
201-
do l = 0, p
202-
do k = 0, n
203-
do j = 0, m
204-
if (ib_markers%sf(j, k, l) /= 0) then
205-
q_prim_vf(E_idx)%sf(j, k, l) = 1._wp
206-
end if
207-
end do
201+
do l = 0, p
202+
do k = 0, n
203+
do j = 0, m
204+
if (ib_markers%sf(j, k, l) /= 0) then
205+
q_prim_vf(E_idx)%sf(j, k, l) = 1._wp
206+
end if
208207
end do
209208
end do
210-
$:END_GPU_PARALLEL_LOOP()
209+
end do
210+
$:END_GPU_PARALLEL_LOOP()
211211

212212
if (num_gps > 0) then
213213
$:GPU_PARALLEL_LOOP(private='[i,physical_loc,dyn_pres,alpha_rho_IP, alpha_IP,pres_IP,vel_IP,vel_g,vel_norm_IP,r_IP, v_IP,pb_IP,mv_IP,nmom_IP,presb_IP,massv_IP,rho, gamma,pi_inf,Re_K,G_K,Gs,gp,innerp,norm,buf, radial_vector, rotation_velocity, j,k,l,q,qv_K,c_IP,nbub,patch_id]')
@@ -258,12 +258,13 @@ contains
258258
end if
259259

260260
! set the pressure
261-
if (patch_ib(patch_id)%moving_ibm == 0) then
261+
if (patch_ib(patch_id)%moving_ibm <= 1) then
262262
q_prim_vf(E_idx)%sf(j, k, l) = pres_IP
263263
else
264264
q_prim_vf(E_idx)%sf(j, k, l) = 0._wp
265265
$:GPU_LOOP(parallelism='[seq]')
266266
do q = 1, num_fluids
267+
! Se the pressure inside a moving immersed boundary based upon the pressure of the image point. acceleration, and normal vector direction
267268
q_prim_vf(E_idx)%sf(j, k, l) = q_prim_vf(E_idx)%sf(j, k, l) + pres_IP/(1._wp - 2._wp*abs(levelset%sf(j, k, l, patch_id)*alpha_rho_IP(q)/pres_IP)*dot_product(patch_ib(patch_id)%force/patch_ib(patch_id)%mass, levelset_norm%sf(j, k, l, patch_id, :)))
268269
end do
269270
end if

src/simulation/m_time_steppers.fpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +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(0:m, 0:n, 0:p)) ! compute the force and torque on the IB from the fluid
615614

616615
do i = 1, num_ibs
617616
if (s == 1) then
@@ -628,6 +627,9 @@ contains
628627
patch_ib(i)%angular_vel = (rk_coef(s, 1)*patch_ib(i)%step_angular_vel + rk_coef(s, 2)*patch_ib(i)%angular_vel)/rk_coef(s, 4)
629628

630629
if (patch_ib(i)%moving_ibm == 2) then ! if we are using two-way coupling, apply force and torque
630+
! compute the force and torque on the IB from the fluid
631+
call s_compute_ib_forces(q_prim_vf(E_idx)%sf(0:m, 0:n, 0:p))
632+
631633
! update the velocity from the force value
632634
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)
633635

0 commit comments

Comments
 (0)