I've recently been looking into trying to calculate the multi-component diffusion fluxes for specific species of 1D laminar premixed flames (burner, freeflame, impinging jet etc.)
Writing the script directly in the python interface leads to unstable and near-infinite values in the mass diffusion contribution in many cases (occurring in areas of low species concentrations). I have trialed this on a few mechanisms and 1D flame models with no luck.
Please find attached the code I have been using for this based on a known result from paper (Lu, 2015), based on my best attempt to create the modified GRI mech from that paper. I have another version of the same code but utilising a CHEMKIN or Cantera csv file solution. In this code, the same issue occurs at low species concentrations (i.e if looking at a species with low concentrations like 'H' or 'OH').
Weirdly, the thermal diffusion result in the code attached seems to be relatively accurate and stable. Unfortunately, I do not have enough knowledge of cantera to try to code this formulation directly into the C++ codes as was done in ember. I have been tempted to use ember, however, I believe it only has the mixture averaged formulation?
I've been stuck on this for a few weeks now, so would really appreciate any thoughts or suggestions you may have.
To replicate issue, please call the diffusion.py TransportCalc class with the following script :
from folder_containing_file.diffusion import TransportCalc
def main():
TransportCalc('../path/to/mech/gri-liu.cti', 'H2')
if __name__=="__main__":
main()