Skip to content

Commit

Permalink
basics of having eos_parm in PeleLMeX
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 committed Sep 13, 2024
1 parent c8b1cab commit db4d0c0
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
6 changes: 6 additions & 0 deletions Source/PeleLMeX.H
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ public:
* velocity, ensuring they sum up to zero. \param a_fluxes diffusion fluxes to
* be updated \param a_spec species rhoYs state data on all levels
*/
template <typename EOSType>
void adjustSpeciesFluxes(
const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
a_spfluxes,
Expand Down Expand Up @@ -1753,6 +1754,11 @@ public:
pele::physics::PhysicsType::transport_type>>
trans_parms;

// EOS pointer
static pele::physics::PeleParams<
pele::physics::eos::EosParm<pele::physics::PhysicsType::eos_type>>
eos_parms;

// Reactor pointer
std::string m_chem_integrator;
std::unique_ptr<pele::physics::reactions::ReactorBase> m_reactor;
Expand Down
5 changes: 5 additions & 0 deletions Source/PeleLMeX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ pele::physics::PeleParams<pele::physics::transport::TransParm<
pele::physics::PhysicsType::transport_type>>
PeleLM::trans_parms;

pele::physics::PeleParams<
pele::physics::eos::EosParm<pele::physics::PhysicsType::eos_type>>
PeleLM::eos_parms;

PeleLM::PeleLM() = default;

PeleLM::~PeleLM()
{
if (m_incompressible == 0) {
trans_parms.deallocate();
eos_parms.deallocate();
m_reactor->close();
}

Expand Down
17 changes: 15 additions & 2 deletions Source/PeleLMeX_Diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ PeleLM::computeDifferentialDiffusionFluxes(
}

// Adjust species diffusion fluxes to ensure their sum is zero
adjustSpeciesFluxes(a_fluxes, GetVecOfConstPtrs(getSpeciesVect(a_time)));
adjustSpeciesFluxes<pele::physics::PhysicsType::eos_type>(
a_fluxes, GetVecOfConstPtrs(getSpeciesVect(a_time)));
//----------------------------------------------------------------

//----------------------------------------------------------------
Expand Down Expand Up @@ -637,6 +638,7 @@ PeleLM::addSoretTerm(
}
}

template <typename EOSType>
void
PeleLM::adjustSpeciesFluxes(
const Vector<Array<MultiFab*, AMREX_SPACEDIM>>& a_spfluxes,
Expand Down Expand Up @@ -745,6 +747,17 @@ PeleLM::adjustSpeciesFluxes(
}
}

template <>
void
PeleLM::adjustSpeciesFluxes<pele::physics::eos::Manifold>(
const Vector<Array<MultiFab*, AMREX_SPACEDIM>>& /*a_spfluxes*/,
Vector<MultiFab const*> const& /*a_spec*/)
{
// Manifold Model: "Species" don't sum to unity, so no need to adjust the
// fluxes
BL_PROFILE("PeleLM::adjustSpeciesFluxes()");
}

void
PeleLM::computeSpeciesEnthalpyFlux(
const Vector<Array<MultiFab*, AMREX_SPACEDIM>>& a_fluxes,
Expand Down Expand Up @@ -1004,7 +1017,7 @@ PeleLM::differentialDiffusionUpdate(
fillPatchSpecies(AmrNewTime);

// Adjust species diffusion fluxes to ensure their sum is zero
adjustSpeciesFluxes(
adjustSpeciesFluxes<pele::physics::PhysicsType::eos_type>(
GetVecOfArrOfPtrs(fluxes), GetVecOfConstPtrs(getSpeciesVect(AmrNewTime)));

// Average down fluxes^{np1,kp1}
Expand Down
8 changes: 8 additions & 0 deletions Source/PeleLMeX_Setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ PeleLM::Setup()

// Initialize EOS and others
if (m_incompressible == 0) {
amrex::Print() << " Initialization of Eos ... \n";
eos_parms.initialize();

amrex::Print() << " Initialization of Transport ... \n";
#ifdef USE_MANIFOLD_EOS
trans_parms.host_only_parm().manfunc_par =
eos_parms.host_only_parm().manfunc_par;
#endif
trans_parms.initialize();
if ((m_les_verbose != 0) and m_do_les) { // Say what transport model we're
// going to use
Expand Down Expand Up @@ -142,6 +149,7 @@ PeleLM::Setup()
m_reactor =
pele::physics::reactions::ReactorBase::create(m_chem_integrator);
m_reactor->init(reactor_type, ncells_chem);
m_reactor->set_eos_parm(eos_parms.device_parm());
// For ReactorNull, we need to also skip instantaneous RR used in divU
if (m_chem_integrator == "ReactorNull") {
m_skipInstantRR = 1;
Expand Down

0 comments on commit db4d0c0

Please sign in to comment.