diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 91390726a3..c5fda35099 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -184,7 +184,7 @@ def set_initial_guess(self, *args, data=None, group=None, **kwargs): arr.TP = T + left.T - T[0], self.P # adjust velocities - if self.flame.domain_type.startswith("axisymmetric"): + if not self.flame.domain_type.startswith("free"): self.gas.TPY = left.T, self.P, left.Y u0 = left.mdot / self.gas.density arr.velocity = u0 * arr.velocity / arr.velocity[0] diff --git a/src/oneD/Boundary1D.cpp b/src/oneD/Boundary1D.cpp index 953c14260e..b148441a56 100644 --- a/src/oneD/Boundary1D.cpp +++ b/src/oneD/Boundary1D.cpp @@ -195,7 +195,7 @@ void Inlet1D::eval(size_t jg, double* xg, double* rg, } else { // 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[0]; + m_mdot = m_flow->density(0) * xb[c_offset_U]; rb[c_offset_L] = xb[c_offset_L]; } diff --git a/src/oneD/StFlow.cpp b/src/oneD/StFlow.cpp index 90f2fefa70..7b96885559 100644 --- a/src/oneD/StFlow.cpp +++ b/src/oneD/StFlow.cpp @@ -514,8 +514,6 @@ void StFlow::evalResidual(double* x, double* rsd, int* diag, rsd[index(c_offset_E, 0)] = x[index(c_offset_E, j)]; } else if (j == m_points - 1) { evalRightBoundary(x, rsd, diag, rdt); - // set residual of poisson's equ to zero - rsd[index(c_offset_E, j)] = x[index(c_offset_E, j)]; } else { // interior points evalContinuity(j, x, rsd, diag, rdt); // set residual of poisson's equ to zero @@ -1023,6 +1021,8 @@ void StFlow::evalRightBoundary(double* x, double* rsd, int* diag, double rdt) doublereal sum = 0.0; rsd[index(c_offset_L, j)] = lambda(x,j) - lambda(x,j-1); diag[index(c_offset_L, j)] = 0; + // set residual of poisson's equ to zero + rsd[index(c_offset_E, j)] = x[index(c_offset_E, j)]; for (size_t k = 0; k < m_nsp; k++) { sum += Y(x,k,j); rsd[index(k+c_offset_Y,j)] = m_flux(k,j-1) + rho_u(x,j)*Y(x,k,j);