diff --git a/integration/BackwardEuler/be_integrator.H b/integration/BackwardEuler/be_integrator.H index d50422b37..a204f404a 100644 --- a/integration/BackwardEuler/be_integrator.H +++ b/integration/BackwardEuler/be_integrator.H @@ -57,6 +57,27 @@ int single_step (BurnT& state, BeT& be, const amrex::Real dt) // work with the current guess + if (integrator_rp::do_corrector_validation) { +#ifdef SDC + const amrex::Real rho_current = state.rho_orig + be.t * state.ydot_a[SRHO]; + const amrex::Real thresh = species_failure_tolerance * rho_current; +#else + const amrex::Real thresh = species_failure_tolerance; +#endif + bool fail{}; + for (int i = 1; i <= NumSpec; ++i) { + if (be.y(i) < -thresh) { + fail = true; + break; + } + } + + if (fail) { + ierr = IERR_BAD_STATE_IN_CORRECTOR; + break; + } + } + // get the ydots for our current guess of y rhs(be.t, state, be, ydot); diff --git a/integration/integrator_data.H b/integration/integrator_data.H index e39d36974..79c9a2646 100644 --- a/integration/integrator_data.H +++ b/integration/integrator_data.H @@ -32,6 +32,7 @@ enum integrator_errors : std::int8_t { IERR_TOO_MUCH_ACCURACY_REQUESTED = -5, IERR_CORRECTOR_CONVERGENCE = -6, IERR_LU_DECOMPOSITION_ERROR = -7, + IERR_BAD_STATE_IN_CORRECTOR = -8, IERR_ENTERED_NSE = -100 };