Skip to content

Commit 42e1177

Browse files
Fixed airfoil shape, but it is not rotating yet
1 parent 91e0f50 commit 42e1177

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

src/common/m_compute_levelset.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ contains
9090
xy_local = matmul(inverse_rotation, xy_local) ! rotate the frame into the IB's coordiantes
9191
9292
if (xy_local(2) >= 0._wp) then
93+
! finds the location on the airfoil grid with the minimum distance (closest)
9394
do k = 1, Np
94-
! TODO :: I think that witht he IBM implementation that airfoil_grid_u(k).y = 0._wp for all indices. Delete?
9595
dist_vec(1) = xy_local(1) - airfoil_grid_u(k)%x
9696
dist_vec(2) = xy_local(2) - airfoil_grid_u(k)%y
9797
dist_vec(3) = 0
@@ -111,6 +111,7 @@ contains
111111
dist_vec(3) = 0
112112
dist = global_dist
113113
else
114+
! TODO :: This looks identical to the above code but using the lower array. Refactor this.
114115
do k = 1, Np
115116
dist_vec(1) = xy_local(1) - airfoil_grid_l(k)%x
116117
dist_vec(2) = xy_local(2) - airfoil_grid_l(k)%y

src/common/m_ib_patches.fpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ contains
209209
allocate (airfoil_grid_u(1:Np))
210210
allocate (airfoil_grid_l(1:Np))
211211

212+
! TODO :: The below instantiations are already handles by the loop below
212213
airfoil_grid_u(1)%x = 0._wp
213214
airfoil_grid_u(1)%y = 0._wp
214215

@@ -218,6 +219,7 @@ contains
218219
eta = 1._wp
219220

220221
do i = 1, Np1 + Np2 - 1
222+
! TODO :: This allcoated the upper and lower airfoil arrays, and does not need to be performed each time the IB markers are updated. Place this as a separate subroutine.
221223
if (i <= Np1) then
222224
xc = i*(pa*ca_in/Np1)
223225
xa = xc/ca_in
@@ -274,19 +276,19 @@ contains
274276
yc = (ma/(1 - pa)**2)*(1 - 2*pa + 2*pa*xa - xa**2)
275277
dycdxc = (2*ma/(1 - pa)**2)*(pa - xa)
276278
end if
277-
if (xy_local(1) >= 0._wp) then
279+
if (xy_local(2) >= 0._wp) then
278280
k = 1
279281
do while (airfoil_grid_u(k)%x < xy_local(1) .and. k <= Np)
280282
k = k + 1
281283
end do
282284
if (f_approx_equal(airfoil_grid_u(k)%x, xy_local(1))) then
283-
if (xy_local(1) <= airfoil_grid_u(k)%y) then
285+
if (xy_local(2) <= airfoil_grid_u(k)%y) then
284286
!!IB
285287
ib_markers_sf(i, j, 0) = patch_id
286288
end if
287289
else
288290
f = (airfoil_grid_u(k)%x - xy_local(1))/(airfoil_grid_u(k)%x - airfoil_grid_u(k - 1)%x)
289-
if (xy_local(1) <= ((1._wp - f)*airfoil_grid_u(k)%y + f*airfoil_grid_u(k - 1)%y)) then
291+
if (xy_local(2) <= ((1._wp - f)*airfoil_grid_u(k)%y + f*airfoil_grid_u(k - 1)%y)) then
290292
!!IB
291293
ib_markers_sf(i, j, 0) = patch_id
292294
end if
@@ -297,14 +299,14 @@ contains
297299
k = k + 1
298300
end do
299301
if (f_approx_equal(airfoil_grid_l(k)%x, xy_local(1))) then
300-
if (xy_local(1) >= airfoil_grid_l(k)%y) then
302+
if (xy_local(2) >= airfoil_grid_l(k)%y) then
301303
!!IB
302304
ib_markers_sf(i, j, 0) = patch_id
303305
end if
304306
else
305307
f = (airfoil_grid_l(k)%x - xy_local(1))/(airfoil_grid_l(k)%x - airfoil_grid_l(k - 1)%x)
306308
307-
if (xy_local(1) >= ((1._wp - f)*airfoil_grid_l(k)%y + f*airfoil_grid_l(k - 1)%y)) then
309+
if (xy_local(2) >= ((1._wp - f)*airfoil_grid_l(k)%y + f*airfoil_grid_l(k - 1)%y)) then
308310
!!IB
309311
ib_markers_sf(i, j, 0) = patch_id
310312
end if

src/simulation/m_ibm.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ contains
396396
integer :: index
397397

398398
do q = 1, num_gps
399+
print *, q, num_gps
399400
gp = ghost_points_in(q)
400401
i = gp%loc(1)
401402
j = gp%loc(2)
@@ -445,7 +446,6 @@ contains
445446
.or. temp_loc > s_cc(index + 1)))
446447
index = index + dir
447448
if (index < -buff_size .or. index > bound) then
448-
print *, q, index, bound, buff_size
449449
print *, "temp_loc=", temp_loc, " s_cc(index)=", s_cc(index), " s_cc(index+1)=", s_cc(index + 1)
450450
print *, "Increase buff_size further in m_helper_basic (currently set to a minimum of 10)"
451451
error stop "Increase buff_size"

src/simulation/m_start_up.fpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ contains
581581
if (patch_ib(i)%c > 0) then
582582
Np = int((patch_ib(i)%p*patch_ib(i)%c/dx(0))*20) + int(((patch_ib(i)%c - patch_ib(i)%p*patch_ib(i)%c)/dx(0))*20) + 1
583583
allocate (MPI_IO_airfoil_IB_DATA%var(1:2*Np))
584-
print *, "HERE Np", Np
585584
end if
586585
end do
587586
end if
@@ -943,8 +942,6 @@ contains
943942
do j = 1, num_ibs
944943
if (patch_ib(j)%c > 0) then
945944

946-
print *, "HERE Np", Np
947-
948945
allocate (airfoil_grid_u(1:Np))
949946
allocate (airfoil_grid_l(1:Np))
950947

src/simulation/p_main.fpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ program p_main
5353
call nvtxStartRange("INIT-GPU-VARS")
5454
call s_initialize_gpu_vars()
5555
call nvtxEndRange
56-
print *, patch_ib(1)%moving_ibm, patch_ib(1)%vel(1), patch_ib(1)%vel(2), patch_ib(1)%vel(3)
5756

5857
! Setting the time-step iterator to the first time-step
5958
if (cfl_dt) then

0 commit comments

Comments
 (0)