Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
8 changes: 4 additions & 4 deletions src/common/m_variables_conversion.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1601,12 +1601,12 @@ contains
end subroutine s_finalize_variables_conversion_module

#ifndef MFC_PRE_PROCESS
subroutine s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv, vel_sum, c_c, c)
subroutine s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv, vel_sum, c_c, c, qv)
$:GPU_ROUTINE(function_name='s_compute_speed_of_sound', &
& parallelism='[seq]', cray_inline=True)

real(wp), intent(in) :: pres
real(wp), intent(in) :: rho, gamma, pi_inf
real(wp), intent(in) :: rho, gamma, pi_inf, qv
real(wp), intent(in) :: H
real(wp), dimension(num_fluids), intent(in) :: adv
real(wp), intent(in) :: vel_sum
Expand Down Expand Up @@ -1642,7 +1642,7 @@ contains
end do
c = c/rho
elseif (((model_eqns == 4) .or. (model_eqns == 2 .and. bubbles_euler))) then
! Sound speed for bubble mmixture to order O(\alpha)
! Sound speed for bubble mixture to order O(\alpha)

if (mpp_lim .and. (num_fluids > 1)) then
c = (1._wp/gamma + 1._wp)* &
Expand All @@ -1654,7 +1654,7 @@ contains
(rho*(1._wp - adv(num_fluids)))
end if
else
c = ((H - 5.e-1*vel_sum)/gamma)
c = (H - 5.e-1*vel_sum - qv/rho)/gamma
end if

if (mixture_err .and. c < 0._wp) then
Expand Down
8 changes: 5 additions & 3 deletions src/post_process/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -1582,7 +1582,7 @@ contains
impure subroutine s_write_energy_data_file(q_prim_vf, q_cons_vf)
type(scalar_field), dimension(sys_size), intent(IN) :: q_prim_vf, q_cons_vf
real(wp) :: Elk, Egk, Elp, Egint, Vb, Vl, pres_av, Et
real(wp) :: rho, pres, dV, tmp, gamma, pi_inf, MaxMa, MaxMa_glb, maxvel, c, Ma, H
real(wp) :: rho, pres, dV, tmp, gamma, pi_inf, MaxMa, MaxMa_glb, maxvel, c, Ma, H, qv
real(wp), dimension(num_vels) :: vel
real(wp), dimension(num_fluids) :: adv
integer :: i, j, k, l, s !looping indices
Expand Down Expand Up @@ -1610,6 +1610,7 @@ contains
rho = 0._wp
gamma = 0._wp
pi_inf = 0._wp
qv = 0._wp
pres = q_prim_vf(E_idx)%sf(i, j, k)
Egint = Egint + q_prim_vf(E_idx + 2)%sf(i, j, k)*(fluid_pp(2)%gamma*pres)*dV
do s = 1, num_vels
Expand All @@ -1625,13 +1626,14 @@ contains
gamma = gamma + adv(l)*fluid_pp(l)%gamma
pi_inf = pi_inf + adv(l)*fluid_pp(l)%pi_inf
rho = rho + adv(l)*q_prim_vf(l)%sf(i, j, k)
qv = qv + adv(l)*q_prim_vf(l)%sf(i, j, k)*fluid_pp(l)%qv
end do

H = ((gamma + 1._wp)*pres + pi_inf)/rho
H = ((gamma + 1._wp)*pres + pi_inf + qv)/rho

call s_compute_speed_of_sound(pres, rho, &
gamma, pi_inf, &
H, adv, 0._wp, 0._wp, c)
H, adv, 0._wp, 0._wp, c, qv)

Ma = maxvel/c
if (Ma > MaxMa .and. (adv(1) > (1.0_wp - 1.0e-10_wp))) then
Expand Down
2 changes: 1 addition & 1 deletion src/post_process/m_start_up.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ contains

call s_compute_speed_of_sound(pres, rho_sf(i, j, k), &
gamma_sf(i, j, k), pi_inf_sf(i, j, k), &
H, adv, 0._wp, 0._wp, c)
H, adv, 0._wp, 0._wp, c, qv_sf(i, j, k))

q_sf(i, j, k) = c
end do
Expand Down
4 changes: 4 additions & 0 deletions src/simulation/include/inline_riemann.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

H_avg = 5.e-1_wp*(H_L + H_R)
gamma_avg = 5.e-1_wp*(gamma_L + gamma_R)
qv_avg = 5.e-1_wp*(qv_L + qv_R)

#:enddef arithmetic_avg

Expand All @@ -32,6 +33,9 @@
vel_avg_rms = (sqrt(rho_L)*vel_L(1) + sqrt(rho_R)*vel_R(1))**2._wp/ &
(sqrt(rho_L) + sqrt(rho_R))**2._wp

qv_avg = (sqrt(rho_L)*qv_L + sqrt(rho_R)*qv_R)/ &
(sqrt(rho_L) + sqrt(rho_R))

if (chemistry) then
eps = 0.001_wp
call get_species_enthalpies_rt(T_L, h_iL)
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/m_cbc.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ contains
H = (E + pres)/rho

! Compute mixture sound speed
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv_local, vel_K_sum, 0._wp, c)
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv_local, vel_K_sum, 0._wp, c, qv)

! First-Order Spatial Derivatives of Primitive Variables

Expand Down
13 changes: 7 additions & 6 deletions src/simulation/m_data_output.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,19 +273,20 @@ contains
real(wp), dimension(num_fluids) :: alpha !< Cell-avg. volume fraction
real(wp) :: gamma !< Cell-avg. sp. heat ratio
real(wp) :: pi_inf !< Cell-avg. liquid stiffness function
real(wp) :: qv !< Cell-avg. internal energy reference value
real(wp) :: c !< Cell-avg. sound speed
real(wp) :: H !< Cell-avg. enthalpy
real(wp), dimension(2) :: Re !< Cell-avg. Reynolds numbers
integer :: j, k, l

! Computing Stability Criteria at Current Time-step
$:GPU_PARALLEL_LOOP(collapse=3, private='[j,k,l,vel, alpha, Re, rho, vel_sum, pres, gamma, pi_inf, c, H]')
$:GPU_PARALLEL_LOOP(collapse=3, private='[j,k,l,vel, alpha, Re, rho, vel_sum, pres, gamma, pi_inf, c, H, qv]')
do l = 0, p
do k = 0, n
do j = 0, m
call s_compute_enthalpy(q_prim_vf, pres, rho, gamma, pi_inf, Re, H, alpha, vel, vel_sum, j, k, l)
call s_compute_enthalpy(q_prim_vf, pres, rho, gamma, pi_inf, Re, H, alpha, vel, vel_sum, qv, j, k, l)

call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, alpha, vel_sum, 0._wp, c)
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, alpha, vel_sum, 0._wp, c, qv)

if (viscous) then
call s_compute_stability_from_dt(vel, c, rho, Re, j, k, l, icfl_sf, vcfl_sf, Rc_sf)
Expand Down Expand Up @@ -1292,7 +1293,7 @@ contains

! Compute mixture sound Speed
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, &
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c)
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c, qv)

accel = accel_mag(j - 2, k, l)
end if
Expand Down Expand Up @@ -1382,7 +1383,7 @@ contains
end if
! Compute mixture sound speed
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, &
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c)
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c, qv)

end if
end if
Expand Down Expand Up @@ -1447,7 +1448,7 @@ contains

! Compute mixture sound speed
call s_compute_speed_of_sound(pres, rho, gamma, pi_inf, &
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c)
((gamma + 1._wp)*pres + pi_inf)/rho, alpha, 0._wp, 0._wp, c, qv)

accel = accel_mag(j - 2, k - 2, l - 2)
end if
Expand Down
Loading
Loading