Skip to content

Commit c7c8d8a

Browse files
Formatting and spelling
1 parent c6c55b7 commit c7c8d8a

File tree

2 files changed

+32
-33
lines changed

2 files changed

+32
-33
lines changed

src/common/m_compute_levelset.fpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ contains
8787
do i = 0, m
8888
do j = 0, n
8989
xy_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, 0._wp] ! get coordinate frame centered on IB
90-
xy_local = matmul(inverse_rotation, xy_local) ! rotate the frame into the IB's coordiantes
90+
xy_local = matmul(inverse_rotation, xy_local) ! rotate the frame into the IB's coordinate
9191
9292
if (xy_local(2) >= 0._wp) then
9393
! finds the location on the airfoil grid with the minimum distance (closest)
9494
do k = 1, Np
9595
dist_vec(1) = xy_local(1) - airfoil_grid_u(k)%x
9696
dist_vec(2) = xy_local(2) - airfoil_grid_u(k)%y
97-
dist_vec(3) = 0
97+
dist_vec(3) = 0._wp
9898
dist = sqrt(sum(dist_vec**2))
9999
if (k == 1) then
100100
global_dist = dist
@@ -135,10 +135,10 @@ contains
135135
136136
levelset%sf(i, j, 0, ib_patch_id) = dist
137137
if (f_approx_equal(dist, 0._wp)) then
138-
levelset_norm%sf(i, j, 0, ib_patch_id, :) = 0
138+
levelset_norm%sf(i, j, 0, ib_patch_id, :) = 0._wp
139139
else
140140
levelset_norm%sf(i, j, 0, ib_patch_id, :) = &
141-
matmul(rotation, dist_vec(:)/dist) ! convert the normal vector back to global grid coordinates
141+
matmul(rotation, dist_vec(:))/dist ! convert the normal vector back to global grid coordinates
142142
end if
143143
144144
end do
@@ -179,7 +179,7 @@ contains
179179
do i = 0, m
180180
181181
xyz_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, z_cc(l) - z_centroid] ! get coordinate frame centered on IB
182-
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordiantes
182+
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinates
183183

184184
if (xyz_local(2) >= y_centroid) then
185185
do k = 1, Np
@@ -288,9 +288,9 @@ contains
288288
(xy_local(2) > bottom_left(2) .and. xy_local(2) < top_right(2))) then
289289

290290
side_dists(1) = bottom_left(1) - xy_local(1)
291-
side_dists(2) = top_right(1) - xy_local(1)
291+
side_dists(2) = top_right(1) - xy_local(1)
292292
side_dists(3) = bottom_left(2) - xy_local(2)
293-
side_dists(4) = top_right(2) - xy_local(2)
293+
side_dists(4) = top_right(2) - xy_local(2)
294294
min_dist = initial_distance_buffer
295295
idx = 1
296296

@@ -366,7 +366,7 @@ contains
366366
do k = 0, p
367367

368368
xyz_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, z_cc(k) - z_centroid] ! get coordinate frame centered on IB
369-
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordiantes
369+
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinate
370370
371371
if ((xyz_local(1) > Left .and. xyz_local(1) < Right) .or. &
372372
(xyz_local(2) > Bottom .and. xyz_local(2) < Top) .or. &
@@ -388,13 +388,13 @@ contains
388388
! and this code should be cleaned up. I verified this behavior
389389
! with tests.
390390
if (f_approx_equal(min_dist, abs(side_dists(1)))) then
391-
levelset%sf(i, j, k, ib_patch_id) = side_dists(1)
392-
if (f_approx_equal(side_dists(1), 0._wp)) then
393-
levelset_norm%sf(i, j, k, ib_patch_id, 1) = 0._wp
394-
else
395-
levelset_norm%sf(i, j, k, ib_patch_id, 1) = side_dists(1)/ &
396-
abs(side_dists(1))
397-
end if
391+
levelset%sf(i, j, k, ib_patch_id) = side_dists(1)
392+
if (f_approx_equal(side_dists(1), 0._wp)) then
393+
levelset_norm%sf(i, j, k, ib_patch_id, 1) = 0._wp
394+
else
395+
levelset_norm%sf(i, j, k, ib_patch_id, 1) = side_dists(1)/ &
396+
abs(side_dists(1))
397+
end if
398398
399399
else if (f_approx_equal(min_dist, abs(side_dists(2)))) then
400400
levelset%sf(i, j, k, ib_patch_id) = side_dists(2)
@@ -422,7 +422,7 @@ contains
422422
levelset_norm%sf(i, j, k, ib_patch_id, 2) = -side_dists(4)/ &
423423
abs(side_dists(4))
424424
end if
425-
425+
426426
else if (f_approx_equal(min_dist, abs(side_dists(5)))) then
427427
levelset%sf(i, j, k, ib_patch_id) = side_dists(5)
428428
if (f_approx_equal(side_dists(5), 0._wp)) then
@@ -442,7 +442,7 @@ contains
442442
end if
443443
end if
444444
levelset_norm%sf(i, j, 0, ib_patch_id, :) = &
445-
matmul(rotation, levelset_norm%sf(i, j, 0, ib_patch_id, :))
445+
matmul(rotation, levelset_norm%sf(i, j, 0, ib_patch_id, :))
446446
end if
447447
end do
448448
end do
@@ -536,7 +536,7 @@ contains
536536
do j = 0, n
537537
do k = 0, p
538538
xyz_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, z_cc(k) - z_centroid] ! get coordinate frame centered on IB
539-
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordiantes
539+
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinates
540540

541541
! get distance to flat edge of cylinder
542542
side_pos = dot_product(xyz_local, dist_sides_vec)
@@ -564,7 +564,7 @@ contains
564564
norm2(levelset_norm%sf(i, j, k, ib_patch_id, :))
565565
end if
566566
levelset_norm%sf(i, j, k, ib_patch_id, :) = &
567-
matmul(rotation, levelset_norm%sf(i, j, k, ib_patch_id, :))
567+
matmul(rotation, levelset_norm%sf(i, j, k, ib_patch_id, :))
568568
end do
569569
end do
570570
end do

src/common/m_ib_patches.fpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,9 @@ contains
207207
Np = Np1 + Np2 + 1
208208

209209
if (.not. allocated(airfoil_grid_u)) then
210-
allocate (airfoil_grid_u(1:Np))
211-
allocate (airfoil_grid_l(1:Np))
210+
allocate (airfoil_grid_u(1:Np))
211+
allocate (airfoil_grid_l(1:Np))
212212
end if
213-
214213

215214
! TODO :: The below instantiations are already handles by the loop below
216215
airfoil_grid_u(1)%x = 0._wp
@@ -222,7 +221,7 @@ contains
222221
eta = 1._wp
223222

224223
do i = 1, Np1 + Np2 - 1
225-
! 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.
224+
! TODO :: This allocated 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.
226225
if (i <= Np1) then
227226
xc = i*(pa*ca_in/Np1)
228227
xa = xc/ca_in
@@ -268,7 +267,7 @@ contains
268267
do j = 0, n
269268
do i = 0, m
270269
xy_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, 0._wp] ! get coordinate frame centered on IB
271-
xy_local = matmul(inverse_rotation, xy_local) ! rotate the frame into the IB's coordiantes
270+
xy_local = matmul(inverse_rotation, xy_local) ! rotate the frame into the IB's coordinates
272271
273272
if (xy_local(1) >= 0._wp .and. xy_local(1) <= ca_in) then
274273
xa = xy_local(1)/ca_in
@@ -417,7 +416,7 @@ contains
417416
do j = 0, n
418417
do i = 0, m
419418
xyz_local = [x_cc(i) - x_centroid, y_cc(j) - y_centroid, z_cc(l) - z_centroid] ! get coordinate frame centered on IB
420-
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordiantes
419+
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinates
421420

422421
if (xyz_local(3) >= z_min .and. xyz_local(3) <= z_max) then
423422

@@ -630,11 +629,11 @@ contains
630629
! Computing the beginning and the end x-, y- and z-coordinates of
631630
! the cuboid based on its centroid and lengths
632631
x_boundary%beg = -0.5_wp*length_x
633-
x_boundary%end = 0.5_wp*length_x
632+
x_boundary%end = 0.5_wp*length_x
634633
y_boundary%beg = -0.5_wp*length_y
635-
y_boundary%end = 0.5_wp*length_y
634+
y_boundary%end = 0.5_wp*length_y
636635
z_boundary%beg = -0.5_wp*length_z
637-
z_boundary%end = 0.5_wp*length_z
636+
z_boundary%end = 0.5_wp*length_z
638637

639638
! Since the cuboidal patch does not allow for its boundaries to get
640639
! smoothed out, the pseudo volume fraction is set to 1 to make sure
@@ -658,7 +657,7 @@ contains
658657
cart_z = z_cc(k)
659658
end if
660659
xyz_local = [x_cc(i) - x_centroid, cart_y - y_centroid, cart_z - z_centroid] ! get coordinate frame centered on IB
661-
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordiantes
660+
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinates
662661
663662
if (x_boundary%beg <= xyz_local(1) .and. &
664663
x_boundary%end >= xyz_local(1) .and. &
@@ -712,11 +711,11 @@ contains
712711
! Computing the beginning and the end x-, y- and z-coordinates of
713712
! the cylinder based on its centroid and lengths
714713
x_boundary%beg = -0.5_wp*length_x
715-
x_boundary%end = 0.5_wp*length_x
714+
x_boundary%end = 0.5_wp*length_x
716715
y_boundary%beg = -0.5_wp*length_y
717-
y_boundary%end = 0.5_wp*length_y
716+
y_boundary%end = 0.5_wp*length_y
718717
z_boundary%beg = -0.5_wp*length_z
719-
z_boundary%end = 0.5_wp*length_z
718+
z_boundary%end = 0.5_wp*length_z
720719
721720
! Initializing the pseudo volume fraction value to 1. The value will
722721
! be modified as the patch is laid out on the grid, but only in the
@@ -738,7 +737,7 @@ contains
738737
cart_z = z_cc(k)
739738
end if
740739
xyz_local = [x_cc(i) - x_centroid, cart_y - y_centroid, cart_z - z_centroid] ! get coordinate frame centered on IB
741-
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordiantes
740+
xyz_local = matmul(inverse_rotation, xyz_local) ! rotate the frame into the IB's coordinates
742741
743742
if (((.not. f_is_default(length_x) .and. &
744743
xyz_local(2)**2 &

0 commit comments

Comments
 (0)