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

Commit

Permalink
Enabling SRD in PeleLM (#193)
Browse files Browse the repository at this point in the history
* Implement flexible redistribution of the diffusion fluxes.
Controlled by 'ns.diffusion_redistribution_type' and defaulted to
'FluxRedist' for the explicit fluxes.

* Fix up the mac_sync for SRD: mass was lost because SRD of Ucorr rhoY fluxes
didn't add up to that of rho. Fix weirdly forgotten subtract of DdWar
term included twice (did not introduce an error if syncIter == 1);

* Need to set body state after initial redistribution and setVal the
temporary div. holder to zero in flux_divergenceRD.

* Remove constraint of div nGrow since tempary is used when EB.
  • Loading branch information
esclapez authored Aug 27, 2021
1 parent a6a8692 commit 6ce7adf
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 91 deletions.
35 changes: 25 additions & 10 deletions Source/PeleLM.H
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ public:
int scalScomp,
const amrex::MFIter& mfi) override;


virtual void mac_sync () override;
//
// Crse/fine fixup functions.
Expand Down Expand Up @@ -411,20 +410,32 @@ public:
FluxBoxes& fb_betan,
FluxBoxes& fb_betanp1);

void flux_divergence (amrex::MultiFab& fdiv,
int fdivComp,
const amrex::MultiFab* const* extensive_fluxes,
int fluxComp,
int nComp,
amrex::Real scale) const;

void getDiffusivity (amrex::MultiFab* diffusivity[BL_SPACEDIM],
void flux_divergenceRD (const amrex::MultiFab &a_state,
int stateComp,
amrex::MultiFab &a_divergence,
int divComp,
const amrex::MultiFab* const* extensive_fluxes,
int fluxComp,
int nComp,
amrex::BCRec const* d_bc,
amrex::Real scale,
amrex::Real a_dt,
int areSpeciesFluxes = 0);

void flux_divergence (amrex::MultiFab& a_divergence,
int divComp,
const amrex::MultiFab* const* a_ext_fluxes,
int fluxComp,
int nComp,
amrex::Real scale);

void getDiffusivity (amrex::MultiFab* diffusivity[AMREX_SPACEDIM],
const amrex::Real time,
const int state_comp,
const int dst_comp,
const int num_comp);

void getDiffusivity_Wbar (amrex::MultiFab* diffusivity[BL_SPACEDIM],
void getDiffusivity_Wbar (amrex::MultiFab* diffusivity[AMREX_SPACEDIM],
const amrex::Real time);

amrex::DistributionMapping getFuncCountDM (const amrex::BoxArray& bxba, int ngrow);
Expand Down Expand Up @@ -705,6 +716,10 @@ public:
static int iter_debug;
static int mHtoTiterMAX;
static amrex::Vector<amrex::Real> mTmpData;

#ifdef AMREX_USE_EB
static std::string diffusion_redistribution_type;
#endif


static int ncells_chem;
Expand Down
Loading

0 comments on commit 6ce7adf

Please sign in to comment.