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 1 commit
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
Next Next commit
Match wdmerger initial model resolution to resolution on finest level
  • Loading branch information
maximumcats committed Oct 7, 2023
commit ed646cc5219b79e365b2f5177112537027761159
8 changes: 0 additions & 8 deletions Exec/science/wdmerger/_prob_params
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ 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).

initial_model_dx real 6.25e5_rt y

# Composition properties of initial models.
# We follow the prescription of Dan et al. 2012 for determining
# the composition of the WDs. In this approach, below a certain
Expand Down
19 changes: 17 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,22 @@ void binary_setup ()

// Generate primary and secondary WD models.

// Use the smallest dx on the finest possible level for determining the resolution
// of the initial model.

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

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 +586,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