Skip to content

Commit

Permalink
Merge branch 'development' into 2d_spherical_rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 authored Dec 8, 2024
2 parents 0593ad3 + 5d9a59a commit 3e910b4
Show file tree
Hide file tree
Showing 13 changed files with 201 additions and 90 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Checks: >
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-use-internal-linkage,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
modernize-*,
Expand All @@ -32,12 +33,14 @@ Checks: >
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-enum-initial-value,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-readability-named-parameter,
-readability-redundant-inline-specifier,
-readability-redundant-member-init,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
- name: Install dependencies
run: |
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 17
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 19
- name: Compile flame_wave
run: |
echo $AMREX_HOME
echo $MICROPHYSICS_HOME
cd Exec/science/subchandra
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-17 CLANG_TIDY_WARN_ERROR=TRUE -j 4
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-19 CLANG_TIDY_WARN_ERROR=TRUE -j 4
26 changes: 26 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# 24.12

* update clang-tidy CI (#2992, #3002)

* fix `problo` != 0 in non-Cartesian coords (#3001)

* fix `apply_av` in spherical (#3000)

* update `xrb_spherical` analysis (#2999)

* add spherical support to plm (#2996, #2997)

* fix coverity issue (#2998)

* fix geometric source term in ppm tracing for spherical (#2995)

* fix dloga for non-radial direction in tracing (#2994)

* fix `scale_flux` in 1d for Cartesian (#2991)

* add the `xrb_spherical` problem setup (#2972)

* add a new distance function that works for all geometries (#2990)

* fix confusing geom name in derive (#2989)

# 24.11

* a new well-balanced method was added to the CTU PPM solver. This
Expand Down
33 changes: 19 additions & 14 deletions Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_simp_sdc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ castro.hi_bc = 2 2 2
max_step = 10000000

# Simulation end time
stop_time = 200.0
stop_time = 1000.0

# CFL number for hyperbolic system
castro.cfl = 0.5
Expand All @@ -70,10 +70,10 @@ castro.cfl = 0.5
castro.fixed_dt = -1.0

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

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

# If we regrid on Level 0, compute a new timestep afterward
amr.compute_new_dt_on_regrid = 1
Expand All @@ -91,6 +91,8 @@ castro.abundance_failure_rho_cutoff = 1.0e0
# Default is 10, 16 is recommended value
castro.max_subcycles = 16

# Switching to simplified SDC
castro.time_integration_method = 3

############################################################################################
# Resolution, gridding and AMR
Expand Down Expand Up @@ -292,20 +294,20 @@ integrator.atol_spec = 1.0e-6
integrator.rtol_enuc = 1.0e-6
integrator.atol_enuc = 1.0e-6

# Do not abort or retry on a failed burn (Castro will handle this)
integrator.abort_on_failure = 0

# 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
network.use_tables = 0

# Switching to simplified SDC
castro.time_integration_method = 3
# use retry in the burner and cap the number of steps to make the
# reactions go faster
integrator.use_burn_retry = 1
integrator.retry_swap_jacobian = 1
integrator.ode_max_steps = 10000

############################################################################################
# Gravity
Expand Down Expand Up @@ -380,16 +382,16 @@ amr.check_file = chk
castro.dump_old = 1

# Simulation time between checkpoints
amr.check_per = 1.0
amr.check_per = -1

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

# Root name of plot files
amr.plot_file = plt

# Simulation time between plotfiles
amr.plot_per = 1.0
amr.plot_per = 2.0

# Number of timesteps between plotfiles
amr.plot_int = -1
Expand Down Expand Up @@ -426,17 +428,20 @@ gravity.v = 1
amr.plot_vars = ALL

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

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

# Derived variables to add to small plot files
amr.derive_small_plot_vars = enuc X(He4) X(C12) X(O16)
amr.derive_small_plot_vars = abar enuc MachNumber magvel magvort X(He4) X(C12) X(O16)

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

# write plotfiles as single precision
fab.format = NATIVE_32

############################################################################################
# Problem parameters
############################################################################################
Expand Down
24 changes: 15 additions & 9 deletions Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_strang
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,20 @@ integrator.atol_spec = 1.0e-6
integrator.rtol_enuc = 1.0e-6
integrator.atol_enuc = 1.0e-6

# Do not abort or retry on a failed burn (Castro will handle this)
integrator.abort_on_failure = 0

# 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
network.use_tables = 0

# use retry in the burner and cap the number of steps to make the
# reactions go faster
integrator.use_burn_retry = 1
integrator.retry_swap_jacobian = 1
integrator.ode_max_steps = 10000

############################################################################################
# Gravity
Expand Down Expand Up @@ -377,16 +380,16 @@ amr.check_file = chk
castro.dump_old = 1

# Simulation time between checkpoints
amr.check_per = 1.0
amr.check_per = -1

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

# Root name of plot files
amr.plot_file = plt

# Simulation time between plotfiles
amr.plot_per = 1.0
amr.plot_per = 2.0

# Number of timesteps between plotfiles
amr.plot_int = -1
Expand Down Expand Up @@ -423,17 +426,20 @@ gravity.v = 1
amr.plot_vars = ALL

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

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

# Derived variables to add to small plot files
amr.derive_small_plot_vars = enuc X(He4) X(C12) X(O16)
amr.derive_small_plot_vars = abar enuc MachNumber magvel magvort X(He4) X(C12) X(O16)

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

# write plotfiles as single precision
fab.format = NATIVE_32

############################################################################################
# Problem parameters
############################################################################################
Expand Down
8 changes: 4 additions & 4 deletions Exec/science/xrb_spherical/analysis/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ def slice(fname:str, field:str,
if field in ["x_velocity", "y_velocity", "z_velocity"]:
sp.set_cmap(field, "coolwarm")
elif field == "Temp":
sp.set_zlim(f, 5.e7, 2.5e9)
sp.set_cmap(f, "magma_r")
sp.set_zlim(field, 5.e7, 2.5e9)
sp.set_cmap(field, "magma_r")
elif field == "enuc":
sp.set_zlim(f, 1.e18, 1.e20)
sp.set_zlim(field, 1.e18, 1.e20)
elif field == "density":
sp.set_zlim(f, 1.e-3, 5.e8)
sp.set_zlim(field, 1.e-3, 5.e8)

# sp.annotate_text((0.05, 0.05), f"{currentTime.in_cgs():8.5f} s")
sp.save(f"{ds}_{loc}")
Expand Down
13 changes: 7 additions & 6 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,12 +851,13 @@ Castro::buildMetrics ()
dLogArea[dir].clear();
geom.GetDLogA(dLogArea[dir],grids,dmap,dir,NUM_GROW);
}
for (int dir = AMREX_SPACEDIM; dir < 2; dir++)
{
dLogArea[dir].clear();
dLogArea[dir].define(grids, dmap, 1, 0);
dLogArea[dir].setVal(0.0);
}

#if (AMREX_SPACEDIM == 1)
dLogArea[1].clear();
dLogArea[1].define(grids, dmap, 1, 0);
dLogArea[1].setVal(0.0);
#endif

#endif

wall_time_start = 0.0;
Expand Down
22 changes: 11 additions & 11 deletions Source/driver/Castro_util.H
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Real volume(const int& i, const int& j, const int& k,
Real rl = geomdata.ProbLo()[0] + static_cast<Real>(i) * dx[0];
Real rr = rl + dx[0];

vol = M_PI * dx[0] * (rr + rl);
vol = std::abs(M_PI * dx[0] * (rr + rl));

} else {

Expand All @@ -226,7 +226,7 @@ Real volume(const int& i, const int& j, const int& k,
Real rl = geomdata.ProbLo()[0] + static_cast<Real>(i) * dx[0];
Real rr = rl + dx[0];

vol = (4.0_rt / 3.0_rt) * M_PI * dx[0] * (rl * rl + rl * rr + rr * rr);
vol = std::abs((4.0_rt / 3.0_rt) * M_PI * dx[0] * (rl * rl + rl * rr + rr * rr));

}

Expand All @@ -247,7 +247,7 @@ Real volume(const int& i, const int& j, const int& k,
Real r_l = geomdata.ProbLo()[0] + static_cast<Real>(i) * dx[0];
Real r_r = geomdata.ProbLo()[0] + static_cast<Real>(i+1) * dx[0];

vol = M_PI * (r_l + r_r) * dx[0] * dx[1];
vol = std::abs(M_PI * (r_l + r_r) * dx[0] * dx[1]);

} else {

Expand All @@ -260,8 +260,8 @@ Real volume(const int& i, const int& j, const int& k,
Real theta_l = geomdata.ProbLo()[1] + static_cast<Real>(j) * dx[1];
Real theta_r = geomdata.ProbLo()[1] + static_cast<Real>(j+1) * dx[1];

vol = twoThirdsPi * (std::cos(theta_l) - std::cos(theta_r)) * dx[0] *
(r_r * r_r + r_r * r_l + r_l * r_l);
vol = std::abs(twoThirdsPi * (std::cos(theta_l) - std::cos(theta_r)) * dx[0] *
(r_r * r_r + r_r * r_l + r_l * r_l));

}

Expand Down Expand Up @@ -306,15 +306,15 @@ Real area(const int& i, const int& j, const int& k,

Real r = geomdata.ProbLo()[0] + static_cast<Real>(i) * dx[0];

a = 2.0_rt * M_PI * r;
a = std::abs(2.0_rt * M_PI * r);

} else {

// Spherical

Real r = geomdata.ProbLo()[0] + static_cast<Real>(i) * dx[0];

a = 4.0_rt * M_PI * r * r;
a = std::abs(4.0_rt * M_PI * r * r);

}

Expand All @@ -339,11 +339,11 @@ Real area(const int& i, const int& j, const int& k,

if (idir == 0) {
Real r = geomdata.ProbLo()[0] + static_cast<Real>(i) * dx[0];
a = 2.0_rt * M_PI * r * dx[1];
a = std::abs(2.0_rt * M_PI * r * dx[1]);
}
else {
Real r = geomdata.ProbLo()[0] + (static_cast<Real>(i) + 0.5_rt) * dx[0];
a = 2.0_rt * M_PI * r * dx[0];
a = std::abs(2.0_rt * M_PI * r * dx[0]);
}

} else {
Expand All @@ -355,13 +355,13 @@ Real area(const int& i, const int& j, const int& k,
Real theta_l = geomdata.ProbLo()[1] + static_cast<Real>(j) * dx[1];
Real theta_r = geomdata.ProbLo()[1] + static_cast<Real>(j+1) * dx[1];

a = 2.0_rt * M_PI * r * r * (std::cos(theta_l) - std::cos(theta_r));
a = std::abs(2.0_rt * M_PI * r * r * (std::cos(theta_l) - std::cos(theta_r)));
}
else {
Real r = geomdata.ProbLo()[0] + (static_cast<Real>(i) + 0.5_rt) * dx[0];
Real theta = geomdata.ProbLo()[1] + static_cast<Real>(j) * dx[1];

a = 2.0_rt * M_PI * std::sin(theta) * r * dx[0];
a = std::abs(2.0_rt * M_PI * std::sin(theta) * r * dx[0]);
}

}
Expand Down
Loading

0 comments on commit 3e910b4

Please sign in to comment.