Many thanks for the query, and very astute observations on your part. I will apologize, up front, for the long email.
1. You are correct that the code in Cantera and the derived version in the paper diverge by that term. This mainly reflects a difference in how the paper authors and the author of that particular bit of code choose to define the activity coefficient, and _might_ relate back to a larger issue in Cantera with how the ideal gas reference state is defined (see here:
https://github.com/Cantera/cantera/issues/841.) I am not 100% certain that the two are linked, but they are at least related.
Importantly, the difference in approach does not impact the activity concentrations, as a similar term then “corrects” for the difference, in getActivityConcentrations:
void RedlichKwongMFTP::getActivityConcentrations(doublereal* c) const
{
getActivityCoefficients(c);
for (size_t k = 0; k < m_kk; k++) {
c[k] *= moleFraction(k)*pressure()/RT();
}
}
My preference is to undo both of these (as written, I think Cantera’s activityCoerficients are actually fugacityCoefficients), to avoid confusions such as this, but I want to first make sure a) that this is 100% correct, and b) that I can do that without first solving the linked issue above, which would be a larger effort (but needs to happen, eventually). I will be looking into it shortly.
2 and 3. On your other questions, I feel like there is a bit of a misunderstanding on what Cantera does for the user. Cantera implements defined sets of routines or calculations to manage and calculate phase properties, *based on user inputs* for how the phases, species, and reactions should be modeled. It automates and generalizes those calculations while maintaining and enforcing consistency, which would be a significant burden for users to do from scratch. It is not, however, a database that provides the species and phase property data. That is largely left to the user.
So for the non-ideal phases, the user is expected to provide the a_coeff and b_coeff parameters for the equation of state. Because these can be calculated from species critical parameters, where they are known, we have provided a database of verified* critical parameters for user convenience. If a user does not provide a_coeff and b_coeff for a species, Cantera scans the database to see if the critical properties can be located there. This is largely a back-up option, though, and moreover the species interaction parameters for a_coeff cannot be calculated from this information.
*I think a critical look at these values and some citations to document where they come from are still needed; but the intent is for them to be verified.
I’d be interested: do you think there would be a value for adding a routine for estimating critical properties from L-J parameters, for species where critical properties are not readily known? Sub-question: are the L-J parameters well known for these species?
Thanks again for your questions and email; I’m very glad you’ve found the paper interesting.
Best,
Steven