Open jiweiqi opened 4 years ago
So RMS uses the moles formulation of the equations rather than the mass fraction formulation. Nothing is done to prevent negative moles, which will occur for species with moles under the absolute tolerance. Since they are calculated directly from the moles the mole fractions and mass fractions will always sum to unity.
I guess this might be why using log -> exp
to compute wdot
is super slow, since clipping negative moles/mass fraction will effect the properties of Jacobian and slow done the ODE solver substantially.
I have a question regarding the clipping of mass fraction. I am wondering whether rms clip negative mass fraction, which happens in the large mechanism. In Cantera, the negative ass fraction is left as it is since clipping will affect the numerical Jacobian and make the solver super slow. Similarly, does rms normalize the mass fraction to unity?
It will be great if someone can point me the relevant source code?