diff --git a/Source/ERF.cpp b/Source/ERF.cpp index 1862a5ac3..86c23ccf7 100644 --- a/Source/ERF.cpp +++ b/Source/ERF.cpp @@ -27,7 +27,8 @@ amrex::Real ERF::previousCPUTimeUsed = 0.0; Vector ERF::ref_tags; SolverChoice ERF::solverChoice; -#ifdef ERF_USE_MULTIBLOCK + +#ifdef ERF_USE_PARTICLES ParticleData ERF::particleData; #endif @@ -313,6 +314,10 @@ ERF::post_timestep (int nstep, Real time, Real dt_lev0) { BL_PROFILE("ERF::post_timestep()"); +#ifdef ERF_USE_PARTICLES + particleData.Redistribute(); +#endif + if (solverChoice.coupling_type == CouplingType::TwoWay || solverChoice.coupling_type == CouplingType::Mixed) { @@ -953,7 +958,6 @@ ERF::ReadParameters () pp.query("fixed_mri_dt_ratio", fixed_mri_dt_ratio); #ifdef ERF_USE_PARTICLES - particleData.init_particles((amrex::ParGDBBase*)GetParGDB(),z_phys_nd); particleData.init_particle_params(); #endif @@ -1116,8 +1120,8 @@ ERF::ReadParameters () solverChoice.pp_prefix = pp_prefix; #endif -#ifdef ERF_USE_MULTIBLOCK - Particleinit_particle_params(); +#ifdef ERF_USE_PARTICLES + particleData.init_particle_params(); #endif solverChoice.init_params(max_level); diff --git a/Source/IO/Plotfile.cpp b/Source/IO/Plotfile.cpp index a6b221333..95a75e179 100644 --- a/Source/IO/Plotfile.cpp +++ b/Source/IO/Plotfile.cpp @@ -59,7 +59,13 @@ ERF::setPlotVariables (const std::string& pp_plot_var_names, Vector } for (int i = 0; i < derived_names.size(); ++i) { if ( containerHasElement(plot_var_names, derived_names[i]) ) { +#ifdef ERF_USE_PARTICLES + if ( (solverChoice.use_terrain || (derived_names[i] != "z_phys" && derived_names[i] != "detJ") ) && + (particleData.use_tracer_particles || (derived_names[i] != "tracer_particle_count") ) && + (particleData.use_hydro_particles || (derived_names[i] != "hydro_particle_count") ) ) { +#else if (solverChoice.use_terrain || (derived_names[i] != "z_phys" && derived_names[i] != "detJ") ) { +#endif tmp_plot_names.push_back(derived_names[i]); } } diff --git a/Source/Particles/ParticleData.H b/Source/Particles/ParticleData.H index ad7d753f8..83e4ce518 100644 --- a/Source/Particles/ParticleData.H +++ b/Source/Particles/ParticleData.H @@ -45,7 +45,7 @@ struct ParticleData { amrex::Print() << "Initialized " << tracer_particles->TotalNumberOfParticles() << " tracer particles." << std::endl; } - // Initialize tracer particles + // Initialize hydro particles if (use_hydro_particles) { hydro_particles = std::make_unique(a_gdb); if (z_phys_nd[0] != nullptr) { diff --git a/Source/TimeIntegration/ERF_Advance.cpp b/Source/TimeIntegration/ERF_Advance.cpp index 5eb8cc668..7fec7dfc4 100644 --- a/Source/TimeIntegration/ERF_Advance.cpp +++ b/Source/TimeIntegration/ERF_Advance.cpp @@ -134,7 +134,7 @@ ERF::Advance (int lev, Real time, Real dt_lev, int /*iteration*/, int /*ncycle*/ #endif #if defined(ERF_USE_RRTMGP) - // Update the microphysics + // Update the radiation advance_radiation(lev, S_new, dt_lev); #endif diff --git a/Source/TimeIntegration/ERF_advance_microphysics.cpp b/Source/TimeIntegration/ERF_advance_microphysics.cpp index 656f3c220..9c0e330c2 100644 --- a/Source/TimeIntegration/ERF_advance_microphysics.cpp +++ b/Source/TimeIntegration/ERF_advance_microphysics.cpp @@ -12,7 +12,6 @@ void ERF::advance_microphysics (int lev, Geom(lev), dt_advance); micro.Advance(); - micro.Diagnose(); micro.Update(cons, qmoist[lev]); } #endif diff --git a/Source/TimeIntegration/ERF_slow_rhs_pre.cpp b/Source/TimeIntegration/ERF_slow_rhs_pre.cpp index e7a491c08..dd80373af 100644 --- a/Source/TimeIntegration/ERF_slow_rhs_pre.cpp +++ b/Source/TimeIntegration/ERF_slow_rhs_pre.cpp @@ -607,14 +607,6 @@ void erf_slow_rhs_pre (int level, int finest_level, //----------------------------------------- // Diffusive terms (pre-computed above) //----------------------------------------- - // Expansion - Array4 er_arr; - if (expr) { - er_arr = expr->array(mfi); - } else { - er_arr = Array4{}; - } - // No terrain diffusion Array4 tau11,tau22,tau33; Array4 tau12,tau13,tau23;