Skip to content

Commit

Permalink
Other fixes to WENO and rhs
Browse files Browse the repository at this point in the history
  • Loading branch information
llibert94 committed Jul 29, 2023
1 parent bbc08dc commit dfb87b8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
10 changes: 5 additions & 5 deletions Examples/PerfectFluid/PerfectFluid.impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ void PerfectFluid<eos_t>::add_matter_rhs(

FOR(idir)
{
vars_t<data_t> vars_right_p;
vars_t<data_t> vars_right_p = vars;
vars_right_p.rho = rp.rho[idir];
vars_right_p.eps = rp.eps[idir];
FOR(j) { vars_right_p.vi[j] = rp.vi[j][idir]; }
PrimitiveRecovery::PtoC(vars_right_p);
vars_t<data_t> flux_right_p =
Fluxes::compute_num_flux(vars_right_p, idir, m_lambda);

vars_t<data_t> vars_right_m;
vars_t<data_t> vars_right_m = vars;
vars_right_m.rho = rm.rho[idir];
vars_right_m.eps = rm.eps[idir];
FOR(j) vars_right_m.vi[j] = rm.vi[j][idir];
Expand All @@ -131,15 +131,15 @@ void PerfectFluid<eos_t>::add_matter_rhs(

FOR(idir)
{
vars_t<data_t> vars_left_p;
vars_t<data_t> vars_left_p = vars;
vars_left_p.rho = lp.rho[idir];
vars_left_p.eps = lp.eps[idir];
FOR(j) { vars_left_p.vi[j] = lp.vi[j][idir]; }
PrimitiveRecovery::PtoC(vars_left_p);
vars_t<data_t> flux_left_p =
Fluxes::compute_num_flux(vars_left_p, idir, m_lambda);

vars_t<data_t> vars_left_m;
vars_t<data_t> vars_left_m = vars;
vars_left_m.rho = lm.rho[idir];
vars_left_m.eps = lm.eps[idir];
FOR(j) { vars_left_m.vi[j] = lm.vi[j][idir]; }
Expand All @@ -161,4 +161,4 @@ void PerfectFluid<eos_t>::add_matter_rhs(
FOR(i) { rhs.vi[i] = 0.; }
}

#endif /* SCALARFIELD_IMPL_HPP_ */
#endif /* PERFECTFLUID_IMPL_HPP_ */
5 changes: 1 addition & 4 deletions Examples/PerfectFluid/WENODerivatives.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class WENODerivatives
sum_alpha = 0.;
FOR(j)
{
alpha[j] = dd[j] / ((m_eW + beta[j]) * (m_eW + beta[j]));
alpha[j] = dd[j] / ((eW + beta[j]) * (eW + beta[j]));
sum_alpha += alpha[j];
}
FOR(j) { weights[j] = alpha[j] / sum_alpha; }
Expand Down Expand Up @@ -158,9 +158,6 @@ class WENODerivatives
get_Pface<data_t>(current_cell.get_box_pointers().m_in_ptr[ivar],
in_index, stride, dir_switch);
}

protected:
double m_eW;
};

#endif /* WENODERIVATIVES_HPP_ */
33 changes: 17 additions & 16 deletions Examples/PerfectFluid/params.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ verbosity = 0

# location / naming of output files
# output_path = "" # Main path for all files. Must exist!
chk_prefix = ScalarField_
plot_prefix = ScalarFieldp_
# restart_file = ScalarField_000000.3d.hdf5
chk_prefix = PerfectFluid_
plot_prefix = PerfectFluidp_
# restart_file = PerfectFluid_000000.3d.hdf5

# HDF5files are written every dt = L/N*dt_multiplier*checkpoint_interval
checkpoint_interval = 500
# set to 0 to turn off plot files (except at t=0 and t=stop_time)
# set to -1 to never ever print plotfiles
plot_interval = 1
num_plot_vars = 2
plot_vars = chi phi
plot_vars = rho eps

# subpaths - specific directories for hdf5, pout, extraction data
# (these are created at runtime)
Expand All @@ -44,12 +44,12 @@ print_progress_only_to_rank_0 = 1
G_Newton = 0.0

# Scalar field initial data
scalar_amplitude = 0.1
scalar_width = 5.0
scalar_mass = 0.2
#scalar_amplitude = 0.1
#scalar_width = 5.0
#scalar_mass = 0.2

# Kerr BH data
kerr_mass = 1.0
kerr_mass = 0.
kerr_spin = 0.0

#################################################
Expand All @@ -62,11 +62,11 @@ kerr_spin = 0.0
# NB - if you have a non-cubic grid, you can specify 'N1' or 'N1_full',
# 'N2' or 'N2_full' and 'N3' or 'N3_full' ( then dx_coarsest = L/N(max) )
# NB - the N values need to be multiples of the block_factor
N_full = 128
L_full = 256
N_full = 64 #128
L_full = 128 #256

# Maximum number of times you can regrid above coarsest level
max_level = 6 # There are (max_level+1) grids, so min is zero
max_level = 5 # There are (max_level+1) grids, so min is zero

# Frequency of regridding at each level and thresholds on the tagging
# Need one for each level except the top one, ie max_level items
Expand All @@ -93,7 +93,7 @@ tag_buffer_size = 0 # this example uses a fixed grid
# Boundary Conditions parameters

#Periodic directions - 0 = false, 1 = true
isPeriodic = 0 0 0
isPeriodic = 1 1 1
# if not periodic, then specify the boundary type
# 0 = static, 1 = sommerfeld, 2 = reflective
# 3 = extrapolating, 4 = mixed
Expand All @@ -111,7 +111,8 @@ vars_parity = 0 0 4 6 0 5 0 #chi and hij
0 0 4 6 0 5 0 #K and Aij
0 1 2 3 #Theta and Gamma
0 1 2 3 1 2 3 #lapse shift and B
0 0 #phi and Pi
0 1 2 3 0 #D Sj and tau
1 2 3 0 0 #vi rho and epsilon
vars_parity_diagnostic = 0 1 2 3 #Ham and Mom

# if sommerfeld boundaries selected, must select
Expand All @@ -121,16 +122,16 @@ nonzero_asymptotic_vars = chi h11 h22 h33 lapse
nonzero_asymptotic_values = 1.0 1.0 1.0 1.0 1.0

# if you are using extrapolating BC:
extrapolation_order = 1
extrapolation_order = 0 #1
num_extrapolating_vars = 2
extrapolating_vars = phi Pi

#################################################
# Evolution parameters

# dt will be dx*dt_multiplier on each grid level
dt_multiplier = 0.25
stop_time = 100.0
dt_multiplier = 0.078125 #0.25
stop_time = 5.0
# max_steps = 4

# Spatial derivative order (only affects CCZ4 RHS)
Expand Down

0 comments on commit dfb87b8

Please sign in to comment.