Skip to content

Commit

Permalink
CMake EB Cases (#315)
Browse files Browse the repository at this point in the history
* do EB cases for cmake with USE_EB, also make these cases tidy

* fix soot cmake compilation

---------

Co-authored-by: Bruce Perry <[email protected]>
Co-authored-by: Bruce Perry <[email protected]>
  • Loading branch information
3 people authored Nov 20, 2023
1 parent 047b533 commit a30a31b
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 122 deletions.
3 changes: 1 addition & 2 deletions CMake/BuildPeleLMeXExe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ function(build_pelelmex_exe pelelmex_exe_name pelelmex_lib_name)
${PELEMP_SRC_DIR}/Soot_Models/SootData.H
${PELEMP_SRC_DIR}/Soot_Models/SootReactions.H
${PELEMP_SRC_DIR}/Soot_Models/SootModel.H
${PELEMP_SRC_DIR}/Soot_Models/SootModel_derive.H
${SRC_DIR}/PeleLMeXSoot.cpp)
${PELEMP_SRC_DIR}/Soot_Models/SootModel_derive.H)
target_include_directories(${pelelmex_exe_name} PRIVATE ${PELEMP_SRC_DIR}/Soot_Models)
endif()

Expand Down
37 changes: 20 additions & 17 deletions Exec/RegTests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#add_subdirectory(EB_BackwardStepFlame)
#add_subdirectory(EB_EnclosedFlame)
#add_subdirectory(EB_EnclosedVortex)
#add_subdirectory(EB_FlowPastCylinder)
#add_subdirectory(EB_PipeFlow)
add_subdirectory(EnclosedFlame)
add_subdirectory(EnclosedInjection)
add_subdirectory(FlameSheet)
add_subdirectory(HITDecay)
add_subdirectory(HotBubble)
add_subdirectory(PeriodicCases)
#add_subdirectory(SprayTest)
add_subdirectory(TaylorGreen)
add_subdirectory(TripleFlame)
if(PELELMEX_DIM GREATER 2)
add_subdirectory(TurbInflow)
if(PELELMEX_ENABLE_EB)
add_subdirectory(EB_BackwardStepFlame)
add_subdirectory(EB_EnclosedFlame)
add_subdirectory(EB_EnclosedVortex)
add_subdirectory(EB_FlowPastCylinder)
add_subdirectory(EB_PipeFlow)
else()
add_subdirectory(EnclosedFlame)
add_subdirectory(EnclosedInjection)
add_subdirectory(FlameSheet)
add_subdirectory(HITDecay)
add_subdirectory(HotBubble)
add_subdirectory(PeriodicCases)
#add_subdirectory(SprayTest)
add_subdirectory(TaylorGreen)
add_subdirectory(TripleFlame)
if(PELELMEX_DIM GREATER 2)
add_subdirectory(TurbInflow)
endif()
#add_subdirectory(Unit)
endif()
#add_subdirectory(Unit)
28 changes: 9 additions & 19 deletions Exec/RegTests/EB_BackwardStepFlame/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,18 @@ pelelmex_initdata(
int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& aux,
amrex::Array4<amrex::Real> const& /*aux*/,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();

AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
, const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];
, const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];);

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];
, const amrex::Real Ly = prob_hi[1] - prob_lo[1];
, const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

AMREX_D_TERM(const amrex::Real x_c = prob_lo[0] + 0.5 * Lx;
, const amrex::Real y_c = prob_lo[1] + 0.5 * Ly;
, const amrex::Real z_c = prob_lo[2] + 0.5 * Lz);
const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];

auto eos = pele::physics::PhysicsType::eos();
constexpr amrex::Real Pi = 3.14159265358979323846264338327950288;

amrex::Real massfrac[NUM_SPECIES] = {0.0};

Expand All @@ -52,8 +41,9 @@ pelelmex_initdata(
AMREX_D_TERM(state(i, j, k, VELX) = prob_parm.meanFlowMag;
, state(i, j, k, VELY) = 0.0;, state(i, j, k, VELZ) = 0.0);

if (is_incompressible)
if (!(is_incompressible == 0)) {
return;
}

if (x > 0.0 && y < 0.0) {
state(i, j, k, TEMP) = prob_parm.T_hot;
Expand Down Expand Up @@ -86,13 +76,13 @@ AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real x[AMREX_SPACEDIM],
const int m_nAux,
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int /*m_nAux*/,
amrex::Real s_ext[NVAR],
const int idir,
const int sgn,
const amrex::Real time,
amrex::GeometryData const& geomdata,
const amrex::Real /*time*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB_BackwardStepFlame/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand Down
31 changes: 15 additions & 16 deletions Exec/RegTests/EB_EnclosedFlame/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pelelmex_initdata(
int i,
int j,
int k,
int is_incompressible,
int /*is_incompressible*/,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& /*aux*/,
amrex::GeometryData const& geomdata,
Expand All @@ -38,8 +38,7 @@ pelelmex_initdata(
, const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

AMREX_D_TERM(const amrex::Real xc = prob_lo[0] + 0.5 * Lx;
, const amrex::Real yc = prob_lo[1] + 0.5 * Ly;
, const amrex::Real zc = prob_lo[2] + 0.5 * Lz;);
, const amrex::Real yc = prob_lo[1] + 0.5 * Ly;, );

constexpr amrex::Real Pi = 3.14159265358979323846264338327950288;

Expand All @@ -62,8 +61,8 @@ pelelmex_initdata(

amrex::Real y1 =
3.6 - (radius - prob_parm.standoff - 1.42 * dx[1] + pert) * 100;
amrex::Real y2 =
3.6 - (radius - prob_parm.standoff + 1.42 * dx[1] + pert) * 100;
// amrex::Real y2 =
// 3.6 - (radius - prob_parm.standoff + 1.42 * dx[1] + pert) * 100;

#elif (AMREX_SPACEDIM == 3)
amrex::Real pertLz = (prob_parm.pertLz > 0.0) ? prob_parm.pertLz : Lz;
Expand All @@ -79,8 +78,8 @@ pelelmex_initdata(

amrex::Real y1 =
3.6 - (radius - prob_parm.standoff - 1.42 * dx[1] + pert) * 100;
amrex::Real y2 =
3.6 - (radius - prob_parm.standoff + 1.42 * dx[1] + pert) * 100;
// amrex::Real y2 =
// 3.6 - (radius - prob_parm.standoff + 1.42 * dx[1] + pert) * 100;
#endif

pele::physics::PMF::pmf(pmf_data, y1, y1, pmf_vals);
Expand Down Expand Up @@ -124,16 +123,16 @@ AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int m_nAux,
amrex::Real s_ext[NVAR],
const int idir,
const int sgn,
const amrex::Real time,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* pmf_data)
const int /*m_nAux*/,
amrex::Real* /*s_ext[NVAR]*/,
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& /*prob_parm*/,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
amrex::Abort("Shouldn't ever be here");
}

AMREX_GPU_DEVICE
Expand Down
40 changes: 16 additions & 24 deletions Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,20 @@ pelelmex_initdata(
int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& aux,
amrex::Array4<amrex::Real> const& /*aux*/,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer 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();
const amrex::Real* dx = geomdata.CellSize();

AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
, const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];
, const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];);
const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];
, const amrex::Real Ly = prob_hi[1] - prob_lo[1];
, const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

AMREX_D_TERM(const amrex::Real xc = prob_lo[0] + 0.5 * Lx;
, const amrex::Real yc = prob_lo[1] + 0.5 * Ly;
, const amrex::Real zc = prob_lo[2] + 0.5 * Lz;);

constexpr amrex::Real Pi = 3.14159265358979323846264338327950288;
const amrex::Real Lx = prob_hi[0] - prob_lo[0];
const amrex::Real xc = prob_lo[0] + 0.5 * Lx;

const amrex::Real deltax = x - prob_parm.xvort;
const amrex::Real deltay = y - prob_parm.yvort;
Expand All @@ -58,7 +50,7 @@ pelelmex_initdata(
state(i, j, k, VELZ) = w_vort;
#endif

if (is_incompressible) {
if (!(is_incompressible == 0)) {
return;
}

Expand Down Expand Up @@ -97,16 +89,16 @@ AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int m_nAux,
amrex::Real s_ext[NVAR],
const int idir,
const int sgn,
const amrex::Real time,
amrex::GeometryData const& geomdata,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* pmf_data)
const int /*m_nAux*/,
amrex::Real* /*s_ext[NVAR]*/,
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& /*prob_parm*/,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
amrex::Abort("Shouldn't ever be here");
}

AMREX_GPU_DEVICE
Expand Down
4 changes: 2 additions & 2 deletions Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand All @@ -13,7 +13,7 @@ PeleLM::readProbParm()
pp.query("yvort", PeleLM::prob_parm->yvort);
pp.query("forcevort", PeleLM::prob_parm->forcevort);

if (!m_incompressible) {
if (m_incompressible == 0) {
auto& trans_parm = PeleLM::trans_parms.host_trans_parm();
amrex::ParmParse pptr("transport");
pp.query("const_viscosity", trans_parm.const_viscosity);
Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB_FlowPastCylinder/PeleLMeX_EBUserDefined.H
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ AMREX_GPU_DEVICE
AMREX_FORCE_INLINE
void
setEBType(
const amrex::Real xEBface[AMREX_SPACEDIM],
const amrex::Real* /*xEBface[AMREX_SPACEDIM]*/,
amrex::Real& EBflagType,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& /*prob_parm*/)
Expand Down
35 changes: 9 additions & 26 deletions Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,12 @@ pelelmex_initdata(
int k,
int is_incompressible,
amrex::Array4<amrex::Real> const& state,
amrex::Array4<amrex::Real> const& aux,
amrex::GeometryData const& geomdata,
amrex::Array4<amrex::Real> const& /*aux*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& prob_parm,
pele::physics::PMF::PmfData::DataContainer const* /*pmf_data*/)
{
const amrex::Real* prob_lo = geomdata.ProbLo();
const amrex::Real* prob_hi = geomdata.ProbHi();
const amrex::Real* dx = geomdata.CellSize();

AMREX_D_TERM(const amrex::Real x = prob_lo[0] + (i + 0.5) * dx[0];
, const amrex::Real y = prob_lo[1] + (j + 0.5) * dx[1];
, const amrex::Real z = prob_lo[2] + (k + 0.5) * dx[2];);

AMREX_D_TERM(const amrex::Real Lx = prob_hi[0] - prob_lo[0];
, const amrex::Real Ly = prob_hi[1] - prob_lo[1];
, const amrex::Real Lz = prob_hi[2] - prob_lo[2]);

AMREX_D_TERM(const amrex::Real x_c = prob_lo[0] + 0.5 * Lx;
, const amrex::Real y_c = prob_lo[1] + 0.5 * Ly;
, const amrex::Real z_c = prob_lo[2] + 0.5 * Lz);

auto eos = pele::physics::PhysicsType::eos();
constexpr amrex::Real Pi = 3.14159265358979323846264338327950288;

amrex::Real massfrac[NUM_SPECIES] = {0.0};
massfrac[O2_ID] = 0.233;
Expand Down Expand Up @@ -78,8 +61,9 @@ pelelmex_initdata(
break;
}

if (is_incompressible)
if (!(is_incompressible == 0)) {
return;
}

state(i, j, k, TEMP) = prob_parm.T_mean;

Expand All @@ -106,16 +90,15 @@ AMREX_FORCE_INLINE
void
bcnormal(
const amrex::Real* /*x[AMREX_SPACEDIM]*/,
const int m_nAux,
const int /*m_nAux*/,
amrex::Real s_ext[NVAR],
const int idir,
const int sgn,
const amrex::Real time,
amrex::GeometryData const& geomdata,
const int /*idir*/,
const int /*sgn*/,
const amrex::Real /*time*/,
amrex::GeometryData const& /*geomdata*/,
ProbParm const& prob_parm,
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};
amrex::Real massfrac[NUM_SPECIES] = {0.0};

Expand Down
2 changes: 1 addition & 1 deletion Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AMReX_ParmParse.H>

void
PeleLM::readProbParm()
PeleLM::readProbParm() // NOLINT(readability-make-member-function-const)
{
amrex::ParmParse pp("prob");

Expand Down
Loading

0 comments on commit a30a31b

Please sign in to comment.