Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
24a9c8c
add bubble advection
wilfonba Apr 23, 2025
614c6c5
small updates
wilfonba Apr 24, 2025
5332d2c
working on GPUs
wilfonba Apr 25, 2025
68214e3
more models
wilfonba Apr 29, 2025
950752c
first changes
wilfonba Apr 30, 2025
2667687
bug fixes
wilfonba May 1, 2025
9814a7f
update mass calculation
wilfonba May 1, 2025
2c5d763
more refactoring
wilfonba May 1, 2025
97e4f03
bug fix
wilfonba May 5, 2025
03880d0
Merge remote-tracking branch 'upstream/master' into MPIRefactor
wilfonba May 5, 2025
5644605
more refactoring
wilfonba May 5, 2025
78043ab
more refactoring
wilfonba May 5, 2025
f2e5692
bug fixes and IBM halo exchange fix
wilfonba May 6, 2025
5e53d53
gpu fixes
wilfonba May 6, 2025
697a0ef
additional code shortening
wilfonba May 8, 2025
1ff32f0
remove even more code
wilfonba May 8, 2025
85273cd
format and bug fixes
wilfonba May 9, 2025
5bb1288
garbage cleanup
wilfonba May 9, 2025
a4c93bd
Merge branch 'master' into MPIRefactor
sbryngelson May 10, 2025
9adc5f8
bug fixes
wilfonba May 14, 2025
6448b37
fix no mpi test
wilfonba May 14, 2025
a96f4c6
bug fixes
wilfonba May 19, 2025
b817ef1
remove extra files
wilfonba May 19, 2025
b5f8201
merge
wilfonba May 19, 2025
5cf0fef
fix build + toolchain
wilfonba May 19, 2025
645f2cf
fix boundary_common on Frontier
wilfonba May 22, 2025
6f2e0f1
merge
wilfonba May 22, 2025
b3c8e8a
wall BCs for EL and bug fixes
wilfonba May 26, 2025
19f6042
Merge branch 'MPIRefactor' into MovingELBubbles
wilfonba May 26, 2025
d58d5a8
bug fix for moving bubbles
wilfonba Jun 1, 2025
22ba445
drag models
wilfonba Jun 1, 2025
854484a
QBMMM BC Bug Fix
wilfonba Jun 1, 2025
35ac235
IBM support for EL Bubbles
wilfonba Jun 2, 2025
a02fe6d
stuff
wilfonba Jun 2, 2025
27d8a4a
MPI EL on CPUs
wilfonba Jun 10, 2025
0822785
remove file
wilfonba Jun 10, 2025
9390c88
3D transfer list
wilfonba Jun 11, 2025
aa259f1
bug fixes
wilfonba Jun 11, 2025
abf8261
Simple cases work
wilfonba Jun 14, 2025
8ebd51c
Merge remote-tracking branch 'upstream/master' into MovingELBubbles
wilfonba Jun 14, 2025
c062310
fix build
wilfonba Jun 14, 2025
ed850c5
Merge remote-tracking branch 'upstream/master' into MovingELBubbles
wilfonba Jun 14, 2025
7326a9d
Merge remote-tracking branch 'upstream/master' into MovingELBubbles
wilfonba Jun 16, 2025
e1e0104
remove comments, fix communication, and refactor transfer lists
wilfonba Jun 16, 2025
7df40fd
comments and GPU MPI
wilfonba Jun 22, 2025
e0d7398
3D Transfer list
wilfonba Jun 24, 2025
fc94cfa
GPU particle MPI
wilfonba Jun 24, 2025
2e89526
improve EL I/O and silo output
wilfonba Jun 25, 2025
817cf75
Merge branch 'MovingELBubbles' of github.com:wilfonba/MFC-Wilfong int…
wilfonba Jun 25, 2025
40009ab
empty array writing and perlin noise ICs
wilfonba Jun 29, 2025
defd38a
Merge remote-tracking branch 'upstream/master' into MovingELBubblesSa…
wilfonba Jul 8, 2025
50e9772
gpu macros and minro fixes
wilfonba Jul 8, 2025
35f6b01
adap dt moving bubbles and 4th order differences
wilfonba Jul 11, 2025
b4e0272
bug fix
wilfonba Jul 11, 2025
c9a76d2
merge conflict resolution
Jul 27, 2025
679926a
finish merge and test
Jul 27, 2025
ac513a3
Merge remote-tracking branch 'upstream/master' into MovingELBubblesSa…
wilfonba Sep 1, 2025
ca56a8f
clean merge
wilfonba Sep 1, 2025
fff74d8
add perturbed IC stuff
wilfonba Sep 2, 2025
56c9ada
Merge remote-tracking branch 'upstream/master' into MovingELBubblesSa…
wilfonba Sep 2, 2025
e9a6525
fix for GNU
wilfonba Sep 2, 2025
69b51ea
periodic BCs mostly working
wilfonba Sep 15, 2025
58a0cba
periodic BCs working with non blocking communication
wilfonba Sep 17, 2025
9b70f9d
bug fixes for indexing and GPU communication
wilfonba Sep 18, 2025
49c194f
improve run_time.inf output
wilfonba Sep 24, 2025
60375fb
bug fixes for run_time.inf
wilfonba Sep 25, 2025
8ffc20c
added options and drag models
wilfonba Oct 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/common/m_boundary_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1942,6 +1942,21 @@ contains
offset_x%beg = buff_size; offset_x%end = buff_size
offset_y%beg = buff_size; offset_y%end = buff_size
offset_z%beg = buff_size; offset_z%end = buff_size

#ifdef MFC_MPI
! Populate global domain boundaries with stretched grids
call s_mpi_allreduce_min(x_cb(-1), glb_bounds(1)%beg)
call s_mpi_allreduce_max(x_cb(m), glb_bounds(1)%end)

if (n > 0) then
call s_mpi_allreduce_min(y_cb(-1), glb_bounds(2)%beg)
call s_mpi_allreduce_max(y_cb(n), glb_bounds(2)%end)
if (p > 0) then
call s_mpi_allreduce_min(z_cb(-1), glb_bounds(3)%beg)
call s_mpi_allreduce_max(z_cb(p), glb_bounds(3)%end)
end if
end if
#endif
#endif

#ifndef MFC_PRE_PROCESS
Expand Down
8 changes: 5 additions & 3 deletions src/common/m_constants.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module m_constants
real(wp), parameter :: small_alf = 1.e-11_wp !< Small alf tolerance
real(wp), parameter :: pi = 3.141592653589793_wp !< Pi
real(wp), parameter :: verysmall = 1.e-12_wp !< Very small number
real(wp), parameter :: Re_b_min = 1.e-6_wp !< minimum bubble reynolds number for drag coeff calc.

integer, parameter :: num_stcls_min = 5 !< Minimum # of stencils
integer, parameter :: path_len = 400 !< Maximum path length
Expand All @@ -21,7 +22,7 @@ module m_constants
integer, parameter :: fourier_rings = 5 !< Fourier filter ring limit
integer, parameter :: num_fluids_max = 10 !< Maximum number of fluids in the simulation
integer, parameter :: num_probes_max = 10 !< Maximum number of flow probes in the simulation
integer, parameter :: num_patches_max = 10
integer, parameter :: num_patches_max = 20
integer, parameter :: num_bc_patches_max = 10
integer, parameter :: pathlen_max = 400
integer, parameter :: nnode = 4 !< Number of QBMM nodes
Expand Down Expand Up @@ -59,8 +60,9 @@ module m_constants
real(wp), parameter :: initial_distance_buffer = 1.e12_wp !< Initialized levelset distance for the shortest path pair algorithm

! Lagrange bubbles constants
integer, parameter :: mapCells = 3 !< Number of cells around the bubble where the smoothening function will have effect
real(wp), parameter :: R_uni = 8314._wp !< Universal gas constant - J/kmol/K
integer, parameter :: mapCells = 3 !< Number of cells around the bubble where the smoothening function will have effect
real(wp), parameter :: R_uni = 8314._wp ! Universal gas constant - J/kmol/K
integer, parameter :: lag_io_vars = 21 ! Number of variables per particle for MPI_IO

! Strang Splitting constants
real(wp), parameter :: dflt_adap_dt_tol = 1.e-4_wp !< Default tolerance for adaptive step size
Expand Down
6 changes: 6 additions & 0 deletions src/common/m_derived_types.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ module m_derived_types
logical :: write_bubbles !< Write files to track the bubble evolution each time step
logical :: write_bubbles_stats !< Write the maximum and minimum radius of each bubble
integer :: nBubs_glb !< Global number of bubbles
integer :: vel_model !< Particle velocity model
integer :: drag_model !< Particle drag model
logical :: pressure_force !< Include pressure force translational motion
logical :: gravity_force !< Include gravity force in translational motion
logical :: momentum_transfer_force !< Include momentum transfer from radial dynamics in translational motion
real(wp) :: c_d !< Drag coefficient
real(wp) :: epsilonb !< Standard deviation scaling for the gaussian function
real(wp) :: charwidth !< Domain virtual depth (z direction, for 2D simulations)
real(wp) :: valmaxvoid !< Maximum void fraction permitted
Expand Down
7 changes: 4 additions & 3 deletions src/common/m_helper_basic.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ contains

pure subroutine s_configure_coordinate_bounds(recon_type, weno_polyn, muscl_polyn, &
igr_order, buff_size, idwint, idwbuff, &
viscous, bubbles_lagrange, m, n, p, num_dims, igr, ib)
viscous, bubbles_lagrange, m, n, p, num_dims, &
igr, ib, fd_number)

integer, intent(in) :: recon_type, weno_polyn, muscl_polyn
integer, intent(in) :: m, n, p, num_dims, igr_order
integer, intent(in) :: m, n, p, num_dims, igr_order, fd_number
integer, intent(inout) :: buff_size
type(int_bounds_info), dimension(3), intent(inout) :: idwint, idwbuff
logical, intent(in) :: viscous, bubbles_lagrange
Expand All @@ -140,7 +141,7 @@ contains

! Correction for smearing function in the lagrangian subgrid bubble model
if (bubbles_lagrange) then
buff_size = max(buff_size, 6)
buff_size = max(buff_size + fd_number, 6 + fd_number)
end if

if (ib) then
Expand Down
70 changes: 68 additions & 2 deletions src/common/m_mpi_common.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,21 @@ contains
impure subroutine s_mpi_reduce_stability_criteria_extrema(icfl_max_loc, &
vcfl_max_loc, &
Rc_min_loc, &
ccfl_max_loc, &
icfl_max_glb, &
vcfl_max_glb, &
Rc_min_glb)
Rc_min_glb, &
ccfl_max_glb)

real(wp), intent(in) :: icfl_max_loc
real(wp), intent(in) :: vcfl_max_loc
real(wp), intent(in) :: Rc_min_loc
real(wp), intent(in) :: ccfl_max_loc

real(wp), intent(out) :: icfl_max_glb
real(wp), intent(out) :: vcfl_max_glb
real(wp), intent(out) :: Rc_min_glb
real(wp), intent(out) :: ccfl_max_glb

#ifdef MFC_SIMULATION
#ifdef MFC_MPI
Expand All @@ -448,6 +452,12 @@ contains
MPI_COMM_WORLD, ierr)
end if

if (surface_tension) then
call MPI_REDUCE(ccfl_max_loc, ccfl_max_glb, 1, &
mpi_p, MPI_MAX, 0, &
MPI_COMM_WORLD, ierr)
end if

#else

icfl_max_glb = icfl_max_loc
Expand All @@ -457,11 +467,35 @@ contains
Rc_min_glb = Rc_min_loc
end if

if (surface_tension) ccfl_max_glb = ccfl_max_loc

#endif
#endif

end subroutine s_mpi_reduce_stability_criteria_extrema

!> The following subroutine takes the inputted variable and
!! determines its sum on the entire computational domain.
!! @param var_loc holds the local value to be reduced among
!! all the processors in communicator. On output, the variable holds
!! the sum, reduced amongst all of the local values.
subroutine s_mpi_reduce_int_sum(var_loc, sum)

integer, intent(inout) :: var_loc
integer, intent(inout) :: sum

#ifdef MFC_MPI
integer :: ierr !< Generic flag used to identify and report MPI errors

! Performing reduction procedure and eventually storing its result
! into the variable that was initially inputted into the subroutine
call MPI_REDUCE(var_loc, sum, 1, MPI_INTEGER, &
MPI_SUM, 0, MPI_COMM_WORLD, ierr)

#endif

end subroutine s_mpi_reduce_int_sum

!> The following subroutine takes the input local variable
!! from all processors and reduces to the sum of all
!! values. The reduced variable is recorded back onto the
Expand Down Expand Up @@ -1137,9 +1171,17 @@ contains
integer :: recon_order !<
!! WENO or MUSCL reconstruction order

integer :: i, j !< Generic loop iterators
integer :: i, j, k !< Generic loop iterators
integer :: ierr !< Generic flag used to identify and report MPI errors

! temp array to store neighbor rank coordinates
integer, dimension(1:num_dims) :: neighbor_coords

! Zeroing out communication needs for moving EL bubbles/particles
nidx(1)%beg = 0; nidx(1)%end = 0
nidx(2)%beg = 0; nidx(2)%end = 0
nidx(3)%beg = 0; nidx(3)%end = 0

if (recon_type == WENO_TYPE) then
recon_order = weno_order
else
Expand Down Expand Up @@ -1316,6 +1358,7 @@ contains
call MPI_CART_RANK(MPI_COMM_CART, proc_coords, &
bc_z%beg, ierr)
proc_coords(3) = proc_coords(3) + 1
nidx(3)%beg = -1
end if

! Boundary condition at the end
Expand All @@ -1324,6 +1367,7 @@ contains
call MPI_CART_RANK(MPI_COMM_CART, proc_coords, &
bc_z%end, ierr)
proc_coords(3) = proc_coords(3) - 1
nidx(3)%end = 1
end if

#ifdef MFC_POST_PROCESS
Expand Down Expand Up @@ -1455,6 +1499,7 @@ contains
call MPI_CART_RANK(MPI_COMM_CART, proc_coords, &
bc_y%beg, ierr)
proc_coords(2) = proc_coords(2) + 1
nidx(2)%beg = -1
end if

! Boundary condition at the end
Expand All @@ -1463,6 +1508,7 @@ contains
call MPI_CART_RANK(MPI_COMM_CART, proc_coords, &
bc_y%end, ierr)
proc_coords(2) = proc_coords(2) - 1
nidx(2)%end = 1
end if

#ifdef MFC_POST_PROCESS
Expand Down Expand Up @@ -1548,13 +1594,15 @@ contains
proc_coords(1) = proc_coords(1) - 1
call MPI_CART_RANK(MPI_COMM_CART, proc_coords, bc_x%beg, ierr)
proc_coords(1) = proc_coords(1) + 1
nidx(1)%beg = -1
end if

! Boundary condition at the end
if (proc_coords(1) < num_procs_x - 1 .or. (bc_x%end == BC_PERIODIC .and. num_procs_x > 1)) then
proc_coords(1) = proc_coords(1) + 1
call MPI_CART_RANK(MPI_COMM_CART, proc_coords, bc_x%end, ierr)
proc_coords(1) = proc_coords(1) - 1
nidx(1)%end = 1
end if

#ifdef MFC_POST_PROCESS
Expand Down Expand Up @@ -1600,6 +1648,24 @@ contains
end if
#endif
end if

@:ALLOCATE(neighbor_ranks(nidx(1)%beg:nidx(1)%end, &
nidx(2)%beg:nidx(2)%end, &
nidx(3)%beg:nidx(3)%end))

do k = nidx(3)%beg, nidx(3)%end
do j = nidx(2)%beg, nidx(2)%end
do i = nidx(1)%beg, nidx(1)%end
if (abs(i) + abs(j) + abs(k) > 0) then
neighbor_coords(1) = proc_coords(1) + i
if (num_dims > 1) neighbor_coords(2) = proc_coords(2) + j
if (num_dims > 2) neighbor_coords(3) = proc_coords(3) + k
call MPI_CART_RANK(MPI_COMM_CART, neighbor_coords, &
neighbor_ranks(i, j, k), ierr)
end if
end do
end do
end do
#endif

end subroutine s_mpi_decompose_computational_domain
Expand Down
Loading