Skip to content

Commit 8e13c6f

Browse files
minor conditional simplifications based on AI reviewer
1 parent 2cf40cb commit 8e13c6f

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/common/m_ib_patches.fpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ contains
8686
call s_ib_cylinder(i, ib_markers_sf)
8787
call s_cylinder_levelset(i, levelset, levelset_norm)
8888
elseif (patch_ib(i)%geometry == 11) then
89-
#ifdef MFC_PRE_PROCESS
9089
call s_ib_3D_airfoil(i, ib_markers_sf)
9190
call s_3D_airfoil_levelset(i, levelset, levelset_norm)
92-
#endif
9391
! STL+IBM patch
9492
elseif (patch_ib(i)%geometry == 12) then
9593
call s_ib_model(i, ib_markers_sf, levelset, levelset_norm)
@@ -110,10 +108,8 @@ contains
110108
call s_ib_rectangle(i, ib_markers_sf)
111109
call s_rectangle_levelset(i, levelset, levelset_norm)
112110
elseif (patch_ib(i)%geometry == 4) then
113-
#ifdef MFC_PRE_PROCESS
114111
call s_ib_airfoil(i, ib_markers_sf)
115112
call s_airfoil_levelset(i, levelset, levelset_norm)
116-
#endif
117113
! STL+IBM patch
118114
elseif (patch_ib(i)%geometry == 5) then
119115
call s_ib_model(i, ib_markers_sf, levelset, levelset_norm)
@@ -277,7 +273,7 @@ contains
277273
end if
278274
if (y_act >= y0) then
279275
k = 1
280-
do while (airfoil_grid_u(k)%x < x_act)
276+
do while (airfoil_grid_u(k)%x < x_act .and. k <= Np)
281277
k = k + 1
282278
end do
283279
if (f_approx_equal(airfoil_grid_u(k)%x, x_act)) then
@@ -771,7 +767,6 @@ contains
771767
!> The STL patch is a 2/3D geometry that is imported from an STL file.
772768
!! @param patch_id is the patch identifier
773769
!! @param ib_markers_sf Array to track patch ids
774-
!! @param ib True if this patch is an immersed boundary
775770
!! @param STL_levelset STL levelset
776771
!! @param STL_levelset_norm STL levelset normals
777772
subroutine s_ib_model(patch_id, ib_markers_sf, STL_levelset, STL_levelset_norm)

src/pre_process/m_icpp_patches.fpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,17 +1656,12 @@ contains
16561656

16571657
eta = f_model_is_inside(model, point, (/dx, dy, dz/), patch_icpp(patch_id)%model_spc)
16581658

1659-
if (patch_icpp(patch_id)%smoothen) then
1660-
if (eta > patch_icpp(patch_id)%model_threshold) then
1661-
eta = 1._wp
1662-
end if
1663-
else
1664-
if (eta > patch_icpp(patch_id)%model_threshold) then
1665-
eta = 1._wp
1666-
else
1667-
eta = 0._wp
1668-
end if
1659+
if (eta > patch_icpp(patch_id)%model_threshold) then
1660+
eta = 1._wp
1661+
else if (.not. patch_icpp(patch_id)%smoothen) then
1662+
eta = 0._wp
16691663
end if
1664+
16701665
call s_assign_patch_primitive_variables(patch_id, i, j, k, &
16711666
eta, q_prim_vf, patch_id_fp)
16721667

0 commit comments

Comments
 (0)