
############################## CASTRO INPUTS ###############################################

############################################################################################
# Geometry
############################################################################################

# Non-periodic boundary conditions
geometry.is_periodic = 0

# Cartesian coordinate system
geometry.coord_sys = 0

# Lower boundary limits in physical space
geometry.prob_lo = -2.56e9

# Upper boundary limits in physical space
geometry.prob_hi =  2.56e9

# System center of mass
problem.center    =   0.0e0

############################################################################################
# Boundary conditions
# 0 = Interior           3 = Symmetry
# 1 = Inflow             4 = SlipWall
# 2 = Outflow            5 = NoSlipWall
############################################################################################

# Boundary conditions on lo x edge
castro.lo_bc = 2

# Boundary conditions on hi x edge
castro.hi_bc = 2

############################################################################################ 
# Timestepping
############################################################################################

# Maximum coarse timestep
max_step = 10000000

# Simulation time to stop at
stop_time = 100.0

# CFL number for hyperbolic system
castro.cfl = 0.5

# Fixed level 0 timestep; unused if < 0
castro.fixed_dt = -1.0

# Scale back initial timestep by this factor
castro.init_shrink = 0.1

# Factor by which dt is allowed to change each timestep
castro.change_max = 1.05

# If we regrid on Level 0, compute a new timestep afterward
amr.compute_new_dt_on_regrid = 1

# Use a retry if an advance violated our stability criteria
castro.use_retry = 1

############################################################################################ 
# Resolution, gridding and AMR
############################################################################################

# Number of cells on the coarse grid
amr.n_cell = 512

# Maximum level number allowed
amr.max_level = 0

# Refinement ratio
amr.ref_ratio = 4 4 4 4 4 4 4 4 4

# How many coarse timesteps between regridding
amr.regrid_int = 2

# Allow special regrids based on stability criteria
castro.use_post_step_regrid = 1

# Number of buffer cells in error estimation
amr.n_error_buf = 2 2 2 2 2 2 2 2 2 2

# Maximum grid size at each level
amr.max_grid_size = 32 48 64 64 64 64 64 64 64 64

# Grid sizes must be a multiple of blocking factor
amr.blocking_factor = 16

# What constitutes an efficient grid
amr.grid_eff = 0.9

# Order of reconstruction for interpolation
castro.state_interp_order = 0

# Limiting on state data interpolation (preserve linear combinations)
castro.lin_limit_state_interp = 1

# Avoid tagging near the domain boundary
castro.max_tagging_radius = 0.75e0

############################################################################################
# Physics to include
############################################################################################

# Whether or not to do hydrodynamics
castro.do_hydro = 1

# Whether or not to do gravity
castro.do_grav = 0

# Whether or not to do reactions
castro.do_react = 1

# Whether or not to apply the sponge
castro.do_sponge = 1

# Whether or not to apply external source terms
castro.add_ext_src = 1
castro.ext_src_implicit = 1

# Whether or not to include the rotation source term
castro.do_rotation = 0

############################################################################################
# PPM/Hydro options
############################################################################################

# Piecewise parabolic with the original limiters (0 is piecewise linear; 2 is new limiters)
castro.ppm_type = 1

# Use the EOS in calculation of the edge states going into the Riemann solver
castro.ppm_temp_fix = 0

# Which Riemann solver to use.
# 0 = Colella, Glaz, and Ferguson (cheaper, less accurate)
# 1 = Colella and Glaz 1985 (more expensive, more accurate)
# 2 = HLL
castro.riemann_solver = 0

# For the CG Riemann solver, we need to tell the solver not to quit when 
# the iterations don't converge, but instead to do additional bisection iteration.
castro.riemann_cg_blend = 2

# Use a lagged predictor estimate of the source terms in the hydro
castro.source_term_predictor = 1

# Reset (rho*e) if it goes negative in the transverse terms
castro.transverse_reset_rhoe = 1

# Reset rho if it goes negative in the transverse terms
castro.transverse_reset_density = 1

# Explicitly limit fluxes to avoid hitting a negative density
castro.limit_fluxes_on_small_dens = 0

############################################################################################
# Thermodynamics
############################################################################################

# Minimum allowable temperature (K)
castro.small_temp = 1.e7

# Minimum allowable density (g / cm**3)
castro.small_dens = 1.e-5

# Threshold for when to use the internal energy in calculating pressure
castro.dual_energy_eta1 = 1.0e-3

# Threshold for when to use (E - K) in updating internal energy
castro.dual_energy_eta2 = 1.0e-4

# Use Coulomb corrections in Helmholtz EOS
eos.use_eos_coulomb = 1

# Keep EOS inputs constant after EOS evaluation
eos.eos_input_is_constant = 1

############################################################################################
# Reactions/Network
############################################################################################

# Limit timestep based on nuclear burning considerations (changes in internal energy)
castro.dtnuc_e = 1.e200

# Limit timestep based on nuclear burning considerations (changes in species)
castro.dtnuc_X = 1.e200

# Minimum temperature for allowing nuclear burning
castro.react_T_min = 1.0e7

# Maximum temperature for allowing nuclear burning
castro.react_T_max = 1.0e12

# Minimum density for allowing nuclear burning
castro.react_rho_min = 1.0e0

# Maximum density for allowing nuclear burning
castro.react_rho_max = 1.0e12

# Smallest allowable mass fraction
network.small_x = 1.0e-12

# Evaluate the RHS during the burn
integrator.call_eos_in_rhs = 1

# Integration tolerances
integrator.rtol_spec = 1.0e-6
integrator.atol_spec = 1.0e-6

integrator.rtol_enuc = 1.0e-6
integrator.atol_enuc = 1.0e-6

# Renormalize abundances during the burn
integrator.renormalize_abundances = 1

# Maximum temperature allowed in the burn
integrator.MAX_TEMP = 1.0e10

# Use tabular rate evaluation when available
network.use_tables = 1

############################################################################################
# Sponge
############################################################################################

castro.sponge_lower_density = 1.0e-1
castro.sponge_upper_density = 1.0e0
castro.sponge_timescale     = 0.01e0

############################################################################################
# Diagnostics and I/O
############################################################################################

# Timesteps between computing and printing volume averaged diagnostic quantities
castro.sum_interval = 1

# Simulation time between computing and printing volume averaged diagnostic quantities
castro.sum_per = -1.0

# Whether or not to output plotfiles
amr.plot_files_output = 1

# Whether or not to output checkpoints
amr.checkpoint_files_output = 1

# Root name of checkpoint files
amr.check_file = chk

# We want to store the 'old' state data in checkpoints
castro.dump_old = 1

# Simulation time between checkpoints
amr.check_per = 10.0

# Number of timesteps between checkpoints
amr.check_int = -1

# Root name of plot files
amr.plot_file = plt

# Simulation time between plotfiles
amr.plot_per = 10.0

# Number of timesteps between plotfiles
amr.plot_int = -1

# Root name of small plot files
amr.small_plot_file = smallplt

# Simulation time between small plotfiles
amr.small_plot_per = 1.0

# Number of timesteps between small plotfiles
amr.small_plot_int = -1

# Do not write plotfiles when we dump checkpoints
amr.write_plotfile_with_checkpoint = 0

# Do not write final checkpoint/plotfile
castro.output_at_completion = 0

# Do not write a plotfile or checkpoint on restart
amr.plotfile_on_restart = 0
amr.checkpoint_on_restart = 0

# Control verbosity in Amr.cpp
amr.v = 1

# Control verbosity in Castro.cpp
castro.v = 1

# Control verbosity in the multigrid solver
mg.v = 0

# State variables to add to plot files
amr.plot_vars = ALL

# Derived variables to add to plot files
amr.derive_plot_vars = ALL

# State variables to add to small plot files
amr.small_plot_vars = density

# Name of the diagnostic sum output files
amr.data_log = star_diag.out primary_diag.out secondary_diag.out

############################################################################################
# Problem parameters
############################################################################################

problem.mass_P = 0.64
problem.mass_S = 0.64

problem.problem = 0

problem.collision_separation = 2.0
problem.collision_impact_parameter = 0.0

problem.orbital_eccentricity = 0.0e0
problem.orbital_angle = 0.0e0
