# how the EulerImplicit chemistry solver solves the concentration?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 4, 2019, 03:06 how the EulerImplicit chemistry solver solves the concentration? #1 Member   Join Date: May 2013 Posts: 31 Rep Power: 9 Hi, all here! These days I used the EulerImplicit chemistry solver to solve the reactions in the flow filed. But I found that the concentration solved by the solver behaved strange in my case, so I traced into the EulerImplicit chemistry solver source to learn how it solves the concentration. in the EulerImplicit.C file, there are lines to construct the matrix: Code: ``` for (label i=0; i& R = this->reactions_[index]; forAll(R.lhs(), s) { const label si = R.lhs()[s].index; const scalar sl = R.lhs()[s].stoichCoeff; RR[si][rRef] -= sl*pr*corr; RR[si][lRef] += sl*pf*corr; } forAll(R.rhs(), s) { const label si = R.rhs()[s].index; const scalar sr = R.rhs()[s].stoichCoeff; RR[si][lRef] -= sr*pf*corr; RR[si][rRef] += sr*pr*corr; }``` let's consider the concentration of a species, c, the new concentration after the time step will be c', then the equation for the code above can be written as: ( RR + 1/dt ) * c'= c/dt here the ( RR + 1/dt ) comes from the code (1), and RR is the reaction rate which have the unit of kmoles/m^3/s rearrange the equation, I got RR * c' = ( c - c' ) / dt = dc/dt so, here is my question, why on the left the " RR * c' " appear? shouldn't it be RR = ( c - c' ) / dt = dc/dt the right equation? the " RR * c' " has the unit of kmoles/m^3/s * kmoles/m^3, which is different of dc/dt that has the unit of kmoles/m^3/s... does anyone has the reference of the EulerImplicit chemistry solver that used in the OF? please help me. Thank you!