diff --git a/Docs/sphinx/geometry/EB.rst b/Docs/sphinx/geometry/EB.rst index fc746eca7..cdedf8611 100644 --- a/Docs/sphinx/geometry/EB.rst +++ b/Docs/sphinx/geometry/EB.rst @@ -100,9 +100,6 @@ This can be controlled in the code with: Re-redistribution ----------------- -.. note:: - This used to be supported when PeleC had it's own redistribution procedure. This is no longer the case now that we use the redistribution procedure highlighted above. This section is kept for historical purposes. - .. _eb_re_redist: .. figure:: EB_re_redist.png @@ -127,7 +124,7 @@ advanced a single time step, which we refer to as re-redistribution. Specificall The re-redistribution is implemented as a book-keeping step where the mass distributed are stored during MOL divergence calculation and given to the coarse and fine flux registers to reflux at the end of each time step. The re-redistribution is performed every time the reflux function is called in post_timestep. More details regarding re-redistribution are -presented in `Pember et al. `_. +presented in `Pember et al. `_. A forthcoming paper will describe the methodology for this procedure when using state redistribution. Date Structures and utility functions diff --git a/Exec/RegTests/EB-C1/eb-symmetry.inp b/Exec/RegTests/EB-C1/eb-symmetry.inp index fc042aa79..f6ee3a044 100644 --- a/Exec/RegTests/EB-C1/eb-symmetry.inp +++ b/Exec/RegTests/EB-C1/eb-symmetry.inp @@ -45,7 +45,7 @@ amr.max_level = 0 # maximum level number allowed #amr.max_level = 1 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est diff --git a/Exec/RegTests/EB-C1/ebmms-1.inp b/Exec/RegTests/EB-C1/ebmms-1.inp index 1a5f6ffab..2de59048b 100644 --- a/Exec/RegTests/EB-C1/ebmms-1.inp +++ b/Exec/RegTests/EB-C1/ebmms-1.inp @@ -45,7 +45,7 @@ amr.max_level = 0 # maximum level number allowed #amr.max_level = 1 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 64 amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est diff --git a/Exec/RegTests/EB-C1/example.inp b/Exec/RegTests/EB-C1/example.inp index d6f256539..a0a606358 100644 --- a/Exec/RegTests/EB-C1/example.inp +++ b/Exec/RegTests/EB-C1/example.inp @@ -46,7 +46,7 @@ amr.max_level = 0 # maximum level number allowed #amr.max_level = 1 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 64 amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est diff --git a/Exec/RegTests/EB-C11/eb-c11.inp b/Exec/RegTests/EB-C11/eb-c11.inp index cfe48d0c0..083b3d810 100644 --- a/Exec/RegTests/EB-C11/eb-c11.inp +++ b/Exec/RegTests/EB-C11/eb-c11.inp @@ -42,7 +42,7 @@ amr.data_log = datlog amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 64 amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est diff --git a/Exec/RegTests/EB-C11/example.inp b/Exec/RegTests/EB-C11/example.inp index cfe48d0c0..083b3d810 100644 --- a/Exec/RegTests/EB-C11/example.inp +++ b/Exec/RegTests/EB-C11/example.inp @@ -42,7 +42,7 @@ amr.data_log = datlog amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 64 amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est diff --git a/Exec/RegTests/EB-C12/eb-c12.inp b/Exec/RegTests/EB-C12/eb-c12.inp index ca092740e..4ffea1e36 100644 --- a/Exec/RegTests/EB-C12/eb-c12.inp +++ b/Exec/RegTests/EB-C12/eb-c12.inp @@ -47,7 +47,7 @@ amr.data_log = datlog amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C12/example.inp b/Exec/RegTests/EB-C12/example.inp index fbc086c5b..952870465 100644 --- a/Exec/RegTests/EB-C12/example.inp +++ b/Exec/RegTests/EB-C12/example.inp @@ -46,7 +46,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C13/example.inp b/Exec/RegTests/EB-C13/example.inp index f2465e4e7..fff40ba29 100644 --- a/Exec/RegTests/EB-C13/example.inp +++ b/Exec/RegTests/EB-C13/example.inp @@ -53,7 +53,7 @@ amr.data_log = datlog amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C3/eb-c3.inp b/Exec/RegTests/EB-C3/eb-c3.inp index cbe3d15cc..78c6a089f 100644 --- a/Exec/RegTests/EB-C3/eb-c3.inp +++ b/Exec/RegTests/EB-C3/eb-c3.inp @@ -49,7 +49,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C3/example.inp b/Exec/RegTests/EB-C3/example.inp index 204110295..8b7696aa1 100644 --- a/Exec/RegTests/EB-C3/example.inp +++ b/Exec/RegTests/EB-C3/example.inp @@ -49,7 +49,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C4-5/eb-c4.inp b/Exec/RegTests/EB-C4-5/eb-c4.inp index f93dcbe5e..671b36312 100644 --- a/Exec/RegTests/EB-C4-5/eb-c4.inp +++ b/Exec/RegTests/EB-C4-5/eb-c4.inp @@ -53,7 +53,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C4-5/eb-c5.inp b/Exec/RegTests/EB-C4-5/eb-c5.inp index 8c13f4d2f..ca1f4e069 100644 --- a/Exec/RegTests/EB-C4-5/eb-c5.inp +++ b/Exec/RegTests/EB-C4-5/eb-c5.inp @@ -52,7 +52,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C4-5/example.inp b/Exec/RegTests/EB-C4-5/example.inp index 99d457c69..13eb01518 100644 --- a/Exec/RegTests/EB-C4-5/example.inp +++ b/Exec/RegTests/EB-C4-5/example.inp @@ -53,7 +53,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C8/eb-c8-rere.inp b/Exec/RegTests/EB-C8/eb-c8-rere.inp new file mode 100644 index 000000000..055de0eb4 --- /dev/null +++ b/Exec/RegTests/EB-C8/eb-c8-rere.inp @@ -0,0 +1,90 @@ +# ------------------ INPUTS TO MAIN PROGRAM ------------------- +max_step = 10000 +stop_time = 1.959e-6 #final time is 0.2*L*sqrt(rhoL/pL) + +# PROBLEM SIZE & GEOMETRY +geometry.is_periodic = 0 0 1 +geometry.coord_sys = 0 # 0 => cart, 1 => RZ 2=>spherical +geometry.prob_lo = 0.0 -0.13 0.0 +geometry.prob_hi = 0.87 0.653 0.0435 +amr.n_cell = 160 144 8 + +# >>>>>>>>>>>>> BC KEYWORDS <<<<<<<<<<<<<<<<<<<<<< +# Interior, UserBC, Symmetry, SlipWall, NoSlipWall +# >>>>>>>>>>>>> BC KEYWORDS <<<<<<<<<<<<<<<<<<<<<< +pelec.lo_bc = "FOExtrap" "NoSlipWall" "Interior" +pelec.hi_bc = "FOExtrap" "NoSlipWall" "Interior" + +# WHICH PHYSICS +pelec.do_hydro = 1 +pelec.do_mol = 1 +pelec.diffuse_vel = 0 +pelec.diffuse_temp = 0 +pelec.diffuse_spec = 0 +pelec.do_react = 0 +pelec.diffuse_enth = 0 + +# TIME STEP CONTROL +pelec.dt_cutoff = 5.e-20 # level 0 timestep below which we halt +pelec.cfl = 0.2 # cfl number for hyperbolic system +pelec.init_shrink = 0.8 # scale back initial timestep +pelec.change_max = 1.05 # scale back initial timestep + +# DIAGNOSTICS & VERBOSITY +pelec.sum_interval = 1 # timesteps between computing mass +pelec.v = 1 # verbosity in PeleC.cpp +amr.v = 1 # verbosity in Amr.cpp +amr.data_log = datlog + +# REFINEMENT / REGRIDDING +amr.max_level = 1 # maximum level number allowed +amr.ref_ratio = 2 2 2 2 # refinement ratio +amr.regrid_int = 2 2 2 2 # how often to regrid +amr.n_error_buf = 0 0 0 0 # number of buffer cells in error est +amr.blocking_factor = 8 # block factor in grid generation +amr.max_grid_size = 64 +amr.grid_eff = 0.99 + +# CHECKPOINT FILES +amr.checkpoint_files_output = 0 +amr.check_file = chk # root name of checkpoint file +amr.check_int = -1 # number of timesteps between checkpoints + +# PLOTFILES +amr.plot_files_output = 1 +amr.plot_file = plt # root name of plotfile +amr.plot_int = 100 # number of timesteps between plotfiles +amr.derive_plot_vars = ALL + +# PROBLEM PARAMETERS +prob.p_l = 1e7 +prob.rho_l = 9.6e-4 +prob.p_r = 1e6 +prob.rho_r = 1.2e-4 +prob.angle = 30.0 +prob.left_gas = N2 +prob.right_gas = HE + +# Problem setup +pelec.eb_boundary_T = 300. +pelec.eb_isothermal = 0 + +# TAGGING +tagging.denerr = 1e20 +tagging.dengrad = 4e-5 +tagging.max_denerr_lev = 3 +tagging.max_dengrad_lev = 3 +tagging.tempgrad = 50.0 +tagging.max_tempgrad_lev = 3 +tagging.max_vfracerr_lev = 0 +tagging.eb_refine_type = "adaptive" +tagging.max_eb_refine_lev = 0 +tagging.min_eb_refine_lev = 0 + +eb2.geom_type = "rotated_box" +eb2.box_lo = -10.0 -0.172 -10.0 +eb2.box_hi = 10.0 0.172 10.0 +eb2.box_rotation = 30.0 +eb2.box_rotation_axe = 2 +eb2.box_has_fluid_inside = 1 +ebd.boundary_grad_stencil_type = 0 \ No newline at end of file diff --git a/Exec/RegTests/EB-C8/eb-c8.inp b/Exec/RegTests/EB-C8/eb-c8.inp index 43db8de3a..9932b3319 100644 --- a/Exec/RegTests/EB-C8/eb-c8.inp +++ b/Exec/RegTests/EB-C8/eb-c8.inp @@ -40,8 +40,10 @@ amr.data_log = datlog amr.max_level = 1 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid +amr.n_error_buf = 0 0 0 0 # number of buffer cells in error est amr.blocking_factor = 8 # block factor in grid generation -amr.max_grid_size = 32 +amr.max_grid_size = 64 +amr.grid_eff = 0.99 # CHECKPOINT FILES amr.checkpoint_files_output = 0 @@ -75,13 +77,10 @@ tagging.max_dengrad_lev = 3 tagging.tempgrad = 50.0 tagging.max_tempgrad_lev = 3 -eb2.geom_type = "extruded_triangles" -extruded_triangles.num_tri = 2 -extruded_triangles.tri_0_point_0 = -20.0 -11.662475437630437 0.0 -extruded_triangles.tri_0_point_1 = 22.0 -20.0 0.0 -extruded_triangles.tri_0_point_2 = 22.0 12.586235868333839 0.0 - -extruded_triangles.tri_1_point_0 = -20.0 -11.431535329954588 0.0 -extruded_triangles.tri_1_point_1 = 22.0 12.817175976009688 0.0 -extruded_triangles.tri_1_point_2 = -20.0 20.0 0.0 -ebd.boundary_grad_stencil_type = 0 +eb2.geom_type = "rotated_box" +eb2.box_lo = -10.0 -0.172 -10.0 +eb2.box_hi = 10.0 0.172 10.0 +eb2.box_rotation = 30.0 +eb2.box_rotation_axe = 2 +eb2.box_has_fluid_inside = 1 +ebd.boundary_grad_stencil_type = 0 \ No newline at end of file diff --git a/Exec/RegTests/EB-C8/example.inp b/Exec/RegTests/EB-C8/example.inp index 1c9f1bb74..1c057b525 100644 --- a/Exec/RegTests/EB-C8/example.inp +++ b/Exec/RegTests/EB-C8/example.inp @@ -73,13 +73,10 @@ tagging.dengrad = 4e-5 tagging.max_denerr_lev = 3 tagging.max_dengrad_lev = 3 -eb2.geom_type = "extruded_triangles" -extruded_triangles.num_tri = 2 -extruded_triangles.tri_0_point_0 = -20.0 -11.662475437630437 0.0 -extruded_triangles.tri_0_point_1 = 22.0 -20.0 0.0 -extruded_triangles.tri_0_point_2 = 22.0 12.586235868333839 0.0 - -extruded_triangles.tri_1_point_0 = -20.0 -11.431535329954588 0.0 -extruded_triangles.tri_1_point_1 = 22.0 12.817175976009688 0.0 -extruded_triangles.tri_1_point_2 = -20.0 20.0 0.0 -ebd.boundary_grad_stencil_type = 0 +eb2.geom_type = "rotated_box" +eb2.box_lo = -10.0 -0.172 -10.0 +eb2.box_hi = 10.0 0.172 10.0 +eb2.box_rotation = 30.0 +eb2.box_rotation_axe = 2 +eb2.box_has_fluid_inside = 1 +ebd.boundary_grad_stencil_type = 0 \ No newline at end of file diff --git a/Exec/RegTests/EB-C8/simple-advection.inp b/Exec/RegTests/EB-C8/simple-advection.inp index 1cb27ec3a..f404ed8e3 100644 --- a/Exec/RegTests/EB-C8/simple-advection.inp +++ b/Exec/RegTests/EB-C8/simple-advection.inp @@ -41,7 +41,7 @@ amr.data_log = datlog extremalog amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 2 2 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES @@ -78,13 +78,5 @@ tagging.dengrad = 4e-5 tagging.max_denerr_lev = 3 tagging.max_dengrad_lev = 3 -# eb2.geom_type = "extruded_triangles" -# extruded_triangles.num_tri = 2 -# extruded_triangles.tri_0_point_0 = -20.0 -11.662475437630437 0.0 -# extruded_triangles.tri_0_point_1 = 22.0 -20.0 0.0 -# extruded_triangles.tri_0_point_2 = 22.0 12.586235868333839 0.0 -# extruded_triangles.tri_1_point_0 = -20.0 -11.431535329954588 0.0 -# extruded_triangles.tri_1_point_1 = 22.0 12.817175976009688 0.0 -# extruded_triangles.tri_1_point_2 = -20.0 20.0 0.0 ebd.boundary_grad_stencil_type = 0 eb2.geom_type = "all_regular" \ No newline at end of file diff --git a/Exec/RegTests/EB-C9/eb-c9.inp b/Exec/RegTests/EB-C9/eb-c9.inp index cb2e7daaa..485c91436 100644 --- a/Exec/RegTests/EB-C9/eb-c9.inp +++ b/Exec/RegTests/EB-C9/eb-c9.inp @@ -47,7 +47,7 @@ amr.data_log = datlog amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/EB-C9/example.inp b/Exec/RegTests/EB-C9/example.inp index 85827b530..32044445a 100644 --- a/Exec/RegTests/EB-C9/example.inp +++ b/Exec/RegTests/EB-C9/example.inp @@ -46,7 +46,7 @@ amr.v = 1 # verbosity in Amr.cpp amr.max_level = 0 # maximum level number allowed amr.ref_ratio = 2 2 2 2 # refinement ratio amr.regrid_int = 2 # how often to regrid -amr.blocking_factor = 4 # block factor in grid generation +amr.blocking_factor = 8 # block factor in grid generation amr.max_grid_size = 32 # CHECKPOINT FILES diff --git a/Exec/RegTests/Sod/sod-3.inp b/Exec/RegTests/Sod/sod-3.inp index 9309cc258..740ce4868 100644 --- a/Exec/RegTests/Sod/sod-3.inp +++ b/Exec/RegTests/Sod/sod-3.inp @@ -81,8 +81,6 @@ tagging.min_eb_refine_lev = 0 tagging.refinement_indicators = box tagging.box.in_box_lo = 0.6 0.125 0.125 -#tagging.box.in_box_lo = 0.6 0.0 0.125 -#tagging.box.in_box_hi = 0.8 0.25 0.25 tagging.box.in_box_hi = 0.8 0.22 0.25 # EB diff --git a/Exec/RegTests/Sod/sod-4.inp b/Exec/RegTests/Sod/sod-4.inp new file mode 100644 index 000000000..0316b89f0 --- /dev/null +++ b/Exec/RegTests/Sod/sod-4.inp @@ -0,0 +1,98 @@ +# ------------------ INPUTS TO MAIN PROGRAM ------------------- +max_step = 100000 +stop_time = 0.2 + +# PROBLEM SIZE & GEOMETRY +geometry.is_periodic = 0 0 0 +geometry.coord_sys = 0 # 0 => cart, 1 => RZ 2=>spherical +geometry.prob_lo = 0 0 0 +geometry.prob_hi = 1.0 1.0 1.0 +amr.n_cell = 32 32 32 + +# >>>>>>>>>>>>> BC KEYWORDS <<<<<<<<<<<<<<<<<<<<<< +# Interior, UserBC, Symmetry, SlipWall, NoSlipWall +# >>>>>>>>>>>>> BC KEYWORDS <<<<<<<<<<<<<<<<<<<<<< +pelec.lo_bc = "SlipWall" "SlipWall" "SlipWall" +pelec.hi_bc = "SlipWall" "SlipWall" "SlipWall" + +# WHICH PHYSICS +pelec.do_hydro = 1 +pelec.do_mol = 1 +pelec.diffuse_vel = 0 +pelec.diffuse_temp = 0 +pelec.diffuse_spec = 0 +pelec.do_react = 0 + +# TIME STEP CONTROL +pelec.cfl = 0.3 # cfl number for hyperbolic system +pelec.init_shrink = 0.1 # scale back initial timestep +pelec.change_max = 1.05 # scale back initial timestep +pelec.dt_cutoff = 5.e-20 # level 0 timestep below which we halt + +# DIAGNOSTICS & VERBOSITY +pelec.sum_interval = 1 # timesteps between computing mass +pelec.v = 1 # verbosity in PeleC.cpp +amr.v = 1 # verbosity in Amr.cpp +amr.data_log = datlog + +# REFINEMENT / REGRIDDING +amr.max_level = 1 # maximum level number allowed +amr.ref_ratio = 2 2 2 2 # refinement ratio +amr.regrid_int = 2 2 2 2 # how often to regrid +amr.blocking_factor = 16 # block factor in grid generation +amr.max_grid_size = 64 +amr.n_error_buf = 0 0 0 0 # number of buffer cells in error est + +# CHECKPOINT FILES +amr.checkpoint_files_output = 0 +amr.check_file = chk # root name of checkpoint file +amr.check_int = 100 # number of timesteps between checkpoints + +# PLOTFILES +amr.plot_files_output = 1 +amr.plot_file = plt # root name of plotfile +amr.plot_int = 1 # number of timesteps between plotfiles +amr.plot_vars = density Temp +amr.derive_plot_vars = x_velocity y_velocity z_velocity magvel magvort pressure + +# PROBLEM PARAMETERS +prob.p_l = 1.0 +prob.u_l = 0.0 +prob.rho_l = 1.0 +prob.p_r = 0.1 +prob.u_r = 0.0 +prob.rho_r = 0.125 +prob.idir = 1 +prob.frac = 0.5 + +# TAGGING +tagging.denerr = 3 +tagging.dengrad = 0.01 +tagging.max_denerr_lev = 0 +tagging.max_dengrad_lev = 0 +tagging.presserr = 3 +tagging.pressgrad = 0.01 +tagging.max_presserr_lev = 0 +tagging.max_pressgrad_lev = 0 +tagging.max_vfracerr_lev = 0 +tagging.eb_refine_type = "adaptive" +tagging.max_eb_refine_lev = 0 +tagging.min_eb_refine_lev = 0 + +tagging.refinement_indicators = box +tagging.box.in_box_lo = 0.55 0.5 0.3 +tagging.box.in_box_hi = 0.85 0.65 0.7 + +# EB +eb2.geom_type = sphere +eb2.sphere_radius = 0.125 +eb2.sphere_center = 0.7 0.5 0.5 +eb2.sphere_has_fluid_inside = 0 +pelec.eb_boundary_T = 300. +pelec.eb_isothermal = 1 +ebd.boundary_grad_stencil_type = 0 +pelec.eb_srd_max_order = 2 + +# amrex.fpe_trap_invalid = 1 +# amrex.fpe_trap_zero = 1 +# amrex.fpe_trap_overflow = 1 diff --git a/Source/Diffusion.cpp b/Source/Diffusion.cpp index 8ad0b1d5b..969918826 100644 --- a/Source/Diffusion.cpp +++ b/Source/Diffusion.cpp @@ -99,7 +99,7 @@ PeleC::getMOLSrcTerm( // cut cells within 1 grow cell (cbox) due to EB redistribute typ = flag_fab.getType(cbox); - const amrex::Box ebfluxbox = amrex::grow(vbox, 2); + const amrex::Box ebfluxbox = amrex::grow(vbox, 3); const int local_i = mfi.LocalIndex(); const auto Ncut = @@ -447,20 +447,6 @@ PeleC::getMOLSrcTerm( AMREX_D_DECL(flx[0], flx[1], flx[2]), sv_eb_flux[local_i].dataPtr(), vfrac.array(mfi), Dterm); } - - if (do_reflux && reflux_factor != 0) { - for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { - amrex::ParallelFor( - eboxes[dir], NVAR, - [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { - flx[dir](i, j, k, n) *= reflux_factor; - }); - } - - update_flux_registers( - dt, vbox, mfi, typ, - {AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}); - } } else if (typ == amrex::FabType::regular) { // Compute flux divergence (1/Vol).Div(F.A) { @@ -473,20 +459,6 @@ PeleC::getMOLSrcTerm( i, j, k, n, AMREX_D_DECL(flx[0], flx[1], flx[2]), vol, Dterm); }); } - - if (do_reflux && reflux_factor != 0) { - for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { - amrex::ParallelFor( - eboxes[dir], NVAR, - [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { - flx[dir](i, j, k, n) *= reflux_factor; - }); - } - - update_flux_registers( - dt, vbox, mfi, typ, - {AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}); - } } else if (typ == amrex::FabType::multivalued) { amrex::Abort("multi-valued eb boundary fluxes to be implemented"); } @@ -516,6 +488,8 @@ PeleC::getMOLSrcTerm( } // EB redistribution + amrex::FArrayBox dm_as_fine( + amrex::Box::TheUnitBox(), MOLSrcTerm.nComp(), amrex::The_Async_Arena()); if (eb_in_domain && (typ != amrex::FabType::regular)) { AMREX_D_TERM(auto apx = areafrac[0]->const_array(mfi); , auto apy = areafrac[1]->const_array(mfi); @@ -553,9 +527,6 @@ PeleC::getMOLSrcTerm( const int as_crse = static_cast(fr_as_crse != nullptr); const int as_fine = static_cast(fr_as_fine != nullptr); - amrex::FArrayBox dm_as_fine( - amrex::Box::TheUnitBox(), MOLSrcTerm.nComp(), - amrex::The_Async_Arena()); amrex::FArrayBox fab_drho_as_crse( amrex::Box::TheUnitBox(), MOLSrcTerm.nComp(), amrex::The_Async_Arena()); @@ -582,14 +553,14 @@ PeleC::getMOLSrcTerm( { BL_PROFILE("ApplyMLRedistribution()"); + const amrex::Real fac_for_redist = (do_mol) ? 0.5 : 1.0; ApplyMLRedistribution( vbox, S.nComp(), Dterm, Dterm_tmp, S.const_array(mfi), scratch, flag_arr, AMREX_D_DECL(apx, apy, apz), vfrac.const_array(mfi), AMREX_D_DECL(fcx, fcy, fcz), ccc, d_bcs.dataPtr(), geom, dt, redistribution_type, as_crse, drho_as_crse->array(), rrflag_as_crse->array(), as_fine, dm_as_fine.array(), - level_mask.const_array(mfi), - level_mask_not_covered, /*fac_for_redist,*/ + level_mask.const_array(mfi), level_mask_not_covered, fac_for_redist, use_wts_in_divnc, 0, eb_srd_max_order); } @@ -598,6 +569,26 @@ PeleC::getMOLSrcTerm( S.const_array(mfi), typ, flag_arr, scratch, Dterm); } + // Refluxing + if (do_reflux && reflux_factor != 0) { + if (typ == amrex::FabType::singlevalued) { + for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { + const auto& ap = areafrac[dir]->const_array(mfi); + amrex::ParallelFor( + eboxes[dir], NVAR, + [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { + if (ap(i, j, k) > 0.0) { + flx[dir](i, j, k, n) /= ap(i, j, k); + } + }); + } + } + + update_flux_registers( + reflux_factor * dt, mfi, typ, + {AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}, dm_as_fine); + } + copy_array4(vbox, NVAR, Dterm, MOLSrc); if (do_mol_load_balance && (cost != nullptr)) { diff --git a/Source/EB.H b/Source/EB.H index 26a1eeb57..08e082de3 100644 --- a/Source/EB.H +++ b/Source/EB.H @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include diff --git a/Source/Geometry.H b/Source/Geometry.H index 872083bf2..2497758dd 100644 --- a/Source/Geometry.H +++ b/Source/Geometry.H @@ -87,6 +87,24 @@ public: build(const amrex::Geometry& geom, const int max_coarsening_level) override; }; +class RotatedCylinder : public Geometry::Register +{ +public: + static std::string identifier() { return "rotated_cylinder"; } + + void + build(const amrex::Geometry& geom, const int max_coarsening_level) override; +}; + +class RotatedBox : public Geometry::Register +{ +public: + static std::string identifier() { return "rotated_box"; } + + void + build(const amrex::Geometry& geom, const int max_coarsening_level) override; +}; + class CheckpointFile : public Geometry::Register { public: diff --git a/Source/Geometry.cpp b/Source/Geometry.cpp index 3a75e7c5e..fa686c783 100644 --- a/Source/Geometry.cpp +++ b/Source/Geometry.cpp @@ -311,6 +311,66 @@ QuarterCircle::build( gshop, geom, max_coarsening_level, max_coarsening_level, 4, false); } +void +RotatedCylinder::build( + const amrex::Geometry& geom, const int max_coarsening_level) +{ + bool inside = true; + amrex::Real radius = 0.0002; + int direction = 0; + amrex::Vector centervec(3, 0.0); + amrex::Real rotation = 0; + int rotation_axe = 0; + + amrex::ParmParse pp("eb2"); + pp.query("cylinder_has_fluid_inside", inside); + pp.query("cylinder_radius", radius); + pp.query("cylinder_direction", direction); + pp.query("cylinder_rotation", rotation); + pp.query("cylinder_rotation_axe", rotation_axe); + pp.getarr("cylinder_center", centervec, 0, 3); + amrex::Array center = { + AMREX_D_DECL(centervec[0], centervec[1], centervec[2])}; + + rotation = (rotation / 180.) * M_PI; + + amrex::EB2::CylinderIF my_cyl(radius, direction, center, inside); + + auto my_cyl_rot = amrex::EB2::rotate(my_cyl, rotation, rotation_axe); + auto gshop = amrex::EB2::makeShop(my_cyl_rot); + amrex::EB2::Build( + gshop, geom, max_coarsening_level, max_coarsening_level, 4, false); +} + +void +RotatedBox::build(const amrex::Geometry& geom, const int max_coarsening_level) +{ + + amrex::ParmParse pp("eb2"); + amrex::RealArray lo; + pp.get("box_lo", lo); + + amrex::RealArray hi; + pp.get("box_hi", hi); + + bool has_fluid_inside; + pp.get("box_has_fluid_inside", has_fluid_inside); + + amrex::Real rotation = 0; + int rotation_axe = 0; + pp.query("box_rotation", rotation); + pp.query("box_rotation_axe", rotation_axe); + + rotation = (rotation / 180.) * M_PI; + + amrex::EB2::BoxIF bf(lo, hi, has_fluid_inside); + + auto bf_rot = amrex::EB2::rotate(bf, rotation, rotation_axe); + auto gshop = amrex::EB2::makeShop(bf_rot); + amrex::EB2::Build( + gshop, geom, max_coarsening_level, max_coarsening_level, 4, false); +} + void CheckpointFile::build( const amrex::Geometry& geom, const int max_coarsening_level) diff --git a/Source/Hydro.cpp b/Source/Hydro.cpp index fdda223e8..802f65174 100644 --- a/Source/Hydro.cpp +++ b/Source/Hydro.cpp @@ -278,12 +278,15 @@ PeleC::construct_hydro_source( bx, hyd_src.nComp(), filtered_source_out.array(), hyd_src); } - // Reflux + // Refluxing if (do_reflux && sub_iteration == sub_ncycle - 1) { const amrex::FabType gtyp = flag_fab.getType(amrex::grow(bx, 1)); + amrex::FArrayBox dm_as_fine( + amrex::Box::TheUnitBox(), hyd_src.nComp(), + amrex::The_Async_Arena()); update_flux_registers( - dt, bx, mfi, gtyp, - {{AMREX_D_DECL(flux.data(), &(flux[1]), &(flux[2]))}}); + dt, mfi, gtyp, + {{AMREX_D_DECL(flux.data(), &(flux[1]), &(flux[2]))}}, dm_as_fine); } } } diff --git a/Source/LES.cpp b/Source/LES.cpp index c758229e6..7a814bede 100644 --- a/Source/LES.cpp +++ b/Source/LES.cpp @@ -65,8 +65,8 @@ PeleC::construct_old_les_source( old_sources[les_src]->setVal(0.0); - amrex::Real flux_factor_old = 0.5; - getLESTerm(time, dt, *old_sources[les_src], flux_factor_old); + amrex::Real reflux_factor_old = 0.5; + getLESTerm(time, dt, *old_sources[les_src], reflux_factor_old); old_sources[les_src]->FillBoundary(geom.periodicity()); } @@ -87,8 +87,8 @@ PeleC::construct_new_les_source( new_sources[les_src]->setVal(0.0); - amrex::Real flux_factor_new = sub_iteration == sub_ncycle - 1 ? 0.5 : 0; - getLESTerm(time, dt, *new_sources[les_src], flux_factor_new); + amrex::Real reflux_factor_new = sub_iteration == sub_ncycle - 1 ? 0.5 : 0; + getLESTerm(time, dt, *new_sources[les_src], reflux_factor_new); } // Calculate the LES term by calling an SFS model @@ -99,7 +99,7 @@ PeleC::getLESTerm( amrex::Real time, amrex::Real dt, amrex::MultiFab& LESTerm, - amrex::Real flux_factor) + amrex::Real reflux_factor) { BL_PROFILE("PeleC::getLESTerm()"); @@ -115,11 +115,11 @@ PeleC::getLESTerm( switch (les_model) { case 0: - getSmagorinskyLESTerm(time, dt, LESTerm, flux_factor); + getSmagorinskyLESTerm(time, dt, LESTerm, reflux_factor); break; case 1: - getDynamicSmagorinskyLESTerm(time, dt, LESTerm, flux_factor); + getDynamicSmagorinskyLESTerm(time, dt, LESTerm, reflux_factor); break; default: @@ -149,14 +149,14 @@ PeleC::getSmagorinskyLESTerm( amrex::Real /*time*/, amrex::Real /*dt*/, amrex::MultiFab& /*LESTerm*/, - amrex::Real /*flux_factor*/) + amrex::Real /*reflux_factor*/) { amrex::Abort("LES only implemented in 3D for now"); #else amrex::Real time, amrex::Real dt, amrex::MultiFab& LESTerm, - amrex::Real flux_factor) + amrex::Real reflux_factor) { // Only use this functionality for 3D const int ngrow = 1; @@ -268,19 +268,13 @@ PeleC::getSmagorinskyLESTerm( }); } - if (do_reflux && flux_factor != 0) // no eb in problem - { - for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { - amrex::ParallelFor( - eboxes[dir], NVAR, - [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { - flx[dir](i, j, k, n) *= flux_factor; - }); - } - + // Refluxing + if (do_reflux && reflux_factor != 0) { + amrex::FArrayBox dm_as_fine( + amrex::Box::TheUnitBox(), LESTerm.nComp(), amrex::The_Async_Arena()); update_flux_registers( - dt, vbox, mfi, typ, - {AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}); + reflux_factor * dt, mfi, typ, + {AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}, dm_as_fine); } } // End of MFIter scope } // End of OMP scope @@ -294,14 +288,14 @@ PeleC::getDynamicSmagorinskyLESTerm( amrex::Real /*time*/, amrex::Real /*dt*/, amrex::MultiFab& /*LESTerm*/, - amrex::Real /*flux_factor*/) + amrex::Real /*reflux_factor*/) { amrex::Abort("LES only implemented in 3D for now"); #else amrex::Real time, amrex::Real dt, amrex::MultiFab& LESTerm, - amrex::Real flux_factor) + amrex::Real reflux_factor) { // clang-format off /* @@ -335,13 +329,6 @@ PeleC::getDynamicSmagorinskyLESTerm( const int nGrowT = test_filter.get_filter_ngrow(); const amrex::GpuArray dx = geom.CellSizeArray(); - amrex::Real dx1 = dx[0]; - for (int dir = 1; dir < AMREX_SPACEDIM; ++dir) { - dx1 *= dx[dir]; - } - const amrex::GpuArray dxD = { - {AMREX_D_DECL(dx1, dx1, dx1)}}; - const amrex::Real* dxDp = dxD.data(); // 1. Get state variable data amrex::MultiFab S( @@ -580,27 +567,13 @@ PeleC::getDynamicSmagorinskyLESTerm( }); } - if (do_reflux && flux_factor != 0) // no eb in problem - { - for (int dir = 0; dir < AMREX_SPACEDIM; dir++) { - amrex::ParallelFor( - eboxes[dir], NVAR, - [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { - flx[dir](i, j, k, n) *= flux_factor; - }); - } - - if (level < parent->finestLevel()) { - getFluxReg(level + 1).CrseAdd( - mfi, {{AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}}, dxDp, - dt, amrex::RunOn::Device); - } - - if (level > 0) { - getFluxReg(level).FineAdd( - mfi, {{AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}}, dxDp, - dt, amrex::RunOn::Device); - } + // Refluxing + if (do_reflux && reflux_factor != 0) { + amrex::FArrayBox dm_as_fine( + amrex::Box::TheUnitBox(), LESTerm.nComp(), amrex::The_Async_Arena()); + update_flux_registers( + reflux_factor * dt, mfi, typ, + {AMREX_D_DECL(&flux_ec[0], &flux_ec[1], &flux_ec[2])}, dm_as_fine); } } } diff --git a/Source/PeleC.H b/Source/PeleC.H index cc6c970c0..5ab21fdfd 100644 --- a/Source/PeleC.H +++ b/Source/PeleC.H @@ -656,10 +656,10 @@ protected: void update_flux_registers( const amrex::Real dt, - const amrex::Box& bx, const amrex::MFIter& mfi, const amrex::FabType& typ, - const std::array& flux); + const std::array& flux, + const amrex::FArrayBox& dm_as_fine); void reflux(); @@ -810,8 +810,24 @@ int PeleC::numGrow() { int ng = 4; - if ((eb_in_domain) && (redistribution_type == "StateRedist")) { - ng += 1; + if (eb_in_domain) { + // IF MOL + FRD then 5 + // IF Godunov + FRD then 6 + // IF MOL + SRD then 6 + // IF Godunov + SRD then 7 + if (do_mol) { + if (redistribution_type == "FluxRedist") { + ng += 1; + } else if (redistribution_type == "StateRedist") { + ng += 2; + } + } else { + if (redistribution_type == "FluxRedist") { + ng += 2; + } else if (redistribution_type == "StateRedist") { + ng += 3; + } + } } return ng; } diff --git a/Source/PeleC.cpp b/Source/PeleC.cpp index 4f9ea28dd..bb93326c4 100644 --- a/Source/PeleC.cpp +++ b/Source/PeleC.cpp @@ -395,6 +395,15 @@ PeleC::read_params() // whether to gather data ppa.query("loadbalance_with_workestimates", do_mol_load_balance); ppa.query("loadbalance_with_workestimates", do_react_load_balance); + + if (eb_in_domain) { + int local_bf; + if (static_cast(ppa.query("blocking_factor", local_bf))) { + if (local_bf < 8) { + amrex::Error("Blocking factor must be at least 8 for EB"); + } + } + } } PeleC::PeleC() @@ -1381,10 +1390,10 @@ PeleC::okToContinue() void PeleC::update_flux_registers( const amrex::Real dt, - const amrex::Box& bx, const amrex::MFIter& mfi, const amrex::FabType& typ, - const std::array& flux) + const std::array& flux, + const amrex::FArrayBox& dm_as_fine) { BL_PROFILE("PeleC::update_flux_registers()"); @@ -1417,9 +1426,6 @@ PeleC::update_flux_registers( } if (fr_as_fine != nullptr) { - amrex::FArrayBox dm_as_fine( - amrex::grow(bx, 1), NVAR, amrex::The_Async_Arena()); - dm_as_fine.setVal(0.0); fr_as_fine->FineAdd( mfi, flux, dxD.data(), dt, vfrac[mfi], {AMREX_D_DECL( diff --git a/Source/main.cpp b/Source/main.cpp index bb510a459..cd0b5b659 100644 --- a/Source/main.cpp +++ b/Source/main.cpp @@ -125,7 +125,7 @@ main(int argc, char* argv[]) amrex::AmrLevel::SetEBSupportLevel( amrex::EBSupport::full); // need both area and volume fractions - amrex::AmrLevel::SetEBMaxGrowCells(6, 6, 6); + amrex::AmrLevel::SetEBMaxGrowCells(7, 7, 7); initialize_EB2( amrptr->Geom(PeleC::getEBMaxLevel()), PeleC::getEBMaxLevel(), diff --git a/Submodules/AMReX b/Submodules/AMReX index 346a4d1c9..d4d0e9031 160000 --- a/Submodules/AMReX +++ b/Submodules/AMReX @@ -1 +1 @@ -Subproject commit 346a4d1c915f2960cc0b0cbd2383cc341da4f56c +Subproject commit d4d0e9031d036070fad6d1d3bc96a8a32b48b3a9 diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c9df19093..250fb2f20 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -225,6 +225,7 @@ add_test_rv(hit-3 HIT) add_test_r(sod-1 Sod) add_test_r(sod-2 Sod) add_test_rv(sod-3 Sod) +add_test_rv(sod-4 Sod) add_test_r(channel-1 ChannelFlow) add_test_r(eb-c4 EB-C4-5) add_test_r(eb-c5 EB-C4-5) @@ -267,11 +268,12 @@ add_test_re(shu-osher-1 Shu-Osher) add_test_re(zerod-1 zeroD) add_test_re(eb-c3 EB-C3) add_test_re(soot-flame Soot-Flame) +add_test_re(eb-c8 EB-C8) +add_test_re(eb-c8-rere EB-C8) if(PELEC_DIM GREATER 2) add_test_re(tg-3 TG) add_test_re(tg-4 TG) add_test_re(eb-c7 EB-C7) - add_test_re(eb-c8 EB-C8) add_test_re(eb-bluffbody-1 EB-BluffBody) add_test_re(eb-plane-1 EB-Plane) endif()