Skip to content

Multicomponent diffusion fluxes, thermal conduction, and mixture viscosity #888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
26f8438
Diffusion Fluxes
DimAdam-01 Jun 8, 2025
7321195
Debugging
DimAdam-01 Jun 9, 2025
bd73252
....
DimAdam-01 Jun 9, 2025
54a0cc4
dfedfe
DimAdam-01 Jun 10, 2025
5cf3a68
dff
DimAdam-01 Jun 11, 2025
7dd0869
MInor Bugs
DimAdam-01 Jun 11, 2025
ba9a48a
Minor Bugs
DimAdam-01 Jun 11, 2025
d9ee1f0
fef
Jun 11, 2025
52a7936
fkjkfje
Jun 11, 2025
8248f97
ferfe
DimAdam-01 Jun 12, 2025
859c085
Merge branch 'Diffusion' of https://github.com/DimAdam-01/MFC-Adam in…
DimAdam-01 Jun 12, 2025
c604675
Loop stuff
DimAdam-01 Jun 12, 2025
beb8022
...
DimAdam-01 Jun 12, 2025
4232149
Delta Issue
Jun 13, 2025
3c6654e
Small Changes
DimAdam-01 Jun 16, 2025
1f126d6
Small Changes V2
DimAdam-01 Jun 16, 2025
8b63895
...
DimAdam-01 Jun 16, 2025
b7ff1db
Spelling
DimAdam-01 Jun 16, 2025
369ad7a
Merge branch 'MFlowCode:master' into Diffusion
DimAdam-01 Jun 16, 2025
59ca1c7
Merge branch 'master' into Diffusion
sbryngelson Jun 18, 2025
3ed1ca3
Merge branch 'master' into Diffusion
sbryngelson Jun 21, 2025
616a3f4
Merge branch 'master' into Diffusion
sbryngelson Jun 21, 2025
98980bd
Refactoring and Deallocation
DimAdam-01 Jun 21, 2025
31ec1aa
Merge branch 'Diffusion' of https://github.com/DimAdam-01/MFC-Adam in…
DimAdam-01 Jun 21, 2025
2cd25d3
Small Stuff
DimAdam-01 Jun 21, 2025
6cc8fec
Small Changes
DimAdam-01 Jun 21, 2025
132123d
Merge branch 'master' into Diffusion
sbryngelson Jun 21, 2025
1186335
Chem ToolChain
DimAdam-01 Jun 21, 2025
6988404
Merge branch 'Diffusion' of https://github.com/DimAdam-01/MFC-Adam in…
DimAdam-01 Jun 21, 2025
2ccbc6d
...
DimAdam-01 Jun 21, 2025
17b9194
..
DimAdam-01 Jun 22, 2025
cf1b9a2
Diffusion Golden File
DimAdam-01 Jun 23, 2025
61734ef
Remove Stuff
DimAdam-01 Jun 23, 2025
68cf1b3
...
DimAdam-01 Jun 23, 2025
7172f7c
Toolchain case
DimAdam-01 Jun 23, 2025
e5a79cd
Small changes
DimAdam-01 Jun 24, 2025
6e619b2
Small Stuff
Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 149 additions & 1 deletion src/common/m_chemistry.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@

use m_thermochem, only: &
num_species, molecular_weights, get_temperature, get_net_production_rates, &
gas_constant, get_mixture_molecular_weight
get_mole_fractions, get_species_binary_mass_diffusivities, &
get_species_mass_diffusivities_mixavg, gas_constant, get_mixture_molecular_weight, &
get_mixture_energy_mass, get_mixture_thermal_conductivity_mixavg, get_species_enthalpies_rt

use m_global_parameters

implicit none

type(int_bounds_info) :: isc1, isc2, isc3
!$acc declare create(isc1, isc2, isc3)

integer, dimension(3) :: offsets
!$acc declare create(offsets)
contains

subroutine s_compute_q_T_sf(q_T_sf, q_cons_vf, bounds)
Expand Down Expand Up @@ -130,4 +137,145 @@

end subroutine s_compute_chemistry_reaction_flux

subroutine s_compute_chemistry_diffusion_flux(idir, q_prim_qp, flux_src_vf, irx, iry, irz)

Check warning on line 140 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L140

Added line #L140 was not covered by tests

type(scalar_field), dimension(sys_size), intent(in) :: q_prim_qp
type(scalar_field), dimension(sys_size), intent(inout) :: flux_src_vf
type(int_bounds_info), intent(in) :: irx, iry, irz

integer, intent(in) :: idir

real(wp), dimension(num_species) :: Xs_L, Xs_R, Xs_cell, Ys_L, Ys_R, Ys_cell
real(wp), dimension(num_species) :: mass_diffusivities_mixavg1, mass_diffusivities_mixavg2
real(wp), dimension(num_species) :: mass_diffusivities_mixavg_Cell, dXk_dxi, h_l, h_r, h_k
real(wp), dimension(num_species) :: Mass_Diffu_Flux
real(wp) :: Mass_Diffu_Energy
real(wp) :: MW_L, MW_R, MW_cell, Rgas_L, Rgas_R, T_L, T_R, P_L, P_R, rho_L, rho_R, rho_cell, rho_Vic
real(wp) :: lambda_L, lambda_R, lambda_Cell, dT_dxi, grid_spacing

integer :: x, y, z, i, n, eqn
integer, dimension(3) :: offsets

isc1 = irx; isc2 = iry; isc3 = irz

Check warning on line 159 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L159

Added line #L159 was not covered by tests

!$acc update device(isc1, isc2, isc3)

if (chemistry) then
! Set offsets based on direction using array indexing
offsets = 0
offsets(idir) = 1

Check warning on line 166 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L165-L166

Added lines #L165 - L166 were not covered by tests

!$acc parallel loop collapse(3) gang vector default(present) copyin(offsets) &
!$acc private(Ys_L,Ys_R,Ys_cell,Xs_L,Xs_R,mass_diffusivities_mixavg1,mass_diffusivities_mixavg2,mass_diffusivities_mixavg_Cell,h_l,h_r,Xs_cell,h_k,dXk_dxi,Mass_Diffu_Flux)
do z = isc3%beg, isc3%end
do y = isc2%beg, isc2%end
do x = isc1%beg, isc1%end

Check warning on line 172 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L170-L172

Added lines #L170 - L172 were not covered by tests
! Calculate grid spacing using direction-based indexing
select case (idir)

Check warning on line 174 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L174

Added line #L174 was not covered by tests
case (1)
grid_spacing = x_cc(x + 1) - x_cc(x)

Check warning on line 176 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L176

Added line #L176 was not covered by tests
case (2)
grid_spacing = y_cc(y + 1) - y_cc(y)

Check warning on line 178 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L178

Added line #L178 was not covered by tests
case (3)
grid_spacing = z_cc(z + 1) - z_cc(z)

Check warning on line 180 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L180

Added line #L180 was not covered by tests
end select

! Extract species mass fractions
!$acc loop seq
do i = chemxb, chemxe
Ys_L(i - chemxb + 1) = q_prim_qp(i)%sf(x, y, z)
Ys_R(i - chemxb + 1) = q_prim_qp(i)%sf(x + offsets(1), y + offsets(2), z + offsets(3))
Ys_cell(i - chemxb + 1) = 0.5_wp*(Ys_L(i - chemxb + 1) + Ys_R(i - chemxb + 1))

Check warning on line 188 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L185-L188

Added lines #L185 - L188 were not covered by tests
end do

! Calculate molecular weights and mole fractions
call get_mixture_molecular_weight(Ys_L, MW_L)
call get_mixture_molecular_weight(Ys_R, MW_R)
MW_cell = 0.5_wp*(MW_L + MW_R)

Check warning on line 194 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L192-L194

Added lines #L192 - L194 were not covered by tests

call get_mole_fractions(MW_L, Ys_L, Xs_L)
call get_mole_fractions(MW_R, Ys_R, Xs_R)

Check warning on line 197 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L196-L197

Added lines #L196 - L197 were not covered by tests

! Calculate gas constants and thermodynamic properties
Rgas_L = gas_constant/MW_L
Rgas_R = gas_constant/MW_R

Check warning on line 201 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L200-L201

Added lines #L200 - L201 were not covered by tests

P_L = q_prim_qp(E_idx)%sf(x, y, z)
P_R = q_prim_qp(E_idx)%sf(x + offsets(1), y + offsets(2), z + offsets(3))

Check warning on line 204 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L203-L204

Added lines #L203 - L204 were not covered by tests

rho_L = q_prim_qp(1)%sf(x, y, z)
rho_R = q_prim_qp(1)%sf(x + offsets(1), y + offsets(2), z + offsets(3))

Check warning on line 207 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L206-L207

Added lines #L206 - L207 were not covered by tests

T_L = P_L/rho_L/Rgas_L
T_R = P_R/rho_R/Rgas_R

Check warning on line 210 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L209-L210

Added lines #L209 - L210 were not covered by tests

rho_cell = 0.5_wp*(rho_L + rho_R)
dT_dxi = (T_R - T_L)/grid_spacing

Check warning on line 213 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L212-L213

Added lines #L212 - L213 were not covered by tests

! Get transport properties
call get_species_mass_diffusivities_mixavg(P_L, T_L, Ys_L, mass_diffusivities_mixavg1)
call get_species_mass_diffusivities_mixavg(P_R, T_R, Ys_R, mass_diffusivities_mixavg2)

Check warning on line 217 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L216-L217

Added lines #L216 - L217 were not covered by tests

call get_mixture_thermal_conductivity_mixavg(T_L, Ys_L, lambda_L)
call get_mixture_thermal_conductivity_mixavg(T_R, Ys_R, lambda_R)

Check warning on line 220 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L219-L220

Added lines #L219 - L220 were not covered by tests

call get_species_enthalpies_rt(T_L, h_l)
call get_species_enthalpies_rt(T_R, h_r)

Check warning on line 223 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L222-L223

Added lines #L222 - L223 were not covered by tests

! Calculate species properties and gradients
!$acc loop seq
do i = chemxb, chemxe
h_l(i - chemxb + 1) = h_l(i - chemxb + 1)*gas_constant*T_L/molecular_weights(i - chemxb + 1)
h_r(i - chemxb + 1) = h_r(i - chemxb + 1)*gas_constant*T_R/molecular_weights(i - chemxb + 1)
Xs_cell(i - chemxb + 1) = 0.5_wp*(Xs_L(i - chemxb + 1) + Xs_R(i - chemxb + 1))
h_k(i - chemxb + 1) = 0.5_wp*(h_l(i - chemxb + 1) + h_r(i - chemxb + 1))
dXk_dxi(i - chemxb + 1) = (Xs_R(i - chemxb + 1) - Xs_L(i - chemxb + 1))/grid_spacing

Check warning on line 232 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L227-L232

Added lines #L227 - L232 were not covered by tests
end do

! Calculate mixture-averaged diffusivities
!$acc loop seq
do i = chemxb, chemxe

Check warning on line 237 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L237

Added line #L237 was not covered by tests
mass_diffusivities_mixavg_Cell(i - chemxb + 1) = &
(mass_diffusivities_mixavg2(i - chemxb + 1) + mass_diffusivities_mixavg1(i - chemxb + 1))/ &
2.0_wp*(1.0_wp - Xs_cell(i - chemxb + 1))/(1.0_wp - Ys_cell(i - chemxb + 1))

Check warning on line 240 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L239-L240

Added lines #L239 - L240 were not covered by tests
end do

lambda_Cell = 0.5_wp*(lambda_R + lambda_L)

Check warning on line 243 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L243

Added line #L243 was not covered by tests

! Calculate mass diffusion fluxes
rho_Vic = 0.0_wp
Mass_Diffu_Energy = 0.0_wp

!$acc loop seq
do eqn = chemxb, chemxe
Mass_Diffu_Flux(eqn - chemxb + 1) = rho_cell*mass_diffusivities_mixavg_Cell(eqn - chemxb + 1)* &
molecular_weights(eqn - chemxb + 1)/MW_cell*dXk_dxi(eqn - chemxb + 1)
rho_Vic = rho_Vic + Mass_Diffu_Flux(eqn - chemxb + 1)
Mass_Diffu_Energy = Mass_Diffu_Energy + h_k(eqn - chemxb + 1)*Mass_Diffu_Flux(eqn - chemxb + 1)

Check warning on line 254 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L250-L254

Added lines #L250 - L254 were not covered by tests
end do

! Apply corrections for mass conservation
!$acc loop seq
do eqn = chemxb, chemxe
Mass_Diffu_Energy = Mass_Diffu_Energy - h_k(eqn - chemxb + 1)*Ys_cell(eqn - chemxb + 1)*rho_Vic
Mass_Diffu_Flux(eqn - chemxb + 1) = Mass_Diffu_Flux(eqn - chemxb + 1) - rho_Vic*Ys_cell(eqn - chemxb + 1)

Check warning on line 261 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L259-L261

Added lines #L259 - L261 were not covered by tests
end do

! Add thermal conduction contribution
Mass_Diffu_Energy = lambda_Cell*dT_dxi + Mass_Diffu_Energy

Check warning on line 265 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L265

Added line #L265 was not covered by tests

! Update flux arrays
flux_src_vf(E_idx)%sf(x, y, z) = flux_src_vf(E_idx)%sf(x, y, z) - Mass_Diffu_Energy

Check warning on line 268 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L268

Added line #L268 was not covered by tests

!$acc loop seq
do eqn = chemxb, chemxe
flux_src_vf(eqn)%sf(x, y, z) = flux_src_vf(eqn)%sf(x, y, z) - Mass_diffu_Flux(eqn - chemxb + 1)

Check warning on line 272 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L271-L272

Added lines #L271 - L272 were not covered by tests
end do
end do
end do
end do
end if

end subroutine s_compute_chemistry_diffusion_flux

Check warning on line 279 in src/common/m_chemistry.fpp

View check run for this annotation

Codecov / codecov/patch

src/common/m_chemistry.fpp#L279

Added line #L279 was not covered by tests

end module m_chemistry
157 changes: 123 additions & 34 deletions src/simulation/m_rhs.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@
& idwbuff(2)%beg:idwbuff(2)%end, &
& idwbuff(3)%beg:idwbuff(3)%end))
end do
if (chem_params%diffusion .and. .not. viscous) then
@:ALLOCATE(flux_src_n(i)%vf(E_idx)%sf( &

Check warning on line 535 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L535

Added line #L535 was not covered by tests
& idwbuff(1)%beg:idwbuff(1)%end, &
& idwbuff(2)%beg:idwbuff(2)%end, &
& idwbuff(3)%beg:idwbuff(3)%end))
end if
end if

else
Expand Down Expand Up @@ -795,9 +801,15 @@
q_prim_qp%vf, &
rhs_vf)
call nvtxEndRange
! RHS for diffusion
if (chemistry .and. chem_params%diffusion) then
call nvtxStartRange("RHS-CHEM-DIFFUSION")
call s_compute_chemistry_diffusion_flux(id, q_prim_qp%vf, flux_src_n(id)%vf, irx, iry, irz)
call nvtxEndRange

Check warning on line 808 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L806-L808

Added lines #L806 - L808 were not covered by tests
end if

! RHS additions for viscosity
if (viscous .or. surface_tension) then
if (viscous .or. surface_tension .or. chem_params%diffusion) then
call nvtxStartRange("RHS-ADD-PHYSICS")
call s_compute_additional_physics_rhs(id, &
q_prim_qp%vf, &
Expand Down Expand Up @@ -1414,20 +1426,46 @@
end do
end if

!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n
do j = 0, m
!$acc loop seq
do i = momxb, E_idx
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dx(j)* &
(flux_src_n(i)%sf(j - 1, k, l) &
- flux_src_n(i)%sf(j, k, l))
if (surface_tension .or. viscous) then
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n

Check warning on line 1432 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1432

Added line #L1432 was not covered by tests
do j = 0, m
!$acc loop seq
do i = momxb, E_idx
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dx(j)* &
(flux_src_n(i)%sf(j - 1, k, l) &
- flux_src_n(i)%sf(j, k, l))

Check warning on line 1439 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1437-L1439

Added lines #L1437 - L1439 were not covered by tests
end do
end do
end do
end do
end do
end if

if (chem_params%diffusion) then
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n
do j = 0, m

Check warning on line 1450 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1448-L1450

Added lines #L1448 - L1450 were not covered by tests
!$acc loop seq
do i = chemxb, chemxe

Check warning on line 1452 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1452

Added line #L1452 was not covered by tests
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dx(j)* &
(flux_src_n(i)%sf(j - 1, k, l) &
- flux_src_n(i)%sf(j, k, l))

Check warning on line 1456 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1454-L1456

Added lines #L1454 - L1456 were not covered by tests
end do

if (.not. viscous) then
rhs_vf(E_idx)%sf(j, k, l) = &
rhs_vf(E_idx)%sf(j, k, l) + 1._wp/dx(j)* &
(flux_src_n(E_idx)%sf(j - 1, k, l) &
- flux_src_n(E_idx)%sf(j, k, l))

Check warning on line 1463 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1461-L1463

Added lines #L1461 - L1463 were not covered by tests
end if
end do
end do
end do
end if

elseif (idir == 2) then ! y-direction

Expand Down Expand Up @@ -1495,20 +1533,46 @@
end do

else
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n
do j = 0, m
!$acc loop seq
do i = momxb, E_idx
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dy(k)* &
(flux_src_n(i)%sf(j, k - 1, l) &
- flux_src_n(i)%sf(j, k, l))

if (viscous .or. surface_tension) then
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n

Check warning on line 1540 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1540

Added line #L1540 was not covered by tests
do j = 0, m
!$acc loop seq
do i = momxb, E_idx
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dy(k)* &
(flux_src_n(i)%sf(j, k - 1, l) &
- flux_src_n(i)%sf(j, k, l))

Check warning on line 1547 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1545-L1547

Added lines #L1545 - L1547 were not covered by tests
end do
end do
end do
end do
end do
end if

if (chem_params%diffusion) then
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n
do j = 0, m

Check warning on line 1558 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1556-L1558

Added lines #L1556 - L1558 were not covered by tests
!$acc loop seq
do i = chemxb, chemxe

Check warning on line 1560 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1560

Added line #L1560 was not covered by tests
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dy(k)* &
(flux_src_n(i)%sf(j, k - 1, l) &
- flux_src_n(i)%sf(j, k, l))

Check warning on line 1564 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1562-L1564

Added lines #L1562 - L1564 were not covered by tests
end do
if (.not. viscous) then
rhs_vf(E_idx)%sf(j, k, l) = &
rhs_vf(E_idx)%sf(j, k, l) + 1._wp/dy(k)* &
(flux_src_n(E_idx)%sf(j, k - 1, l) &
- flux_src_n(E_idx)%sf(j, k, l))

Check warning on line 1570 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1568-L1570

Added lines #L1568 - L1570 were not covered by tests
end if
end do
end do
end do
end if
end if

! Applying the geometrical viscous Riemann source fluxes calculated as average
Expand Down Expand Up @@ -1581,20 +1645,45 @@
end do
end if

!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n
do j = 0, m
!$acc loop seq
do i = momxb, E_idx
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dz(l)* &
(flux_src_n(i)%sf(j, k, l - 1) &
- flux_src_n(i)%sf(j, k, l))
if (viscous .or. surface_tension) then
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n

Check warning on line 1651 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1651

Added line #L1651 was not covered by tests
do j = 0, m
!$acc loop seq
do i = momxb, E_idx
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dz(l)* &
(flux_src_n(i)%sf(j, k, l - 1) &
- flux_src_n(i)%sf(j, k, l))

Check warning on line 1658 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1656-L1658

Added lines #L1656 - L1658 were not covered by tests
end do
end do
end do
end do
end do
end if

if (chem_params%diffusion) then
!$acc parallel loop collapse(3) gang vector default(present)
do l = 0, p
do k = 0, n
do j = 0, m

Check warning on line 1669 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1667-L1669

Added lines #L1667 - L1669 were not covered by tests
!$acc loop seq
do i = chemxb, chemxe

Check warning on line 1671 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1671

Added line #L1671 was not covered by tests
rhs_vf(i)%sf(j, k, l) = &
rhs_vf(i)%sf(j, k, l) + 1._wp/dz(l)* &
(flux_src_n(i)%sf(j, k, l - 1) &
- flux_src_n(i)%sf(j, k, l))

Check warning on line 1675 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1673-L1675

Added lines #L1673 - L1675 were not covered by tests
end do
if (.not. viscous) then
rhs_vf(E_idx)%sf(j, k, l) = &
rhs_vf(E_idx)%sf(j, k, l) + 1._wp/dz(l)* &
(flux_src_n(E_idx)%sf(j, k, l - 1) &
- flux_src_n(E_idx)%sf(j, k, l))

Check warning on line 1681 in src/simulation/m_rhs.fpp

View check run for this annotation

Codecov / codecov/patch

src/simulation/m_rhs.fpp#L1679-L1681

Added lines #L1679 - L1681 were not covered by tests
end if
end do
end do
end do
end if

if (grid_geometry == 3) then
!$acc parallel loop collapse(3) gang vector default(present)
Expand Down
Loading
Loading