From 8134f55e24e5502a51055ed1dcdcc600e9da8e34 Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Fri, 25 Feb 2022 13:48:49 -0700 Subject: [PATCH 1/7] Remove compile flag from GMake. --- Utils/Make.PeleLMeX | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Utils/Make.PeleLMeX b/Utils/Make.PeleLMeX index b1f26767..4a68355c 100644 --- a/Utils/Make.PeleLMeX +++ b/Utils/Make.PeleLMeX @@ -24,9 +24,6 @@ ifeq ($(USE_EFIELD),TRUE) DEFINES += -DPELE_USE_EFIELD LMdirs += Source/Efield Source/Efield/GMRES Source/Efield/LinOps endif -ifeq ($(USE_TURBINFLOW), TRUE) - DEFINES += -DPELE_USE_TURBINFLOW -endif Bpack += $(foreach dir, $(LMdirs), $(PELELMEX_HOME)/$(dir)/Make.package) Blocs += $(foreach dir, $(LMdirs), $(PELELMEX_HOME)/$(dir)) @@ -66,13 +63,9 @@ endif ChemDir = Support/Fuego/Mechanism/Models/$(Chemistry_Model) -PPdirs := Utility/PMF Source $(ChemDir) Reactions Eos Transport +PPdirs := Utility/PMF Utility/TurbInflow Source $(ChemDir) Reactions Eos Transport PPHdirs := Support/Fuego/Evaluation -ifeq ($(USE_TURBINFLOW), TRUE) - PPdirs += Utility/TurbInflow -endif - Bpack += $(foreach dir, $(PPdirs), $(PELE_PHYSICS_HOME)/$(dir)/Make.package) Blocs += $(foreach dir, $(PPdirs), $(PELE_PHYSICS_HOME)/$(dir)) Blocs += $(foreach dir, $(PPHdirs), $(PELE_PHYSICS_HOME)/$(dir)) From 0c92c2444fcfc624c36f31869790ac7fe24b2e21 Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Fri, 25 Feb 2022 16:16:02 -0700 Subject: [PATCH 2/7] Move the turb data into PeleLM.H and update calls to refactored turbinflow. --- Source/PeleLM.H | 6 ++- Source/PeleLMBC.cpp | 43 +++++++------------ Source/PeleLMBCfill.H | 95 ++++-------------------------------------- Source/PeleLMSetup.cpp | 3 ++ 4 files changed, 30 insertions(+), 117 deletions(-) diff --git a/Source/PeleLM.H b/Source/PeleLM.H index 270a8674..767ad0ca 100644 --- a/Source/PeleLM.H +++ b/Source/PeleLM.H @@ -12,6 +12,7 @@ #include #include "PelePhysics.H" #include "PMFData.H" +#include "turbinflow.H" #include "ReactorBase.H" #include #include @@ -494,9 +495,7 @@ class PeleLM : public amrex::AmrCore { // Fill physical boundaries void setInflowBoundaryVel (amrex::MultiFab &a_vel, int lev, PeleLM::TimeStamp a_time); -#ifdef PELE_USE_TURBINFLOW void fillTurbInflow(amrex::MultiFab &a_vel, int vel_comp, int lev, const amrex::Real a_time); -#endif // Average down operations void averageDownState(const PeleLM::TimeStamp &a_time); @@ -896,6 +895,9 @@ class PeleLM : public amrex::AmrCore { std::string m_chem_integrator; std::unique_ptr m_reactor; + // Turbulence injection + pele::physics::turbinflow::TurbInflow turb_inflow; + // Linear solvers std::unique_ptr m_diffusion_op; std::unique_ptr m_mcdiffusion_op; diff --git a/Source/PeleLMBC.cpp b/Source/PeleLMBC.cpp index 1434db29..caa6a1d5 100644 --- a/Source/PeleLMBC.cpp +++ b/Source/PeleLMBC.cpp @@ -4,9 +4,6 @@ #ifdef AMREX_USE_EB #include #endif -#ifdef PELE_USE_TURBINFLOW -#include -#endif // Conversion from physBC to fieldBC maps // Components are Interior, Inflow, Outflow, Symmetry, & @@ -318,13 +315,12 @@ void PeleLM::fillpatch_state(int lev, int nCompState = ( m_incompressible ) ? AMREX_SPACEDIM : NVAR; -#ifdef PELE_USE_TURBINFLOW fillTurbInflow(a_state, VELX, lev, a_time); -#endif if (lev == 0) { PhysBCFunct> bndry_func(geom[lev], fetchBCRecArray(0,nCompState), - PeleLMCCFillExtDirState{lprobparm, lpmfdata, m_nAux}); + PeleLMCCFillExtDirState{lprobparm, lpmfdata, + m_nAux, turb_inflow.is_initialized()}); FillPatchSingleLevel(a_state, IntVect(nGhost), a_time, {&(m_leveldata_old[lev]->state),&(m_leveldata_new[lev]->state)}, {m_t_old[lev], m_t_new[lev]},0,0,nCompState,geom[lev], bndry_func, 0); @@ -334,9 +330,11 @@ void PeleLM::fillpatch_state(int lev, auto* mapper = getInterpolator(); PhysBCFunct> crse_bndry_func(geom[lev-1], fetchBCRecArray(0,nCompState), - PeleLMCCFillExtDirState{lprobparm, lpmfdata, m_nAux}); + PeleLMCCFillExtDirState{lprobparm, lpmfdata, + m_nAux, turb_inflow.is_initialized()}); PhysBCFunct> fine_bndry_func(geom[lev], fetchBCRecArray(0,nCompState), - PeleLMCCFillExtDirState{lprobparm, lpmfdata, m_nAux}); + PeleLMCCFillExtDirState{lprobparm, lpmfdata, + m_nAux, turb_inflow.is_initialized()}); FillPatchTwoLevels(a_state, IntVect(nGhost), a_time, {&(m_leveldata_old[lev-1]->state),&(m_leveldata_new[lev-1]->state)}, {m_t_old[lev-1], m_t_new[lev-1]}, @@ -347,9 +345,7 @@ void PeleLM::fillpatch_state(int lev, refRatio(lev-1), mapper, fetchBCRecArray(0,nCompState), 0); } -#ifdef PELE_USE_TURBINFLOW a_state.EnforcePeriodicity(geom[lev].periodicity()); -#endif } // Fill the density @@ -674,17 +670,17 @@ void PeleLM::fillcoarsepatch_state(int lev, int nCompState = ( m_incompressible ) ? AMREX_SPACEDIM : NVAR; -#ifdef PELE_USE_TURBINFLOW fillTurbInflow(a_state, VELX, lev, a_time); -#endif // Interpolator auto* mapper = getInterpolator(); PhysBCFunct> crse_bndry_func(geom[lev-1], fetchBCRecArray(0,nCompState), - PeleLMCCFillExtDirState{lprobparm, lpmfdata, m_nAux}); + PeleLMCCFillExtDirState{lprobparm, lpmfdata, + m_nAux, turb_inflow.is_initialized()}); PhysBCFunct> fine_bndry_func(geom[lev], fetchBCRecArray(0,nCompState), - PeleLMCCFillExtDirState{lprobparm, lpmfdata, m_nAux}); + PeleLMCCFillExtDirState{lprobparm, lpmfdata, + m_nAux, turb_inflow.is_initialized()}); InterpFromCoarseLevel(a_state, IntVect(nGhost), a_time, m_leveldata_new[lev-1]->state, 0, 0, nCompState, geom[lev-1], geom[lev], @@ -828,29 +824,25 @@ void PeleLM::setInflowBoundaryVel(MultiFab &a_vel, } } -#ifdef PELE_USE_TURBINFLOW fillTurbInflow(a_vel, 0, lev, a_time); -#endif ProbParm const* lprobparm = prob_parm_d; pele::physics::PMF::PmfData::DataContainer const* lpmfdata = pmf_data.getDeviceData(); - PhysBCFunct> bndry_func(geom[lev], dummyVelBCRec, - PeleLMCCFillExtDirVel{lprobparm, lpmfdata, m_nAux}); + PhysBCFunct> bndry_func(geom[lev], dummyVelBCRec, + PeleLMCCFillExtDirState{lprobparm, lpmfdata, + m_nAux, turb_inflow.is_initialized()}); bndry_func(a_vel, 0, AMREX_SPACEDIM, a_vel.nGrowVect(), time, 0); -#ifdef PELE_USE_TURBINFLOW a_vel.EnforcePeriodicity(geom[lev].periodicity()); -#endif } -#ifdef PELE_USE_TURBINFLOW void PeleLM::fillTurbInflow(MultiFab &a_vel, int vel_comp, int lev, const Real a_time) { - if (PeleLM::prob_parm->do_turb) { + if (turb_inflow.is_initialized()) { ProbParm *probparmDD = PeleLM::prob_parm_d; ProbParm *probparmDH = PeleLM::prob_parm; @@ -884,8 +876,7 @@ void PeleLM::fillTurbInflow(MultiFab &a_vel, auto bndryBoxLO_ghost = amrex::Box(amrex::adjCellLo(modDom,dir,Grow) & bx); data.setVal(0.0,bndryBoxLO_ghost,vel_comp,AMREX_SPACEDIM); - add_turb(bndryBoxLO, data, 0, geom[lev], a_time, dir, amrex::Orientation::low, probparmDH->tp); - probparmDH->turb_ok[dir] = true; + turb_inflow.add_turb(bndryBoxLO, data, 0, geom[lev], a_time, dir, amrex::Orientation::low); } auto bndryBoxHI = amrex::Box(amrex::adjCellHi(geom[lev].Domain(),dir,4) & bx); @@ -902,8 +893,7 @@ void PeleLM::fillTurbInflow(MultiFab &a_vel, auto bndryBoxHI_ghost = amrex::Box(amrex::adjCellHi(modDom,dir,Grow) & bx); data.setVal(0.0,bndryBoxHI_ghost,vel_comp,AMREX_SPACEDIM); - add_turb(bndryBoxHI, data, 0, geom[lev], a_time, dir, amrex::Orientation::high, probparmDH->tp); - probparmDH->turb_ok[dir+AMREX_SPACEDIM] = true; + turb_inflow.add_turb(bndryBoxHI, data, 0, geom[lev], a_time, dir, amrex::Orientation::high); } } } @@ -912,4 +902,3 @@ void PeleLM::fillTurbInflow(MultiFab &a_vel, amrex::Gpu::copy(amrex::Gpu::hostToDevice, probparmDH, probparmDH + 1, probparmDD); } } -#endif diff --git a/Source/PeleLMBCfill.H b/Source/PeleLMBCfill.H index 3b60305d..3af828c2 100644 --- a/Source/PeleLMBCfill.H +++ b/Source/PeleLMBCfill.H @@ -12,11 +12,14 @@ struct PeleLMCCFillExtDirState ProbParm const* lprobparm; pele::physics::PMF::PmfData::DataContainer const* lpmfdata; const int m_nAux; + int m_do_turbInflow = 0; AMREX_GPU_HOST constexpr PeleLMCCFillExtDirState(ProbParm const* a_prob_parm, - pele::physics::PMF::PmfData::DataContainer const* a_pmf_data, int a_nAux) - : lprobparm(a_prob_parm), lpmfdata(a_pmf_data), m_nAux(a_nAux) {} + pele::physics::PMF::PmfData::DataContainer const* a_pmf_data, + int a_nAux, int do_turbInflow) + : lprobparm(a_prob_parm), lpmfdata(a_pmf_data), + m_nAux(a_nAux), m_do_turbInflow(do_turbInflow) {} AMREX_GPU_DEVICE void operator()( @@ -53,16 +56,14 @@ struct PeleLMCCFillExtDirState if ((bc[idir] == amrex::BCType::ext_dir) and (iv[idir] < domlo[idir])) { -#ifdef PELE_USE_TURBINFLOW // If using TurbInflow, pass in the turbulent data. User can overwrite if needed - if (lprobparm->do_turb) { + if (m_do_turbInflow) { if ( n >= VELX && n < DENSITY ) { if ( !isnan(state(iv,VELX+n)) ) { // During fillcoarsepatch, get here with nan. TODO: find a better fix s_ext[VELX+n] = state(iv,VELX+n); } } } -#endif // bcnormal() is defined in pelelm_prob.H in problem directory in /Exec bcnormal(x, m_nAux, s_ext, idir, 1, time, geom, *lprobparm, lpmfdata); state(iv,n) = s_ext[n]; @@ -80,16 +81,14 @@ struct PeleLMCCFillExtDirState if ((bc[idir+AMREX_SPACEDIM] == amrex::BCType::ext_dir) and (iv[idir] > domhi[idir])) { -#ifdef PELE_USE_TURBINFLOW // If using TurbInflow, pass in the turbulent data. User can overwrite if needed - if (lprobparm->do_turb) { + if (m_do_turbInflow) { if ( n >= VELX && n < DENSITY ) { if ( !isnan(state(iv,VELX+n)) ) { // During fillcoarsepatch, get here with nan. TODO: find a better fix s_ext[VELX+n] = state(iv,VELX+n); } } } -#endif // bcnormal() is defined in pelelm_prob.H in problem directory in /Exec bcnormal(x, m_nAux, s_ext, idir, -1, time, geom, *lprobparm, lpmfdata); state(iv,n) = s_ext[n]; @@ -99,86 +98,6 @@ struct PeleLMCCFillExtDirState } }; -struct PeleLMCCFillExtDirVel -{ - - ProbParm const* lprobparm; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata; - const int m_nAux; - - AMREX_GPU_HOST - constexpr PeleLMCCFillExtDirVel(ProbParm const* a_prob_parm, - pele::physics::PMF::PmfData::DataContainer const* a_pmf_data, int a_nAux) - : lprobparm(a_prob_parm), lpmfdata(a_pmf_data), m_nAux(a_nAux) {} - - AMREX_GPU_DEVICE - void operator()( - const amrex::IntVect& iv, - amrex::Array4 const& vel, - const int /*dcomp*/, - const int /*numcomp*/, - amrex::GeometryData const& geom, - const amrex::Real time, - const amrex::BCRec* bcr, - const int /*bcomp*/, - const int /*orig_comp*/) const - { - - // Get geometry data - const int* domlo = geom.Domain().loVect(); - const int* domhi = geom.Domain().hiVect(); - const amrex::Real* prob_lo = geom.ProbLo(); - const amrex::Real* dx = geom.CellSize(); - const amrex::Real x[AMREX_SPACEDIM] = {AMREX_D_DECL(prob_lo[0] + (iv[0] + 0.5) * dx[0], - prob_lo[1] + (iv[1] + 0.5) * dx[1], - prob_lo[2] + (iv[2] + 0.5) * dx[2])}; - - // Get the first velocity component BC - const int* bc = bcr->data(); - - // bcnormal handles all the state components at once - amrex::Real s_ext[NVAR] = {0.0}; - - for (int idir = 0; idir < AMREX_SPACEDIM; idir++) { - // Low - if ((bc[idir] == amrex::BCType::ext_dir) and (iv[idir] < domlo[idir])) { - -#ifdef PELE_USE_TURBINFLOW - // If using TurbInflow, pass in the turbulent data. User can overwrite if needed - if (lprobparm->do_turb) { - for (int n = 0; n < AMREX_SPACEDIM; n++) { - s_ext[VELX+n] = vel(iv,VELX+n); - } - } -#endif - // bcnormal() is defined in pelelm_prob.H in problem directory in /Exec - bcnormal(x, m_nAux, s_ext, idir, 1, time, geom, *lprobparm, lpmfdata); - - for (int n = 0; n < AMREX_SPACEDIM; n++) { - vel(iv,n) = s_ext[VELX+n]; - } - // High - } else if ((bc[idir+AMREX_SPACEDIM] == amrex::BCType::ext_dir) and (iv[idir] > domhi[idir])) { - -#ifdef PELE_USE_TURBINFLOW - // If using TurbInflow, pass in the turbulent data. User can overwrite if needed - if (lprobparm->do_turb) { - for (int n = 0; n < AMREX_SPACEDIM; n++) { - s_ext[VELX+n] = vel(iv,VELX+n); - } - } -#endif - // bcnormal() is defined in pelelm_prob.H in problem directory in /Exec - bcnormal(x, m_nAux, s_ext, idir, -1, time, geom, *lprobparm, lpmfdata); - - for (int n = 0; n < AMREX_SPACEDIM; n++) { - vel(iv,n) = s_ext[VELX+n]; - } - } - } - } -}; - struct PeleLMCCFillExtDirSpec { diff --git a/Source/PeleLMSetup.cpp b/Source/PeleLMSetup.cpp index 7ff125bb..32344180 100644 --- a/Source/PeleLMSetup.cpp +++ b/Source/PeleLMSetup.cpp @@ -83,6 +83,9 @@ void PeleLM::Setup() { #endif } + // Initiliaze turbulence injection + turb_inflow.init(Geom(0)); + // Initiliaze BCs setBoundaryConditions(); From c3a448bfedd15f807679501d653f566bc95f1aaa Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Fri, 25 Feb 2022 16:17:03 -0700 Subject: [PATCH 3/7] Update TurbInflow regtest. --- Exec/RegTests/TurbInflow/pelelm_prob.cpp | 52 --------------------- Exec/RegTests/TurbInflow/pelelm_prob_parm.H | 7 --- 2 files changed, 59 deletions(-) diff --git a/Exec/RegTests/TurbInflow/pelelm_prob.cpp b/Exec/RegTests/TurbInflow/pelelm_prob.cpp index 2cb47119..ef0c8c3f 100644 --- a/Exec/RegTests/TurbInflow/pelelm_prob.cpp +++ b/Exec/RegTests/TurbInflow/pelelm_prob.cpp @@ -10,58 +10,6 @@ void PeleLM::readProbParm() pp.query("flowDir", prob_parm->meanFlowDir); pp.query("flowMag", prob_parm->meanFlowMag); - auto problo = geom[0].ProbLo(); - auto probhi = geom[0].ProbHi(); - - prob_parm->do_turb = false; -#ifdef PELE_USE_TURBINFLOW - if (pp.countval("turb_file") > 0) { -#if AMREX_SPACEDIM==2 - amrex::Abort("Turbulence inflow unsupported in 2D."); -#endif - std::string turb_file = ""; - pp.query("turb_file", turb_file); - amrex::Real turb_scale_loc = 1.0; - pp.query("turb_scale_loc", turb_scale_loc); - amrex::Real turb_scale_vel = 1.0; - pp.query("turb_scale_vel", turb_scale_vel); - - PeleLM::prob_parm->do_turb = true; - - // Hold nose here - required because of dynamically allocated data in tp - AMREX_ASSERT_WITH_MESSAGE(PeleLM::prob_parm->tp.tph == nullptr,"Can only be one TurbParmHost"); - PeleLM::prob_parm->tp.tph = new TurbParmHost; - - amrex::Vector turb_center(2,0.0); - if ( prob_parm->meanFlowDir == 0 ) { - turb_center[0] = 0.5 * (probhi[1] + problo[1]); - turb_center[1] = 0.5 * (probhi[2] + problo[2]); - } else if ( prob_parm->meanFlowDir == 1 ) { - turb_center[0] = 0.5 * (probhi[0] + problo[0]); - turb_center[1] = 0.5 * (probhi[2] + problo[2]); - } else if ( prob_parm->meanFlowDir == 2 ) { - turb_center[0] = 0.5 * (probhi[0] + problo[0]); - turb_center[1] = 0.5 * (probhi[1] + problo[1]); - } - - pp.queryarr("turb_center", turb_center); - AMREX_ASSERT_WITH_MESSAGE(turb_center.size() == 2, "turb_center must have two elements"); - for (int n = 0; n < turb_center.size(); ++n) { - turb_center[n] *= turb_scale_loc; - } - - int turb_nplane = 32; - pp.query("turb_nplane", turb_nplane); - AMREX_ASSERT(turb_nplane > 0); - amrex::Real turb_conv_vel = 1; - pp.query("turb_conv_vel", turb_conv_vel); - AMREX_ASSERT(turb_conv_vel > 0); - - init_turbinflow(turb_file, turb_scale_loc, turb_scale_vel, turb_center, turb_conv_vel, - turb_nplane, PeleLM::prob_parm->tp); - } -#endif - /* if (!m_incompressible) { auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); diff --git a/Exec/RegTests/TurbInflow/pelelm_prob_parm.H b/Exec/RegTests/TurbInflow/pelelm_prob_parm.H index d1b9dbd2..3734ce3d 100644 --- a/Exec/RegTests/TurbInflow/pelelm_prob_parm.H +++ b/Exec/RegTests/TurbInflow/pelelm_prob_parm.H @@ -3,9 +3,6 @@ #include #include -#ifdef PELE_USE_TURBINFLOW -#include -#endif using namespace amrex::literals; @@ -15,9 +12,5 @@ struct ProbParm amrex::Real P_mean = 101325.0_rt; amrex::Real meanFlowMag = 0.0; int meanFlowDir = 1; - - TurbParm tp; - amrex::GpuArray turb_ok = {{false}}; - bool do_turb = false; }; #endif From d03130e8b0b10188591516d9c7bb481c8afce75f Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Fri, 25 Feb 2022 16:17:50 -0700 Subject: [PATCH 4/7] Update GMake and input files. --- Exec/RegTests/TurbInflow/GNUmakefile | 1 - Exec/RegTests/TurbInflow/input.3d | 12 ++++++------ Exec/RegTests/TurbInflow/input.3d_BoxLoZ | 12 ++++++------ Exec/RegTests/TurbInflow/input.3d_negY | 12 ++++++------ Exec/RegTests/TurbInflow/input.3d_posX | 12 ++++++------ 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/Exec/RegTests/TurbInflow/GNUmakefile b/Exec/RegTests/TurbInflow/GNUmakefile index 2f69a1fd..d8f3049b 100644 --- a/Exec/RegTests/TurbInflow/GNUmakefile +++ b/Exec/RegTests/TurbInflow/GNUmakefile @@ -20,7 +20,6 @@ USE_CUDA = FALSE USE_HIP = FALSE # PeleLMeX -USE_TURBINFLOW = TRUE # PelePhysics Chemistry_Model = air diff --git a/Exec/RegTests/TurbInflow/input.3d b/Exec/RegTests/TurbInflow/input.3d index 0b5cf896..7ab8fb07 100644 --- a/Exec/RegTests/TurbInflow/input.3d +++ b/Exec/RegTests/TurbInflow/input.3d @@ -29,12 +29,12 @@ prob.P_mean = 101325.0 prob.flowDir = 2 prob.flowMag = 5 -prob.turb_file = Turb_AJA -prob.turb_scale_loc = 1.0 -prob.turb_scale_vel = 0.1 -prob.turb_center = 0.005 0.005 -prob.turb_conv_vel = 5. -prob.turb_nplane = 32 +turbinflow.turb_file = TurbFileHIT/TurbTEST +turbinflow.turb_scale_loc = 633.151 +turbinflow.turb_scale_vel = 0.5 +turbinflow.turb_center = 0.005 0.005 +turbinflow.turb_conv_vel = 5. +turbinflow.turb_nplane = 32 #------------ INPUTS TO CONSTANT TRANSPORT ----------------- transport.const_viscosity = 0.0001 diff --git a/Exec/RegTests/TurbInflow/input.3d_BoxLoZ b/Exec/RegTests/TurbInflow/input.3d_BoxLoZ index 178d9899..eb1fefa5 100644 --- a/Exec/RegTests/TurbInflow/input.3d_BoxLoZ +++ b/Exec/RegTests/TurbInflow/input.3d_BoxLoZ @@ -29,12 +29,12 @@ prob.P_mean = 101325.0 prob.flowDir = 2 prob.flowMag = 5 -prob.turb_file = TurbFileHIT/TurbTEST -prob.turb_scale_loc = 633.151 -prob.turb_scale_vel = 0.5 -prob.turb_center = 0.005 0.005 -prob.turb_conv_vel = 5. -prob.turb_nplane = 32 +turbinflow.turb_file = TurbFileHIT/TurbTEST +turbinflow.turb_scale_loc = 633.151 +turbinflow.turb_scale_vel = 0.5 +turbinflow.turb_center = 0.005 0.005 +turbinflow.turb_conv_vel = 5. +turbinflow.turb_nplane = 32 #------------ INPUTS TO CONSTANT TRANSPORT ----------------- transport.const_viscosity = 0.0001 diff --git a/Exec/RegTests/TurbInflow/input.3d_negY b/Exec/RegTests/TurbInflow/input.3d_negY index 9e92bc18..f2ac91b7 100644 --- a/Exec/RegTests/TurbInflow/input.3d_negY +++ b/Exec/RegTests/TurbInflow/input.3d_negY @@ -29,12 +29,12 @@ prob.P_mean = 101325.0 prob.flowDir = 1 prob.flowMag = -5 -prob.turb_file = Turb_AJA -prob.turb_scale_loc = 1.0 -prob.turb_scale_vel = 0.1 -prob.turb_center = 0.005 0.005 -prob.turb_conv_vel = 5. -prob.turb_nplane = 32 +turbinflow.turb_file = TurbFileHIT/TurbTEST +turbinflow.turb_scale_loc = 633.151 +turbinflow.turb_scale_vel = 0.5 +turbinflow.turb_center = 0.005 0.005 +turbinflow.turb_conv_vel = 5. +turbinflow.turb_nplane = 32 #------------ INPUTS TO CONSTANT TRANSPORT ----------------- transport.const_viscosity = 0.0001 diff --git a/Exec/RegTests/TurbInflow/input.3d_posX b/Exec/RegTests/TurbInflow/input.3d_posX index 9e266922..d6374d40 100644 --- a/Exec/RegTests/TurbInflow/input.3d_posX +++ b/Exec/RegTests/TurbInflow/input.3d_posX @@ -29,12 +29,12 @@ prob.P_mean = 101325.0 prob.flowDir = 0 prob.flowMag = 5 -prob.turb_file = Turb_AJA -prob.turb_scale_loc = 1.0 -prob.turb_scale_vel = 0.1 -prob.turb_center = 0.005 0.005 -prob.turb_conv_vel = 5. -prob.turb_nplane = 32 +turbinflow.turb_file = TurbFileHIT/TurbTEST +turbinflow.turb_scale_loc = 633.151 +turbinflow.turb_scale_vel = 0.5 +turbinflow.turb_center = 0.005 0.005 +turbinflow.turb_conv_vel = 5. +turbinflow.turb_nplane = 32 #------------ INPUTS TO CONSTANT TRANSPORT ----------------- transport.const_viscosity = 0.0001 From b77e435ddefb5632f8fb26a78a1efd3cb95dc9b4 Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Fri, 25 Feb 2022 16:35:49 -0700 Subject: [PATCH 5/7] Add TurbInflow tests to CI. --- .github/workflows/linux.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 6d8cfb15..d35b5926 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -307,3 +307,47 @@ jobs: working-directory: ./Exec/RegTests/EB_PipeFlow/ run: | ./PeleLMeX3d.gnu.MPI.ex input.3d-regt amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + + # Build and Run the TurbInflow RegTest in DEBUG with GNU7.5 and MPI support + TI3D_MPIRun: + name: GNU@7.5 MPI Run [TI3DDBG] + runs-on: ubuntu-latest + env: + {CXXFLAGS: "-Werror -Wshadow -Woverloaded-virtual -Wunreachable-code"} + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.6.0 + with: + access_token: ${{github.token}} + - uses: actions/checkout@v2 + - name: System Dependencies + run: .github/workflows/dependencies/dependencies.sh + - name: Repo Dependencies + run: Utils/CloneDeps.sh + - name: GenerateTurbFile + env: + AMREX_HOME: ${GITHUB_WORKSPACE}/build/amrex + PELE_PHYSICS_HOME: ${GITHUB_WORKSPACE}/build/PelePhysics + PELELM_HOME: ${GITHUB_WORKSPACE} + AMREX_HYDRO_HOME: ${GITHUB_WORKSPACE}/build/AMReX-Hydro + working-directory: ./Exec/RegTests/TurbInflow/TurbFileHIT + run: | + make -j 2 COMP=gnu + ./PeleTurb3d.gnu.ex input hit_file=../../HITDecay/hit_ic_4_32.dat input_ncell=32 + - name: Build + env: + AMREX_HOME: ${GITHUB_WORKSPACE}/build/amrex + PELE_PHYSICS_HOME: ${GITHUB_WORKSPACE}/build/PelePhysics + PELELM_HOME: ${GITHUB_WORKSPACE} + AMREX_HYDRO_HOME: ${GITHUB_WORKSPACE}/build/AMReX-Hydro + working-directory: ./Exec/RegTests/TurbInflow/ + run: | + make TPL COMP=gnu USE_MPI=TRUE DEBUG=TRUE + make -j 2 COMP=gnu USE_MPI=TRUE DEBUG=TRUE + - name: Run + working-directory: ./Exec/RegTests/TurbInflow/ + run: | + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_negY peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_posY peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_BoxLoZ peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 From 60b1ec02a7b2e1a4271c3f3c4cccd1f7a8239e99 Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Fri, 25 Feb 2022 17:20:26 -0700 Subject: [PATCH 6/7] Activate FPE traps while testing TurbInflow --- Exec/RegTests/TurbInflow/input.3d | 6 +++--- Exec/RegTests/TurbInflow/input.3d_BoxLoZ | 6 +++--- Exec/RegTests/TurbInflow/input.3d_negY | 6 +++--- Exec/RegTests/TurbInflow/input.3d_posX | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Exec/RegTests/TurbInflow/input.3d b/Exec/RegTests/TurbInflow/input.3d index 7ab8fb07..bfd79829 100644 --- a/Exec/RegTests/TurbInflow/input.3d +++ b/Exec/RegTests/TurbInflow/input.3d @@ -70,6 +70,6 @@ amr.O2.value_greater = 0.4 amr.O2.field_name = Y(O2) fabarray.mfiter_tile_size = 1024 1024 1024 -#amrex.fpe_trap_invalid = 1 -#amrex.fpe_trap_zero = 1 -#amrex.fpe_trap_overflow = 1 +amrex.fpe_trap_invalid = 1 +amrex.fpe_trap_zero = 1 +amrex.fpe_trap_overflow = 1 diff --git a/Exec/RegTests/TurbInflow/input.3d_BoxLoZ b/Exec/RegTests/TurbInflow/input.3d_BoxLoZ index eb1fefa5..630c8dd1 100644 --- a/Exec/RegTests/TurbInflow/input.3d_BoxLoZ +++ b/Exec/RegTests/TurbInflow/input.3d_BoxLoZ @@ -73,6 +73,6 @@ amr.loBoxZ.in_box_lo = 0.0 0.0 0.0 amr.loBoxZ.in_box_hi = 0.01 0.01 0.005 fabarray.mfiter_tile_size = 1024 1024 1024 -#amrex.fpe_trap_invalid = 1 -#amrex.fpe_trap_zero = 1 -#amrex.fpe_trap_overflow = 1 +amrex.fpe_trap_invalid = 1 +amrex.fpe_trap_zero = 1 +amrex.fpe_trap_overflow = 1 diff --git a/Exec/RegTests/TurbInflow/input.3d_negY b/Exec/RegTests/TurbInflow/input.3d_negY index f2ac91b7..9d3d4687 100644 --- a/Exec/RegTests/TurbInflow/input.3d_negY +++ b/Exec/RegTests/TurbInflow/input.3d_negY @@ -70,6 +70,6 @@ amr.O2.value_greater = 0.4 amr.O2.field_name = Y(O2) fabarray.mfiter_tile_size = 1024 1024 1024 -#amrex.fpe_trap_invalid = 1 -#amrex.fpe_trap_zero = 1 -#amrex.fpe_trap_overflow = 1 +amrex.fpe_trap_invalid = 1 +amrex.fpe_trap_zero = 1 +amrex.fpe_trap_overflow = 1 diff --git a/Exec/RegTests/TurbInflow/input.3d_posX b/Exec/RegTests/TurbInflow/input.3d_posX index d6374d40..ba0629e3 100644 --- a/Exec/RegTests/TurbInflow/input.3d_posX +++ b/Exec/RegTests/TurbInflow/input.3d_posX @@ -70,6 +70,6 @@ amr.O2.value_greater = 0.4 amr.O2.field_name = Y(O2) fabarray.mfiter_tile_size = 1024 1024 1024 -#amrex.fpe_trap_invalid = 1 -#amrex.fpe_trap_zero = 1 -#amrex.fpe_trap_overflow = 1 +amrex.fpe_trap_invalid = 1 +amrex.fpe_trap_zero = 1 +amrex.fpe_trap_overflow = 1 From 6e79fb9aaf50b15340cec38d738c086db2ca10db Mon Sep 17 00:00:00 2001 From: Lucas Esclapez Date: Mon, 28 Feb 2022 14:08:09 -0700 Subject: [PATCH 7/7] Fix input typo and coarsen turbinflow tests. --- .github/workflows/linux.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index d35b5926..7ae22abc 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -347,7 +347,7 @@ jobs: - name: Run working-directory: ./Exec/RegTests/TurbInflow/ run: | - mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 - mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_negY peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 - mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_posY peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 - mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_BoxLoZ peleLM.num_init_iter=1 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d peleLM.num_init_iter=1 amr.n_cell=32 32 32 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_negY peleLM.num_init_iter=1 amr.n_cell=32 32 32 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_posX peleLM.num_init_iter=1 amr.n_cell=32 32 32 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1 + mpirun -n 2 ./PeleLMeX3d.gnu.DEBUG.MPI.ex input.3d_BoxLoZ peleLM.num_init_iter=1 amr.n_cell=32 32 32 amr.max_step=2 amr.plot_int=-1 amr.check_int=-1