Skip to content

Commit 2090b48

Browse files
committed
Made bubble functions pure
1 parent 1c9d815 commit 2090b48

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

src/simulation/m_bubbles.fpp

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ contains
278278
!$acc routine seq
279279
real(wp), intent(in) :: fR0, fR, fV, fpb
280280
real(wp), intent(in) :: gam_l, Ca_l, Web_l, Re_inv_l
281-
logical, intent(in) :: polytropic_l
281+
logical, intent(in) :: polytropic_l
282282

283283
real(wp) :: f_cpbw_KM
284284

285285
if (polytropic_l) then
286286
f_cpbw_KM = Ca_l*((fR0/fR)**(3._wp*gam_l)) - Ca_l + 1._wp
287287
if (.not. f_is_default(Web_l)) f_cpbw_KM = f_cpbw_KM + &
288-
(2._wp/(Web_l*fR0))*((fR0/fR)**(3._wp*gam_l))
288+
(2._wp/(Web_l*fR0))*((fR0/fR)**(3._wp*gam_l))
289289
else
290290
f_cpbw_KM = fpb
291291
end if
@@ -323,7 +323,7 @@ contains
323323
if (polytropic_l) then
324324
cdot_star = -3._wp*gam_l*Ca_l*((fR0/fR)**(3._wp*gam_l))*fV/fR
325325
if (.not. f_is_default(Web_l)) cdot_star = cdot_star - &
326-
3._wp*gam_l*(2._wp/(Web_l*fR0))*((fR0/fR)**(3._wp*gam_l))*fV/fR
326+
3._wp*gam_l*(2._wp/(Web_l*fR0))*((fR0/fR)**(3._wp*gam_l))*fV/fR
327327
else
328328
cdot_star = fpbdot
329329
end if
@@ -370,16 +370,20 @@ contains
370370
!! @param fV Current bubble velocity
371371
!! @param fmass_v Current mass of vapour
372372
!! @param iR0 Bubble size index (EE) or bubble identifier (EL)
373-
!! @param fmass_n Current gas mass (EL)
374-
!! @param fbeta_c Mass transfer coefficient (EL)
375-
!! @param fconc_v Current vapor concentration (EL)
376-
!! @param gam_l Physical Bubble parameter (pass in from global parameters)
377-
!! @param Ca_l Cavitation number (pass in from global parameters)
378-
!! @param Web_l Weber number (pass in from global parameters)
379-
!! @param Re_inv_l Inverse Reynolds number (pass in from global parameters)
373+
!! @param mass_n0_l Physical Bubble parameter (pass in from global parameters)
374+
!! @param Re_trans_c_l Physical Bubble parameter (pass in from global parameters)
375+
!! @param chi_vw_l Bubble wall properties (pass in from Bubble Module)
376+
!! @param rho_mw_l Bubble wall properties (pass in from Bubble Module)
377+
!! @param Pe_c_l Physical Bubble parameter (pass in from global parameters)
378+
!! @param pv_l Physical Bubble parameter (pass in from global parameters)
379+
!! @param R_v_l Physical Bubble parameter (pass in from global parameters)
380+
!! @param Tw_l Physical Bubble parameter (pass in from global parameters)
380381
!! @param polytropic_l Polytropic switch (pass in from global parameters)
381382
!! @param bubbles_lagrange_l Lagrangian subgrid bubble model switch (pass in from global parameters)
382383
!! @param thermal_l Thermal behavior (pass in from global parameters)
384+
!! @param fmass_n Current gas mass (EL)
385+
!! @param fbeta_c Mass transfer coefficient (EL)
386+
!! @param fconc_v Current vapor concentration (EL)
383387
pure function f_vflux(fR, fV, fpb, fmass_v, iR0, mass_n0_l, Re_trans_c_l, chi_vw_l, rho_mw_l, Pe_c_l, pv_l, R_v_l, Tw_l, thermal_l, bubbles_lagrange_l, fmass_n, fbeta_c, fR_m, fgamma_m)
384388
!$acc routine seq
385389
real(wp), intent(in) :: fR
@@ -443,37 +447,44 @@ contains
443447
!! @param fbeta_t Mass transfer coefficient (EL)
444448
!! @param fR_m Mixture gas constant (EL)
445449
!! @param fgamma_m Mixture gamma (EL)
446-
function f_bpres_dot(fvflux, fR, fV, fpb, fmass_v, iR0, fbeta_t, fR_m, fgamma_m)
450+
!! @param fconc_v Current vapor concentration (EL)
451+
function f_bpres_dot(fvflux, fR, fV, fpb, fmass_v, iR0, Tw_l, R_v_l, pv_l, pb0_l, mass_n0_l, mass_v0_l, Pe_T_l, Re_trans_T_l, k_mw_l, thermal_l, bubbles_lagrange_l,fbeta_t, fR_m, fgamma_m)
447452
!$acc routine seq
448453
real(wp), intent(in) :: fvflux
449454
real(wp), intent(in) :: fR
450455
real(wp), intent(in) :: fV
451456
real(wp), intent(in) :: fpb
452457
real(wp), intent(in) :: fmass_v
453458
integer, intent(in) :: iR0
459+
real(wp), intent(in) :: Tw_l, R_v_l, pv_l
460+
real(wp), dimension(:), allocatable, intent(in) :: pb0_l, mass_n0_l, mass_v0_l, Pe_T_l
461+
real(wp), dimension(:), allocatable, intent(in) :: Re_trans_T_l
462+
real(wp), intent(in) :: k_mw_l
463+
integer, intent(in) :: thermal_l
464+
logical, intent(in) :: bubbles_lagrange_l
454465
real(wp), intent(in), optional :: fbeta_t, fR_m, fgamma_m
455466

456467
real(wp) :: T_bar
457468
real(wp) :: grad_T
458469
real(wp) :: f_bpres_dot
459470
real(wp) :: heatflux
460471

461-
if (thermal == 3) then
462-
if (bubbles_lagrange) then
472+
if (thermal_l == 3) then
473+
if (bubbles_lagrange_l) then
463474
T_bar = fpb*(4._wp/3._wp*pi*fR**3._wp)/fR_m
464-
grad_T = -fbeta_t*(T_bar - Tw)
475+
grad_T = -fbeta_t*(T_bar - Tw_l)
465476
heatflux = (fgamma_m - 1._wp)/fgamma_m*grad_T/fR
466-
f_bpres_dot = 3._wp*fgamma_m*(-fV*fpb + fvflux*R_v*Tw &
477+
f_bpres_dot = 3._wp*fgamma_m*(-fV*fpb + fvflux*R_v_l*Tw_l &
467478
+ heatflux)/fR
468479
return
469480
end if
470-
T_bar = Tw*(fpb/pb0(iR0))*(fR/R0(iR0))**3 &
471-
*(mass_n0(iR0) + mass_v0(iR0))/(mass_n0(iR0) + fmass_v)
472-
grad_T = -Re_trans_T(iR0)*(T_bar - Tw)
473-
f_bpres_dot = 3._wp*gamma_m*(-fV*fpb + fvflux*R_v*Tw &
474-
+ pb0(iR0)*k_mw*grad_T/Pe_T(iR0)/fR)/fR
481+
T_bar = Tw_l*(fpb/pb0_l(iR0))*(fR/R0(iR0))**3 &
482+
*(mass_n0_l(iR0) + mass_v0_l(iR0))/(mass_n0_l(iR0) + fmass_v)
483+
grad_T = -Re_trans_T_l(iR0)*(T_bar - Tw_l)
484+
f_bpres_dot = 3._wp*gamma_m*(-fV*fpb + fvflux*R_v_l*Tw_l &
485+
+ pb0_l(iR0)*k_mw_l*grad_T/Pe_T_l(iR0)/fR)/fR
475486
else
476-
f_bpres_dot = -3._wp*gamma_m*fV/fR*(fpb - pv)
487+
f_bpres_dot = -3._wp*gamma_m*fV/fR*(fpb - pv_l)
477488
end if
478489

479490
end function f_bpres_dot

src/simulation/m_bubbles_EE.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ contains
273273
mv = q_prim_vf(ms(q))%sf(j, k, l)
274274
call s_bwproperty(pb, q)
275275
vflux = f_vflux(myR, myV, mv, q, mass_n0, Re_trans_c, chi_vw, rho_mw, Pe_c, pv, R_v, Tw, thermal, bubbles_lagrange)
276-
pbdot = f_bpres_dot(vflux, myR, myV, pb, mv, q)
276+
pbdot = f_bpres_dot(vflux, myR, myV, pb, mv, q, Tw, R_v, pv, pb0, mass_n0, mass_v0, Pe_T, Re_trans_T, k_mw, thermal, bubbles_lagrange)
277277

278278
bub_p_src(j, k, l, q) = nbub*pbdot
279279
bub_m_src(j, k, l, q) = nbub*vflux*4._wp*pi*(myR**2._wp)

src/simulation/m_bubbles_EL.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ contains
562562

563563
! Vapor and heat fluxes
564564
myVapFlux = f_vflux(myR, myV, myPb, myMass_v, k, mass_n0, Re_trans_c, chi_vw, rho_mw, Pe_c, pv, R_v, Tw, thermal, bubbles_lagrange, myMass_n, myBeta_c, myR_m, mygamma_m)
565-
myPbdot = f_bpres_dot(myVapFlux, myR, myV, myPb, myMass_v, k, myBeta_t, myR_m, mygamma_m)
565+
myPbdot = f_bpres_dot(myVapFlux, myR, myV, myPb, myMass_v, k, Tw, R_v, pv, pb0, mass_n0, mass_v0, Pe_T, Re_trans_T, k_mw, thermal, bubbles_lagrange, myBeta_t, myR_m, mygamma_m)
566566
myMvdot = 4._wp*pi*myR**2._wp*myVapFlux
567567

568568
! Obtaining driving pressure

0 commit comments

Comments
 (0)