Skip to content

Commit

Permalink
Merge branch 'development' into struct_params
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jan 1, 2024
2 parents 56729e2 + e8756a5 commit e5715c5
Show file tree
Hide file tree
Showing 27 changed files with 4,395 additions and 268 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/model_parser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: model parser

on: [pull_request]
jobs:
model_parser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get submodules
run: |
git submodule update --init
cd external/Microphysics
git fetch; git checkout development
cd ../amrex
git fetch; git checkout development
cd ../..
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile model_parser test
run: |
cd Util/model_parser/test
make -j 4
- name: Run model_parser test
run: |
cd Util/model_parser/test
./Castro3d.gnu.ex
5 changes: 2 additions & 3 deletions Exec/reacting_tests/nse_test/create_pretty_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ def read_convergence(file_lo, file_hi):
"rho_E": r"$\rho E$",
"rho_e": r"$\rho e$",
"Temp": r"$T$",
"rho_H1": r"$\rho X(\isotm{H}{1})$",
"rho_n": r"$\rho X(\mathrm{n})$",
"rho_p": r"$\rho X(\mathrm{p})$",
"rho_He4": r"$\rho X(\isotm{He}{4})$",
"rho_C12": r"$\rho X(\isotm{C}{12})$",
"rho_O16": r"$\rho X(\isotm{O}{16})$",
"rho_Cr48": r"$\rho X(\isotm{Cr}{48})$",
"rho_Fe52": r"$\rho X(\isotm{Fe}{52})$",
"rho_Fe54": r"$\rho X(\isotm{Fe}{54})$",
Expand Down
4 changes: 2 additions & 2 deletions Exec/science/flame_wave/ci-benchmarks/grid_diag.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# COLUMN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# TIMESTEP TIME MASS XMOM YMOM ZMOM ANG. MOM. X ANG. MOM. Y ANG. MOM. Z KIN. ENERGY INT. ENERGY GAS ENERGY GRAV. ENERGY TOTAL ENERGY CENTER OF MASS X-LOC CENTER OF MASS Y-LOC CENTER OF MASS Z-LOC CENTER OF MASS X-VEL CENTER OF MASS Y-VEL CENTER OF MASS Z-VEL MAXIMUM TEMPERATURE MAXIMUM DENSITY MAXIMUM T_S / T_E
0 0.0000000000000000 1.4902024346464787e+20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 2.9583337617665660e+37 2.9583337617665660e+37 0.0000000000000000e+00 2.9583337617665660e+37 2.7306640614148750e+04 6.8067773166795473e+02 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000156899e+08 3.1017131702472486e+07 0.0000000000000000e+00
1 5.9694928185132600e-08 1.4902038799260451e+20 -9.8852813993167483e+18 7.0758681407801181e+23 -3.7077151117729030e+15 -7.8559831399077499e+18 7.9789428545426686e+19 1.9321854546506737e+28 2.7622571688141327e+29 2.9583392229687520e+37 2.9583392505913144e+37 0.0000000000000000e+00 2.9583392505913144e+37 2.7306640614147251e+04 6.8067725884159722e+02 0.0000000000000000e+00 -6.6335093690719216e-02 4.7482550784469004e+03 -2.4880589573803199e-05 1.0000972452748042e+08 3.1017431302318867e+07 1.9852339015703824e-12
2 1.2535934918877847e-07 1.4902056479398973e+20 -2.0759055840781603e+19 1.4862415462814482e+24 -1.6351019859135748e+16 -3.4644556495600996e+19 3.5187152213757382e+20 4.0584338401784393e+28 5.5823502529134965e+29 2.9583452181108320e+37 2.9583452739343134e+37 0.0000000000000000e+00 2.9583452739343134e+37 2.7306640614140473e+04 6.8067697458181988e+02 0.0000000000000000e+00 -1.3930329595435043e-01 9.9733989623249036e+03 -1.0972324445112568e-04 1.0003863648020169e+08 3.1017667549506564e+07 1.9917944188178796e-12
1 5.9694928185132600e-08 1.4902038799260451e+20 -9.8852814000373391e+18 7.0758681407801342e+23 -3.7077151119947915e+15 -7.8559831403383900e+18 7.9789428550115738e+19 1.9321854546506743e+28 2.7622571688115688e+29 2.9583392229687520e+37 2.9583392505913144e+37 0.0000000000000000e+00 2.9583392505913144e+37 2.7306640614147251e+04 6.8067725884159722e+02 0.0000000000000000e+00 -6.6335093695554737e-02 4.7482550784469113e+03 -2.4880589575292177e-05 1.0000972452758998e+08 3.1017431302318867e+07 2.1834522208251888e-12
2 1.2535934918877847e-07 1.4902056479398969e+20 -2.0759055857352421e+19 1.4862415462814437e+24 -1.6351019861504854e+16 -3.4644556500407476e+19 3.5187152219157529e+20 4.0584338401784253e+28 5.5823502529036681e+29 2.9583452181108315e+37 2.9583452739343125e+37 0.0000000000000000e+00 2.9583452739343125e+37 2.7306640614140484e+04 6.8067697458182033e+02 0.0000000000000000e+00 -1.3930329606554864e-01 9.9733989623248763e+03 -1.0972324446702355e-04 1.0003863648118678e+08 3.1017667549506564e+07 1.8217100523183610e-12
2 changes: 1 addition & 1 deletion Exec/science/flame_wave/ci-benchmarks/species_diag.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# TIMESTEP TIME Mass He4 Mass C12 Mass O16 Mass Ne20 Mass Mg24 Mass Si28 Mass S32 Mass Ar36 Mass Ca40 Mass Ti44 Mass Cr48 Mass Fe52 Mass Ni56
0 0.0000000000000000 3.5899765861250859e-15 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.1354824912929246e-14
1 5.9694928185132600e-08 3.5899765861251656e-15 7.4944874211898590e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.1354897598484802e-14
2 1.2535934918877847e-07 3.5899765861253060e-15 7.4944963166333664e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.1354986514892610e-14
2 1.2535934918877847e-07 3.5899765861253060e-15 7.4944963166333664e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.1354986514892597e-14
5 changes: 4 additions & 1 deletion Exec/science/massive_star/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ USE_MPI = TRUE

USE_GRAV = TRUE
USE_REACT = TRUE

USE_SIMPLIFIED_SDC = TRUE

USE_NSE_TABLE = TRUE

BL_NO_FORT := TRUE
Expand All @@ -27,7 +30,7 @@ NETWORK_DIR := aprox19

INTEGRATOR_DIR := VODE

MAX_NPTS_MODEL = 32768
MAX_NPTS_MODEL = 65536

PROBLEM_DIR ?= ./

Expand Down
15 changes: 15 additions & 0 deletions Exec/science/massive_star/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# massive star

This setup models the convective burning shells in a massive star
leading up to core collapse. Some details:

* The initial model is from MESA and is put onto a uniform grid using
the routines in the AMReX Astrophysics initial model repo
(https://github.com/amrex-astro/initial_models) in the
``massive_star`` directory.

* We use simplified-SDC together with aprox19 and an NSE table
(generated from pynucastro)

* The Castro ``drive_initial_convection`` functionality is used to
establish the initial convective velocity field.
18 changes: 13 additions & 5 deletions Exec/science/massive_star/inputs_2d.nse
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ amr.n_error_buf = 2 2 2 2 # number of buffer cells in error est
amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.check_file = chk # root name of checkpoint file
amr.check_int = 50 # number of timesteps between checkpoints
amr.check_int = 25 # number of timesteps between checkpoints
amr.plot_file = plt # root name of plot file
castro.plot_per_is_exact = 0
amr.plot_per = 0.2
Expand All @@ -77,22 +77,24 @@ castro.store_burn_weights = 1
castro.small_dens = 1.0
castro.small_temp = 1.e6

castro.time_integration_method = 0
castro.time_integration_method = 3
castro.use_retry = 1
castro.max_subcycles = 16

# problem initialization

problem.model_name = "15m_500_sec.aprox19.hse.20.00km"
problem.model_name = "15m_500_sec.aprox19.hse.5.00km"

problem.perturb_model = 1
problem.velpert_amplitude = 5.e6

problem.interpolate_pres = 1

# convection

castro.drive_initial_convection = 1
castro.drive_initial_convection_reinit_period = 1
castro.drive_initial_convection_tmax = 10
castro.drive_initial_convection_reinit_period = 2
castro.drive_initial_convection_tmax = 250

# refinement

Expand All @@ -114,6 +116,9 @@ integrator.jacobian = 1

network.rho_nse = 1.e7
network.T_nse = 3.e9
network.Si_nse = 0.02

integrator.ode_max_steps = 500000

network.small_x = 1.e-10

Expand All @@ -124,3 +129,6 @@ network.nse_table_interp_linear = 0

# disable jacobian caching in VODE
integrator.use_jacobian_caching = 0

# do we include weak rate neutrino losses in the energy?
integrator.nse_include_enu_weak = 0
126 changes: 0 additions & 126 deletions Exec/science/massive_star/inputs_2d.nse.sdc

This file was deleted.

14 changes: 7 additions & 7 deletions Exec/science/massive_star/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,17 @@ void problem_initialize_state_data (int i, int j, int k,

if (problem::perturb_model) {
// random numbers between -1 and 1
GpuArray<Real, 27> alpha;
GpuArray<Real, 27> beta;
GpuArray<Real, 27> gamma;
GpuArray<Real, 27> alpha{};
GpuArray<Real, 27> beta{};
GpuArray<Real, 27> gamma{};

// random numbers between 0 and 2*pi
GpuArray<Real, 27> phix;
GpuArray<Real, 27> phiy;
GpuArray<Real, 27> phiz;
GpuArray<Real, 27> phix{};
GpuArray<Real, 27> phiy{};
GpuArray<Real, 27> phiz{};

// compute the norm of k
GpuArray<Real, 27> normk;
GpuArray<Real, 27> normk{};

for (int kk = 1; kk <= 3; ++kk) {
for (int jj = 1; jj <= 3; ++jj) {
Expand Down
46 changes: 23 additions & 23 deletions Exec/science/wdmerger/ci-benchmarks/wdmerger_collision_2D.out
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
plotfile = plt00095
time = 1.25
variables minimum value maximum value
density 8.7136176158e-05 13348283.786
xmom -4.4636648292e+14 1.4969028735e+15
ymom -1.8931343553e+15 1.9807937913e+15
density 8.7136170328e-05 13347626.831
xmom -4.4623942798e+14 1.4982725823e+15
ymom -1.8879302767e+15 1.980304858e+15
zmom 0 0
rho_E 7.7947390767e+11 5.6568077669e+24
rho_e 7.4321344551e+11 5.6343409475e+24
Temp 100000 3972527783.9
rho_He4 8.7136176158e-17 1473.9666386
rho_C12 3.4854470463e-05 5030539.1488
rho_O16 5.2281705694e-05 7778301.6377
rho_Ne20 8.7136176158e-17 1023673.1153
rho_Mg24 8.7136176158e-17 1040419.2782
rho_Si28 8.7136176158e-17 4251082.0739
rho_S32 8.7136176158e-17 2179431.2961
rho_Ar36 8.7136176158e-17 497747.48798
rho_Ca40 8.7136176158e-17 382056.037
rho_Ti44 8.7136176158e-17 1576.0930955
rho_Cr48 8.7136176158e-17 1467.9139369
rho_Fe52 8.7136176158e-17 14831.710059
rho_Ni56 8.7136176158e-17 182702.27304
phiGrav -4.6147467267e+17 -2.2055818332e+16
grav_x -461195258.85 -48603.568291
grav_y -444709392.81 392306861.64
rho_E 7.7948360809e+11 5.64675518e+24
rho_e 7.4322366401e+11 5.6244082614e+24
Temp 100000 3969215375.1
rho_He4 8.7136170328e-17 1473.6068478
rho_C12 3.4854468131e-05 5028784.2519
rho_O16 5.2281702196e-05 7774667.7686
rho_Ne20 8.7136170328e-17 448739.14288
rho_Mg24 8.7136170328e-17 1131012.4412
rho_Si28 8.7136170328e-17 4244213.8084
rho_S32 8.7136170328e-17 2178795.6667
rho_Ar36 8.7136170328e-17 496791.83986
rho_Ca40 8.7136170328e-17 381536.89513
rho_Ti44 8.7136170328e-17 1576.1652647
rho_Cr48 8.7136170328e-17 1467.4931808
rho_Fe52 8.7136170328e-17 14841.830382
rho_Ni56 8.7136170328e-17 182905.91385
phiGrav -4.6146743474e+17 -2.2055817929e+16
grav_x -461199998.92 -48603.52543
grav_y -444710966.19 392312565.37
grav_z 0 0
rho_enuc -7.6356851771e+21 5.7259582003e+26
rho_enuc -7.4954583352e+21 6.7150736332e+26

5 changes: 0 additions & 5 deletions Source/driver/Castro.H
Original file line number Diff line number Diff line change
Expand Up @@ -1462,11 +1462,6 @@ protected:
static amrex::AmrTracerParticleContainer* TracerPC;
#endif

///
/// Name of the probin file and its length.
///
static std::string probin_file;

static amrex::IntVect hydro_tile_size;
static amrex::IntVect no_tile_size;

Expand Down
8 changes: 1 addition & 7 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ Radiation* Castro::radiation = nullptr;
#endif


std::string Castro::probin_file = "probin";


#if AMREX_SPACEDIM == 1
#ifndef AMREX_USE_GPU
IntVect Castro::hydro_tile_size(1024);
Expand Down Expand Up @@ -555,8 +552,6 @@ Castro::read_params ()

}

ppa.query("probin_file",probin_file);

Vector<int> tilesize(AMREX_SPACEDIM);
if (pp.queryarr("hydro_tile_size", tilesize, 0, AMREX_SPACEDIM))
{
Expand Down Expand Up @@ -3658,8 +3653,7 @@ Castro::derive (const std::string& name,
void
Castro::extern_init ()
{
// initialize the external runtime parameters -- these will
// live in the probin
// initialize the external runtime parameters

if (ParallelDescriptor::IOProcessor()) {
std::cout << "reading extern runtime parameters ..." << std::endl;
Expand Down
Loading

0 comments on commit e5715c5

Please sign in to comment.