Zero out the chemistry for a specific species

92 views
Skip to first unread message

Arsalan Taassob

unread,
Apr 28, 2022, 11:19:36 PM4/28/22
to Cantera Users' Group
Hi everyone,
I am working with Cantera and I am using Plug Flow Reactor (PFR) method. I am trying to disable the chemistry for a specific species, for example, H2O. I use the chemistry_enabled function but it applies to all species, however, I need it only for a specific species. 
I would be happy if someone can help me in this regard.
Thanks in advance 

Steven DeCaluwe

unread,
Apr 28, 2022, 11:24:46 PM4/28/22
to canter...@googlegroups.com
Hi, you can use the “set_multiplier” method to do this. 

It will require just a little bit of preprocessing to loop over the reactions and find those with the species of interest. 

If you need help with that let us know, but please also let us know what interface you are using (eg Python, Matlab, etc)

Best,
Steven

Sent from my iPhone

On Apr 29, 2022, at 1:21 PM, 'Arsalan Taassob' via Cantera Users' Group <canter...@googlegroups.com> wrote:

Hi everyone,
I am working with Cantera and I am using Plug Flow Reactor (PFR) method. I am trying to disable the chemistry for a specific species, for example, H2O. I use the chemistry_enabled function but it applies to all species, however, I need it only for a specific species. 
I would be happy if someone can help me in this regard.
Thanks in advance 

--
You received this message because you are subscribed to the Google Groups "Cantera Users' Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cantera-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cantera-users/628042d6-1daa-4145-9a21-4be92a1ce9d2n%40googlegroups.com.

Arsalan Taassob

unread,
Apr 30, 2022, 11:54:00 AM4/30/22
to Cantera Users' Group
Thanks a lot for your response. I am using Python as the interface. I tried to use '' set_multiplier'' but it seems like it is a bit tricky. I would be glad if you can help me to use this function.
Also, I have attached the code (it is basically the template PFR code in Cantera), and I will explain my question again with more details; It may help better.
I intend to set the dY/dt of H2 equal to zero during the simulation: Should I still use set_multiplier? 
I would appreciate it if someone can help me in this regard.
Thanks
Arsalan  
PFR_Default_SIM.py

Arsalan Taassob

unread,
May 3, 2022, 12:51:44 AM5/3/22
to Cantera Users' Group
Hi
Does any group member know about my question?
I would appreciate it if somebody can help me in this matter.
Thanks in advance
Arsalan  

Ingmar Schoegl

unread,
May 3, 2022, 5:05:58 PM5/3/22
to Cantera Users' Group
Hi,
Setting dY/dt of H2 equal to zero is somewhat 'interesting' from a conservation of mass perspective, but there may be a valid physical motivation. The multipliers will affect individual reactions, which is not quite the same, as it also affects other reactants (essentially, it disables the entire reaction). At the moment, I am not aware of a capability outside of the newly introduced ExtensibleReactor framework in 2.6 to turn off individual ODE's (see https://github.com/Cantera/cantera/blob/main/interfaces/cython/cantera/examples/reactors/custom2.py) that could be used for this problem. I am not very familiar with this new capability yet, so there will be a learning curve.
-ingmar-
Reply all
Reply to author
Forward
0 new messages