diff --git a/include/cantera/oneD/IonFlow.h b/include/cantera/oneD/IonFlow.h index 6b8e7e39df..5ce7019e02 100644 --- a/include/cantera/oneD/IonFlow.h +++ b/include/cantera/oneD/IonFlow.h @@ -79,9 +79,8 @@ class IonFlow : public FreeFlame vector_fp& mobi_e_fixed); protected: - virtual void updateProperties(size_t jg, double* x, double* rsd, - int* diag, double rdt, size_t j0, - size_t j1, size_t jmin, size_t jmax); + virtual void evalResidual(double* x, double* rsd, int* diag, + double rdt, size_t jmin, size_t jmax); virtual void updateTransport(double* x, size_t j0, size_t j1); virtual void updateDiffFluxes(const double* x, size_t j0, size_t j1); //! Solving phase one: the fluxes of charged species are turned off diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index 600bd3e86c..9f31c9c238 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -242,9 +242,11 @@ class StFlow : public Domain1D m_kin->getNetProductionRates(&m_wdot(0,j)); } - virtual void updateProperties(size_t jg, double* x, double* rsd, - int* diag, double rdt, size_t j0, - size_t j1, size_t jmin, size_t jmax); + virtual void updateProperties(size_t jg, double* x, double* rsd, int* diag, + double rdt, size_t jmin, size_t jmax); + + virtual void evalResidual(double* x, double* rsd, int* diag, + double rdt, size_t jmin, size_t jmax); /** * Update the thermodynamic properties from point j0 to point j1 diff --git a/src/oneD/IonFlow.cpp b/src/oneD/IonFlow.cpp index d7328ce9f3..92ec5ae062 100644 --- a/src/oneD/IonFlow.cpp +++ b/src/oneD/IonFlow.cpp @@ -230,11 +230,10 @@ void IonFlow::setElectricPotential(const double v1, const double v2) m_outletVoltage = v2; } -void IonFlow::updateProperties(size_t jg, double* x, double* rsd, - int* diag, double rdt, size_t j0, - size_t j1, size_t jmin, size_t jmax) +void IonFlow::evalResidual(double* x, double* rsd, int* diag, + double rdt, size_t jmin, size_t jmax) { - StFlow::updateProperties(jg, x, rsd, diag, rdt, j0, j1, jmin, jmax); + StFlow::evalResidual(x, rsd, diag, rdt, jmin, jmax); if (m_stage != 3) { return; } diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index 660fe8075a..e5d8962195 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -240,17 +240,17 @@ void StFlow::eval(size_t jg, doublereal* xg, jmax = std::min(jpt+1,m_points-1); } + updateProperties(jg, x, rsd, diag, rdt, jmin, jmax); + evalResidual(x, rsd, diag, rdt, jmin, jmax); +} + +void StFlow::updateProperties(size_t jg, double* x, double* rsd, int* diag, + double rdt, size_t jmin, size_t jmax) +{ // properties are computed for grid points from j0 to j1 size_t j0 = std::max(jmin, 1) - 1; size_t j1 = std::min(jmax+1,m_points-1); - updateProperties(jg, x, rsd, diag, rdt, j0, j1, jmin, jmax); -} - -void StFlow::updateProperties(size_t jg, double* x, double* rsd, - int* diag, double rdt, size_t j0, - size_t j1, size_t jmin, size_t jmax) -{ updateThermo(x, j0, j1); if (jg == npos || m_force_full_update) { // update transport properties only if a Jacobian is not being @@ -267,7 +267,11 @@ void StFlow::updateProperties(size_t jg, double* x, double* rsd, // update the species diffusive mass fluxes whether or not a // Jacobian is being evaluated updateDiffFluxes(x, j0, j1); +} +void StFlow::evalResidual(double* x, double* rsd, int* diag, + double rdt, size_t jmin, size_t jmax) +{ //---------------------------------------------------- // evaluate the residual equations at all required // grid points