Skip to content

bubbles clean-up: remove R0_type and V0 #963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ Implementation of the parameters into the model follow [Ando (2010)](references.
| `polydisperse` | Logical | Polydispersity in equilibrium bubble radius R0 |
| `nb` | Integer | Number of bins: [1] Monodisperse; [$>1$] Polydisperse |
| `poly_sigma` | Real | Standard deviation for probability density function of polydisperse bubble populations |
| `R0_type` | Integer | Quadrature rule for probability density function of polydisperse bubble populations |
| `Ca` | Real | Cavitation number |
| `Web` | Real | Weber number |
| `Re_inv` | Real | Inverse Reynolds number |
Expand All @@ -761,15 +760,12 @@ When ``polytropic = 'F'``, the gas compression is modeled as non-polytropic due
- `thermal` specifies a model for heat transfer across the bubble interface by an integer from 1 through 3.
`thermal = 1`, `2`, and `3` correspond to no heat transfer (adiabatic gas compression), isothermal heat transfer, and heat transfer with a constant heat transfer coefficient based on [Preston et al., 2007](references.md), respectively.

- `polydisperse` activates polydispersity in the bubble model through a probability density function (PDF) of the equilibrium bubble radius.
- `polydisperse` activates polydispersity in the bubble model through a probability density function (PDF) of the equilibrium bubble radius. Simpson's rule is used for integrating the log-normal PDF of equilibrium bubble radius for polydisperse populations.

- `R0ref` specifies the reference bubble radius.

- `nb` specifies the number of discrete bins that define the probability density function (PDF) of the equilibrium bubble radius.

- `R0_type` specifies the quadrature rule for integrating the log-normal PDF of equilibrium bubble radius for polydisperse populations.
`R0_type = 1` corresponds to Simpson's rule.

- `poly_sigma` specifies the standard deviation of the log-normal PDF of equilibrium bubble radius for polydisperse populations.

- `Ca`, `Web`, and `Re_inv` respectively specify the Cavitation number, Weber number, and the inverse Reynolds number that characterize the offset of the gas pressure from the vapor pressure, surface tension, and liquid viscosity when the polytropic gas compression model is used.
Expand Down
1 change: 0 additions & 1 deletion examples/1D_poly_bubscreen/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
"bubbles_euler": "T",
"bubble_model": 2,
"polytropic": "T",
"R0_type": 1,
"thermal": 3,
"R0ref": myr0,
"nb": 1,
Expand Down
1 change: 0 additions & 1 deletion examples/1D_qbmm/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
"bubble_model": 2,
"polytropic": "F",
"polydisperse": "T",
"R0_type": 1,
"poly_sigma": 0.3,
"thermal": 3,
"R0ref": myr0,
Expand Down
1 change: 0 additions & 1 deletion examples/2D_bubbly_steady_shock/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@
"bubble_model": 2,
"polytropic": "T",
"polydisperse": "F",
"R0_type": 1,
"poly_sigma": 0.3,
"thermal": 3,
"R0ref": x0,
Expand Down
1 change: 0 additions & 1 deletion examples/2D_whale_bubble_annulus/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@
"bubbles_euler": "T",
"bubble_model": 3,
"polytropic": "T",
"R0_type": 1,
"thermal": 3,
"R0ref": myr0,
"nb": 1,
Expand Down
17 changes: 5 additions & 12 deletions src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ module m_global_parameters
integer :: nb
real(wp) :: R0ref
real(wp) :: Ca, Web, Re_inv
real(wp), dimension(:), allocatable :: weight, R0, V0
real(wp), dimension(:), allocatable :: weight, R0
logical :: bubbles_euler
logical :: qbmm
logical :: polytropic
Expand Down Expand Up @@ -556,7 +556,7 @@ contains

allocate (bub_idx%rs(nb), bub_idx%vs(nb))
allocate (bub_idx%ps(nb), bub_idx%ms(nb))
allocate (weight(nb), R0(nb), V0(nb))
allocate (weight(nb), R0(nb))

if (qbmm) then
allocate (bub_idx%moms(nb, nmom))
Expand Down Expand Up @@ -588,11 +588,7 @@ contains
if (nb == 1) then
weight(:) = 1._wp
R0(:) = 1._wp
V0(:) = 0._wp
else if (nb > 1) then
!call s_simpson
V0(:) = 0._wp
else
else if (nb < 1) then
stop 'Invalid value of nb'
end if

Expand Down Expand Up @@ -659,7 +655,7 @@ contains

allocate (bub_idx%rs(nb), bub_idx%vs(nb))
allocate (bub_idx%ps(nb), bub_idx%ms(nb))
allocate (weight(nb), R0(nb), V0(nb))
allocate (weight(nb), R0(nb))

do i = 1, nb
if (polytropic .neqv. .true.) then
Expand All @@ -680,10 +676,7 @@ contains
if (nb == 1) then
weight(:) = 1._wp
R0(:) = 1._wp
V0(:) = 0._wp
else if (nb > 1) then
V0(:) = 0._wp
else
else if (nb < 1) then
stop 'Invalid value of nb'
end if

Expand Down
14 changes: 4 additions & 10 deletions src/pre_process/m_assign_variables.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ contains
! Bubbles euler variables
if (bubbles_euler) then
do i = 1, nb
muR = R0(i)*patch_icpp(smooth_patch_id)%r0 ! = R0(i)
muV = V0(i)*patch_icpp(smooth_patch_id)%v0 ! = 0
muR = R0(i)*patch_icpp(smooth_patch_id)%r0
muV = patch_icpp(smooth_patch_id)%v0
if (qbmm) then
! Initialize the moment set
if (dist_type == 1) then
Expand Down Expand Up @@ -610,8 +610,8 @@ contains
! Smoothed bubble variables
if (bubbles_euler) then
do i = 1, nb
muR = R0(i)*patch_icpp(patch_id)%r0 ! = 1*R0(i)
muV = V0(i)*patch_icpp(patch_id)%v0 ! = 1*V0(i)
muR = R0(i)*patch_icpp(patch_id)%r0
muV = patch_icpp(patch_id)%v0
if (qbmm) then
! Initialize the moment set
if (dist_type == 1) then
Expand All @@ -630,12 +630,6 @@ contains
q_prim_vf(bub_idx%fullmom(i, 0, 2))%sf(j, k, l) = muV**2 + sigV**2
end if
else
! q_prim_vf(bub_idx%rs(i))%sf(j,k,l) = &
! (eta * R0(i)*patch_icpp(patch_id)%r0 &
! + (1._wp-eta)*orig_prim_vf(bub_idx%rs(i)))
! q_prim_vf(bub_idx%vs(i))%sf(j,k,l) = &
! (eta * V0(i)*patch_icpp(patch_id)%v0 &
! + (1._wp-eta)*orig_prim_vf(bub_idx%vs(i)))
q_prim_vf(bub_idx%rs(i))%sf(j, k, l) = muR
q_prim_vf(bub_idx%vs(i))%sf(j, k, l) = muV

Expand Down
3 changes: 1 addition & 2 deletions src/pre_process/m_checker.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,10 @@ contains
end subroutine s_check_inputs_grid_stretching

!> Checks constraints on the QBMM and polydisperse bubble parameters
!! (qbmm, polydisperse, dist_type, rhoRV, and R0_type)
!! (qbmm, polydisperse, dist_type and rhoRV)
impure subroutine s_check_inputs_qbmm_and_polydisperse
@:PROHIBIT(qbmm .and. dist_type == dflt_int, "dist_type must be set if using QBMM")
@:PROHIBIT(qbmm .and. dist_type /= 1 .and. rhoRV > 0._wp, "rhoRV cannot be used with dist_type != 1")
@:PROHIBIT(polydisperse .and. R0_type == dflt_int, "R0 type must be set if using Polydisperse")
end subroutine s_check_inputs_qbmm_and_polydisperse

!> Checks constraints on initial partial density perturbation
Expand Down
19 changes: 5 additions & 14 deletions src/pre_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ module m_global_parameters
integer :: nb
real(wp) :: R0ref
real(wp) :: Ca, Web, Re_inv
real(wp), dimension(:), allocatable :: weight, R0, V0
real(wp), dimension(:), allocatable :: weight, R0
logical :: bubbles_euler
logical :: qbmm !< Quadrature moment method
integer :: nmom !< Number of carried moments
Expand Down Expand Up @@ -252,7 +252,6 @@ module m_global_parameters
real(wp) :: gamma_m, gamma_n, mu_n
real(wp) :: poly_sigma
integer :: dist_type !1 = binormal, 2 = lognormal-normal
integer :: R0_type !1 = simpson
!> @}

!> @name Surface Tension Modeling
Expand Down Expand Up @@ -493,7 +492,6 @@ contains
sigV = dflt_real
rhoRV = 0._wp
dist_type = dflt_int
R0_type = dflt_int

R_n = dflt_real
R_v = dflt_real
Expand Down Expand Up @@ -639,7 +637,7 @@ contains
sys_size = n_idx
end if

allocate (weight(nb), R0(nb), V0(nb))
allocate (weight(nb), R0(nb))
allocate (bub_idx%rs(nb), bub_idx%vs(nb))
allocate (bub_idx%ps(nb), bub_idx%ms(nb))

Expand Down Expand Up @@ -680,11 +678,7 @@ contains
if (nb == 1) then
weight(:) = 1._wp
R0(:) = 1._wp
V0(:) = 1._wp
else if (nb > 1) then
V0(:) = 1._wp
!R0 and weight initialized in s_simpson
else
else if (nb < 1) then
stop 'Invalid value of nb'
end if

Expand Down Expand Up @@ -759,7 +753,7 @@ contains

allocate (bub_idx%rs(nb), bub_idx%vs(nb))
allocate (bub_idx%ps(nb), bub_idx%ms(nb))
allocate (weight(nb), R0(nb), V0(nb))
allocate (weight(nb), R0(nb))

do i = 1, nb
if (.not. polytropic) then
Expand All @@ -780,10 +774,7 @@ contains
if (nb == 1) then
weight(:) = 1._wp
R0(:) = 1._wp
V0(:) = 0._wp
else if (nb > 1) then
V0(:) = 1._wp
else
else if (nb < 1) then
stop 'Invalid value of nb'
end if

Expand Down
2 changes: 1 addition & 1 deletion src/pre_process/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ contains
& 'loops_x', 'loops_y', 'loops_z', 'model_eqns', 'num_fluids', &
& 'weno_order', 'precision', 'perturb_flow_fluid', &
& 'perturb_sph_fluid', 'num_patches', 'thermal', 'nb', 'dist_type',&
& 'R0_type', 'relax_model', 'num_ibs', 'n_start', 'elliptic_smoothing_iters', &
& 'relax_model', 'num_ibs', 'n_start', 'elliptic_smoothing_iters', &
& 'num_bc_patches', 'mixlayer_perturb_nk' ]
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
#:endfor
Expand Down
2 changes: 1 addition & 1 deletion src/pre_process/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ contains
rhoref, pref, bubbles_euler, R0ref, nb, &
polytropic, thermal, Ca, Web, Re_inv, &
polydisperse, poly_sigma, qbmm, &
sigR, sigV, dist_type, rhoRV, R0_type, &
sigR, sigV, dist_type, rhoRV, &
file_per_process, relax, relax_model, &
palpha_eps, ptgalpha_eps, ib, num_ibs, patch_ib, &
sigma, adv_n, cfl_adap_dt, cfl_const_dt, n_start, &
Expand Down
25 changes: 7 additions & 18 deletions src/simulation/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ module m_global_parameters

real(wp), dimension(:), allocatable :: weight !< Simpson quadrature weights
real(wp), dimension(:), allocatable :: R0 !< Bubble sizes
real(wp), dimension(:), allocatable :: V0 !< Bubble velocities
$:GPU_DECLARE(create='[weight,R0,V0]')
$:GPU_DECLARE(create='[weight,R0]')

logical :: bubbles_euler !< Bubbles euler on/off
logical :: polytropic !< Polytropic switch
Expand All @@ -424,10 +423,9 @@ module m_global_parameters
integer, parameter :: nmom = 6 !< Number of carried moments per R0 location
integer :: nmomsp !< Number of moments required by ensemble-averaging
integer :: nmomtot !< Total number of carried moments moments/transport equations
integer :: R0_type

real(wp) :: pi_fac !< Factor for artificial pi_inf
$:GPU_DECLARE(create='[qbmm, nmomsp,nmomtot,R0_type,pi_fac]')
$:GPU_DECLARE(create='[qbmm, nmomsp,nmomtot,pi_fac]')

#:if not MFC_CASE_OPTIMIZATION
$:GPU_DECLARE(create='[nb]')
Expand Down Expand Up @@ -671,8 +669,6 @@ contains
num_fluids = dflt_int
#:endif

R0_type = dflt_int

adv_n = .false.
adap_dt = .false.
adap_dt_tol = dflt_real
Expand Down Expand Up @@ -902,7 +898,7 @@ contains
sys_size = n_idx
end if

@:ALLOCATE(weight(nb), R0(nb), V0(nb))
@:ALLOCATE(weight(nb), R0(nb))
@:ALLOCATE(bub_idx%rs(nb), bub_idx%vs(nb))
@:ALLOCATE(bub_idx%ps(nb), bub_idx%ms(nb))

Expand Down Expand Up @@ -943,11 +939,7 @@ contains
if (nb == 1) then
weight(:) = 1._wp
R0(:) = 1._wp
V0(:) = 1._wp
else if (nb > 1) then
V0(:) = 1._wp
!R0 and weight initialized in s_simpson
else
else if (nb < 1) then
stop 'Invalid value of nb'
end if

Expand Down Expand Up @@ -1019,7 +1011,7 @@ contains

@:ALLOCATE(bub_idx%rs(nb), bub_idx%vs(nb))
@:ALLOCATE(bub_idx%ps(nb), bub_idx%ms(nb))
@:ALLOCATE(weight(nb), R0(nb), V0(nb))
@:ALLOCATE(weight(nb), R0(nb))

do i = 1, nb
if (polytropic) then
Expand All @@ -1039,10 +1031,7 @@ contains
if (nb == 1) then
weight(:) = 1._wp
R0(:) = 1._wp
V0(:) = 0._wp
else if (nb > 1) then
V0(:) = 1._wp
else
else if (nb < 1) then
stop 'Invalid value of nb'
end if

Expand Down Expand Up @@ -1280,7 +1269,7 @@ contains
#:endif

$:GPU_ENTER_DATA(copyin='[nb,R0ref,Ca,Web,Re_inv,weight,R0, &
& V0,bubbles_euler,polytropic,polydisperse,qbmm,R0_type, &
& bubbles_euler,polytropic,polydisperse,qbmm, &
& ptil,bubble_model,thermal,poly_sigma]')
$:GPU_ENTER_DATA(copyin='[R_n,R_v,phi_vn,phi_nv,Pe_c,Tw,pv, &
& M_n,M_v,k_n,k_v,pb0,mass_n0,mass_v0,Pe_T, &
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_mpi_proxy.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ contains
& 'wave_speeds', 'avg_state', 'precision', 'bc_x%beg', 'bc_x%end', &
& 'bc_y%beg', 'bc_y%end', 'bc_z%beg', 'bc_z%end', 'fd_order', &
& 'num_probes', 'num_integrals', 'bubble_model', 'thermal', &
& 'R0_type', 'num_source', 'relax_model', 'num_ibs', 'n_start', &
& 'num_source', 'relax_model', 'num_ibs', 'n_start', &
& 'num_bc_patches', 'num_igr_iters', 'num_igr_warm_start_iters']
call MPI_BCAST(${VAR}$, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
#:endfor
Expand Down
8 changes: 4 additions & 4 deletions src/simulation/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ contains
polydisperse, poly_sigma, qbmm, &
relax, relax_model, &
palpha_eps, ptgalpha_eps, &
R0_type, file_per_process, sigma, &
file_per_process, sigma, &
pi_fac, adv_n, adap_dt, adap_dt_tol, &
bf_x, bf_y, bf_z, &
k_x, k_y, k_z, w_x, w_y, w_z, p_x, p_y, p_z, &
Expand Down Expand Up @@ -1249,7 +1249,7 @@ contains

call s_initialize_global_parameters_module()
!Quadrature weights and nodes for polydisperse simulations
if (bubbles_euler .and. nb > 1 .and. R0_type == 1) then
if (bubbles_euler .and. nb > 1) then
call s_simpson(weight, R0)
end if
!Initialize variables for non-polytropic (Preston) model
Expand Down Expand Up @@ -1412,8 +1412,8 @@ contains
if (chemistry) then
$:GPU_UPDATE(device='[q_T_sf%sf]')
end if
$:GPU_UPDATE(device='[nb,R0ref,Ca,Web,Re_inv,weight,R0,V0, &
& bubbles_euler,polytropic,polydisperse,qbmm,R0_type, &
$:GPU_UPDATE(device='[nb,R0ref,Ca,Web,Re_inv,weight,R0, &
& bubbles_euler,polytropic,polydisperse,qbmm, &
& ptil,bubble_model,thermal,poly_sigma,adv_n,adap_dt, &
& adap_dt_tol,n_idx,pi_fac,low_Mach]')
$:GPU_UPDATE(device='[R_n,R_v,phi_vn,phi_nv,Pe_c,Tw,pv,M_n, &
Expand Down
2 changes: 0 additions & 2 deletions toolchain/mfc/run/case_dicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def analytic(self):
'num_patches': ParamType.INT,
'qbmm': ParamType.LOG,
'dist_type': ParamType.INT,
'R0_type': ParamType.INT,
'sigR': ParamType.REAL,
'sigV': ParamType.REAL,
'rhoRV': ParamType.REAL,
Expand Down Expand Up @@ -276,7 +275,6 @@ def analytic(self):
'acoustic_source': ParamType.LOG,
'num_source': ParamType.INT,
'qbmm': ParamType.LOG,
'R0_type': ParamType.INT,
'integral_wrt': ParamType.LOG,
'num_integrals': ParamType.INT,
'rdma_mpi': ParamType.LOG,
Expand Down
1 change: 0 additions & 1 deletion toolchain/mfc/test/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
'qbmm' : 'F',
'dist_type' : 2,
'poly_sigma' : 0.3,
'R0_type' : 1,
'sigR' : 0.1,
'sigV' : 0.1,
'rhoRV' : 0.0,
Expand Down
Loading