|
9 | 9 | module m_chemistry
|
10 | 10 |
|
11 | 11 | use m_thermochem, only: &
|
12 |
| - num_species, molecular_weights, get_temperature, get_net_production_rates |
| 12 | + num_species, molecular_weights, get_temperature, get_net_production_rates, & |
| 13 | + gas_constant, get_mixture_molecular_weight |
13 | 14 |
|
14 | 15 | use m_global_parameters
|
15 | 16 |
|
@@ -58,6 +59,32 @@ contains
|
58 | 59 |
|
59 | 60 | end subroutine s_compute_q_T_sf
|
60 | 61 |
|
| 62 | + subroutine s_compute_T_from_primitives(q_T_sf, q_prim_vf, bounds) |
| 63 | + |
| 64 | + type(scalar_field), intent(inout) :: q_T_sf |
| 65 | + type(scalar_field), dimension(sys_size), intent(in) :: q_prim_vf |
| 66 | + type(int_bounds_info), dimension(1:3), intent(in) :: bounds |
| 67 | + |
| 68 | + integer :: x, y, z, i |
| 69 | + real(wp), dimension(num_species) :: Ys |
| 70 | + real(wp) :: mix_mol_weight |
| 71 | + |
| 72 | + do z = bounds(3)%beg, bounds(3)%end |
| 73 | + do y = bounds(2)%beg, bounds(2)%end |
| 74 | + do x = bounds(1)%beg, bounds(1)%end |
| 75 | + !$acc loop seq |
| 76 | + do i = chemxb, chemxe |
| 77 | + Ys(i - chemxb + 1) = q_prim_vf(i)%sf(x, y, z) |
| 78 | + end do |
| 79 | + |
| 80 | + call get_mixture_molecular_weight(Ys, mix_mol_weight) |
| 81 | + q_T_sf%sf(x, y, z) = q_prim_vf(E_idx)%sf(x, y, z)*mix_mol_weight/(gas_constant*q_prim_vf(1)%sf(x, y, z)) |
| 82 | + end do |
| 83 | + end do |
| 84 | + end do |
| 85 | + |
| 86 | + end subroutine s_compute_T_from_primitives |
| 87 | + |
61 | 88 | subroutine s_compute_chemistry_reaction_flux(rhs_vf, q_cons_qp, q_T_sf, q_prim_qp, bounds)
|
62 | 89 |
|
63 | 90 | type(scalar_field), dimension(sys_size), intent(inout) :: rhs_vf
|
|
0 commit comments