Skip to content

Commit

Permalink
Fix #628: Fetch Pyro from upstream (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
henryleberre authored Sep 24, 2024
1 parent 41357f9 commit 07fd919
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
12 changes: 10 additions & 2 deletions src/common/m_thermochem.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
module m_thermochem

#:if chemistry
use m_pyrometheus
#:else
use m_pyrometheus, only: &
num_species, species_names, gas_constant, mol_weights, &
get_temperature, get_net_production_rates, get_pressure, &
get_mixture_molecular_weight, get_mixture_energy_mass, &
get_temperature
#:endif

implicit none

#:if not chemistry
integer, parameter :: num_species = 0
character(len=:), allocatable, dimension(:) :: species_names
#:endif
Expand Down
17 changes: 11 additions & 6 deletions src/post_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module m_global_parameters
integer :: pi_inf_idx !< Index of liquid stiffness func. eqn.
type(int_bounds_info) :: stress_idx !< Indices of elastic stresses
integer :: c_idx !< Index of color function
type(int_bounds_info) :: chemistry_idx !< Indexes of first & last concentration eqns.
type(int_bounds_info) :: species_idx !< Indexes of first & last concentration eqns.
type(int_bounds_info) :: temperature_idx !< Indexes of first & last temperature eqns.
!> @}

Expand Down Expand Up @@ -611,13 +611,18 @@ contains
end if

if (chemistry) then
chemistry_idx%beg = sys_size + 1
chemistry_idx%end = sys_size + num_species
sys_size = chemistry_idx%end
species_idx%beg = sys_size + 1
species_idx%end = sys_size + num_species
sys_size = species_idx%end

temperature_idx%beg = sys_size + 1
temperature_idx%end = sys_size + 1
sys_size = temperature_idx%end
else
species_idx%beg = 1
species_idx%end = 1
temperature_idx%beg = 1
temperature_idx%end = 1
end if

momxb = mom_idx%beg
Expand All @@ -632,8 +637,8 @@ contains
strxe = stress_idx%end
intxb = internalEnergies_idx%beg
intxe = internalEnergies_idx%end
chemxb = chemistry_idx%beg
chemxe = chemistry_idx%end
chemxb = species_idx%beg
chemxe = species_idx%end
tempxb = temperature_idx%beg
tempxe = temperature_idx%end

Expand Down
12 changes: 6 additions & 6 deletions src/pre_process/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ module m_global_parameters
integer :: pi_inf_idx !< Index of liquid stiffness func. eqn.
type(int_bounds_info) :: stress_idx !< Indexes of elastic shear stress eqns.
integer :: c_idx !< Index of the color function
type(int_bounds_info) :: chemistry_idx !< Indexes of first & last concentration eqns.
type(int_bounds_info) :: species_idx !< Indexes of first & last concentration eqns.
type(int_bounds_info) :: temperature_idx !< Indexes of first & last temperature eqns.

type(int_bounds_info) :: bc_x, bc_y, bc_z !<
Expand Down Expand Up @@ -696,9 +696,9 @@ contains
end if

if (chemistry) then
chemistry_idx%beg = sys_size + 1
chemistry_idx%end = sys_size + num_species
sys_size = chemistry_idx%end
species_idx%beg = sys_size + 1
species_idx%end = sys_size + num_species
sys_size = species_idx%end

temperature_idx%beg = sys_size + 1
temperature_idx%end = sys_size + 1
Expand All @@ -717,8 +717,8 @@ contains
strxe = stress_idx%end
intxb = internalEnergies_idx%beg
intxe = internalEnergies_idx%end
chemxb = chemistry_idx%beg
chemxe = chemistry_idx%end
chemxb = species_idx%beg
chemxe = species_idx%end
tempxb = temperature_idx%beg
tempxe = temperature_idx%end

Expand Down
16 changes: 8 additions & 8 deletions src/simulation/m_global_parameters.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ module m_global_parameters
integer :: pi_inf_idx !< Index of liquid stiffness func. eqn.
type(int_bounds_info) :: stress_idx !< Indexes of first and last shear stress eqns.
integer :: c_idx ! Index of the color function
type(int_bounds_info) :: chemistry_idx !< Indexes of first & last concentration eqns.
type(int_bounds_info) :: species_idx !< Indexes of first & last concentration eqns.
type(int_bounds_info) :: temperature_idx !< Indexes of first & last temperature eqns.
!> @}

Expand Down Expand Up @@ -286,7 +286,7 @@ module m_global_parameters

integer :: startx, starty, startz

!$acc declare create(sys_size, buff_size, startx, starty, startz, E_idx, gamma_idx, pi_inf_idx, alf_idx, n_idx, stress_idx, chemistry_idx)
!$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)

! END: Simulation Algorithm Parameters =====================================

Expand Down Expand Up @@ -1068,9 +1068,9 @@ contains
end if

if (chemistry) then
chemistry_idx%beg = sys_size + 1
chemistry_idx%end = sys_size + num_species
sys_size = chemistry_idx%end
species_idx%beg = sys_size + 1
species_idx%end = sys_size + num_species
sys_size = species_idx%end

temperature_idx%beg = sys_size + 1
temperature_idx%end = sys_size + 1
Expand All @@ -1089,13 +1089,13 @@ contains
strxe = stress_idx%end
intxb = internalEnergies_idx%beg
intxe = internalEnergies_idx%end
chemxb = chemistry_idx%beg
chemxe = chemistry_idx%end
chemxb = species_idx%beg
chemxe = species_idx%end
tempxb = temperature_idx%beg
tempxe = temperature_idx%end

!$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)
!$acc update device(chemistry_idx)
!$acc update device(species_idx)
!$acc update device(cfl_target, m, n, p)

!$acc update device(alt_soundspeed, acoustic_source, num_source)
Expand Down
2 changes: 1 addition & 1 deletion toolchain/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ pandas

# Chemistry
cantera
pyrometheus @ git+https://github.com/henryleberre/pyrometheus.git@multi-lang-part-2
pyrometheus @ git+https://github.com/pyrometheus/pyrometheus.git@mfc

0 comments on commit 07fd919

Please sign in to comment.