Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
bug fixes for unity Le (#223)
Browse files Browse the repository at this point in the history
Co-authored-by: Bruce Perry <baperry@princeton.edu>
  • Loading branch information
baperry2 and bperry65 committed Apr 21, 2022
1 parent 02b0708 commit d4babf7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Source/PeleLM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ PeleLM::define_data ()
raii_fbs.push_back(std::unique_ptr<FluxBoxes>{new FluxBoxes(this, nEdgeStates, nGrowEdges)});
EdgeFlux = raii_fbs.back()->get();

if (NUM_SPECIES>0 && !unity_Le)
if (NUM_SPECIES>0)
{
raii_fbs.push_back(std::unique_ptr<FluxBoxes>{new FluxBoxes(this, NUM_SPECIES+3, nGrow)});
SpecDiffusionFluxn = raii_fbs.back()->get();
Expand Down
2 changes: 1 addition & 1 deletion Source/PeleLM_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ getTransportCoeffUnityLe(int i, int j, int k,

amrex::Real cpmix = 0.0_rt;
eos.TY2Cp(T(i,j,k), y, cpmix);
lambda(i,j,k) = mu_cgs * 1.0e-1_rt * PrInv * cpmix; // Constant Prandtl number
lambda(i,j,k) = (mu_cgs * 1.0e-1_rt) * PrInv * (cpmix * 1.0e-4_rt); // Constant Prandtl number + unit conversions
}

AMREX_GPU_HOST_DEVICE
Expand Down
21 changes: 15 additions & 6 deletions Source/PeleLM_derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,21 @@ void pelelm_dertransportcoeff (const Box& bx, FArrayBox& derfab, int dcomp, int

// Get the transport GPU data pointer
auto const* ltransparm = PeleLM::trans_parms.device_trans_parm();

amrex::ParallelFor(bx,
[T, rhoY, rhoD, lambda, mu, ltransparm] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
getTransportCoeff( i, j, k, rhoY, T, rhoD, lambda, mu, ltransparm);
});
if ( PeleLM::unity_Le ) {
amrex::Real ScInv = 1.0/PeleLM::schmidt;
amrex::Real PrInv = 1.0/PeleLM::prandtl;
amrex::ParallelFor(bx,
[T, rhoY, rhoD, lambda, mu, ScInv, PrInv, ltransparm] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
getTransportCoeffUnityLe( i, j, k, ScInv, PrInv, rhoY, T, rhoD, lambda, mu, ltransparm);
});
} else {
amrex::ParallelFor(bx,
[T, rhoY, rhoD, lambda, mu, ltransparm] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
getTransportCoeff( i, j, k, rhoY, T, rhoD, lambda, mu, ltransparm);
});
}

}

Expand Down

0 comments on commit d4babf7

Please sign in to comment.