From dfb87b8ac89e234c5d02215bd0f6a92a41601cc9 Mon Sep 17 00:00:00 2001 From: llibert94 Date: Sat, 29 Jul 2023 14:59:25 +0100 Subject: [PATCH] Other fixes to WENO and rhs --- Examples/PerfectFluid/PerfectFluid.impl.hpp | 10 +++---- Examples/PerfectFluid/WENODerivatives.hpp | 5 +--- Examples/PerfectFluid/params.txt | 33 +++++++++++---------- 3 files changed, 23 insertions(+), 25 deletions(-) diff --git a/Examples/PerfectFluid/PerfectFluid.impl.hpp b/Examples/PerfectFluid/PerfectFluid.impl.hpp index 721429657..db387cceb 100644 --- a/Examples/PerfectFluid/PerfectFluid.impl.hpp +++ b/Examples/PerfectFluid/PerfectFluid.impl.hpp @@ -104,7 +104,7 @@ void PerfectFluid::add_matter_rhs( FOR(idir) { - vars_t vars_right_p; + vars_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]; } @@ -112,7 +112,7 @@ void PerfectFluid::add_matter_rhs( vars_t flux_right_p = Fluxes::compute_num_flux(vars_right_p, idir, m_lambda); - vars_t vars_right_m; + vars_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]; @@ -131,7 +131,7 @@ void PerfectFluid::add_matter_rhs( FOR(idir) { - vars_t vars_left_p; + vars_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]; } @@ -139,7 +139,7 @@ void PerfectFluid::add_matter_rhs( vars_t flux_left_p = Fluxes::compute_num_flux(vars_left_p, idir, m_lambda); - vars_t vars_left_m; + vars_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]; } @@ -161,4 +161,4 @@ void PerfectFluid::add_matter_rhs( FOR(i) { rhs.vi[i] = 0.; } } -#endif /* SCALARFIELD_IMPL_HPP_ */ +#endif /* PERFECTFLUID_IMPL_HPP_ */ diff --git a/Examples/PerfectFluid/WENODerivatives.hpp b/Examples/PerfectFluid/WENODerivatives.hpp index 57f25fe0d..aa852129e 100644 --- a/Examples/PerfectFluid/WENODerivatives.hpp +++ b/Examples/PerfectFluid/WENODerivatives.hpp @@ -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; } @@ -158,9 +158,6 @@ class WENODerivatives get_Pface(current_cell.get_box_pointers().m_in_ptr[ivar], in_index, stride, dir_switch); } - - protected: - double m_eW; }; #endif /* WENODERIVATIVES_HPP_ */ diff --git a/Examples/PerfectFluid/params.txt b/Examples/PerfectFluid/params.txt index 450301bca..de6892a03 100644 --- a/Examples/PerfectFluid/params.txt +++ b/Examples/PerfectFluid/params.txt @@ -8,9 +8,9 @@ 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 @@ -18,7 +18,7 @@ checkpoint_interval = 500 # 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) @@ -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 ################################################# @@ -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 @@ -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 @@ -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 @@ -121,7 +122,7 @@ 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 @@ -129,8 +130,8 @@ 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)