Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scale wdmerger initial model resolution based on resolution on finest level #2611

Draft
wants to merge 4 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/wdmerger_collision-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 3 additions & 6 deletions Exec/science/wdmerger/_prob_params
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 24 additions & 24 deletions Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out
Original file line number Diff line number Diff line change
@@ -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

22 changes: 20 additions & 2 deletions Exec/science/wdmerger/wdmerger_util.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <wdmerger_util.H>
#include <binary.H>
#include <global.H>
#include <network.H>
#include <ambient.H>
#include <model_parser.H>
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down