Skip to content

Commit

Permalink
Merge branch 'erf-model:development' into xyuan/rad_develop
Browse files Browse the repository at this point in the history
  • Loading branch information
xyuan authored Nov 23, 2023
2 parents 6655431 + 68a0bfb commit 11c45d5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
12 changes: 8 additions & 4 deletions Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ amrex::Real ERF::previousCPUTimeUsed = 0.0;
Vector<AMRErrorTag> ERF::ref_tags;

SolverChoice ERF::solverChoice;
#ifdef ERF_USE_MULTIBLOCK

#ifdef ERF_USE_PARTICLES
ParticleData ERF::particleData;
#endif

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions Source/IO/Plotfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ ERF::setPlotVariables (const std::string& pp_plot_var_names, Vector<std::string>
}
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]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Particles/ParticleData.H
Original file line number Diff line number Diff line change
Expand Up @@ -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<HydroPC>(a_gdb);
if (z_phys_nd[0] != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion Source/TimeIntegration/ERF_Advance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion Source/TimeIntegration/ERF_advance_microphysics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ void ERF::advance_microphysics (int lev,
Geom(lev),
dt_advance);
micro.Advance();
micro.Diagnose();
micro.Update(cons, qmoist[lev]);
}
#endif
8 changes: 0 additions & 8 deletions Source/TimeIntegration/ERF_slow_rhs_pre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,6 @@ void erf_slow_rhs_pre (int level, int finest_level,
//-----------------------------------------
// Diffusive terms (pre-computed above)
//-----------------------------------------
// Expansion
Array4<Real> er_arr;
if (expr) {
er_arr = expr->array(mfi);
} else {
er_arr = Array4<Real>{};
}

// No terrain diffusion
Array4<Real> tau11,tau22,tau33;
Array4<Real> tau12,tau13,tau23;
Expand Down

0 comments on commit 11c45d5

Please sign in to comment.