Skip to content

Commit

Permalink
Fix efield (#35)
Browse files Browse the repository at this point in the history
* Fix Efield BCfill with PMF changes.

* Update 1D efield flame source code.
  • Loading branch information
esclapez authored and nickwimer committed Mar 24, 2022
1 parent 215a152 commit 2f99347
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 18 deletions.
12 changes: 6 additions & 6 deletions Exec/Efield/FlameSheetIons/pelelm_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <PeleLM_Index.H>
#include <pelelm_prob_parm.H>
#include <pmf.H>
#include <pmf_data.H>
#include <PMF.H>
#include <PMFData.H>
#include <PelePhysics.H>
#include <EOS_Extension.H>
#include <PeleLMEF_Constants.H>
Expand All @@ -27,7 +27,7 @@ void pelelm_initdata(int i, int j, int k,
amrex::Array4<amrex::Real> const& phiV,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
PmfData const * pmf_data)
pele::physics::PMF::PmfData::DataContainer const * pmf_data)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
Expand Down Expand Up @@ -65,7 +65,7 @@ void pelelm_initdata(int i, int j, int k,
y2 = (y - prob_parm.standoff + 0.5*dx[1] + pert);

y1 += 0.5*dx[1];
PMF::pmf(pmf_data,y1, y1, pmf_vals);
pele::physics::PMF::pmf(pmf_data,y1, y1, pmf_vals);

temp(i,j,k) = pmf_vals[0];;

Expand Down Expand Up @@ -152,7 +152,7 @@ bcnormal(
const amrex::Real time,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
PmfData const *pmf_data)
pele::physics::PMF::PmfData::DataContainer const * pmf_data)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
amrex::GpuArray<amrex::Real, NUM_SPECIES + 4> pmf_vals = {0.0};
Expand All @@ -161,7 +161,7 @@ bcnormal(

auto eos = pele::physics::PhysicsType::eos();
if (sgn == 1) {
PMF::pmf(pmf_data,prob_lo[idir], prob_lo[idir], pmf_vals);
pele::physics::PMF::pmf(pmf_data,prob_lo[idir], prob_lo[idir], pmf_vals);

AMREX_D_TERM(s_ext[VELX] = 0.0;,
s_ext[VELY] = pmf_vals[1];,
Expand Down
6 changes: 1 addition & 5 deletions Exec/Efield/FlameSheetIons/pelelm_prob.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include <PeleLM.H>
#include <AMReX_ParmParse.H>
#include <pmf.H>

void PeleLM::readProbParm()
{
Expand All @@ -14,8 +13,5 @@ void PeleLM::readProbParm()
pp.query("PhiV_y_hi", PeleLM::prob_parm->phiV_hiy);
pp.query("PhiV_y_lo", PeleLM::prob_parm->phiV_loy);

std::string pmf_datafile;
pp.query("pmf_datafile", pmf_datafile);
int pmf_do_average = 1;
PMF::read_pmf(pmf_datafile, pmf_do_average);
PeleLM::pmf_data.initialize();
}
15 changes: 8 additions & 7 deletions Source/Efield/PeleLMEFUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <PeleLM_K.H>
#include <PeleLMEF_K.H>
#include <PeleLMBCfill.H>
#include <pmf_data.H>
#include <AMReX_FillPatchUtil.H>

using namespace amrex;
Expand Down Expand Up @@ -266,19 +265,20 @@ void PeleLM::fillPatchNLnE(Real a_time,
int a_nGrow)
{
ProbParm const* lprobparm = prob_parm_d;
pele::physics::PMF::PmfData::DataContainer const* lpmfdata = pmf_data.getDeviceData();

int lev = 0;
{
PhysBCFunct<GpuBndryFuncFab<PeleLMCCFillExtDirnE>> bndry_func(geom[lev], fetchBCRecArray(NE,1),
PeleLMCCFillExtDirnE{lprobparm, pmf_data_g, m_nAux});
PeleLMCCFillExtDirnE{lprobparm, lpmfdata, m_nAux});
FillPatchSingleLevel(*a_nE[lev],IntVect(a_nGrow),a_time,{a_nE[lev]},{a_time},
0,0,1,geom[lev],bndry_func,0);
}
for (lev = 1; lev <= finest_level; ++lev) {
PhysBCFunct<GpuBndryFuncFab<PeleLMCCFillExtDirnE>> crse_bndry_func(geom[lev-1], fetchBCRecArray(NE,1),
PeleLMCCFillExtDirnE{lprobparm, pmf_data_g, m_nAux});
PeleLMCCFillExtDirnE{lprobparm, lpmfdata, m_nAux});
PhysBCFunct<GpuBndryFuncFab<PeleLMCCFillExtDirnE>> fine_bndry_func(geom[lev], fetchBCRecArray(NE,1),
PeleLMCCFillExtDirnE{lprobparm, pmf_data_g, m_nAux});
PeleLMCCFillExtDirnE{lprobparm, lpmfdata, m_nAux});

Interpolater* mapper = &pc_interp;
FillPatchTwoLevels(*a_nE[lev],IntVect(a_nGrow),a_time,
Expand All @@ -295,19 +295,20 @@ void PeleLM::fillPatchNLphiV(Real a_time,
int a_nGrow)
{
ProbParm const* lprobparm = prob_parm_d;
pele::physics::PMF::PmfData::DataContainer const* lpmfdata = pmf_data.getDeviceData();

int lev = 0;
{
PhysBCFunct<GpuBndryFuncFab<PeleLMCCFillExtDirPhiV>> bndry_func(geom[lev], fetchBCRecArray(PHIV,1),
PeleLMCCFillExtDirPhiV{lprobparm, pmf_data_g, m_nAux});
PeleLMCCFillExtDirPhiV{lprobparm, lpmfdata, m_nAux});
FillPatchSingleLevel(*a_phiV[lev],IntVect(a_nGrow),a_time,{a_phiV[lev]},{a_time},
0,0,1,geom[lev],bndry_func,0);
}
for (lev = 1; lev <= finest_level; ++lev) {
PhysBCFunct<GpuBndryFuncFab<PeleLMCCFillExtDirPhiV>> crse_bndry_func(geom[lev-1], fetchBCRecArray(PHIV,1),
PeleLMCCFillExtDirPhiV{lprobparm, pmf_data_g, m_nAux});
PeleLMCCFillExtDirPhiV{lprobparm, lpmfdata, m_nAux});
PhysBCFunct<GpuBndryFuncFab<PeleLMCCFillExtDirPhiV>> fine_bndry_func(geom[lev], fetchBCRecArray(PHIV,1),
PeleLMCCFillExtDirPhiV{lprobparm, pmf_data_g, m_nAux});
PeleLMCCFillExtDirPhiV{lprobparm, lpmfdata, m_nAux});

Interpolater* mapper = &pc_interp;
FillPatchTwoLevels(*a_phiV[lev],IntVect(a_nGrow),a_time,
Expand Down

0 comments on commit 2f99347

Please sign in to comment.