Skip to content

Commit c36ce91

Browse files
authored
Dummy Chemistry Mechanism (#680) (#689)
1 parent e4cf90b commit c36ce91

File tree

15 files changed

+71
-75
lines changed

15 files changed

+71
-75
lines changed

src/common/m_derived_types.fpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
module m_derived_types
1010

1111
use m_constants !< Constants
12-
use m_thermochem !< Thermodynamic properties
12+
13+
use m_thermochem, only: num_species
1314

1415
implicit none
1516

src/common/m_thermochem.fpp

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/common/m_variables_conversion.fpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ module m_variables_conversion
2222

2323
use m_helper
2424

25-
use m_thermochem
25+
use m_thermochem, only: &
26+
num_species, get_temperature, get_pressure, &
27+
get_mixture_molecular_weight, get_mixture_energy_mass
2628

2729
! ==========================================================================
2830

@@ -1126,7 +1128,7 @@ contains
11261128
q_prim_vf(i)%sf(j, k, l)/2d0
11271129
end do
11281130

1129-
#:if chemistry
1131+
if (chemistry) then
11301132
do i = chemxb, chemxe
11311133
Ys(i - chemxb + 1) = q_prim_vf(i)%sf(j, k, l)
11321134
q_cons_vf(i)%sf(j, k, l) = rho*q_prim_vf(i)%sf(j, k, l)
@@ -1140,7 +1142,7 @@ contains
11401142
dyn_pres + rho*e_mix
11411143

11421144
q_cons_vf(T_idx)%sf(j, k, l) = q_prim_vf(T_idx)%sf(j, k, l)
1143-
#:else
1145+
else
11441146
! Computing the energy from the pressure
11451147
if ((model_eqns /= 4) .and. (bubbles .neqv. .true.)) then
11461148
! E = Gamma*P + \rho u u /2 + \pi_inf + (\alpha\rho qv)
@@ -1156,7 +1158,7 @@ contains
11561158
!Tait EOS, no conserved energy variable
11571159
q_cons_vf(E_idx)%sf(j, k, l) = 0.
11581160
end if
1159-
#:endif
1161+
end if
11601162

11611163
! Computing the internal energies from the pressure and continuities
11621164
if (model_eqns == 3) then

src/post_process/m_global_parameters.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module m_global_parameters
1818

1919
use m_helper_basic !< Functions to compare floating point numbers
2020

21-
use m_thermochem !< Thermodynamic and chemical properties module
21+
use m_thermochem, only: num_species, species_names
2222

2323
! ==========================================================================
2424

src/post_process/m_start_up.f90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ module m_start_up
3535

3636
use m_checker
3737

38-
use m_thermochem !< Procedures used to compute thermodynamic
39-
!! quantities
38+
use m_thermochem, only: num_species, species_names
4039

4140
use m_finite_differences
4241

src/pre_process/m_assign_variables.fpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module m_assign_variables
1515

1616
use m_helper_basic !< Functions to compare floating point numbers
1717

18-
use m_thermochem !< Thermodynamic and chemical properties
18+
use m_thermochem, only: num_species, gas_constant, get_mixture_molecular_weight
1919

2020
! one form to another
2121
! ==========================================================================
@@ -166,7 +166,7 @@ contains
166166
+ (1d0 - eta)*patch_icpp(smooth_patch_id)%pi_inf
167167
168168
! Species Concentrations
169-
#:if chemistry
169+
if (chemistry) then
170170
block
171171
real(kind(0d0)) :: sum, term
172172
@@ -194,7 +194,7 @@ contains
194194
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))
197-
#:endif
197+
end if
198198
199199
! Updating the patch identities bookkeeping variable
200200
if (1d0 - eta < 1d-16) patch_id_fp(j, k, l) = patch_id
@@ -543,7 +543,7 @@ contains
543543
end do
544544
545545
! Species Concentrations
546-
#:if chemistry
546+
if (chemistry) then
547547
block
548548
real(kind(0d0)) :: sum, term
549549
@@ -572,7 +572,7 @@ contains
572572
call get_mixture_molecular_weight(Ys, mean_molecular_weight)
573573
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))
575-
#:endif
575+
end if
576576
577577
! Set streamwise velocity to hyperbolic tangent function of y
578578
if (mixlayer_vel_profile) then

src/pre_process/m_data_output.fpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module m_data_output
2929
use m_helper
3030

3131
use m_delay_file_access
32+
33+
use m_thermochem, only: species_names
34+
3235
! ==========================================================================
3336

3437
implicit none

src/pre_process/m_global_parameters.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module m_global_parameters
1818

1919
use m_helper_basic ! Functions to compare floating point numbers
2020

21-
use m_thermochem ! Thermodynamic and chemical properties
21+
use m_thermochem, only: num_species
2222

2323
! ==========================================================================
2424

src/simulation/include/inline_riemann.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
vel_avg_rms = (sqrt(rho_L)*vel_L(1) + sqrt(rho_R)*vel_R(1))**2d0/ &
3232
(sqrt(rho_L) + sqrt(rho_R))**2d0
3333

34-
#:if chemistry
34+
if (chemistry) then
3535
eps = 0.001d0
3636
call get_species_enthalpies_rt(T_L, h_iL)
3737
call get_species_enthalpies_rt(T_R, h_iR)
@@ -59,7 +59,7 @@
5959

6060
Phi_avg(:) = (gamma_avg - 1.d0)*(vel_avg_rms/2.0d0 - h_avg_2(:)) + gamma_avg*gas_constant/mol_weights(:)*T_avg
6161
c_sum_Yi_Phi = sum(Yi_avg(:)*Phi_avg(:))
62-
#:endif
62+
end if
6363

6464
#:enddef roe_avg
6565

src/simulation/m_chemistry.fpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ module m_chemistry
1111
use ieee_arithmetic
1212

1313
use m_mpi_proxy
14-
use m_thermochem
14+
use m_thermochem, only: &
15+
num_species, mol_weights, get_net_production_rates
16+
1517
use m_global_parameters
18+
1619
use m_finite_differences
1720

1821
implicit none
@@ -116,8 +119,7 @@ contains
116119
real(kind(0d0)), dimension(num_species) :: omega
117120
real(kind(0d0)) :: cp_mix
118121

119-
#:if chemistry
120-
122+
if (chemistry) then
121123
!$acc parallel loop collapse(3) gang vector default(present) &
122124
!$acc private(Ys, omega)
123125
do z = idwint(3)%beg, idwint(3)%end
@@ -147,11 +149,11 @@ contains
147149
end do
148150
end do
149151

150-
#:else
152+
else
151153

152154
@:ASSERT(.false., "Chemistry is not enabled")
153155

154-
#:endif
156+
end if
155157

156158
end subroutine s_compute_chemistry_reaction_flux
157159

0 commit comments

Comments
 (0)