Skip to content

Commit 1568228

Browse files
Hyeoksu LeeHyeoksu Lee
authored andcommitted
add mpp_lim to mixture rule acc
1 parent 4461db2 commit 1568228

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

src/common/m_variables_conversion.fpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,13 @@ contains
339339
pi_inf_K = pi_infs(1)
340340
qv_K = qvs(1)
341341
else
342+
if (mpp_lim) then
343+
do i = 1, num_fluids
344+
alpha_rho_K(i) = max(0._wp, alpha_rho_K(i))
345+
alpha_K(i) = min(max(0._wp, alpha_K(i)), 1._wp)
346+
end do
347+
alpha_K = alpha_K/max(sum(alpha_K), sgm_eps)
348+
end if
342349
rho_K = 0._wp; gamma_K = 0._wp; pi_inf_K = 0._wp; qv_K = 0._wp
343350
do i = 1, num_fluids
344351
rho_K = rho_K + alpha_rho_K(i)
@@ -609,8 +616,6 @@ contains
609616

610617
call s_compute_species_fraction(qK_cons_vf, j, k, l, alpha_rho_K, alpha_K)
611618

612-
! print *, j, k, l, alpha_rho_K, qK_cons_vf(1)%sf(j, k, l), alpha_K, qK_cons_vf(advxb)%sf(j, k, l)
613-
614619
if (model_eqns /= 4) then
615620
#ifdef MFC_SIMULATION
616621
! If in simulation, use acc mixture subroutines
@@ -1340,7 +1345,6 @@ contains
13401345
alpha_rho_K(i) = max(0._wp, alpha_rho_K(i))
13411346
alpha_K(i) = min(max(0._wp, alpha_K(i)), 1._wp)
13421347
end do
1343-
13441348
alpha_K = alpha_K/max(sum(alpha_K), 1.e-16_wp)
13451349
end if
13461350

src/simulation/m_bubbles_EL.fpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,11 +642,7 @@ contains
642642
call s_get_pinf(k, q_prim_vf, 1, myPinf, cell, aux1, aux2)
643643

644644
! Obtain liquid density and computing speed of sound from pinf
645-
$:GPU_LOOP(parallelism='[seq]')
646-
do i = 1, num_fluids
647-
myalpha_rho(i) = q_prim_vf(i)%sf(cell(1), cell(2), cell(3))
648-
myalpha(i) = q_prim_vf(E_idx + i)%sf(cell(1), cell(2), cell(3))
649-
end do
645+
call s_compute_species_fraction(q_prim_vf, cell(1), cell(2), cell(3), myalpha_rho, myalpha)
650646
call s_convert_species_to_mixture_variables_acc(myRho, gamma, pi_inf, qv, myalpha, &
651647
myalpha_rho, Re)
652648
call s_compute_cson_from_pinf(q_prim_vf, myPinf, cell, myRho, gamma, pi_inf, myCson)

src/simulation/m_hyperelastic.fpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ contains
110110
do l = 0, p
111111
do k = 0, n
112112
do j = 0, m
113-
$:GPU_LOOP(parallelism='[seq]')
114-
do i = 1, num_fluids
115-
alpha_rho_k(i) = q_cons_vf(i)%sf(j, k, l)
116-
alpha_k(i) = q_cons_vf(advxb + i - 1)%sf(j, k, l)
117-
end do
113+
114+
call s_compute_species_fraction(q_cons_vf, j, k, l, alpha_rho_k, alpha_k)
115+
118116
! If in simulation, use acc mixture subroutines
119117
call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv, alpha_k, &
120118
alpha_rho_k, Re, G_local, Gs_hyper)

0 commit comments

Comments
 (0)