Skip to content

Commit

Permalink
Merge branch 'development' into update_xrb_spherical
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 authored Jan 28, 2025
2 parents a1234cb + 9fdc8cb commit 24a815f
Show file tree
Hide file tree
Showing 91 changed files with 847 additions and 288 deletions.
3 changes: 2 additions & 1 deletion .codespell-ignore-words
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ nd
ue
bion
aas
checkin
checkin
indx
2 changes: 1 addition & 1 deletion .github/workflows/gpu_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:

jobs:
gpu-compilation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
Expand Down
22 changes: 21 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# 25.01

* address rotation source in spherical 2d coordinate (#2967)

* update scripts and input files for diffusion test (#3012)

* update pressure via eos when transverse_use_eos=1 (#3004)

* update thermal diffusion documentation (#3011)

* rename `Opacity_dir` -> `OPACITY_DIR` (#3006)

* sync GPU CI dependencies with AMReX (#3010)

* wdmerger: update inputs for He mergers to include burn retry
and adjust I/O (#3008)

* fix area/vol factors for spherical when theta is close to 0 or pi
(#3007)

# 24.12

* update clang-tidy CI (#2992, #3002)
Expand Down Expand Up @@ -908,7 +928,7 @@
the conversion of primitive to conserved variables (#804)
* We've changed how the backup for retries is done. Presently if
use_retry is enabled we make a pre-emptive copy of the StateData
use_retry is enabled we make a preemptive copy of the StateData
right at the beginning of the timestep. Now we only backup when
we detect that a retry is needed (#812)
Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/DustCollapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = ignition.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/StarGrav/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ USE_REACT = FALSE

USE_MODEL_PARSER = TRUE

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
Expand Down
4 changes: 2 additions & 2 deletions Exec/gravity_tests/evrard_collapse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ USE_OMP = FALSE
USE_GRAV = TRUE


# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/hse_convergence/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ USE_MAESTRO_INIT = FALSE

CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/hse_convergence_general/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ USE_MODEL_PARSER = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/hydrostatic_adjust/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ USE_MODEL_PARSER = TRUE

CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/uniform_cube/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ USE_GRAV ?= TRUE
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHSICS_HOME)/Networks
# This sets the network directory in $(MICROPHSICS_HOME)/networks
NETWORK_DIR ?= general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/gravity_tests/uniform_sphere/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ USE_GRAV ?= TRUE
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHSICS_HOME)/Networks
# This sets the network directory in $(MICROPHSICS_HOME)/networks
NETWORK_DIR ?= general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/KH/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NUMADV := 1
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR ?= gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR ?= general_null
NETWORK_INPUTS ?= gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/RT/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Sedov/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Sod_stellar/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ USE_MHD = FALSE
# define the location of the CASTRO top directory
CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Vortices_LWAcoustics/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/acoustic_pulse/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/acoustic_pulse_general/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := helmholtz

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/double_mach_reflection/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/oddeven/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/riemann_2d/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ CASTRO_HOME ?= ../../..
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/Networks
# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/rotating_torus/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ USE_HYBRID_MOMENTUM = TRUE
# define the location of the CASTRO top directory
CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/eos
# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := polytrope

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
Expand Down
31 changes: 31 additions & 0 deletions Exec/hydro_tests/simple_convection/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PRECISION = DOUBLE
PROFILE = FALSE
DEBUG = FALSE
DIM = 2

COMP = gnu

USE_MPI = TRUE
USE_OMP = FALSE

USE_GRAV = TRUE
USE_REACT = FALSE

USE_MODEL_PARSER = TRUE
USE_RNG_STATE_INIT = TRUE

CASTRO_HOME ?= ../../..

# This sets the EOS directory in $(MICROPHYSICS_HOME)/EOS
EOS_DIR := gamma_law

# This sets the network directory in $(MICROPHYSICS_HOME)/networks
NETWORK_DIR := general_null
NETWORK_INPUTS = gammalaw.net

PROBLEM_DIR ?= ./

Bpack := $(PROBLEM_DIR)/Make.package
Blocs := $(PROBLEM_DIR)

include $(CASTRO_HOME)/Exec/Make.Castro
3 changes: 3 additions & 0 deletions Exec/hydro_tests/simple_convection/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CEXE_headers += initial_model.H


5 changes: 5 additions & 0 deletions Exec/hydro_tests/simple_convection/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# simple_convection

This is an implementation of the convection problem from pyro.


12 changes: 12 additions & 0 deletions Exec/hydro_tests/simple_convection/_prob_params
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
dens_base real 10.0 y

scale_height real 4.0 y

y_height real 2.0 y

thickness real 0.25 y

e_rate real 0.1 y

low_density_cutoff real 0.01 y

94 changes: 94 additions & 0 deletions Exec/hydro_tests/simple_convection/initial_model.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#ifndef INITIAL_MODEL_H
#define INITIAL_MODEL_H

#include <prob_parameters.H>
#include <network.H>
#include <eos.H>

struct model_t {
amrex::Real dens_base = -1;
amrex::Real scale_height = -1;
Real xn[NumSpec] = {0.0};
};



///
/// construct an initial model in HSE. Note: this does not return
/// anything, but rather updates the model_parser globals with the
/// model information.
///
AMREX_INLINE
void
generate_initial_model(const int npts_model, const Real xmin, const Real xmax,
const model_t model_params) {

model::npts = npts_model;
model::initialized = true;

if (npts_model > NPTS_MODEL) {
amrex::Error("Error: model has more than NPTS_MODEL points, Increase MAX_NPTS_MODEL");
}

// compute the pressure scale height (for an isothermal, ideal-gas
// atmosphere)

amrex::Real pres_base = model_params.scale_height * model_params.dens_base * std::abs(gravity::const_grav);

// create the grid -- cell centers

Real dx = (xmax - xmin) / npts_model;

for (int i = 0; i < npts_model; i++) {
model::profile(0).r(i) = xmin + (static_cast<Real>(i) + 0.5_rt) * dx;
}

for (int i = 0; i < npts_model; i++) {

amrex::Real density;
amrex::Real pressure;

amrex::Real profile = 1.0 - (eos_rp::eos_gamma - 1.0) / eos_rp::eos_gamma * model::profile(0).r(i) / model_params.scale_height;

if (profile > 0.0) {
density = std::max(model_params.dens_base * std::pow(profile, 1.0/(eos_rp::eos_gamma - 1.0)),
problem::low_density_cutoff);
} else {
density = problem::low_density_cutoff;
}

if (i == 0) {
pressure = pres_base;
} else if (density <= problem::low_density_cutoff + 1.e-30_rt) {
pressure = model::profile(0).state(i-1, model::ipres);
} else {
pressure = pres_base *
std::pow(density / model_params.dens_base, eos_rp::eos_gamma);
}

// initial guess

amrex::Real temp = T_guess;

eos_t eos_state;
eos_state.p = pressure;
eos_state.T = temp;
eos_state.rho = density;
for (int n = 0; n < NumSpec; n++) {
eos_state.xn[n] = model_params.xn[n];
}

eos(eos_input_rp, eos_state);

model::profile(0).state(i, model::idens) = density;
model::profile(0).state(i, model::ipres) = pressure;
model::profile(0).state(i, model::itemp) = eos_state.T;
for (int n = 0; n < NumSpec; n++) {
model::profile(0).state(i, model::ispec+n) = model_params.xn[n];
}

}

}

#endif
Loading

0 comments on commit 24a815f

Please sign in to comment.