Skip to content

Commit 84b8c9e

Browse files
committed
Address PR comments
1 parent 7340b87 commit 84b8c9e

13 files changed

+55
-54
lines changed

src/common/m_derived_types.fpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,9 @@ module m_derived_types
314314
logical :: diffusion
315315
logical :: reactions
316316
317+
!> Method of determining gamma.
318+
!> gamma_method = 1: Ref. Section 2.3.1 Formulation of doi:10.7907/ZKW8-ES97.
319+
!> gamma_method = 2: c_p / c_v where c_p, c_v are specific heats.
317320
integer :: gamma_method
318321
end type chemistry_parameters
319322

src/common/m_variables_conversion.fpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ contains
942942
qK_prim_vf(i)%sf(j, k, l) = max(0d0, qK_cons_vf(i)%sf(j, k, l)/rho_K)
943943
end do
944944

945-
qK_prim_vf(tempxb)%sf(j, k, l) = qK_cons_vf(tempxb)%sf(j, k, l)
945+
qK_prim_vf(T_idx)%sf(j, k, l) = qK_cons_vf(T_idx)%sf(j, k, l)
946946
else
947947
!$acc loop seq
948948
do i = 1, contxe
@@ -980,7 +980,7 @@ contains
980980

981981
qK_prim_vf(E_idx)%sf(j, k, l) = pres
982982
if (chemistry) then
983-
qK_prim_vf(tempxb)%sf(j, k, l) = T
983+
qK_prim_vf(T_idx)%sf(j, k, l) = T
984984
end if
985985

986986
if (bubbles) then
@@ -1133,13 +1133,13 @@ contains
11331133
end do
11341134

11351135
call get_mixture_molecular_weight(Ys, mix_mol_weight)
1136-
T = q_prim_vf(tempxb)%sf(j, k, l)
1136+
T = q_prim_vf(T_idx)%sf(j, k, l)
11371137
call get_mixture_energy_mass(T, Ys, e_mix)
11381138

11391139
q_cons_vf(E_idx)%sf(j, k, l) = &
11401140
dyn_pres + rho*e_mix
11411141

1142-
q_cons_vf(tempxb)%sf(j, k, l) = q_prim_vf(tempxb)%sf(j, k, l)
1142+
q_cons_vf(T_idx)%sf(j, k, l) = q_prim_vf(T_idx)%sf(j, k, l)
11431143
#:else
11441144
! Computing the energy from the pressure
11451145
if ((model_eqns /= 4) .and. (bubbles .neqv. .true.)) then
@@ -1398,7 +1398,7 @@ contains
13981398
end subroutine s_finalize_variables_conversion_module
13991399

14001400
#ifndef MFC_PRE_PROCESS
1401-
subroutine s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv, vel_sum, c_avggg, c)
1401+
subroutine s_compute_speed_of_sound(pres, rho, gamma, pi_inf, H, adv, vel_sum, c_c, c)
14021402
#ifdef CRAY_ACC_WAR
14031403
!DIR$ INLINEALWAYS s_compute_speed_of_sound
14041404
#else
@@ -1409,16 +1409,14 @@ contains
14091409
real(kind(0d0)), intent(in) :: H
14101410
real(kind(0d0)), dimension(num_fluids), intent(in) :: adv
14111411
real(kind(0d0)), intent(in) :: vel_sum
1412-
real(kind(0d0)), intent(in) :: c_avggg
1412+
real(kind(0d0)), intent(in) :: c_c
14131413
real(kind(0d0)), intent(out) :: c
14141414

14151415
real(kind(0d0)) :: blkmod1, blkmod2
1416-
real(kind(0d0)) :: Tolerance, c_c
1416+
real(kind(0d0)) :: Tolerance
14171417
integer :: q
14181418

14191419
if (chemistry) then
1420-
c_c = c_avggg
1421-
14221420
if (avg_state == 1 .and. abs(c_c) > Tolerance) then
14231421
c = sqrt(c_c - (gamma - 1.0d0)*(vel_sum - H))
14241422
else

src/post_process/m_global_parameters.fpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,16 @@ module m_global_parameters
129129
type(int_bounds_info) :: stress_idx !< Indices of elastic stresses
130130
integer :: c_idx !< Index of color function
131131
type(int_bounds_info) :: species_idx !< Indexes of first & last concentration eqns.
132-
type(int_bounds_info) :: temperature_idx !< Indexes of first & last temperature eqns.
132+
integer :: T_idx !< Index of temperature eqn.
133133
!> @}
134134

135135
! Cell Indices for the (local) interior points (O-m, O-n, 0-p).
136+
! Stands for "InDices With BUFFer".
136137
type(int_bounds_info) :: idwint(1:3)
137138

138139
! Cell Indices for the entire (local) domain. In simulation, this includes
139140
! the buffer region. idwbuff and idwint are the same otherwise.
141+
! Stands for "InDices With BUFFer".
140142
type(int_bounds_info) :: idwbuff(1:3)
141143

142144
!> @name Boundary conditions in the x-, y- and z-coordinate directions
@@ -284,7 +286,6 @@ module m_global_parameters
284286
integer :: bubxb, bubxe
285287
integer :: strxb, strxe
286288
integer :: chemxb, chemxe
287-
integer :: tempxb, tempxe
288289
!> @}
289290

290291
contains
@@ -624,14 +625,12 @@ contains
624625
species_idx%end = sys_size + num_species
625626
sys_size = species_idx%end
626627

627-
temperature_idx%beg = sys_size + 1
628-
temperature_idx%end = sys_size + 1
629-
sys_size = temperature_idx%end
628+
T_idx = sys_size + 1
629+
sys_size = T_idx
630630
else
631631
species_idx%beg = 1
632632
species_idx%end = 1
633-
temperature_idx%beg = 1
634-
temperature_idx%end = 1
633+
T_idx = 1
635634
end if
636635

637636
momxb = mom_idx%beg
@@ -648,8 +647,6 @@ contains
648647
intxe = internalEnergies_idx%end
649648
chemxb = species_idx%beg
650649
chemxe = species_idx%end
651-
tempxb = temperature_idx%beg
652-
tempxe = temperature_idx%end
653650

654651
#ifdef MFC_MPI
655652
allocate (MPI_IO_DATA%view(1:sys_size))

src/post_process/m_start_up.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ subroutine s_save_data(t_step, varname, pres, c, H)
312312
end do
313313

314314
if (chem_wrt_T) then
315-
q_sf = q_prim_vf(tempxb)%sf(-offset_x%beg:m + offset_x%end, &
316-
-offset_y%beg:n + offset_y%end, &
317-
-offset_z%beg:p + offset_z%end)
315+
q_sf = q_prim_vf(T_idx)%sf(-offset_x%beg:m + offset_x%end, &
316+
-offset_y%beg:n + offset_y%end, &
317+
-offset_z%beg:p + offset_z%end)
318318

319319
write (varname, '(A)') 'T'
320320
call s_write_variable_to_formatted_database_file(varname, t_step)

src/pre_process/m_assign_variables.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ contains
191191
end block
192192
193193
call get_mixture_molecular_weight(Ys, mean_molecular_weight)
194-
q_prim_vf(tempxb)%sf(j, k, l) = &
194+
q_prim_vf(T_idx)%sf(j, k, l) = &
195195
q_prim_vf(E_idx)%sf(j, k, l)*mean_molecular_weight &
196196
/(gas_constant*q_prim_vf(1)%sf(j, k, l))
197197
#:endif
@@ -570,7 +570,7 @@ contains
570570
end block
571571
572572
call get_mixture_molecular_weight(Ys, mean_molecular_weight)
573-
q_prim_vf(tempxb)%sf(j, k, l) = &
573+
q_prim_vf(T_idx)%sf(j, k, l) = &
574574
q_prim_vf(E_idx)%sf(j, k, l)*mean_molecular_weight/(gas_constant*q_prim_vf(1)%sf(j, k, l))
575575
#:endif
576576

src/pre_process/m_data_output.fpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ contains
261261
.or. &
262262
((i >= chemxb) .and. (i <= chemxe)) &
263263
.or. &
264-
((i == tempxb)) &
264+
((i == T_idx)) &
265265
) then
266266
write (2, FMT) x_cb(j), q_cons_vf(i)%sf(j, 0, 0)
267267
else if (i == mom_idx%beg) then !u
@@ -825,7 +825,7 @@ contains
825825
write (1, '(I3,A20,A20)') chemxb + i - 1, "Y_{"//trim(species_names(i))//"} \rho", "Y_{"//trim(species_names(i))//"}"
826826
end do
827827

828-
write (1, '(I3,A20,A20)') tempxb, "T", "T"
828+
write (1, '(I3,A20,A20)') T_idx, "T", "T"
829829
end if
830830

831831
write (1, '(A)') ""
@@ -837,7 +837,7 @@ contains
837837
if (strxb /= 0) write (1, '("[",I2,",",I2,"]",A)') strxb, strxe, " Stress"
838838
if (intxb /= 0) write (1, '("[",I2,",",I2,"]",A)') intxb, intxe, " Internal Energies"
839839
if (chemxb /= 0) write (1, '("[",I2,",",I2,"]",A)') chemxb, chemxe, " Chemistry"
840-
if (tempxb /= 0) write (1, '("[",I2,",",I2,"]",A)') tempxb, tempxe, " Temperature"
840+
if (T_idx /= 0) write (1, '("[",I2,",",I2,"]",A)') T_idx, T_idx, " Temperature"
841841

842842
close (1)
843843

src/pre_process/m_global_parameters.fpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,15 @@ module m_global_parameters
106106
type(int_bounds_info) :: stress_idx !< Indexes of elastic shear stress eqns.
107107
integer :: c_idx !< Index of the color function
108108
type(int_bounds_info) :: species_idx !< Indexes of first & last concentration eqns.
109-
type(int_bounds_info) :: temperature_idx !< Indexes of first & last temperature eqns.
109+
integer :: T_idx !< Index of temperature eqn.
110110

111111
! Cell Indices for the (local) interior points (O-m, O-n, 0-p).
112+
! Stands for "InDices With BUFFer".
112113
type(int_bounds_info) :: idwint(1:3)
113114

114115
! Cell Indices for the entire (local) domain. In simulation and post_process,
115116
! this includes the buffer region. idwbuff and idwint are the same otherwise.
117+
! Stands for "InDices With BUFFer".
116118
type(int_bounds_info) :: idwbuff(1:3)
117119

118120
type(int_bounds_info) :: bc_x, bc_y, bc_z !<
@@ -237,7 +239,6 @@ module m_global_parameters
237239
integer :: bubxb, bubxe
238240
integer :: strxb, strxe
239241
integer :: chemxb, chemxe
240-
integer :: tempxb, tempxe
241242
!> @}
242243

243244
integer, allocatable, dimension(:, :, :) :: logic_grid
@@ -707,9 +708,8 @@ contains
707708
species_idx%end = sys_size + num_species
708709
sys_size = species_idx%end
709710

710-
temperature_idx%beg = sys_size + 1
711-
temperature_idx%end = sys_size + 1
712-
sys_size = temperature_idx%end
711+
T_idx = sys_size + 1
712+
sys_size = T_idx
713713
end if
714714

715715
momxb = mom_idx%beg
@@ -726,8 +726,6 @@ contains
726726
intxe = internalEnergies_idx%end
727727
chemxb = species_idx%beg
728728
chemxe = species_idx%end
729-
tempxb = temperature_idx%beg
730-
tempxe = temperature_idx%end
731729

732730
! Configuring Coordinate Direction Indexes =========================
733731
idwint(1)%beg = 0; idwint(2)%beg = 0; idwint(3)%beg = 0

src/simulation/include/inline_riemann.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
gamma_avg = Cp_avg/Cv_avg
5959

6060
Phi_avg(:) = (gamma_avg - 1.d0)*(vel_avg_rms/2.0d0 - h_avg_2(:)) + gamma_avg*gas_constant/mol_weights(:)*T_avg
61-
c_avggg = sum(Yi_avg(:)*Phi_avg(:))
61+
c_sum_Yi_Phi = sum(Yi_avg(:)*Phi_avg(:))
6262
#:endif
6363

6464
#:enddef roe_avg

src/simulation/m_chemistry.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ contains
8888
rhs_vf(eqn)%sf(x, y, z) = flux_x + flux_y + flux_z
8989
end do
9090

91-
rhs_vf(tempxb)%sf(x, y, z) = 0d0
91+
rhs_vf(T_idx)%sf(x, y, z) = 0d0
9292
end do
9393
end do
9494
end do
@@ -130,7 +130,7 @@ contains
130130
end do
131131

132132
rho = q_cons_qp(contxe)%sf(x, y, z)
133-
T = q_prim_qp(tempxb)%sf(x, y, z)
133+
T = q_prim_qp(T_idx)%sf(x, y, z)
134134

135135
call get_net_production_rates(rho, T, Ys, omega)
136136

src/simulation/m_global_parameters.fpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,19 @@ module m_global_parameters
239239
type(int_bounds_info) :: stress_idx !< Indexes of first and last shear stress eqns.
240240
integer :: c_idx ! Index of the color function
241241
type(int_bounds_info) :: species_idx !< Indexes of first & last concentration eqns.
242-
type(int_bounds_info) :: temperature_idx !< Indexes of first & last temperature eqns.
242+
integer :: T_idx !< Index of the temperature equation
243243
!> @}
244244

245245
!$acc declare create(bub_idx)
246246

247247
! Cell Indices for the (local) interior points (O-m, O-n, 0-p).
248+
! Stands for "InDices With INTerior".
248249
type(int_bounds_info) :: idwint(1:3)
249250
!$acc declare create(idwint)
250251

251252
! Cell Indices for the entire (local) domain. In simulation and post_process,
252253
! this includes the buffer region. idwbuff and idwint are the same otherwise.
254+
! Stands for "InDices With BUFFer".
253255
type(int_bounds_info) :: idwbuff(1:3)
254256
!$acc declare create(idwbuff)
255257

@@ -301,7 +303,7 @@ module m_global_parameters
301303

302304
integer :: startx, starty, startz
303305

304-
!$acc declare create(sys_size, buff_size, startx, starty, startz, E_idx, gamma_idx, pi_inf_idx, alf_idx, n_idx, stress_idx, species_idx)
306+
!$acc declare create(sys_size, buff_size, startx, starty, startz, E_idx, T_idx, gamma_idx, pi_inf_idx, alf_idx, n_idx, stress_idx, species_idx)
305307

306308
! END: Simulation Algorithm Parameters =====================================
307309

@@ -467,9 +469,8 @@ module m_global_parameters
467469
integer :: bubxb, bubxe
468470
integer :: strxb, strxe
469471
integer :: chemxb, chemxe
470-
integer :: tempxb, tempxe
471472

472-
!$acc declare create(momxb, momxe, advxb, advxe, contxb, contxe, intxb, intxe, bubxb, bubxe, strxb, strxe, chemxb, chemxe, tempxb, tempxe)
473+
!$acc declare create(momxb, momxe, advxb, advxe, contxb, contxe, intxb, intxe, bubxb, bubxe, strxb, strxe, chemxb, chemxe)
473474

474475
#ifdef CRAY_ACC_WAR
475476
@:CRAY_DECLARE_GLOBAL(real(kind(0d0)), dimension(:), gammas, gs_min, pi_infs, ps_inf, cvs, qvs, qvps)
@@ -1004,9 +1005,8 @@ contains
10041005
species_idx%end = sys_size + num_species
10051006
sys_size = species_idx%end
10061007

1007-
temperature_idx%beg = sys_size + 1
1008-
temperature_idx%end = sys_size + 1
1009-
sys_size = temperature_idx%end
1008+
T_idx = sys_size + 1
1009+
sys_size = T_idx
10101010
end if
10111011

10121012
if (qbmm .and. .not. polytropic) then
@@ -1118,10 +1118,8 @@ contains
11181118
intxe = internalEnergies_idx%end
11191119
chemxb = species_idx%beg
11201120
chemxe = species_idx%end
1121-
tempxb = temperature_idx%beg
1122-
tempxe = temperature_idx%end
11231121

1124-
!$acc update device(momxb, momxe, advxb, advxe, contxb, contxe, bubxb, bubxe, intxb, intxe, sys_size, buff_size, E_idx, alf_idx, n_idx, adv_n, adap_dt, pi_fac, strxb, strxe, chemxb, chemxe, tempxb, tempxe)
1122+
!$acc update device(momxb, momxe, advxb, advxe, contxb, contxe, bubxb, bubxe, intxb, intxe, sys_size, buff_size, E_idx, T_idx, alf_idx, n_idx, adv_n, adap_dt, pi_fac, strxb, strxe, chemxb, chemxe)
11251123
!$acc update device(species_idx)
11261124
!$acc update device(cfl_target, m, n, p)
11271125

0 commit comments

Comments
 (0)