@@ -325,4 +325,65 @@ contains
325325
326326 end subroutine s_compute_bubble_EE_source
327327
328+ !> Evaluate the Euler- Euler pressure correction at cell centers and store it in ptil. This mirrors the modified mixture pressure
329+ !! that the HLLC solver applies to the reconstructed face states in m_riemann_solver_hllc.fpp, following Ando (2010 ), Eq. (2.5 ).
330+ !! It is a diagnostic: ptil is read only by the probe output path and never feeds back into the solution.
331+ impure subroutine s_compute_ptilde (q_cons_vf , q_prim_vf )
332+
333+ type(scalar_field), dimension (sys_size), intent (in ) :: q_cons_vf, q_prim_vf
334+ real (wp) :: R3bar, R3V2bar, PbwR3bar
335+ real (wp) :: myRho, myP, alf, myR, myV, myPb
336+ integer :: j, k, l, q, ii
337+
338+ $:GPU_PARALLEL_LOOP(private= ' [j, k, l, q, ii, R3bar, R3V2bar, PbwR3bar, myRho, myP, alf, myR, myV, myPb]' , collapse= 3 )
339+ do l = 0 , p
340+ do k = 0 , n
341+ do j = 0 , m
342+ alf = q_prim_vf(eqn_idx%alf)%sf(j, k, l)
343+ myP = q_prim_vf(eqn_idx%E)%sf(j, k, l)
344+
345+ myRho = 0._wp
346+ $:GPU_LOOP(parallelism= ' [seq]' )
347+ do ii = 1 , num_fluids
348+ myRho = myRho + q_cons_vf(ii)%sf(j, k, l)
349+ end do
350+
351+ if (qbmm) then
352+ R3bar = mom_sp(1 )%sf(j, k, l)
353+ R3V2bar = mom_sp(3 )%sf(j, k, l)
354+ PbwR3bar = mom_sp(4 )%sf(j, k, l)
355+ else
356+ R3bar = 0._wp
357+ R3V2bar = 0._wp
358+ PbwR3bar = 0._wp
359+
360+ $:GPU_LOOP(parallelism= ' [seq]' )
361+ do q = 1 , nb
362+ myR = q_prim_vf(rs(q))%sf(j, k, l)
363+ myV = q_prim_vf(vs(q))%sf(j, k, l)
364+ if (polytropic) then
365+ myPb = 0._wp
366+ else
367+ myPb = q_prim_vf(ps(q))%sf(j, k, l)
368+ end if
369+
370+ R3bar = R3bar + weight(q)* (myR** 3._wp )
371+ R3V2bar = R3V2bar + weight(q)* (myR** 3._wp )* (myV** 2._wp )
372+ PbwR3bar = PbwR3bar + weight(q)* f_cpbw_KM(R0(q), myR, myV, myPb)* (myR** 3._wp )
373+ end do
374+ end if
375+
376+ ! Same degenerate- state guard the HLLC solver uses
377+ if (alf < small_alf .or. R3bar < small_alf) then
378+ ptil(j, k, l) = alf* myP
379+ else
380+ ptil(j, k, l) = alf* (myP - PbwR3bar/ R3bar - myRho* R3V2bar/ R3bar)
381+ end if
382+ end do
383+ end do
384+ end do
385+ $:END_GPU_PARALLEL_LOOP()
386+
387+ end subroutine s_compute_ptilde
388+
328389end module m_bubbles_EE
0 commit comments