Skip to content

Commit

Permalink
Merge branch 'xrb_layered_sync' of github.com:zingale/Castro into xrb…
Browse files Browse the repository at this point in the history
…_layered_sync
  • Loading branch information
zingale committed May 27, 2024
2 parents 48b6fa0 + 2227f71 commit 8b20f61
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Exec/science/xrb_layered/inputs_2d
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ problem.model_name = "toy_atm_hot_3cm.hse"

problem.apply_perturbation = 1

problem.H_min = 1.e-5
problem.He_min = 1.e-5

problem.model_shift = 750.0

# MICROPHYSICS
Expand Down
10 changes: 6 additions & 4 deletions Exec/science/xrb_layered/inputs_2d.nonsquare
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ amr.v = 1 # verbosity in Amr.cpp

# REFINEMENT / REGRIDDING
amr.max_level = 1 # maximum level number allowed
amr.ref_ratio = 4 2 2 2 # refinement ratio
amr.ref_ratio = 2 2 2 2 # refinement ratio
amr.regrid_int = 2 2 2 2 # how often to regrid
amr.blocking_factor = 8 # block factor in grid generation
amr.max_grid_size = 256
Expand All @@ -74,7 +74,7 @@ amr.check_int = 1000 # number of timesteps between checkpoints

# PLOTFILES
amr.plot_file = xrb_plt # root name of plotfile
amr.plot_int = 1000 # number of timesteps between plotfiles
amr.plot_per = 0.001
amr.derive_plot_vars = ALL

# PROBLEM PARAMETERS
Expand All @@ -84,11 +84,13 @@ problem.apply_perturbation = 1

problem.model_shift = 750.0

problem.H_min = 1.e-5
problem.He_min = 1.e-5
problem.H_min = -1
problem.He_min = -1

# MICROPHYSICS
integrator.jacobian = 1

integrator.atol_spec = 1.e-6
integrator.rtol_spec = 1.e-6

integrator.X_reject_buffer = 4.0
4 changes: 1 addition & 3 deletions Exec/science/xrb_layered/inputs_3d.nonsquare
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ amr.check_int = 1000 # number of timesteps between checkpoints

# PLOTFILES
amr.plot_file = xrb_plt # root name of plotfile
amr.plot_per = 0.001 # number of timesteps between plotfiles
amr.plot_per = 0.001
amr.derive_plot_vars = ALL

amr.small_plot_file = xrb_smallplt # root name of plotfile
Expand All @@ -100,6 +100,4 @@ integrator.jacobian = 1
integrator.atol_spec = 1.e-6
integrator.rtol_spec = 1.e-6

integrator.linalg_do_pivoting = 0

integrator.X_reject_buffer = 4.0
12 changes: 9 additions & 3 deletions Exec/science/xrb_layered/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,34 @@ void problem_initialize_state_data (int i, int j, int k,
height += problem::model_shift;

state(i,j,k,URHO) = interpolate(height, model::idens);
state(i,j,k,UTEMP) = interpolate(height, model::itemp);
state(i,j,k,UTEMP) = interpolate(height, model::itemp); // this will be an initial guess
Real p_zone = interpolate(height, model::ipres);

// interpolate species as mass fractions and make sure they sum to
// 1. Later we will convert to densities.

Real sumX{0.0};
for (int n = 0; n < NumSpec; ++n) {
state(i,j,k,UFS+n) = interpolate(height, model::ispec+n);
sumX += state(i,j,k,UFS+n);
}

// make sure the species sum to 1
for (int n = 0; n < NumSpec; ++n) {
state(i,j,k,UFS+n) /= sumX;
}

eos_t eos_state;
eos_state.rho = state(i,j,k,URHO);
eos_state.T = state(i,j,k,UTEMP);
eos_state.p = p_zone;

for (int n = 0; n < NumSpec; n++) {
eos_state.xn[n] = state(i,j,k,UFS+n);
}

eos(eos_input_rt, eos_state);
eos(eos_input_rp, eos_state);

state(i,j,k,UTEMP) = eos_state.T;
state(i,j,k,UEINT) = state(i,j,k,URHO) * eos_state.e;
state(i,j,k,UEDEN) = state(i,j,k,UEINT);

Expand Down

0 comments on commit 8b20f61

Please sign in to comment.