diff --git a/.github/workflows/downstream.yml b/.github/workflows/downstream.yml index 403f6e812..be8307bb4 100644 --- a/.github/workflows/downstream.yml +++ b/.github/workflows/downstream.yml @@ -312,4 +312,4 @@ jobs: echo "::add-matcher::${{ github.workspace }}/PeleC/.github/problem-matchers/gcc.json" cat clang-tidy-warnings.txt export return=$(tail -n 1 clang-tidy-warnings.txt | awk '{print $2}') - exit ${return} \ No newline at end of file + exit ${return} diff --git a/Source/Spray/SprayInterpolation.H b/Source/Spray/SprayInterpolation.H index 76ae916d8..56bd5344b 100644 --- a/Source/Spray/SprayInterpolation.H +++ b/Source/Spray/SprayInterpolation.H @@ -114,7 +114,8 @@ InterpolateGasPhase( const amrex::IntVect* indx_array, const amrex::Real* weights, const pele::physics::eos::EosParm* - eosparm = nullptr) + eosparm = nullptr, + const SprayData* spray = nullptr) { auto eos = pele::physics::PhysicsType::eos(eosparm); #ifdef PELELM_USE_SPRAY @@ -164,11 +165,14 @@ InterpolateGasPhase( // from the manifold table. We already have the interpolated value of manifold // variables at the spray particle location stored in 'mass_frac'. I just need // to call GenericReadManifoldData +#ifndef USE_MANIFOLD_EOS + amrex::ignore_unused(spray); +#endif + #ifdef USE_MANIFOLD_EOS for (int n = 0; n < SPRAY_FUEL_NUM; n++) { amrex::Real tempval; - eos.Y2ChemSpecies( - mass_frac.data(), SprayParticleContainer::d_sprayData->indx[n], tempval); + eos.Y2ChemSpecies(mass_frac.data(), spray->indx[n], tempval); gpv.Yspec_fluid[n] = tempval; } #endif diff --git a/Source/Spray/SprayParticles.H b/Source/Spray/SprayParticles.H index c8ac27800..bbca4b1be 100644 --- a/Source/Spray/SprayParticles.H +++ b/Source/Spray/SprayParticles.H @@ -45,8 +45,10 @@ public: static void SprayCleanUp() { - delete m_sprayData; - amrex::The_Arena()->free(d_sprayData); + // delete m_sprayData; + // amrex::The_Arena()->free(d_sprayData); + d_sprayData = nullptr; + m_sprayData = nullptr; } /// \brief Generalized injection routine for a single SprayJet diff --git a/Source/Spray/SprayParticles.cpp b/Source/Spray/SprayParticles.cpp index b467eb9bf..98f76a157 100644 --- a/Source/Spray/SprayParticles.cpp +++ b/Source/Spray/SprayParticles.cpp @@ -384,7 +384,7 @@ SprayParticleContainer::updateParticles( gpv.reset(); InterpolateGasPhase( gpv, state_box, rhoarr, rhoYarr, Tarr, momarr, engarr, - indx_array.data(), weights.data(), fdat->eosparm); + indx_array.data(), weights.data(), fdat->eosparm, fdat); // Solve for avg mw and pressure at droplet location fdat->calcBoilT(gpv, cBoilT.data()); if (is_film) { diff --git a/Source/Spray/SpraySetup.cpp b/Source/Spray/SpraySetup.cpp index c4330acbf..07e21e28b 100644 --- a/Source/Spray/SpraySetup.cpp +++ b/Source/Spray/SpraySetup.cpp @@ -32,8 +32,11 @@ SprayParticleContainer::readSprayParams(int& particle_verbose) << std::endl; #endif m_sprayData = new SprayData{}; - d_sprayData = - static_cast(amrex::The_Arena()->alloc(sizeof(SprayData))); + // d_sprayData = + // static_cast(amrex::The_Arena()->alloc(sizeof(SprayData))); + d_sprayData = static_cast( + amrex::The_Device_Arena()->alloc(sizeof(SprayData))); + ParmParse pp("particles"); // Control the verbosity of the Particle class pp.query("v", particle_verbose);