mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
added comments, fixed incorrect bc, other minor adjustments to two-point method
This commit is contained in:
parent
ad29065c48
commit
f76a247936
@ -196,11 +196,11 @@ public:
|
|||||||
double fixedTemperatureLocation();
|
double fixedTemperatureLocation();
|
||||||
|
|
||||||
//! ------ One and Two-Point flame control methods
|
//! ------ One and Two-Point flame control methods
|
||||||
//! Set the left control point location. This is used for one or two
|
//! Set the left control point location. This is used for two
|
||||||
//! point flame control.
|
//! point flame control.
|
||||||
void setLeftControlPoint(double temperature);
|
void setLeftControlPoint(double temperature);
|
||||||
|
|
||||||
//! Set the right control point location. This is used for one or two
|
//! Set the right control point location. This is used for two
|
||||||
//! point flame control.
|
//! point flame control.
|
||||||
void setRightControlPoint(double temperature);
|
void setRightControlPoint(double temperature);
|
||||||
//! -------------------
|
//! -------------------
|
||||||
|
@ -264,6 +264,13 @@ public:
|
|||||||
//! conditions would over-specify the problem. Thus, the boundary conditions are changed
|
//! 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.
|
//! to reflect the fact that the control points are serving as internal boundary conditions.
|
||||||
//!
|
//!
|
||||||
|
//! In this method, the imposition of the two internal boundary conditions requires that two other
|
||||||
|
//! boundary conditions be changed. The first is the boundary condition for the continuity equation
|
||||||
|
//! at the left boundary, which is changed to be a value that is derived from the solution at the
|
||||||
|
//! left boundary. The second is the continuity boundary condition at the right boundary, which is
|
||||||
|
//! also determined from the flow solution by using the oxidizer axial velocity equation variable to
|
||||||
|
//! compute the mass flux at the right boundary.
|
||||||
|
//!
|
||||||
//! This method is based on the work of M. Nishioka, C.K. Law, and T. Takeno (1996) titled
|
//! 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
|
//! "A Flame-Controlling Continuation Method for Generating S-Curve Responses with
|
||||||
//! Detailed Chemistry"
|
//! Detailed Chemistry"
|
||||||
|
@ -209,6 +209,11 @@ void Inlet1D::eval(size_t jg, double* xg, double* rg,
|
|||||||
m_mdot = m_flow->density(0) * xb[c_offset_U];
|
m_mdot = m_flow->density(0) * xb[c_offset_U];
|
||||||
} else if (m_flow->isStrained()) { //axisymmetric flow
|
} else if (m_flow->isStrained()) { //axisymmetric flow
|
||||||
if (m_flow->twoPointControlEnabled()) {
|
if (m_flow->twoPointControlEnabled()) {
|
||||||
|
// When using two-point control, the mass flow rate at the left inlet is not
|
||||||
|
// specified. Instead, the mass flow rate is dictated by the velocity at the
|
||||||
|
// left inlet, which comes from the U variable. The default boundary condition specified
|
||||||
|
// in the StFlow.cpp file already handles this case. We only need to update the stored
|
||||||
|
// value of m_mdot so that other equations that use the quantity are consistent.
|
||||||
m_mdot = m_flow->density(0)*xb[c_offset_U];
|
m_mdot = m_flow->density(0)*xb[c_offset_U];
|
||||||
} else {
|
} else {
|
||||||
// The flow domain sets this to -rho*u. Add mdot to specify the mass
|
// The flow domain sets this to -rho*u. Add mdot to specify the mass
|
||||||
@ -246,12 +251,13 @@ void Inlet1D::eval(size_t jg, double* xg, double* rg,
|
|||||||
|
|
||||||
if (m_flow->twoPointControlEnabled()) {// For point control adjustments
|
if (m_flow->twoPointControlEnabled()) {// For point control adjustments
|
||||||
// At the right boundary, the mdot is dictated by the velocity at the
|
// At the right boundary, the mdot is dictated by the velocity at the
|
||||||
// right boundary, which comes from the Uo variable.
|
// right boundary, which comes from the Uo variable. The variable Uo is
|
||||||
|
// the left-moving velocity and has a negative value, so the mass flow has
|
||||||
|
// to be negated to give a positive value when using Uo.
|
||||||
m_mdot = -(m_flow->density(last_index) * xb[c_offset_Uo]);
|
m_mdot = -(m_flow->density(last_index) * xb[c_offset_Uo]);
|
||||||
rb[c_offset_U] += m_mdot;
|
rb[c_offset_U] += m_mdot;
|
||||||
} else {
|
} else {
|
||||||
rb[c_offset_U] += m_mdot;
|
rb[c_offset_U] += m_mdot;
|
||||||
rb[c_offset_Uo] += m_mdot/m_flow->density(last_index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t k = 0; k < m_nsp; k++) {
|
for (size_t k = 0; k < m_nsp; k++) {
|
||||||
|
@ -533,7 +533,7 @@ void StFlow::evalLambda(double* x, double* rsd, int* diag,
|
|||||||
// j0 and j1 are constrained to only interior points
|
// j0 and j1 are constrained to only interior points
|
||||||
size_t j0 = std::max<size_t>(jmin, 1);
|
size_t j0 = std::max<size_t>(jmin, 1);
|
||||||
size_t j1 = std::min(jmax, m_points - 2);
|
size_t j1 = std::min(jmax, m_points - 2);
|
||||||
double epsilon = 1e-5; // Precision threshold for being 'equal' to a coordinate
|
double epsilon = 1e-8; // Precision threshold for being 'equal' to a coordinate
|
||||||
for (size_t j = j0; j <= j1; j++) { // interior points
|
for (size_t j = j0; j <= j1; j++) { // interior points
|
||||||
if (m_twoPointControl) {
|
if (m_twoPointControl) {
|
||||||
if (std::abs(grid(j) - m_zLeft) < epsilon ) {
|
if (std::abs(grid(j) - m_zLeft) < epsilon ) {
|
||||||
@ -608,8 +608,6 @@ void StFlow::evalUo(double* x, double* rsd, int* diag,
|
|||||||
if (jmax == m_points - 1) { // right boundary
|
if (jmax == m_points - 1) { // right boundary
|
||||||
if(m_twoPointControl) {
|
if(m_twoPointControl) {
|
||||||
rsd[index(c_offset_Uo, jmax)] = Uo(x,jmax) - Uo(x,jmax-1);
|
rsd[index(c_offset_Uo, jmax)] = Uo(x,jmax) - Uo(x,jmax-1);
|
||||||
} else {
|
|
||||||
rsd[index(c_offset_Uo, jmax)] = Uo(x,jmax);
|
|
||||||
}
|
}
|
||||||
diag[index(c_offset_Uo, jmax)] = 0;
|
diag[index(c_offset_Uo, jmax)] = 0;
|
||||||
}
|
}
|
||||||
@ -617,7 +615,7 @@ void StFlow::evalUo(double* x, double* rsd, int* diag,
|
|||||||
// j0 and j1 are constrained to only interior points
|
// j0 and j1 are constrained to only interior points
|
||||||
size_t j0 = std::max<size_t>(jmin, 1);
|
size_t j0 = std::max<size_t>(jmin, 1);
|
||||||
size_t j1 = std::min(jmax, m_points - 2);
|
size_t j1 = std::min(jmax, m_points - 2);
|
||||||
double epsilon = 1e-5; // Precision threshold for being 'equal' to a coordinate
|
double epsilon = 1e-8; // Precision threshold for being 'equal' to a coordinate
|
||||||
for (size_t j = j0; j <= j1; j++) { // interior points
|
for (size_t j = j0; j <= j1; j++) { // interior points
|
||||||
if (m_twoPointControl) {
|
if (m_twoPointControl) {
|
||||||
if (std::abs(grid(j) - m_zRight) < epsilon) {
|
if (std::abs(grid(j) - m_zRight) < epsilon) {
|
||||||
|
Loading…
Reference in New Issue
Block a user