sandialabs / Spitfire

Spitfire is a Python/C++ library for constructing tabulated chemistry models and solving differential equations.
Other
37 stars 9 forks source link

Second derivative in the flamelet equations #30

Closed davide-schintu closed 1 year ago

davide-schintu commented 1 year ago

Probably I didn't fully understand the code, but I can't find in the flamelet_rhs function the second derivative of the temperature and species mass fractions. Are they defined somewhere else? I'm trying to reconstruct the differential equations found in the documentation.

Thank's, have a nice day.

michael-a-hansen commented 1 year ago

Hi there. The second derivatives are computed in src/spitfire/griffon/flamelet_kernels.cpp, CombustionKernels::flamelet_rhs, with the precomputed stencil coefficients (see the flamelet_stencils method in that same file):

out_rhs[i] += cmajor[i] * state[i] + csub[i] * state[i - nSpec] + csup[i] * state[i + nSpec];

Does this help?

davide-schintu commented 1 year ago

Hi there. The second derivatives are computed in src/spitfire/griffon/flamelet_kernels.cpp, CombustionKernels::flamelet_rhs, with the precomputed stencil coefficients (see the flamelet_stencils method in that same file):

out_rhs[i] += cmajor[i] * state[i] + csub[i] * state[i - nSpec] + csup[i] * state[i + nSpec];

Does this help?

Hi. Yes, it does! I'm studying the code and I was missing only the second derivative term (I used other flamelet generators that were structured in a different way). Anyway, I'm very interested too in a real-gas implementation of Spitfire, so I'll keep you posted for future implementations. Thank's!