diff --git a/.github/workflows/wdmerger_collision-compare.yml b/.github/workflows/wdmerger_collision-compare.yml index cd1e9c8b5f..abd5ccafda 100644 --- a/.github/workflows/wdmerger_collision-compare.yml +++ b/.github/workflows/wdmerger_collision-compare.yml @@ -43,5 +43,5 @@ jobs: - name: Check the extrema run: | cd Exec/science/wdmerger - ../../../external/amrex/Tools/Plotfile/fextrema.gnu.ex plt00095 > fextrema.out + ../../../external/amrex/Tools/Plotfile/fextrema.gnu.ex plt00094 > fextrema.out diff fextrema.out ci-benchmarks/wdmerger_collision_2D.out diff --git a/Exec/science/wdmerger/_prob_params b/Exec/science/wdmerger/_prob_params index f4c0317d85..0ee597979d 100644 --- a/Exec/science/wdmerger/_prob_params +++ b/Exec/science/wdmerger/_prob_params @@ -61,13 +61,10 @@ single_star integer 0 n # 1D initial model parameters -# For the grid spacing for our model, we'll use -# 6.25 km. No simulation we do is likely to have a resolution -# higher than that inside the stars (it represents -# three jumps by a factor of four compared to our -# normal coarse grid resolution). +# For the grid spacing for our model, we'll scale up the resolution on the finest level +# by this factor. The resolution will be further enhanced by a factor of nsub. -initial_model_dx real 6.25e5_rt y +initial_model_dx_factor real 10.0_rt y # Composition properties of initial models. # We follow the prescription of Dan et al. 2012 for determining diff --git a/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out b/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out index a933d102df..fbd5f39e3b 100644 --- a/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out +++ b/Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out @@ -1,29 +1,29 @@ - plotfile = plt00095 + plotfile = plt00094 time = 1.25 variables minimum value maximum value - density 8.7136176158e-05 13348283.786 - xmom -4.4636648292e+14 1.4969028735e+15 - ymom -1.8931343553e+15 1.9807937913e+15 + density 8.7747369099e-05 13875434.219 + xmom -4.2605969892e+14 1.6671417722e+15 + ymom -1.8984472807e+15 2.0542868341e+15 zmom 0 0 - rho_E 7.7947390767e+11 5.6568077669e+24 - rho_e 7.4321344551e+11 5.6343409475e+24 - Temp 100000 3972527783.9 - rho_He4 8.7136176158e-17 1473.9666386 - rho_C12 3.4854470463e-05 5030539.1488 - rho_O16 5.2281705694e-05 7778301.6377 - rho_Ne20 8.7136176158e-17 1023673.1153 - rho_Mg24 8.7136176158e-17 1040419.2782 - rho_Si28 8.7136176158e-17 4251082.0739 - rho_S32 8.7136176158e-17 2179431.2961 - rho_Ar36 8.7136176158e-17 497747.48798 - rho_Ca40 8.7136176158e-17 382056.037 - rho_Ti44 8.7136176158e-17 1576.0930955 - rho_Cr48 8.7136176158e-17 1467.9139369 - rho_Fe52 8.7136176158e-17 14831.710059 - rho_Ni56 8.7136176158e-17 182702.27304 - phiGrav -4.6147467267e+17 -2.2055818332e+16 - grav_x -461195258.85 -48603.568291 - grav_y -444709392.81 392306861.64 + rho_E 9.7109449439e+11 5.5153057381e+24 + rho_e 9.2278752823e+11 5.4809070383e+24 + Temp 129554.6025 3968185742 + rho_He4 8.7747369099e-17 1500.0627459 + rho_C12 3.5098947639e-05 5385594.9933 + rho_O16 5.2648421459e-05 8182678.0555 + rho_Ne20 8.7747369099e-17 318345.70683 + rho_Mg24 8.7747369099e-17 1108974.2395 + rho_Si28 8.7747369099e-17 4492222.6108 + rho_S32 8.7747369099e-17 2142509.5036 + rho_Ar36 8.7747369099e-17 482205.25964 + rho_Ca40 8.7747369099e-17 372152.3934 + rho_Ti44 8.7747369099e-17 1847.5804463 + rho_Cr48 8.7747369099e-17 2107.8391698 + rho_Fe52 8.7747369099e-17 18845.901334 + rho_Ni56 8.7747369099e-17 244972.68947 + phiGrav -4.6507706646e+17 -2.2078878103e+16 + grav_x -465874841.65 -48624.974761 + grav_y -461458822.05 397460892.49 grav_z 0 0 - rho_enuc -7.6356851771e+21 5.7259582003e+26 + rho_enuc -1.2654029692e+22 3.8743115323e+26 diff --git a/Exec/science/wdmerger/wdmerger_util.cpp b/Exec/science/wdmerger/wdmerger_util.cpp index 3ccf324816..042a2769e0 100644 --- a/Exec/science/wdmerger/wdmerger_util.cpp +++ b/Exec/science/wdmerger/wdmerger_util.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -555,8 +556,25 @@ void binary_setup () // Generate primary and secondary WD models. + // Scale the resolution of the initial model based on dx on the finest possible level. + // Make sure that our resolution is a significant factor better than that dx, and factor + // in sub-grid sampling if we're using that. + + auto fine_geom = global::the_amr_ptr->Geom(global::the_amr_ptr->maxLevel()); + auto fine_dx = fine_geom.CellSizeArray(); + + Real initial_model_dx = fine_dx[0]; +#if AMREX_SPACEDIM >= 2 + initial_model_dx = std::min(initial_model_dx, fine_dx[1]); +#endif +#if AMREX_SPACEDIM == 3 + initial_model_dx = std::min(initial_model_dx, fine_dx[2]); +#endif + + initial_model_dx /= (problem::initial_model_dx_factor * problem::nsub); + establish_hse(problem::mass_P, problem::central_density_P, problem::radius_P, - problem::core_comp_P, problem::stellar_temp, problem::initial_model_dx, + problem::core_comp_P, problem::stellar_temp, initial_model_dx, problem::envelope_mass_P, problem::envelope_comp_P, 0); amrex::Print() << std::endl; @@ -571,7 +589,7 @@ void binary_setup () if (!problem::single_star) { establish_hse(problem::mass_S, problem::central_density_S, problem::radius_S, - problem::core_comp_S, problem::stellar_temp, problem::initial_model_dx, + problem::core_comp_S, problem::stellar_temp, initial_model_dx, problem::envelope_mass_S, problem::envelope_comp_S, 1); amrex::Print() << "Generated initial model for secondary WD of mass " << std::setprecision(3) << problem::mass_S / C::M_solar