Several problems with modeling liquid-gas transfer reactor

45 views
Skip to first unread message

james jery

unread,
Aug 26, 2025, 9:53:04 AMAug 26
to Cantera Users' Group
Hi!
I want to model a gas-liquid packed bed reactor with Cantera. The modeling process primarily involves gas-liquid mass transfer terms, and I meet serval problems:

1.
The mass transfer coefficient changes with the state of the reactor, I attempted to simulate gas-liquid mass transfer by modifying the chemical mechanism file with the reaction SO2(g) <=> SO2(aq) through the chemical reaction module, as shown in the code. Is this approach feasible?

2.
When the gas-phase reactor energy is set to "on," the gas temperature drops drastically. When the liquid-phase reaction energy is set to "on," an error is reported. How does it happen?

3.
I want to use Cantera as a chemical source term. How can I obtain its source term and implicit source term? I've tried in my giving code, am I right?

Thank you.
PackedBedTower.py
Na2CO3_surf.yaml

Ray Speth

unread,
Sep 17, 2025, 11:26:30 PMSep 17
to Cantera Users' Group

Hi,

What version of Cantera are you using? I wasn’t able to run your code using either the latest release (Cantera 3.1) or the current development version without first making several modifications to the input file. Specifically:

  • There is a typo on the definition of the surface phase, where sites-density should be site-density.
  • Two of the species included in the liquid phase (H2CO3 and N2) are missing their equation-of-state sections. Though I’m not sure that N2 should be included in the liquid phase, at least using its gas phase thermo data.

Following that, there is then an issue with your integration loop, which boils down to:

t = 0.0 dt = 0.01 while t<2: sim.advance(dt) t = t+ dt

The argument to the advance method should not be the time step but rather that absolute time that the integrator should reach. As written, the loop will integrate to 0.01 second, and then the subsequent calls will do nothing except increase the value of t.

The integrator errors that you get after turning on the energy equation are a bit more complex to resolve. For reasons I don’t quite understand, the integrator occasionally tries to evaluate the equations with enthalpy values that correspond to temperatures that are out of bounds for the liquid water equation of state. There is currently an issue with this situation, where setting invalid values on the phase object once makes it impossible to set a valid state afterwards, resulting in these unrecoverable errors. I’ve put together a pull request which should resolve the issue. If you can build Cantera from source, you can try this after it’s been merged into the main branch.

More broadly, I think you’re on the right track with representing the mass transfer between the liquid and the gas using “reactions” on the surface. You may need to think a bit about the meaning of the “site density” that Cantera applies in the calculation of these rates and whether you’re getting the rates you expect. For handling rates that vary as a function of other parameters in your system, you may also want to look at using the ExtensibleRate and/or ExtensibleReactor classes to implement your custom behavior.

I’m not sure I follow your last question. Do you have a definition for the terms that you want to compute?

Regards,
Ray

james jery

unread,
Sep 23, 2025, 2:49:52 AM (11 days ago) Sep 23
to Cantera Users' Group

Thankyou very much for your reply!!!

I am sorry for not reviewing my modeling work carefully before submitting codes, which contained obvious errors. I’m using Cantera 3.0 and I ‘ve followed your advice and corrected the mistakes.

Again, thank you for the thorough feedback—and for taking the extra help of reporting the problem I met!!!

I did model gas–liquid mass transfer by treated it as a reaction in Cantera and found that simply overlaying an Arrhenius expression worked very well.But I have a follow-up question: if I switch to the ExtensibleReactor module from a “tricky” reaction to model the mass-transfer, how do I deal with a multiphase interface? For example, how to get gas component in a liquid phase reactor?

And what if I use the ExtensibleReaction class instead? I’d like to implement a surface-renewal model, but that theory needs time parameter t as an explicit variable, which ExtensibleReaction Module cannot achieve.

My another goal is to couple Cantera to a CFD solver via its chemical source terms. I see two possible routes:

  1. Let Cantera return the production result and heat-release in each time step, then hand those straight to the CFD;
  2. Spilt the results into an explicit part and an implicit part, and make them into solver’s own linear system.

It’s the second route that confuses me. Cantera exposes a handful of gradient-related Methods: Reactor.finite_difference_jacobian, ReactorNet. get_derivative(), Many derivative terms in Kinetics modules, even and ThermoPhase.netProductionRates, etc.I tried to use Reactor.finite_difference_jacobian and ReactorNet. get_derivative() accordingly (see the new codes I submitted). Is my model correct?

PackedBedTower.py
Na2CO3_surf.yaml
Reply all
Reply to author
Forward
0 new messages