From 7ed2a029534ece426a64d686c3da013245e325c3 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 14 Nov 2012 21:07:13 +0000 Subject: [PATCH] StFlow::_getInitialSoln now sets the solution to a valid thermodynamic state This fixes errors that occured when the "showSolution" method was called before explicitly setting the initial solution profile. --- include/cantera/oneD/StFlow.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/cantera/oneD/StFlow.h b/include/cantera/oneD/StFlow.h index 6cdf5498c..43de70b86 100644 --- a/include/cantera/oneD/StFlow.h +++ b/include/cantera/oneD/StFlow.h @@ -117,15 +117,11 @@ public: } } - - /// Write the initial solution estimate into - /// array x. + /// Write the initial solution estimate into array x. virtual void _getInitialSoln(doublereal* x) { for (size_t j = 0; j < m_points; j++) { - x[index(2,j)] = T_fixed(j); - for (size_t k = 0; k < m_nsp; k++) { - x[index(4+k,j)] = Y_fixed(k,j); - } + T(x,j) = m_thermo->temperature(); + m_thermo->getMassFractions(&Y(x, 0, j)); } }