diff --git a/Docs/sphinx_doc/Inputs.rst b/Docs/sphinx_doc/Inputs.rst index cde344a97..12746fdf7 100644 --- a/Docs/sphinx_doc/Inputs.rst +++ b/Docs/sphinx_doc/Inputs.rst @@ -112,8 +112,9 @@ List of Parameters | | subsequent | | | | | levels | | | +---------------------------+-----------------+-----------------+-------------+ -| **amr.regrid_int** | how often to | Integer > 0 | must be set | -| | regrid | | | +| **amr.regrid_int** | how often to | Integer > 0 | -1 | +| | regrid | (if negative, | | +| | | no regridding) | | +---------------------------+-----------------+-----------------+-------------+ | **amr.regrid_on_restart** | should we | 0 or 1 | 0 | | | regrid | | | diff --git a/Docs/sphinx_doc/MeshRefinement.rst b/Docs/sphinx_doc/MeshRefinement.rst index 7236d2165..bc6eb6ac0 100644 --- a/Docs/sphinx_doc/MeshRefinement.rst +++ b/Docs/sphinx_doc/MeshRefinement.rst @@ -34,13 +34,13 @@ one level of refinement, where prob_lo_z and prob_hi_z are the vertical extents amr.max_level = 1 amr.ref_ratio = 2 - amr.refinement_indicators = box1 box2 + erf.refinement_indicators = box1 box2 - amr.box1.in_box_lo = .15 .25 - amr.box1.in_box_hi = .35 .45 + erf.box1.in_box_lo = .15 .25 + erf.box1.in_box_hi = .35 .45 - amr.box2.in_box_lo = .65 .75 - amr.box2.in_box_hi = .85 .95 + erf.box2.in_box_lo = .65 .75 + erf.box2.in_box_hi = .85 .95 In the example below, we refine the region ((.15,.25,prob_lo_z)(.35,.45,prob_hi_z)) by two levels of factor 3 refinement. In this case, the refined region at level 1 will @@ -51,10 +51,10 @@ be sufficient to enclose the refined region at level 2. amr.max_level = 2 amr.ref_ratio = 3 3 - amr.refinement_indicators = box1 + erf.refinement_indicators = box1 - amr.box1.in_box_lo = .15 .25 - amr.box1.in_box_hi = .35 .45 + erf.box1.in_box_lo = .15 .25 + erf.box1.in_box_hi = .35 .45 And in this final example, the region ((.15,.25,prob_lo_z)(.35,.45,prob_hi_z)) will be refined by two levels of factor 3, but the larger region, ((.05,.05,prob_lo_z)(.75,.75,prob_hi_z)) @@ -65,14 +65,14 @@ will be refined by a single factor 3 refinement. amr.max_level = 2 amr.ref_ratio = 3 3 - amr.refinement_indicators = box1 box2 + erf.refinement_indicators = box1 box2 - amr.box1.in_box_lo = .15 .25 - amr.box1.in_box_hi = .35 .45 + erf.box1.in_box_lo = .15 .25 + erf.box1.in_box_hi = .35 .45 - amr.box2.in_box_lo = .05 .05 - amr.box2.in_box_hi = .75 .75 - amr.box2.max_level = 1 + erf.box2.in_box_lo = .05 .05 + erf.box2.in_box_hi = .75 .75 + erf.box2.max_level = 1 Dynamic Mesh Refinement @@ -102,23 +102,23 @@ computed by dividing the variable named rhotheta by the variable named density. :: - amr.refinement_indicators = hi_rho lo_theta advdiff + erf.refinement_indicators = hi_rho lo_theta advdiff - amr.hi_rho.max_level = 3 - amr.hi_rho.value_greater = 1. 2. - amr.hi_rho.field_name = density + erf.hi_rho.max_level = 3 + erf.hi_rho.value_greater = 1. 2. + erf.hi_rho.field_name = density - amr.lo_theta.max_level = 1 - amr.lo_theta.value_less = 300 - amr.lo_theta.field_name = rhotheta - amr.lo_theta.in_box_lo = .25 .25 .25 - amr.lo_theta.in_box_hi = .75 .75 .75 + erf.lo_theta.max_level = 1 + erf.lo_theta.value_less = 300 + erf.lo_theta.field_name = rhotheta + erf.lo_theta.in_box_lo = .25 .25 .25 + erf.lo_theta.in_box_hi = .75 .75 .75 - amr.advdiff.max_level = 2 - amr.advdiff.adjacent_difference_greater = 0.01 - amr.advdiff.field_name = rhoadv_0 - amr.advdiff.start_time = 0.001 - amr.advdiff.end_time = 0.002 + erf.advdiff.max_level = 2 + erf.advdiff.adjacent_difference_greater = 0.01 + erf.advdiff.field_name = rhoadv_0 + erf.advdiff.start_time = 0.001 + erf.advdiff.end_time = 0.002 Coupling Types -------------- diff --git a/Exec/inputs.mesh_refinement b/Exec/inputs.mesh_refinement index 89841fa2a..9e5406bb9 100644 --- a/Exec/inputs.mesh_refinement +++ b/Exec/inputs.mesh_refinement @@ -9,6 +9,6 @@ amr.regrid_int = 2 2 2 2 # how often to regrid amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est # How to specify a region for static refinement -amr.refinement_indicators = box1 -amr.box1.in_box_lo = .15 .25 -amr.box1.in_box_hi = .55 .65 +erf.refinement_indicators = box1 +erf.box1.in_box_lo = .15 .25 +erf.box1.in_box_hi = .55 .65 diff --git a/Source/ERF.H b/Source/ERF.H index 1c3e7ac89..d42ba4ca6 100644 --- a/Source/ERF.H +++ b/Source/ERF.H @@ -203,8 +203,10 @@ public: amrex::Real dt, amrex::Real time, amrex::InterpFaceRegister* ifr); +#if defined(ERF_USE_MOISTURE) void advance_microphysics (int lev, amrex::MultiFab& cons_in, const amrex::Real& dt_advance); +#endif amrex::MultiFab& build_fine_mask (int lev); diff --git a/Source/ERF_Tagging.cpp b/Source/ERF_Tagging.cpp index b48d3faf4..c5c2e2eac 100644 --- a/Source/ERF_Tagging.cpp +++ b/Source/ERF_Tagging.cpp @@ -20,17 +20,32 @@ ERF::ErrorEst (int level, TagBoxArray& tags, Real time, int /*ngrow*/) { std::unique_ptr mf; - // This allows dynamic refinement based on the value of the scalar - if (ref_tags[j].Field() == "scalar") { + // This allows dynamic refinement based on the value of the density + if (ref_tags[j].Field() == "density") + { + mf = std::make_unique(grids[level], dmap[level], 1, 0); + MultiFab::Copy(*mf,vars_new[level][Vars::cons],Rho_comp,0,1,0); + + // This allows dynamic refinement based on the value of the scalar/pressure/theta + } else if ( (ref_tags[j].Field() == "scalar" ) || + (ref_tags[j].Field() == "pressure") || + (ref_tags[j].Field() == "theta" ) ) + { mf = std::make_unique(grids[level], dmap[level], 1, 0); for (MFIter mfi(*mf, TilingIfNotGPU()); mfi.isValid(); ++mfi) { const Box& bx = mfi.tilebox(); auto& dfab = (*mf)[mfi]; auto& sfab = vars_new[level][Vars::cons][mfi]; - derived::erf_derscalar(bx, dfab, 0, 1, sfab, Geom(level), time, nullptr, level); + if (ref_tags[j].Field() == "scalar") { + derived::erf_derscalar(bx, dfab, 0, 1, sfab, Geom(level), time, nullptr, level); + } else if (ref_tags[j].Field() == "pressure") { + derived::erf_derpres(bx, dfab, 0, 1, sfab, Geom(level), time, nullptr, level); + } else if (ref_tags[j].Field() == "theta") { + derived::erf_dertheta(bx, dfab, 0, 1, sfab, Geom(level), time, nullptr, level); + } } // mfi - } // scalar + } // This is sufficient for static refinement (where we don't need mf filled first) ref_tags[j](tags,mf.get(),clearval,tagval,time,level,geom[level]); diff --git a/Source/TimeIntegration/ERF_advance_microphysics.cpp b/Source/TimeIntegration/ERF_advance_microphysics.cpp index 998a4cbfc..37de746b1 100644 --- a/Source/TimeIntegration/ERF_advance_microphysics.cpp +++ b/Source/TimeIntegration/ERF_advance_microphysics.cpp @@ -2,11 +2,11 @@ using namespace amrex; +#if defined(ERF_USE_MOISTURE) void ERF::advance_microphysics(int lev, MultiFab& cons, const Real& dt_advance) { -#if defined(ERF_USE_MOISTURE) micro.Init(cons, qmoist[lev], grids_to_evolve[lev], Geom(lev), @@ -19,5 +19,5 @@ void ERF::advance_microphysics(int lev, micro.MicroPrecipFall(); micro.Update(cons, qmoist[lev]); -#endif } +#endif diff --git a/Source/TimeIntegration/ERF_slow_rhs_post.cpp b/Source/TimeIntegration/ERF_slow_rhs_post.cpp index f779b75b6..d4ebbc04f 100644 --- a/Source/TimeIntegration/ERF_slow_rhs_post.cpp +++ b/Source/TimeIntegration/ERF_slow_rhs_post.cpp @@ -18,7 +18,6 @@ using namespace amrex; * * @param[in] level level of resolution * @param[in] dt slow time step - * @param[in] grids_to_evolve the region in the domain excluding the relaxation and specified zones * @param[out] S_rhs RHS computed here * @param[in] S_old solution at start of time step * @param[in] S_new solution at end of current RK stage @@ -48,7 +47,6 @@ using namespace amrex; void erf_slow_rhs_post (int /*level*/, Real dt, - BoxArray& grids_to_evolve, Vector& S_rhs, Vector& S_old, Vector& S_new, diff --git a/Source/TimeIntegration/TI_headers.H b/Source/TimeIntegration/TI_headers.H index e0fbbb242..73494e3d4 100644 --- a/Source/TimeIntegration/TI_headers.H +++ b/Source/TimeIntegration/TI_headers.H @@ -65,7 +65,6 @@ void erf_slow_rhs_pre (int level, int nrk, */ void erf_slow_rhs_post (int level, amrex::Real dt, - amrex::BoxArray& grids_to_evolve, amrex::Vector& S_rhs, amrex::Vector& S_old, amrex::Vector& S_new, diff --git a/Source/TimeIntegration/TI_slow_rhs_fun.H b/Source/TimeIntegration/TI_slow_rhs_fun.H index ce70710c1..829a91ba6 100644 --- a/Source/TimeIntegration/TI_slow_rhs_fun.H +++ b/Source/TimeIntegration/TI_slow_rhs_fun.H @@ -267,7 +267,7 @@ // Moving terrain if ( solverChoice.use_terrain && (solverChoice.terrain_type == 1) ) { - erf_slow_rhs_post(level, slow_dt, grids_to_evolve[level], + erf_slow_rhs_post(level, slow_dt, S_rhs, S_old, S_new, S_data, S_prim, S_scratch, xvel_new, yvel_new, zvel_new, source, SmnSmn, eddyDiffs, @@ -282,7 +282,7 @@ #endif incompressible); } else { - erf_slow_rhs_post(level, slow_dt, grids_to_evolve[level], + erf_slow_rhs_post(level, slow_dt, S_rhs, S_old, S_new, S_data, S_prim, S_scratch, xvel_new, yvel_new, zvel_new, source, SmnSmn, eddyDiffs, diff --git a/Submodules/AMReX b/Submodules/AMReX index 0236a3732..5a90c264f 160000 --- a/Submodules/AMReX +++ b/Submodules/AMReX @@ -1 +1 @@ -Subproject commit 0236a3732cc8e399e01eacd0253a782da40ce1f7 +Subproject commit 5a90c264fad82e0d09fe3958a679dddca3571940