Skip to content

Commit

Permalink
disable wbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Howarth committed Nov 15, 2024
1 parent c5a16f0 commit b52b30c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
21 changes: 11 additions & 10 deletions Source/PeleLMeX_Diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ PeleLM::correctIsothermalBoundary(
}
}
}
//TODO: wbar fluxes disabled for this case - boundary system becomes complex
// TODO: wbar fluxes disabled for this case - boundary system becomes complex
}

void
Expand Down Expand Up @@ -631,18 +631,18 @@ PeleLM::addWbarTerm(

amrex::ParallelFor(

gbx,
[rho_arr, rhoY_arr, Wbar_arr, gradY_arr, Wbar_boundary_arr, domain,
have_boundary,
phys_bc = m_phys_bc,leosparm] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
getMwmixGivenRY(i, j, k, rho_arr, rhoY_arr, Wbar_arr,leosparm);
gbx, [rho_arr, rhoY_arr, Wbar_arr, gradY_arr, Wbar_boundary_arr, domain,
have_boundary, phys_bc = m_phys_bc,
leosparm] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
getMwmixGivenRY(i, j, k, rho_arr, rhoY_arr, Wbar_arr, leosparm);
if (have_boundary != 0) { // need to impose gradWbar on boundary for
// computeGradient
// for dirichlet boundaries, we'll overwrite inhomog neumann ones
// NOTE: for now, this is skipped since wbar disabled for isothermal/soret
// NOTE: for now, this is skipped since wbar disabled for
// isothermal/soret
Wbar_boundary_arr(i, j, k) = Wbar_arr(i, j, k);
int idx[3] = {i, j, k};
for (int idim = 0; idim < AMREX_SPACEDIM; idim++) {
for (int idim = 0; idim < AMREX_SPACEDIM; idim++) {
const auto bc_lo = phys_bc.lo(idim);
const auto bc_hi = phys_bc.hi(idim);
bool on_lo = (bc_lo == BoundaryCondition::BCNoSlipWallIsotherm ||
Expand All @@ -651,9 +651,10 @@ PeleLM::addWbarTerm(
bool on_hi = (bc_hi == BoundaryCondition::BCNoSlipWallIsotherm ||
bc_hi == BoundaryCondition::BCSlipWallIsotherm) &&
(idx[idim] > domain.bigEnd(idim));

if (on_lo || on_hi) {
getGradMwmixGivengradYMwmix(i, j, k, gradY_arr, Wbar_arr, Wbar_boundary_arr,leosparm);
getGradMwmixGivengradYMwmix(
i, j, k, gradY_arr, Wbar_arr, Wbar_boundary_arr, leosparm);
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions Source/PeleLMeX_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -571,16 +571,18 @@ getGradMwmixGivengradYMwmix(
int k,
amrex::Array4<const amrex::Real> const& gradY,
amrex::Array4<const amrex::Real> const& Mwmix,
amrex::Array4<amrex::Real> const& gradMwmix) noexcept
amrex::Array4<amrex::Real> const& gradMwmix,
pele::physics::eos::EosParm<pele::physics::PhysicsType::eos_type> const*
eosparm) noexcept
{
using namespace amrex::literals;

auto eos = pele::physics::PhysicsType::eos();
auto eos = pele::physics::PhysicsType::eos(eosparm);
amrex::Real imw[NUM_SPECIES] = {0.0_rt};
eos.inv_molecular_weight(imw);
gradMwmix(i, j, k) = 0.0;
for (int n = 0; n < NUM_SPECIES; n++) {
// imw[n] *= 1000.0; // CGS -> MKS
imw[n] *= 1000.0; // CGS -> MKS
gradMwmix(i, j, k) += gradY(i, j, k, n) * imw[n];
}
// gradWbar = -Wbar^2 * sum(grad Y_k / W_k)
Expand Down
8 changes: 5 additions & 3 deletions Source/PeleLMeX_Setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,10 @@ PeleLM::Setup()
<< " Using mixture-averaged transport with Soret effects"
<< std::endl;
if (m_soret_boundary_override != 0) {
amrex::Print() << " Imposing inhomogeneous Neumann conditions "
"for species on isothermal walls"
<< std::endl;
amrex::Print()
<< " Imposing inhomogeneous Neumann conditions "
"for species on isothermal walls. WARNING: use_wbar disabled."
<< std::endl;
}
}
} else {
Expand Down Expand Up @@ -437,6 +438,7 @@ PeleLM::readParameters()
}
if (isothermal) {
m_soret_boundary_override = 1;
m_use_wbar = 0;
#if PELE_USE_EFIELD
amrex::Abort("Isothermal walls with Soret incompatible with Efield");
#endif
Expand Down

0 comments on commit b52b30c

Please sign in to comment.