diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index 8cb26fbe0..069baf4ff 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -292,8 +292,19 @@ public: return m_rho[j]; } + //! @deprecated To be removed after %Cantera 3.0. Superseded by isFree() virtual bool fixed_mdot(); + /** + * Retrieve flag indicating whether flow is freely propagating. + * The flow is unstrained and the axial mass flow rate is not specified. + * For free flame propagation, the axial velocity is determined by the solver. + * @since New in %Cantera 3.0 + */ + bool isFree() const { + return m_isFree; + } + void setViscosityFlag(bool dovisc) { m_dovisc = dovisc; } diff --git a/src/oneD/Boundary1D.cpp b/src/oneD/Boundary1D.cpp index 731ceb37b..2aed4e699 100644 --- a/src/oneD/Boundary1D.cpp +++ b/src/oneD/Boundary1D.cpp @@ -193,15 +193,15 @@ void Inlet1D::eval(size_t jg, double* xg, double* rg, rb[c_offset_T] -= m_temp; } - if (m_flow->fixed_mdot()) { - // The flow domain sets this to -rho*u. Add mdot to specify the mass - // flow rate. - rb[c_offset_L] += m_mdot; - } else { + if (m_flow->isFree()) { // if the flow is a freely-propagating flame, mdot is not specified. // Set mdot equal to rho*u, and also set lambda to zero. m_mdot = m_flow->density(0) * xb[c_offset_U]; rb[c_offset_L] = xb[c_offset_L]; + } else { + // The flow domain sets this to -rho*u. Add mdot to specify the mass + // flow rate. + rb[c_offset_L] += m_mdot; } // add the convective term to the species residual equations @@ -390,7 +390,7 @@ void Outlet1D::eval(size_t jg, double* xg, double* rg, integer* diagg, int* db = diag - nc; // zero Lambda - if (m_flow_left->fixed_mdot()) { + if (!m_flow_left->isFree()) { rb[c_offset_U] = xb[c_offset_L]; } @@ -493,9 +493,7 @@ void OutletRes1D::eval(size_t jg, double* xg, double* rg, double* rb = r - nc; int* db = diag - nc; - if (!m_flow_left->fixed_mdot()) { - ; - } else { + if (m_flow_left->isFree()) { rb[c_offset_U] = xb[c_offset_L]; // zero Lambda } if (m_flow_left->doEnergy(m_flow_left->nPoints()-1)) { diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index d87abc117..39782ae57 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -688,7 +688,7 @@ int Sim1D::setFixedTemperature(double t) StFlow* d_free = dynamic_cast(&domain(n)); size_t npnow = d.nPoints(); size_t nstart = znew.size(); - if (d_free && !d_free->fixed_mdot()) { + if (d_free && d_free->isFree()) { for (size_t m = 0; m < npnow - 1; m++) { bool fixedpt = false; double t1 = value(n, c_offset_T, m); @@ -766,7 +766,7 @@ double Sim1D::fixedTemperature() double t_fixed = std::numeric_limits::quiet_NaN(); for (size_t n = 0; n < nDomains(); n++) { StFlow* d = dynamic_cast(&domain(n)); - if (d && !d->fixed_mdot() && d->m_tfixed > 0) { + if (d && d->isFree() && d->m_tfixed > 0) { t_fixed = d->m_tfixed; break; } @@ -779,7 +779,7 @@ double Sim1D::fixedTemperatureLocation() double z_fixed = std::numeric_limits::quiet_NaN(); for (size_t n = 0; n < nDomains(); n++) { StFlow* d = dynamic_cast(&domain(n)); - if (d && !d->fixed_mdot() && d->m_tfixed > 0) { + if (d && d->isFree() && d->m_tfixed > 0) { z_fixed = d->m_zfixed; break; } diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index 7ee6d0411..34da843b0 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -298,6 +298,8 @@ void StFlow::setGasAtMidpoint(const double* x, size_t j) } bool StFlow::fixed_mdot() { + warn_deprecated("StFlow::fixed_mdot", "To be removed after" + " Cantera 3.0. Replaced by isFree()."); return !m_isFree; } diff --git a/src/oneD/refine.cpp b/src/oneD/refine.cpp index c34cbcb76..9d1fe555c 100644 --- a/src/oneD/refine.cpp +++ b/src/oneD/refine.cpp @@ -181,7 +181,7 @@ int Refiner::analyze(size_t n, const double* z, const double* x) } // Keep the point where the temperature is fixed - if (fflame && !fflame->fixed_mdot() && z[j] == fflame->m_zfixed) { + if (fflame && fflame->isFree() && z[j] == fflame->m_zfixed) { m_keep[j] = 1; } }