1D simulations of multiphase flow

54 views
Skip to first unread message

Victoria Stephens

unread,
Sep 23, 2022, 3:11:39 PM9/23/22
to Cantera Users' Group
Hello all,

I'd like to do some 1D simulations of a two-phase flow, but I'm running into some roadblocks, and I'm curious if any of you lovely people have ideas or suggestions.

We're simulating a premixed burner-stabilized flame in C++ using StFlow. With just one gas phase, it works great. The goal, however, is to use it as a base for some integrated testing of the soot chemistry library I wrote (to be published soon!). We've been able to do some separated tests (run the premixed flame, write the data, apply the soot library), but examination of the source terms and comparison to experimental data indicate that we need to couple the soot to the gas phase to move forward. Here are some things we've explored:
  • Pseudo-coupling by running repeated cycles of flame and soot library to feed back to the flame and so on. It's clunky, slow, and not robust, so we want to avoid this.
  • MultiPhase thermo object; unfortunately, StFlow doesn't support anything but ideal gas objects. I've read a few posts about the inability to use StFlow for real gases, all of which indicate that updating StFlow is a bigger project than I realized, so I'm not holding my breath on this one.
  • Write a less restrictive 1D flow class based on StFlow that lets us use a multiphase object. Since the rates for one of the two phases will be computed by the attached library, I feel like this could work, but I'm not confident in my ability to robustly modify Cantera's source code.
  • Using Quantities to combine phase states. I thought this had potential, but I can't for the life of me figure out what header to include to do it in C++, or, for that matter, whether it's possible at all in C++. If anyone knows, I'd love to hear more.
  • Adding soot moments to the gas mechanism as extra "gas" species and updating the appropriate reaction rates externally. This requires us to scale the soot moment values back and forth so that they don't affect cantera's gas rate calculations, which seems like a sure recipe for errors. It would also require us to add the appropriate soot moment transport equations to StFlow, which can be done, but also introduces various issues associated with compiling and linking Cantera against my library directly. It also suggests that we would either need to recompile Cantera every time we wanted to test a different soot mechanism or write some extra infrastructure to accommodate user input of that nature, both of which sound like time-consuming and potentially frustrating processes.
Have any of you successfully used Cantera for a multiphase 1D simulation? Do any of these ideas have more merit than the others based on your experience? Are we out of luck, forced to write our own premixed solver and relegate Cantera to spitting out gas rates? I appreciate any suggestions, opinions, or experiences you might be willing to share. 

Victoria Stephens

unread,
Sep 23, 2022, 4:46:28 PM9/23/22
to Cantera Users' Group
Well, I solved one mystery. Turns out that Quantity is a 2.6.0 feature, and I was using 2.5.1 (how primitive of me). I updated to 2.6.0, but now I've discovered that Quantity is a struct defined in a source file rather than a header, making it impossible to access with #include. I'm no C++ expert, but I've used it enough to wonder if this is an error or an intentional placement. Anyone know who/how to ask?

Ingmar Schoegl

unread,
Sep 24, 2022, 8:49:10 AM9/24/22
to Cantera Users' Group
Hi Victoria,

It is correct that Cantera in its current form does not support multiphase 1D flow. Regarding "Quantity", could you be a little more specific about your needs? There are currently two `Quantity` objects: in Python, it specifies a 'specific quantity of a `Solution`', while in C++, a struct of the same name implements a value with a unit for internal purposes (which is presumably the reason why it is not exposed to the API). Regarding your last point about linking custom code to Cantera, you may not need to recompile the entire package; at least on Linux, I have been successful in linking external features. Presumably, the same should work for macOS; windows may be a little trickier. So it depends ...

-ingmar-

Reply all
Reply to author
Forward
0 new messages