diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index debe9a4efc5..2c82e7b5768 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -22,12 +22,12 @@ namespace Cantera //! Offsets of solution components in the 1D solution array. enum offset { - c_offset_U //! axial velocity + c_offset_U //! axial velocity [m/s] , c_offset_V //! strain rate - , c_offset_T //! temperature + , c_offset_T //! temperature [Kelvin] , c_offset_L //! (1/r)dP/dr , c_offset_E //! electric field - , c_offset_Uo //! oxidizer axial velocity + , c_offset_Uo //! oxidizer axial velocity [m/s] , c_offset_Y //! mass fractions }; @@ -241,33 +241,55 @@ class StFlow : public Domain1D //! In this method there are control points that are designated in a domain, and //! the value of the solution at these points is fixed. The values of the control //! points are dictated and thus serve as a boundary condition that affects the - //! solution of the goerning equations in the 1D domain. The imposition of fixed - //! points in the domain means that the original set of governign equations' boundary + //! solution of the governing equations in the 1D domain. The imposition of fixed + //! points in the domain means that the original set of governing equations' boundary //! conditions would over-specify the problem. Thus, the boundary conditions are changed //! to reflect the fact that the control points are serving as internal boundary conditions. + //! + //! This method is based on the work of M. Nishioka, C.K. Law, and T. Takeno (1996) titled + //! "A Flame-Controlling Continuation Method for Generating S-Curve Responses with + //! Detailed Chemistry" //! The current left control point temperature double leftControlPointTemperature() const { - if (m_twoPointControl && (m_zLeft != Undef)) + if (m_twoPointControl && (m_zLeft != Undef)) { return m_tLeft; + } + } + + //! The current left control point spatial coordinate + double leftControlPointCoordinate() const { + if (m_twoPointControl && (m_zLeft != Undef)) { + return m_zLeft; + } } //! Set the temperature of the left control point void setLeftControlPointTemperature(double temperature) { - if (m_twoPointControl && (m_zLeft != Undef)) + if (m_twoPointControl && (m_zLeft != Undef)) { m_tLeft = temperature; + } } //! The current right control point temperature double rightControlPointTemperature() const { - if (m_twoPointControl && (m_zRight != Undef)) + if (m_twoPointControl && (m_zRight != Undef)) { return m_tRight; + } + } + + //! The current right control point spatial coordinate + double rightControlPointCoordinate() const { + if (m_twoPointControl && (m_zRight != Undef)) { + return m_zRight; + } } //! Set the temperature of the right control point void setRightControlPointTemperature(double temperature) { - if (m_twoPointControl && (m_zRight != Undef)) + if (m_twoPointControl && (m_zRight != Undef)) { m_tRight = temperature; + } } //! Set the status of the two-point control diff --git a/interfaces/cython/cantera/_onedim.pxd b/interfaces/cython/cantera/_onedim.pxd index a253a39ee38..c39fdcc9044 100644 --- a/interfaces/cython/cantera/_onedim.pxd +++ b/interfaces/cython/cantera/_onedim.pxd @@ -93,8 +93,10 @@ cdef extern from "cantera/oneD/StFlow.h": void enableTwoPointControl(cbool) cbool twoPointControlEnabled() double leftControlPointTemperature() + double leftControlPointCoordinate() void setLeftControlPointTemperature(double) double rightControlPointTemperature() + double rightControlPointCoordinate() void setRightControlPointTemperature(double) diff --git a/interfaces/cython/cantera/_onedim.pyx b/interfaces/cython/cantera/_onedim.pyx index 644189fb0f9..2cf82f539de 100644 --- a/interfaces/cython/cantera/_onedim.pyx +++ b/interfaces/cython/cantera/_onedim.pyx @@ -651,7 +651,17 @@ cdef class _FlowBase(Domain1D): return self.flow.rightControlPointTemperature() def __set__(self, T): self.flow.setRightControlPointTemperature(T) - + + property zLeft: + """ Left control point temperature [K] """ + def __get__(self): + return self.flow.leftControlPointCoordinate() + + property zRight: + """ Right control point temperature [K] """ + def __get__(self): + return self.flow.rightControlPointCoordinate() + property two_point_control_enabled: """ Determines whether or not to enable two point flame control""" def __get__(self): diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 338377a6913..cfee24c6568 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -306,6 +306,11 @@ def tLeft(self): def tLeft(self, T): self.flame.tLeft = T + @property + def zLeft(self): + """ Get the left control point coordinate [m] """ + return self.flame.zLeft + @property def tRight(self): """ Get/Set the right control point temperature [K] """ @@ -315,6 +320,11 @@ def tRight(self): def tRight(self, T): self.flame.tRight = T + @property + def zRight(self): + """ Get the right control point coordinate [m] """ + return self.flame.zRight + def elemental_mass_fraction(self, m): r""" Get the elemental mass fraction :math:`Z_{\mathrm{mass},m}` of element diff --git a/src/oneD/Boundary1D.cpp b/src/oneD/Boundary1D.cpp index 7bd6760b23f..fc08c012a81 100644 --- a/src/oneD/Boundary1D.cpp +++ b/src/oneD/Boundary1D.cpp @@ -198,7 +198,7 @@ void Inlet1D::eval(size_t jg, double* xg, double* rg, // 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]; - } else if (m_flow->isStrained()) { + } else if (m_flow->isStrained()) { //axisymmetric flow if (m_flow->twoPointControlEnabled()) { m_mdot = m_flow->density(0)*xb[c_offset_U]; } else { @@ -235,7 +235,6 @@ void Inlet1D::eval(size_t jg, double* xg, double* rg, rb[c_offset_T] -= m_flow->T_fixed(m_flow->nPoints() - 1); } - if (m_flow->twoPointControlEnabled()) {// For point control adjustments // At the right boundary, the mdot is dictated by the velocity at the // right boundary, which comes from the Uo variable.