Skip to content

Commit

Permalink
sync up with the MAESTROeX xrb_layered
Browse files Browse the repository at this point in the history
also add a non-uniform grid version
  • Loading branch information
zingale committed Apr 21, 2024
1 parent 4ef6d25 commit 427fc8f
Show file tree
Hide file tree
Showing 5 changed files with 1,131 additions and 1,029 deletions.
6 changes: 5 additions & 1 deletion Exec/science/xrb_layered/_prob_params
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
H_min real 1.e-4_rt y
# H mass fraction above which to refine
H_min real -1.0 y

# He mass fraction above which to refine
He_min real -1.0 y

cutoff_density real 50.0_rt y

Expand Down
6 changes: 3 additions & 3 deletions Exec/science/xrb_layered/inputs_2d
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ geometry.is_periodic = 1 0
geometry.coord_sys = 0 # 0 => cart, 1 => RZ 2=>spherical
geometry.prob_lo = 0.0 0.0
geometry.prob_hi = 3072 3072
amr.n_cell = 128 128
amr.n_cell = 256 256

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# 0 = Interior 3 = Symmetry
Expand Down Expand Up @@ -75,11 +75,11 @@ amr.plot_int = 1000 # number of timesteps between plotfiles
amr.derive_plot_vars = ALL

# PROBLEM PARAMETERS
problem.model_name = "toy_atm_hot_castro_3cm.hse"
problem.model_name = "toy_atm_hot_3cm.hse"

problem.apply_perturbation = 1

problem.model_shift = 300.0
problem.model_shift = 750.0

# MICROPHYSICS
integrator.jacobian = 1
Expand Down
94 changes: 94 additions & 0 deletions Exec/science/xrb_layered/inputs_2d.nonsquare
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 1000000
stop_time = 1000.0

# PROBLEM SIZE & GEOMETRY
geometry.is_periodic = 1 0
geometry.coord_sys = 0 # 0 => cart, 1 => RZ 2=>spherical
geometry.prob_lo = 0.0 0.0
geometry.prob_hi = 3072 3072
amr.n_cell = 128 256

castro.allow_non_unit_aspect_zones = 1
castro.domain_is_plane_parallel = 1

# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
# 0 = Interior 3 = Symmetry
# 1 = Inflow 4 = SlipWall
# 2 = Outflow 5 = NoSlipWall
# >>>>>>>>>>>>> BC FLAGS <<<<<<<<<<<<<<<<
castro.lo_bc = 0 3
castro.hi_bc = 0 2

castro.fill_ambient_bc = 1
castro.ambient_fill_dir = 1
castro.ambient_outflow_vel = 1


# WHICH PHYSICS
castro.do_hydro = 1
castro.do_react = 1
castro.add_ext_src = 0
castro.do_grav = 1
castro.do_sponge = 1

castro.ppm_type = 1
castro.grav_source_type = 2
castro.use_pslope = 1
castro.pslope_cutoff_density = 1.e4

gravity.gravity_type = ConstantGrav
gravity.const_grav = -1.29e14

# burning
castro.react_rho_min = 1.e2
castro.react_T_min = 5.e6


# TIME STEP CONTROL
castro.cfl = 0.8 # cfl number for hyperbolic system
castro.init_shrink = 0.1 # scale back initial timestep
castro.change_max = 1.1 # max time step growth

# SPONGE
castro.sponge_upper_density = 1.e3
castro.sponge_lower_density = 1.e2
castro.sponge_timescale = 1.0e-7

# DIAGNOSTICS & VERBOSITY
castro.sum_interval = 1 # timesteps between computing mass
castro.v = 1 # verbosity in Castro.cpp
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.regrid_int = 2 2 2 2 # how often to regrid
amr.blocking_factor = 8 # block factor in grid generation
amr.max_grid_size = 256
amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est

# CHECKPOINT FILES
amr.check_file = xrb_chk # root name of checkpoint file
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.derive_plot_vars = ALL

# PROBLEM PARAMETERS
problem.model_name = "toy_atm_hot_3cm.hse"

problem.apply_perturbation = 1

problem.model_shift = 750.0

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

# MICROPHYSICS
integrator.jacobian = 1

integrator.atol_spec = 1.e-6
integrator.rtol_spec = 1.e-6
6 changes: 5 additions & 1 deletion Exec/science/xrb_layered/problem_tagging.H
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef problem_tagging_H
#define problem_tagging_H

#include <state_indices.H>

AMREX_GPU_HOST_DEVICE AMREX_INLINE
void problem_tagging(int i, int j, int k,
Array4<char> const& tag,
Expand All @@ -10,7 +12,9 @@ void problem_tagging(int i, int j, int k,
// Tag on regions of with H > H_min and rho < cutoff_density.
// Note that H is the first species variable and so is in index UFS of the state array.

if (state(i,j,k,URHO) > problem::cutoff_density && state(i,j,k,UFS) > problem::H_min) {
if (state(i,j,k,URHO) > problem::cutoff_density &&
(state(i,j,k,UFS) > state(i,j,k,URHO) * problem::H_min ||
state(i,j,k,UFS+1) > state(i,j,k,URHO) * problem::He_min)) {
tag(i,j,k) = TagBox::SET;
}
}
Expand Down
Loading

0 comments on commit 427fc8f

Please sign in to comment.