Skip to content

Commit b3a1bda

Browse files
authored
Merge branch 'development' into remove_divide_in_screening
2 parents 5b2b652 + 74cbf07 commit b3a1bda

File tree

4 files changed

+29
-6
lines changed

4 files changed

+29
-6
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
}

0 commit comments

Comments
 (0)