Help with adding a solid phase source term

30 views
Skip to first unread message

ambu...@gmail.com

unread,
Feb 10, 2021, 7:39:18 PM2/10/21
to Cantera Users' Group
Hello everyone

I am using Cantera 2.4 through C++ and simulating a transient 0D simulation by adding a source term for a solid species that is not part of the reaction mechanism. By this, I mean, the source term for the solid species is not calculated from the ReactorNet::getNetProductionrates() method. To start with, initially, I added the following reaction to the mechanism:

a (g) -> b (g) + c (solid)

The species properties for the solid are already specified in the mechanism.  I tried specifying a small value of 10^-9 to m_wdot[k] for the case when k corresponds to the solid species in Reactor::evalEqs() method, and Reactor::evalEqs() method is called by ReactorNet::advance() method. However, when I ran the basic 0D code, it gave me the following error:

***********************************************************************
CanteraError thrown by Reactor::updateState:
Error in function boost::math::tools::bisect<double>: No change of sign in boost::math::tools::bisect, either there is no root to find, or there are multiple roots in the interval (f(min) = -1266325.2420804861).
at U = 159745.56333696243, rho = 0.25780918724920693
***********************************************************************

Components with largest weighted error estimates:
22: 2.075517873548208
12: 1.5650438991872218
9: -0.9907766423076384
21: -0.9567935050532509
13: 0.8508006350971093
33: -0.46662651185010817
26: -0.3710650506353222
37: 0.30985087131968597
27: 0.2178064803847693
38: -0.21529725623101595
***********************************************************************

Aborted (core dumped)

After this, I realized that Reactor::evalEqs() method internally runs several times before proceeding to the next time step. Hence, I am a little confused as to where I should start from.

Is it possible to add an additional solution variable without dealing with the reaction mechanism and calculate its source terms externally?

Many thanks for considering my request.


Regards
Ambuj
Reply all
Reply to author
Forward
0 new messages