Skip to content

Commit 7c70fd4

Browse files
Spelling and formatting
1 parent 25ee314 commit 7c70fd4

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

docs/documentation/case.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ This is enabled by adding `'elliptic_smoothing': "T",` and `'elliptic_smoothing_
309309
| `model_threshold` | Real | Ray fraction inside the model patch above which the fraction is set to one.|
310310
| `moving_ibm` | Integer | Sets the method used for IB movement. |
311311
| `vel(i)` | Real | Initial velocity of the moving IB in the i-th direction. |
312-
| `angular_vel(i)` | Real | Initial angular velcoity of the moving IB in the i-th direction. |
312+
| `angular_vel(i)` | Real | Initial angular velocity of the moving IB in the i-th direction. |
313313

314314
These parameters should be prepended with `patch_ib(j)%` where $j$ is the patch index.
315315

@@ -336,9 +336,9 @@ Additional details on this specification can be found in [The Naca Airfoil Serie
336336

337337
- `moving_ibm` sets the method by which movement will be applied to the immersed boundary. Using 0 will result in no movement. Using 1 will result 1-way coupling where the boundary moves at a constant rate and applied forces to the fluid based upon it's own motion. In 1-way coupling, the fluid does not apply forces back onto the IB.
338338

339-
- `vel(i)` is the initial linear velocity of the IB in the x, y, z direction for i=1, 2, 3. When `moving_ibm` equals 1, this velcoity is constant.
339+
- `vel(i)` is the initial linear velocity of the IB in the x, y, z direction for i=1, 2, 3. When `moving_ibm` equals 1, this velocity is constant.
340340

341-
- `angular_vel(i)` is the initial angular velocity of the IB about the x, y, z axes for i=1, 2, 3 in radians per second. When `moving_ibm` equals 1, this angular velcoity is constant.
341+
- `angular_vel(i)` is the initial angular velocity of the IB about the x, y, z axes for i=1, 2, 3 in radians per second. When `moving_ibm` equals 1, this angular velocity is constant.
342342

343343
### 5. Fluid Material’s
344344

src/common/m_mpi_common.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ contains
486486
! Performing the reduction procedure
487487
if (loc(var_loc) == loc(var_glb)) then
488488
call MPI_Allreduce(MPI_IN_PLACE, var_glb, num_vectors*vector_length, &
489-
mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr)
489+
mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr)
490490
else
491491
call MPI_Allreduce(var_loc, var_glb, num_vectors*vector_length, &
492-
mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr)
492+
mpi_p, MPI_SUM, MPI_COMM_WORLD, ierr)
493493
end if
494494
495495
#endif

src/simulation/m_ibm.fpp

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ contains
202202
do j = 0, m
203203
do k = 0, n
204204
do l = 0, p
205-
if (ib_markers%sf(j,k,l) == patch_id) then
205+
if (ib_markers%sf(j, k, l) == patch_id) then
206206
q_prim_vf(E_idx)%sf(j, k, l) = 1._wp
207207
end if
208208
end do
@@ -264,8 +264,8 @@ contains
264264
if (patch_ib(patch_id)%moving_ibm == 0) then
265265
q_prim_vf(E_idx)%sf(j, k, l) = pres_IP
266266
else
267-
! TODO :: improve for two fluid
268-
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,:)))
267+
! TODO :: improve for two fluid
268+
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, :)))
269269
end if
270270
end do
271271

@@ -1019,21 +1019,21 @@ contains
10191019
if (patch_ib(ib_idx)%moving_ibm == 2) then
10201020
if (num_dims == 3) then
10211021
radial_vector = [x_cc(i), y_cc(j), z_cc(k)] - [patch_ib(ib_idx)%x_centroid, patch_ib(ib_idx)%y_centroid, patch_ib(ib_idx)%z_centroid] ! get the vector pointing to the grid cell
1022-
else
1022+
else
10231023
radial_vector = [x_cc(i), y_cc(j), 0._wp] - [patch_ib(ib_idx)%x_centroid, patch_ib(ib_idx)%y_centroid, 0._wp] ! get the vector pointing to the grid cell
10241024
end if
1025-
pressure_divergence(1) = (pressure(i+1, j, k) - pressure(i-1, j, k)) / (2._wp * x_cc(i))
1026-
pressure_divergence(2) = (pressure(i, j+1, k) - pressure(i, j-1, k)) / (2._wp * y_cc(j))
1027-
cell_volume = x_cc(i) * y_cc(j)
1025+
pressure_divergence(1) = (pressure(i + 1, j, k) - pressure(i - 1, j, k))/(2._wp*x_cc(i))
1026+
pressure_divergence(2) = (pressure(i, j + 1, k) - pressure(i, j - 1, k))/(2._wp*y_cc(j))
1027+
cell_volume = x_cc(i)*y_cc(j)
10281028
if (num_dims == 3) then
1029-
pressure_divergence(3) = (pressure(i, j, k+1) - pressure(i, j, k-1)) / (2._wp * z_cc(k))
1030-
cell_volume = cell_volume * z_cc(k)
1029+
pressure_divergence(3) = (pressure(i, j, k + 1) - pressure(i, j, k - 1))/(2._wp*z_cc(k))
1030+
cell_volume = cell_volume*z_cc(k)
10311031
else
10321032
pressure_divergence(3) = 0._wp
10331033
end if
10341034
1035-
forces(ib_idx, :) = forces(ib_idx, :) - (pressure_divergence * cell_volume)
1036-
torques(ib_idx, :) = torques(ib_idx, :) + (cross_product(radial_vector, pressure_divergence) * cell_volume)
1035+
forces(ib_idx, :) = forces(ib_idx, :) - (pressure_divergence*cell_volume)
1036+
torques(ib_idx, :) = torques(ib_idx, :) + (cross_product(radial_vector, pressure_divergence)*cell_volume)
10371037
end if
10381038
end if
10391039
end do
@@ -1068,9 +1068,9 @@ contains
10681068
10691069
real(wp), dimension(3), optional :: axis !< the axis about which we compute the moment. Only required in 3D.
10701070
integer, intent(in) :: ib_marker
1071-
1072-
real (wp) :: moment, distance_to_axis, cell_volume
1073-
real (wp), dimension(3) :: position, closest_point_along_axis, vector_to_axis
1071+
1072+
real(wp) :: moment, distance_to_axis, cell_volume
1073+
real(wp), dimension(3) :: position, closest_point_along_axis, vector_to_axis
10741074
integer :: i, j, k, count
10751075
10761076
if (p == 0) then
@@ -1080,26 +1080,25 @@ contains
10801080
patch_ib(ib_marker)%moment = 1._wp
10811081
return
10821082
else
1083-
axis = axis / sqrt(sum(axis))
1083+
axis = axis/sqrt(sum(axis))
10841084
end if
1085-
1085+
10861086
! if the IB is in 2D or a 3D sphere, we can compute this exactly
10871087
if (patch_ib(ib_marker)%geometry == 2) then ! circle
1088-
patch_ib(ib_marker)%moment = 0.5 * patch_ib(ib_marker)%mass * (patch_ib(ib_marker)%radius)**2
1088+
patch_ib(ib_marker)%moment = 0.5*patch_ib(ib_marker)%mass*(patch_ib(ib_marker)%radius)**2
10891089
elseif (patch_ib(ib_marker)%geometry == 3) then ! rectangle
1090-
patch_ib(ib_marker)%moment = patch_ib(i)%mass * (patch_ib(ib_marker)%length_x**2 + patch_ib(ib_marker)%length_y**2) / 6._wp
1090+
patch_ib(ib_marker)%moment = patch_ib(i)%mass*(patch_ib(ib_marker)%length_x**2 + patch_ib(ib_marker)%length_y**2)/6._wp
10911091
elseif (patch_ib(ib_marker)%geometry == 8) then ! sphere
1092-
patch_ib(ib_marker)%moment = 0.4 * patch_ib(ib_marker)%mass * (patch_ib(ib_marker)%radius)**2
1093-
1092+
patch_ib(ib_marker)%moment = 0.4*patch_ib(ib_marker)%mass*(patch_ib(ib_marker)%radius)**2
1093+
10941094
else ! we do not have an analytic moment of inertia calculation and need to approximate it directly
10951095
count = 0
10961096
moment = 0._wp
10971097
cell_volume = (x_cc(1) - x_cc(0))*(y_cc(1) - y_cc(0)) ! computed without grid stretching. Update in the loop to perform with stretching
10981098
if (p /= 0) then
1099-
cell_volume = cell_volume * (z_cc(1) - z_cc(0))
1099+
cell_volume = cell_volume*(z_cc(1) - z_cc(0))
11001100
end if
11011101
1102-
11031102
$:GPU_PARALLEL_LOOP(private='[position,closest_point_along_axis,vector_to_axis,distance_to_axis]', copy='[moment,count]', copyin='[ib_marker,cell_volume,axis]', collapse=3)
11041103
do i = 0, m
11051104
do j = 0, j
@@ -1130,7 +1129,7 @@ contains
11301129
$:END_GPU_PARALLEL_LOOP()
11311130
11321131
! write the final moment assuming the points are all uniform density
1133-
patch_ib(ib_marker)%moment = moment * patch_ib(ib_marker)%mass / (count * cell_volume)
1132+
patch_ib(ib_marker)%moment = moment*patch_ib(ib_marker)%mass/(count*cell_volume)
11341133
$:GPU_UPDATE(device='[patch_ib(ib_marker)%moment]')
11351134
end if
11361135

src/simulation/m_time_steppers.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,9 @@ contains
632632
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)
633633

634634
! update the angular velocity with the torque value
635-
patch_ib(i)%angular_vel = (patch_ib(i)%angular_vel * patch_ib(i)%moment) + (rk_coef(s, 3)*dt*patch_ib(i)%torque/rk_coef(s, 4)) ! add the torque to the angular momentum
635+
patch_ib(i)%angular_vel = (patch_ib(i)%angular_vel*patch_ib(i)%moment) + (rk_coef(s, 3)*dt*patch_ib(i)%torque/rk_coef(s, 4)) ! add the torque to the angular momentum
636636
call s_compute_moment_of_inertia(i, patch_ib(i)%angular_vel) ! update the moment of inertia to be based on the direction of the angular momentum
637-
patch_ib(i)%angular_vel = patch_ib(i)%angular_vel / patch_ib(i)%moment ! convert back to angular velocity with the new moment of inertia
637+
patch_ib(i)%angular_vel = patch_ib(i)%angular_vel/patch_ib(i)%moment ! convert back to angular velocity with the new moment of inertia
638638
end if
639639

640640
! Update the angle of the IB

0 commit comments

Comments
 (0)