From 2600315cc007782b6fe06d9259ec59ea71fef62b Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Thu, 6 Jun 2024 17:34:33 -0600 Subject: [PATCH 1/4] updates needed for peleparams for PMF and transport --- Source/Efield/PeleLMeX_EFUtils.cpp | 6 ++---- Source/PeleLMeX.H | 8 +++++--- Source/PeleLMeX.cpp | 5 +++-- Source/PeleLMeX_BC.cpp | 21 +++++++-------------- Source/PeleLMeX_DeriveFunc.cpp | 6 +++--- Source/PeleLMeX_FlowController.cpp | 3 +-- Source/PeleLMeX_Init.cpp | 3 +-- Source/PeleLMeX_Setup.cpp | 2 +- Source/PeleLMeX_TransportProp.cpp | 4 ++-- Submodules/PelePhysics | 2 +- 10 files changed, 26 insertions(+), 34 deletions(-) diff --git a/Source/Efield/PeleLMeX_EFUtils.cpp b/Source/Efield/PeleLMeX_EFUtils.cpp index 3a7891a9..9b0dc2fa 100644 --- a/Source/Efield/PeleLMeX_EFUtils.cpp +++ b/Source/Efield/PeleLMeX_EFUtils.cpp @@ -290,8 +290,7 @@ void PeleLM::fillPatchNLnE(Real a_time, Vector const& a_nE, int a_nGrow) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); int lev = 0; { @@ -324,8 +323,7 @@ PeleLM::fillPatchNLphiV( Real a_time, Vector const& a_phiV, int a_nGrow) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); int lev = 0; { diff --git a/Source/PeleLMeX.H b/Source/PeleLMeX.H index 549bb228..47fcb775 100644 --- a/Source/PeleLMeX.H +++ b/Source/PeleLMeX.H @@ -1742,11 +1742,13 @@ public: amrex::Vector m_ctrl_cntl_pts; // PMF parameters - pele::physics::PMF::PmfData pmf_data; + pele::physics::PeleParams + pmf_data; // Transport pointer - static pele::physics::transport::TransportParams< - pele::physics::PhysicsType::transport_type> + static pele::physics::PeleParams> trans_parms; // Reactor pointer diff --git a/Source/PeleLMeX.cpp b/Source/PeleLMeX.cpp index 59d5cc07..3dc3a2a3 100644 --- a/Source/PeleLMeX.cpp +++ b/Source/PeleLMeX.cpp @@ -7,8 +7,9 @@ using namespace amrex; -pele::physics::transport::TransportParams< - pele::physics::PhysicsType::transport_type> +pele::physics::PeleParams> PeleLM::trans_parms; PeleLM::PeleLM() = default; diff --git a/Source/PeleLMeX_BC.cpp b/Source/PeleLMeX_BC.cpp index 1e422536..a9a5bd23 100644 --- a/Source/PeleLMeX_BC.cpp +++ b/Source/PeleLMeX_BC.cpp @@ -349,8 +349,7 @@ PeleLM::fillpatch_state( int lev, const amrex::Real a_time, amrex::MultiFab& a_state, int nGhost) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); int nCompState = (m_incompressible) != 0 ? AMREX_SPACEDIM : NVAR; @@ -404,8 +403,7 @@ PeleLM::fillpatch_density( int nGhost) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); if (lev == 0) { // Density @@ -451,8 +449,7 @@ PeleLM::fillpatch_species( int nGhost) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); if (lev == 0) { // Species @@ -497,8 +494,7 @@ PeleLM::fillpatch_temp( int nGhost) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); if (lev == 0) { PhysBCFunct> bndry_func( geom[lev], fetchBCRecArray(TEMP, 1), @@ -541,8 +537,7 @@ PeleLM::fillpatch_phiV( int nGhost) { ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); if (lev == 0) { PhysBCFunct> bndry_func( geom[lev], fetchBCRecArray(PHIV, 1), @@ -745,8 +740,7 @@ PeleLM::fillcoarsepatch_state( { AMREX_ASSERT(lev > 0); ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); int nCompState = (m_incompressible) != 0 ? AMREX_SPACEDIM : NVAR; @@ -882,8 +876,7 @@ PeleLM::setInflowBoundaryVel(MultiFab& a_vel, int lev, TimeStamp a_time) fillTurbInflow(a_vel, 0, lev, time); ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); PhysBCFunct> bndry_func( geom[lev], dummyVelBCRec, PeleLMCCFillExtDirState{ diff --git a/Source/PeleLMeX_DeriveFunc.cpp b/Source/PeleLMeX_DeriveFunc.cpp index 8e08e986..bf310075 100644 --- a/Source/PeleLMeX_DeriveFunc.cpp +++ b/Source/PeleLMeX_DeriveFunc.cpp @@ -1324,7 +1324,7 @@ pelelmex_dervisc( auto const& rhoY = statefab.const_array(FIRSTSPEC); auto const& T = statefab.array(TEMP); auto der = derfab.array(dcomp); - auto const* ltransparm = a_pelelm->trans_parms.device_trans_parm(); + auto const* ltransparm = a_pelelm->trans_parms.device_parm(); amrex::ParallelFor( bx, [rhoY, T, der, ltransparm] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { @@ -1370,7 +1370,7 @@ pelelmex_derdiffc( auto rhoD = derfab.array(dcomp); auto lambda = dummies.array(0); auto mu = dummies.array(1); - auto const* ltransparm = a_pelelm->trans_parms.device_trans_parm(); + auto const* ltransparm = a_pelelm->trans_parms.device_parm(); auto rhotheta = do_soret ? derfab.array(dcomp + NUM_SPECIES) : dummies.array(2); // dummy for no soret amrex::Real LeInv = a_pelelm->m_Lewis_inv; @@ -1417,7 +1417,7 @@ pelelmex_derlambda( auto lambda = derfab.array(dcomp); auto mu = dummies.array(0); auto rhotheta = dummies.array(NUM_SPECIES + 1); - auto const* ltransparm = a_pelelm->trans_parms.device_trans_parm(); + auto const* ltransparm = a_pelelm->trans_parms.device_parm(); amrex::Real LeInv = a_pelelm->m_Lewis_inv; amrex::Real PrInv = a_pelelm->m_Prandtl_inv; amrex::ParallelFor( diff --git a/Source/PeleLMeX_FlowController.cpp b/Source/PeleLMeX_FlowController.cpp index d1b9553f..dbae2a77 100644 --- a/Source/PeleLMeX_FlowController.cpp +++ b/Source/PeleLMeX_FlowController.cpp @@ -67,8 +67,7 @@ PeleLM::initActiveControl() // Extract data from BC: assumes flow comes in from lo side of ctrl_flameDir ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); Gpu::DeviceVector s_ext_v(NVAR); Real* s_ext_d = s_ext_v.data(); diff --git a/Source/PeleLMeX_Init.cpp b/Source/PeleLMeX_Init.cpp index dace64fa..239b6c30 100644 --- a/Source/PeleLMeX_Init.cpp +++ b/Source/PeleLMeX_Init.cpp @@ -338,8 +338,7 @@ PeleLM::initLevelData(int lev) // Prob/PMF data ProbParm const* lprobparm = prob_parm_d; - pele::physics::PMF::PmfData::DataContainer const* lpmfdata = - pmf_data.getDeviceData(); + auto const* lpmfdata = pmf_data.device_parm(); #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) diff --git a/Source/PeleLMeX_Setup.cpp b/Source/PeleLMeX_Setup.cpp index deb511d1..b7a50852 100644 --- a/Source/PeleLMeX_Setup.cpp +++ b/Source/PeleLMeX_Setup.cpp @@ -107,7 +107,7 @@ PeleLM::Setup() // Initialize EOS and others if (m_incompressible == 0) { amrex::Print() << " Initialization of Transport ... \n"; - trans_parms.allocate(); + trans_parms.initialize(); if ((m_les_verbose != 0) and m_do_les) { // Say what transport model we're // going to use amrex::Print() << " Using LES in transport with Sc = " diff --git a/Source/PeleLMeX_TransportProp.cpp b/Source/PeleLMeX_TransportProp.cpp index 932dbc2e..420670b8 100644 --- a/Source/PeleLMeX_TransportProp.cpp +++ b/Source/PeleLMeX_TransportProp.cpp @@ -262,7 +262,7 @@ PeleLM::calcViscosity(const TimeStamp& a_time) } else { // Transport data pointer - auto const* ltransparm = trans_parms.device_trans_parm(); + auto const* ltransparm = trans_parms.device_parm(); // MultiArrays auto const& sma = ldata_p->state.const_arrays(); @@ -291,7 +291,7 @@ PeleLM::calcDiffusivity(const TimeStamp& a_time) auto* ldata_p = getLevelDataPtr(lev, a_time); // Transport data pointer - auto const* ltransparm = trans_parms.device_trans_parm(); + auto const* ltransparm = trans_parms.device_parm(); // MultiArrays auto const& sma = ldata_p->state.const_arrays(); diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index 0aee17a3..69263b54 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit 0aee17a3645293ed352ef2f15b728ad3318a32fa +Subproject commit 69263b541262f89e7990746d7a9a755b0722a5bd From b5b03889ffe03d26d1a7c71cbe3824b3ea7b31de Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Thu, 6 Jun 2024 17:48:30 -0600 Subject: [PATCH 2/4] fix some cases for transparm --- Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.cpp | 2 +- Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.cpp | 2 +- Exec/RegTests/EB_PipeFlow/pelelmex_prob.cpp | 2 +- Exec/RegTests/HotBubble/pelelmex_prob.cpp | 2 +- Exec/RegTests/PeriodicCases/pelelmex_prob.cpp | 2 +- Exec/RegTests/TaylorGreen/pelelmex_prob.cpp | 2 +- Exec/RegTests/TurbInflow/pelelmex_prob.cpp | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.cpp b/Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.cpp index 124a9125..2a5aeada 100644 --- a/Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.cpp +++ b/Exec/RegTests/EB_EnclosedVortex/pelelmex_prob.cpp @@ -14,7 +14,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) pp.query("forcevort", PeleLM::prob_parm->forcevort); if (m_incompressible == 0) { - auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + auto& trans_parm = PeleLM::trans_parms.host_parm(); amrex::ParmParse pptr("transport"); pp.query("const_viscosity", trans_parm.const_viscosity); pp.query("const_bulk_viscosity", trans_parm.const_bulk_viscosity); diff --git a/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.cpp b/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.cpp index 091c1a79..90660285 100644 --- a/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.cpp +++ b/Exec/RegTests/EB_FlowPastCylinder/pelelmex_prob.cpp @@ -12,7 +12,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) pp.query("meanFlowMag", prob_parm->meanFlowMag); // if (!m_incompressible) { - // auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + // auto& trans_parm = PeleLM::trans_parms.host_parm(); // amrex::ParmParse pptr("transport"); // pp.query("const_viscosity", trans_parm.const_viscosity); // pp.query("const_bulk_viscosity", trans_parm.const_bulk_viscosity); diff --git a/Exec/RegTests/EB_PipeFlow/pelelmex_prob.cpp b/Exec/RegTests/EB_PipeFlow/pelelmex_prob.cpp index 11a285b6..94d643f2 100644 --- a/Exec/RegTests/EB_PipeFlow/pelelmex_prob.cpp +++ b/Exec/RegTests/EB_PipeFlow/pelelmex_prob.cpp @@ -15,7 +15,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) /* if (!m_incompressible) { - auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + auto& trans_parm = PeleLM::trans_parms.host_parm(); amrex::ParmParse pptr("transport"); pp.query("const_viscosity", trans_parm.const_viscosity); pp.query("const_bulk_viscosity", trans_parm.const_bulk_viscosity); diff --git a/Exec/RegTests/HotBubble/pelelmex_prob.cpp b/Exec/RegTests/HotBubble/pelelmex_prob.cpp index 954c0210..8aeaafd7 100644 --- a/Exec/RegTests/HotBubble/pelelmex_prob.cpp +++ b/Exec/RegTests/HotBubble/pelelmex_prob.cpp @@ -14,7 +14,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) pp.query("use_symmetry", prob_parm->is_sym); pp.query("use_mix_bubble", prob_parm->bubble_is_mix); - auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + auto& trans_parm = PeleLM::trans_parms.host_parm(); amrex::ParmParse pptr("transport"); pp.query("const_viscosity", trans_parm.const_viscosity); pp.query("const_bulk_viscosity", trans_parm.const_bulk_viscosity); diff --git a/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp b/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp index a5360276..ee411cc3 100644 --- a/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp +++ b/Exec/RegTests/PeriodicCases/pelelmex_prob.cpp @@ -81,7 +81,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) } if (m_incompressible == 0) { - auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + auto& trans_parm = PeleLM::trans_parms.host_parm(); amrex::ParmParse pptr("transport"); pp.query("const_viscosity", trans_parm.const_viscosity); pp.query("const_bulk_viscosity", trans_parm.const_bulk_viscosity); diff --git a/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp b/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp index df98e8eb..1ce36b92 100644 --- a/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp +++ b/Exec/RegTests/TaylorGreen/pelelmex_prob.cpp @@ -37,7 +37,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) // Transport amrex::Real cpmix_cgs; eos.TY2Cp(prob_parm->T_mean, massfrac, cpmix_cgs); - auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + auto& trans_parm = PeleLM::trans_parms.host_parm(); trans_parm.const_bulk_viscosity = 0.0; trans_parm.const_diffusivity = 0.0; trans_parm.const_viscosity = diff --git a/Exec/RegTests/TurbInflow/pelelmex_prob.cpp b/Exec/RegTests/TurbInflow/pelelmex_prob.cpp index 7c7184e0..c8e2c5b9 100644 --- a/Exec/RegTests/TurbInflow/pelelmex_prob.cpp +++ b/Exec/RegTests/TurbInflow/pelelmex_prob.cpp @@ -14,7 +14,7 @@ PeleLM::readProbParm() // NOLINT(readability-make-member-function-const) /* if (!m_incompressible) { - auto& trans_parm = PeleLM::trans_parms.host_trans_parm(); + auto& trans_parm = PeleLM::trans_parms.host_parm(); amrex::ParmParse pptr("transport"); pp.query("const_viscosity", trans_parm.const_viscosity); pp.query("const_bulk_viscosity", trans_parm.const_bulk_viscosity); From ec3f0ae257b5ab9ba7a54905b4a271651e656694 Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Fri, 7 Jun 2024 10:18:50 -0600 Subject: [PATCH 3/4] trans parm update in spray --- Source/PeleLMeX_SprayParticles.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/PeleLMeX_SprayParticles.cpp b/Source/PeleLMeX_SprayParticles.cpp index 00f98f60..76c73a74 100644 --- a/Source/PeleLMeX_SprayParticles.cpp +++ b/Source/PeleLMeX_SprayParticles.cpp @@ -300,7 +300,7 @@ PeleLM::SprayMKDLevel(const int level, const Real time, const Real dt) // Advance the particle velocities to the half-time and the positions to // the new time - auto const* ltransparm = PeleLM::trans_parms.device_trans_parm(); + auto const* ltransparm = PeleLM::trans_parms.device_parm(); MultiFab& state = *(m_spraystate[level]); MultiFab& source = *(m_spraysource[level]); From 0999e32da589c240d1811516a5b0d5c119abfbab Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Fri, 7 Jun 2024 11:58:58 -0600 Subject: [PATCH 4/4] update pp --- Submodules/PelePhysics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Submodules/PelePhysics b/Submodules/PelePhysics index 69263b54..b17d6b7f 160000 --- a/Submodules/PelePhysics +++ b/Submodules/PelePhysics @@ -1 +1 @@ -Subproject commit 69263b541262f89e7990746d7a9a755b0722a5bd +Subproject commit b17d6b7f547e9fe983f97266d82292c101b9fc11