Skip to content

Commit 3a1c364

Browse files
authored
Merge branch 'development' into remove_nse_aprox_nets
2 parents f7e58cc + d7041c9 commit 3a1c364

File tree

10 files changed

+165
-224
lines changed

10 files changed

+165
-224
lines changed

EOS/helmholtz/actual_eos.H

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,10 +1315,11 @@ void actual_eos_init ()
13151315
for (int j = 0; j < jmax; ++j) {
13161316
amrex::Real tsav = tlo + j * tstp;
13171317
t[j] = std::pow(10.0e0_rt, tsav);
1318-
for (int i = 0; i < imax; ++i) {
1319-
amrex::Real dsav = dlo + i * dstp;
1320-
d[i] = std::pow(10.0e0_rt, dsav);
1321-
}
1318+
}
1319+
1320+
for (int i = 0; i < imax; ++i) {
1321+
amrex::Real dsav = dlo + i * dstp;
1322+
d[i] = std::pow(10.0e0_rt, dsav);
13221323
}
13231324

13241325
// it does not work on all machines (for GPUs) broadcast to other

integration/BackwardEuler/be_integrator.H

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,27 @@ int single_step (BurnT& state, BeT& be, const amrex::Real dt)
5757

5858
// work with the current guess
5959

60+
if (integrator_rp::do_corrector_validation) {
61+
#ifdef SDC
62+
const amrex::Real rho_current = state.rho_orig + be.t * state.ydot_a[SRHO];
63+
const amrex::Real thresh = species_failure_tolerance * rho_current;
64+
#else
65+
const amrex::Real thresh = species_failure_tolerance;
66+
#endif
67+
bool fail{};
68+
for (int i = 1; i <= NumSpec; ++i) {
69+
if (be.y(i) < -thresh) {
70+
fail = true;
71+
break;
72+
}
73+
}
74+
75+
if (fail) {
76+
ierr = IERR_BAD_STATE_IN_CORRECTOR;
77+
break;
78+
}
79+
}
80+
6081
// get the ydots for our current guess of y
6182

6283
rhs(be.t, state, be, ydot);

integration/integrator_data.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum integrator_errors : std::int8_t {
3232
IERR_TOO_MUCH_ACCURACY_REQUESTED = -5,
3333
IERR_CORRECTOR_CONVERGENCE = -6,
3434
IERR_LU_DECOMPOSITION_ERROR = -7,
35+
IERR_BAD_STATE_IN_CORRECTOR = -8,
3536
IERR_ENTERED_NSE = -100
3637
};
3738

integration/integrator_setup_sdc.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ void integrator_cleanup (IntegratorT& int_state, BurnT& state,
186186
}
187187

188188
for (int n = 0; n < NumSpec; ++n) {
189-
if (state.y[SFS+n] / state.rho < -species_failure_tolerance) {
189+
if (state.y[SFS+n] < -state.rho * species_failure_tolerance) {
190190
state.success = false;
191191
}
192192

193-
if (state.y[SFS+n] / state.rho > 1.0_rt + species_failure_tolerance) {
193+
if (state.y[SFS+n] > state.rho * (1.0_rt + species_failure_tolerance)) {
194194
state.success = false;
195195
}
196196
}
Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Initializing AMReX (25.12-25-g10b67a795031)...
2-
AMReX (25.12-25-g10b67a795031) initialized
1+
Initializing AMReX (25.12-41-g443bf9e380c3)...
2+
AMReX (25.12-41-g443bf9e380c3) initialized
33
starting the single zone burn...
44
reading in network electron-capture / beta-decay tables...
55
------------------------------------
@@ -10,24 +10,24 @@ reading in network electron-capture / beta-decay tables...
1010
Solved Chemical Potentials are: -6.83314245e+00 and -1.08589066e+01
1111
------------------------------------
1212
Element Burn Xs NSE Xs abs err rel err
13-
H1 5.38909747e-02 5.38909747e-02 9.78384040e-16 1.81548774e-14
14-
He4 5.17680679e-01 5.17680679e-01 2.99760217e-13 5.79044629e-13
15-
C12 1.31566442e-05 1.31566442e-05 2.79215941e-17 2.12224285e-12
16-
N13 2.54374035e-09 2.54374035e-09 3.67185474e-21 1.44348646e-12
17-
O16 3.19225352e-05 3.19225352e-05 3.81774690e-17 1.19594101e-12
18-
F17 1.49115081e-09 1.49115081e-09 5.73029369e-22 3.84286665e-13
19-
Ne20 7.33589878e-07 7.33589878e-07 2.50647637e-18 3.41672704e-12
20-
Na23 3.67457204e-08 3.67457204e-08 1.62643561e-19 4.42619056e-12
21-
Mg24 1.00775502e-04 1.00775502e-04 7.83620673e-16 7.77590442e-12
22-
Al27 2.01751573e-05 2.01751573e-05 3.62733389e-17 1.79792100e-12
23-
Si28 3.62276881e-02 3.62276881e-02 2.63643274e-13 7.27739714e-12
24-
P31 1.53540144e-03 1.53540144e-03 1.16827121e-14 7.60889745e-12
25-
S32 3.79938039e-02 3.79938039e-02 3.78377885e-13 9.95893660e-12
26-
Ar36 2.41944405e-02 2.41944405e-02 1.59768032e-13 6.60350183e-12
27-
Ca40 2.82965820e-02 2.82965820e-02 5.85469173e-14 2.06904556e-12
28-
Ti44 1.62787599e-03 1.62787599e-03 2.68008272e-14 1.64636787e-11
29-
Cr48 9.74012544e-03 9.74012544e-03 1.24115995e-13 1.27427512e-11
30-
Fe52 5.86021446e-02 5.86021446e-02 4.69617401e-13 8.01365553e-12
31-
Ni56 2.30043480e-01 2.30043480e-01 1.35380596e-12 5.88500034e-12
13+
H1 5.38909747e-02 5.38909747e-02 1.35308431e-15 2.51078092e-14
14+
He4 5.17680679e-01 5.17680679e-01 3.00759417e-13 5.80974777e-13
15+
C12 1.31566442e-05 1.31566442e-05 2.80350965e-17 2.13086986e-12
16+
N13 2.54374035e-09 2.54374035e-09 3.76243102e-21 1.47909397e-12
17+
O16 3.19225352e-05 3.19225352e-05 3.84417433e-17 1.20421962e-12
18+
F17 1.49115081e-09 1.49115081e-09 5.19676220e-22 3.48506816e-13
19+
Ne20 7.33589878e-07 7.33589878e-07 2.50001774e-18 3.40792290e-12
20+
Na23 3.67457204e-08 3.67457204e-08 1.60618623e-19 4.37108379e-12
21+
Mg24 1.00775502e-04 1.00775502e-04 7.84420272e-16 7.78383888e-12
22+
Al27 2.01751573e-05 2.01751573e-05 3.51891368e-17 1.74418153e-12
23+
Si28 3.62276881e-02 3.62276881e-02 2.63990219e-13 7.28697392e-12
24+
P31 1.53540144e-03 1.53540144e-03 1.16026980e-14 7.55678462e-12
25+
S32 3.79938039e-02 3.79938039e-02 3.78592990e-13 9.96459820e-12
26+
Ar36 2.41944405e-02 2.41944405e-02 1.59903341e-13 6.60909438e-12
27+
Ca40 2.82965820e-02 2.82965820e-02 5.84185478e-14 2.06450899e-12
28+
Ti44 1.62787599e-03 1.62787599e-03 2.67932378e-14 1.64590165e-11
29+
Cr48 9.74012544e-03 9.74012544e-03 1.24083036e-13 1.27393673e-11
30+
Fe52 5.86021446e-02 5.86021446e-02 4.69776995e-13 8.01637889e-12
31+
Ni56 2.30043480e-01 2.30043480e-01 1.35355616e-12 5.88391445e-12
3232
------------------------------------
33-
AMReX (25.12-25-g10b67a795031) finalized
33+
AMReX (25.12-41-g443bf9e380c3) finalized

paper/paper.bib

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,14 +1065,37 @@ @article{nn_astro_2022
10651065
}
10661066

10671067
@article{dnn_astro_2025,
1068-
title={Deep Neural Networks for Modeling Astrophysical Nuclear reacting flows},
1069-
author={{Zhang}, Xiaoyu and {Yi}, Yuxiao and {Wang}, Lile and {Xu}, Zhi-Qin John and {Zhang}, Tianhan and {Zhou}, Yao},
1070-
year={2025},
1071-
month={April},
1072-
eprint={2504.14180},
1073-
archivePrefix={arXiv},
1074-
primaryClass={astro-ph.IM},
1075-
url={https://arxiv.org/abs/2504.14180},
1076-
journal={arXiv e-prints},
1077-
keywords={Astrophysics - Instrumentation and Methods for Astrophysics}
1078-
}
1068+
doi = {10.3847/1538-4357/adf331},
1069+
url = {https://doi.org/10.3847/1538-4357/adf331},
1070+
year = {2025},
1071+
month = {sep},
1072+
publisher = {The American Astronomical Society},
1073+
volume = {990},
1074+
number = {2},
1075+
pages = {105},
1076+
author = {Zhang, Xiaoyu and Yi, Yuxiao and Wang, Lile and Xu, Zhi-Qin John and Zhang, Tianhan and Zhou, Yao},
1077+
title = {Deep Neural Networks for Modeling Astrophysical Nuclear Reacting Flows},
1078+
journal = {The Astrophysical Journal},
1079+
abstract = {In astrophysical simulations, nuclear reacting flows
1080+
pose computational challenges due to the stiffness
1081+
of reaction networks. We introduce neural
1082+
network-based surrogate models using the DeePODE
1083+
framework to enhance simulation efficiency while
1084+
maintaining accuracy and robustness. Our method
1085+
replaces conventional stiff ordinary differential
1086+
equation (ODE) solvers with deep learning models
1087+
trained through evolutionary Monte Carlo sampling
1088+
from zero-dimensional simulation data, ensuring
1089+
generalization across varied thermonuclear and
1090+
hydrodynamic conditions. Tested on 3-species and
1091+
13-species reaction networks, the models achieve ≲1\%
1092+
accuracy relative to semi-implicit numerical
1093+
solutions and deliver a ∼2.6× speedup on CPUs. A
1094+
temperature-thresholded deployment strategy ensures
1095+
stability in extreme conditions, sustaining neural
1096+
network utilization above 75\% in multidimensional
1097+
simulations. These data-driven surrogates
1098+
effectively mitigate stiffness constraints, offering
1099+
a scalable approach for high-fidelity modeling of
1100+
astrophysical nuclear reacting flows.}
1101+
}

0 commit comments

Comments
 (0)