merging mechanisms

678 views
Skip to first unread message

YGreg

unread,
May 19, 2021, 9:06:25 AM5/19/21
to Cantera Users' Group
Hello everyone,

I am trying to estimate the ignition delay,  flame temperature, and remaining burnt products in a reactor, for various mixtures for which I cannot find a suited mechanism. 

On one hand I have  an hydrocarbon : kerosene or dodecane and on the other hand  an organophosphorus compound (triethyl or tributyl phosphate). I am interested in the decompostion of the later during the combustion (in air, constant pressure), as function of initial proportion of the reactants.

Phosphorus is obviously never present in the mechanism files I found for those 2 fuels. For the  organophosphorus  I only found mechanism with propane or methane.

Merging yaml files appears to be too random, as the species names may be a bit different from a yaml file to another, not to mention it still won't include the proper reactions of the longer alkanes with phosphorus components.

I was wondering if by any chance there is some relevancy in using the mixture option to burn 2 gas phases of different yaml files in a reactor?  a bit such as in the example files  https://www.cantera.org/examples/python/multiphase/adiabatic.py.html. However it seems it is not the case as I understand that cantera will treat those separately, which is not relevant for my problem. Could someone clarify this point?

So I am now wondering which clever assumptions could be made on the fuel burning so that I can replace it by something present in the organophosphorus yaml files for example if I am interested in order of magnitude of the burning temperature or in the remaining species of the phophorus reactant? (I understand that different problems will need different codes but I am looking for general  recommendations for now).

Thanks for your help!

tullio viola

unread,
May 19, 2021, 9:41:04 AM5/19/21
to canter...@googlegroups.com
Wonderful question! I'll follow!

Tullio Viola

STEMS-CNR, Naples, Italy

--
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/0e231695-f229-453a-bdca-57ef5f26f2een%40googlegroups.com.

Bryan Weber

unread,
May 19, 2021, 10:06:37 AM5/19/21
to Cantera Users' Group
Hi,

Unfortunately, you've hit the main problem of combining mechanisms, that the species aren't named consistently. Unfortunately, there's no good way to deal with this other than manually. As far as adding reactions, you can possibly make some assumptions if you know the reaction rate with primary, secondary, and tertiary carbon atoms in the hydrocarbon (and possibly with allylic sites as well). This is frequently done when scaling up reaction mechanisms for other molecules, but Cantera isn't equipped to solve that kind of problem. Other software such as RMG (https://rmg.mit.edu) may be more appropriate.

As far as what Cantera can accomplish, the Mixture object can be used to estimate the adiabatic flame temperature, as shown in the example you linked. Cantera can handle multiple mechanism files, as in that example, but if there are "duplicated" species with different names between the mechanisms, Cantera will treat them as separate species.

I hope that helps!
Bryan

YGreg

unread,
May 19, 2021, 1:06:37 PM5/19/21
to Cantera Users' Group
Thanks Bryan for this clarification, this does help me! and I ll take a look at RMG as well.

I actually have several problems in this research project:

- first the ignition of the mixture: given the fact that part of my reactants may be flame inhibitors, ignition for a given solicitation (lets say 1000k applied for 30s) may fail. To simulate this I assume the detailed kinetics are needed and I cannot find a proper way to resolve this problem for the moment.

- concerning the temperature of combustion  in the mixture, your answer is exactly what I need in fact. In such case I am not so interested in the kinetics but more in a general equilibrium state. So if I am correct, the complete reaction kinetics are not preponderant here and despite some reactions would be missing, I might obtain reasonable order of magnitudes of the equilibrium temperature. 

- also, depending on the initial reactants proportions/conditions, obtaining a list of species remaining at the end of the reaction is also a question of equilibrium for which the complete kinetics may not be entirely necessary. Is that a correct assumption?

- at last a final (major) difficulty : my experiment is actually a burning pool form which I will take an average evaporation rate. I am not familiar with the reactor tool implemented in cantera : is it relevant to use a single or a chain of constant pressure reactors to perform the calculations? I understood,  that after an infinite time the state of the reactor is supposed to be close to that computed with the equilibrium function.

Thanks

Bryan Weber

unread,
May 19, 2021, 4:06:09 PM5/19/21
to Cantera Users' Group
Hi,

In general, the equilibrium conditions depend only on the chemical potentials of the species, which can be determined from thermodynamic data of the species, there's no need for kinetic information to determine equilibrium temperature or composition. So, provided that all important species are present in the input file with appropriate thermodynamic functions, then you'll get exactly the equilibrium temperature.

If you're interested in any time-dependent behavior, including ignition timing and/or behavior, then you'll need kinetics (detailed or not is up to your modeling assumptions). As far as modeling your experiment, unfortunately Cantera doesn't have the concept of a liquid-vapor interface at the moment. Stating it more generally, interfaces in Cantera are assumed to consist of a specified number of reaction "sites" which may or may not be occupied by a species at any given instant. Unfortunately, this view doesn't lend itself very well to problems involving processes like evaporation. Evaporation (of droplets, primarily) is a topic that comes up on the list pretty frequently, and I don't think we've found a good answer to that kind of problem yet. If you come up with any ways of modeling those systems, I'd be very interested to hear about it!

Best,
Bryan

Boyang Xu

unread,
May 20, 2021, 11:51:27 AM5/20/21
to Cantera Users' Group
Hi,

Concerning merging of mechanism, I agree with Bryan and it is really a pain. If your two mechanisms have identifiers (such as SMILES or InChI) associated to each species, you can write a script or use Chemkin to merge.  However, most probably it is not the case for you, as most of the mechanisms do not have such information. Then the only option is to do it by hand, and here are some tips during that process to save some time: (i) you can list and compare the species names with grouping by chemical formula extracted from the thermodynamic data, as this can help improving the speed of identifying equivalent species; (ii) you can write a script to batch change species name of both mechanisms to the nomenclature you defined; (iii) Now the two mechs follow the same nomenclature, so you can use Chemkin to merge them.

Concerning the liquid-gas interaction, I have similar problem. After tying to workaround using various methods, I have succeed in doing so using the "MassFlowController" modules which should connect its one end to the reactor and the other end to a reservoir (instead of the other reactor).  In this way, we can define evaporation/dissolution as mass flow out of/ into the reactor, the flow rate of which could be defines as any function (for my case, mdot_eva = A_interface * k_eva * C_species * MW_species ).The reservoir it connected should contains only one species (the species that evaporates/dissolves). Also, we should have two separate MassFlowController for evaporation and dissolution process. 

The reason why Reservoir instead of the other Reactor is used here is because MassFlowController or FlowDevice can transport only the whole mixture, not components. The drawback of this approach is that you have to define numerous MassFlowController if you have many evaporating species. For example, if you have 2 reactors (e.g., liquid and gas),  2 directions (e.g., evaporation and dissolution), and k interacting species, you will have to define 2*2*k MassFlowControllers and k or 2*k Reservoirs (depending on if you give separate names for one species in different phases.). Another drawback is that you have to update all the mass flow rates at every time steps, if your defined functions depend on parameters other than time and pressure (e.g., for my case,  concentration of one species in one reactor).

Hope these can help you.

Best regards,
boyang

Steven DeCaluwe

unread,
May 20, 2021, 12:10:53 PM5/20/21
to <cantera-users@googlegroups.com>
unfortunately Cantera doesn't have the concept of a liquid-vapor interface at the moment. Stating it more generally, interfaces in Cantera are assumed to consist of a specified number of reaction "sites" which may or may not be occupied by a species at any given instant.

I might be missing something, but I’m not certain that I agree with this statement.  The interface in Cantera does not need to have any species at all, and can certainly just provide a code object to handle reactions converting species in one bulk phase to species in a second bulk phase.  For example, we currently model the deposition and removal of Li2S particles in lithium-sulfur batteries via the reaction:

Li+(electrolyte) + electron(solid) + LiS(electrolyte) <=> Li2S(solid)

Which requires an interface between the solid and the liquid electrolyte, but does not actually involve any interface species.  In principle, I don’t see any reason why a similar reaction between a liquid and a gas phase could not be written.  The “interface” object is just a “pass-through,” in a manner of speaking, allowing us to associate the bulk phases with one another for this reaction.  Figuring out the thermodynamics might be a pain, and you would need to write your own code for the residual functions, I would think, but in terms of the code infrastructure, it seems like Cantera can handle it.

Steven





--
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.

Bryan Weber

unread,
May 20, 2021, 12:12:17 PM5/20/21
to Cantera Users' Group
Thanks for the correction Steven! I'm happy to learn about new ways of approaching things.

Bryan

Boyang Xu

unread,
May 20, 2021, 2:21:46 PM5/20/21
to Cantera Users' Group
Hi S. DeCaluwe,

Thanks for providing this approach!

Actually, I have tried this method before for gas-liquid interaction, but my attempts failed. The problem is that although this definition of interface reactions without "site-species" receive no complaint from Cantera and calculations can proceed successfully, the interface reactions are actually not accounted for during the calculations. I guess the rate of progress for these reactions are somehow computed to be zero due to the absence of site-species in the definition of these reactions.

Do you have any solution to this? Or is it possible to share a working example if you have succeed with this approach before? 

Thank you so much!

Best,
Boyang

Steven DeCaluwe

unread,
May 20, 2021, 3:02:31 PM5/20/21
to <cantera-users@googlegroups.com>
Hi Boyang,

Hard to say what the issue is without seeing the code, input file, etc., but I really don’t think the ‘zero’ rates are due to the interface object.

The forward rates would be your rate coefficient times the activity concentrations of the reactants.
The reverse rates are calculated similarly, except that (for a reversible reaction), the reverse rate coefficient is calculated as the forward coefficient, divided by the equilibrium constant.  

Like I said below, I think the thermo will be the trick, and I don’t have a clear picture in my mind how you would do it..  For vapor and liquid in equilibrium, the net rates would be zero, but the individual forward and reverse rates would be non-zero.  That is the first thing I would check.

Best,
Steven




Boyang Xu

unread,
May 20, 2021, 4:55:34 PM5/20/21
to Cantera Users' Group
Hi Steven,

Thanks for the reply!

I just checked the rate of progress of the interface reactions (1st is dissolution and 2nd is evaporation). The rate of progress for dissolution is always 0, while the rate of progress for evaporation is constant value with time and equal to the rate constant (meaning the code takes the concentration of O2 as constant and equal to 1). 

Part of my input file and phase definition are provide in the text below. Could you help me check for problems? Thanks a lot!

Kind regards,
Boyang

------
.yaml file:

phases:
- name: liquid
  thermo: ideal-gas
  elements: [H, C, O, N, Ar, He]
  species: [O2, RH,  ... ]
  kinetics: gas
  state: {T: 300.0, P: 1 atm}

- name: gas
  thermo: ideal-gas
  elements: [H,C,O]
  species: [O2(g), RH]

- name: interface
  thermo: ideal-surface
  species: [O2, O2(g)]
  reactions: [interface-reactions]
  kinetics: surface

# Gas-liquid interface: species & reactions
interface-reactions:
- equation: O2(g) => O2  # O2 dissolution
  rate-constant: {A: 1.0e-12, b: 0.0, Ea: 0.0}
- equation: O2 => O2(g)  # O2 evaporation
  rate-constant: {A: 2.823e-12, b: 0.0, Ea: 0.0}


------
Input file:

def get_vapor_pressure(T):
A = 4.54436
B = 1738.123
C = 0.394
return 10**( A-(B/(T + C)) )*1e5

# Initial Values
temp_dgC = 160
temp = temp_dgC + 273.15
pres_init = 14*1e5
X_O2_init = 0.0131378
X_RH_init = 1 - X_O2_init
v_liq = 5*1e-6
v_gas = 20*1e-6
rho_liq = 722.8

# Phases
liq, gas = ct.import_phases('liq-toluene_superskl.yaml',['liquid', 'gas'])
itf = ct.Interface('liq-toluene_superskl.yaml', name='interface',adjacent=[liq,gas])
liq.TDX = temp, rho_liq, { 'RH': X_RH_init, 'O2': X_O2_init }
gas.TPX = temp, pres_init, { 'O2(g)': pres_init - get_vapor_pressure(temp), 'RH(g)': get_vapor_pressure(temp) }
itf.TP = temp, pres_init

# Reactors
rliq = ct.Reactor(liq, name='Liquid Reactor', energy='off')
rgas = ct.Reactor(gas, name='Gas Reactor', energy='off')
rliq.volume = v_liq
rgas.volume = v_gas

# Reactors network
sim = ct.ReactorNet([rliq,rgas])

# Start iterating
tstep = 1        # sec
tend = 60*60*1000  # 1000h
tlog = 60*60   # 1h
tot_steps = int(tend/tstep)
log_steps = int(tlog/tstep)

time = 0.0
print("{:6} {:10} {:10} {:10} {:10} {:10}".format('t [h]', '[O2(l)]', 'P_g [bar]', '[O2(g)]', 'rate_sol', 'rate_eva'))
for n in range(tot_steps):
time += tstep
sim.advance(time)
if n%log_steps == 0:
print("{:6.0f} {:10.4g} {:10.2f} {:10.4g} {:10.4g} {:10.4g}".format(time/tlog, liq['O2'].concentrations[0], rgas.thermo.P/1e5, gas['O2(g)'].concentrations[0], itf.forward_rates_of_progress[0], itf.forward_rates_of_progress[1]))

------
Ouput

t [h]  [O2(l)]    P_g [bar]  [O2(g)]    rate_sol   rate_eva  
     0      0.104      14.00     0.2935          0  2.823e-12
     1    0.03182      14.00     0.2935          0  2.823e-12
     2  4.829e-07      14.00     0.2935          0  2.823e-12
     3  4.827e-07      14.00     0.2935          0  2.823e-12
     4  4.826e-07      14.00     0.2935          0  2.823e-12
...
   100  4.717e-07      14.00     0.2935          0  2.823e-12

Steven DeCaluwe

unread,
Aug 20, 2021, 5:53:19 PM8/20/21
to Cantera Users' Group
Hi Boyang,

Sorry that I’m just now having a look at this.

The first thing I would recommend is that you change the interface species names.  Your interface species are named 'O2' and 'O2(g)’, which both exactly match names in one of the adjacent phases.  I don’t actually know what Cantera does here—how does it know which O2 the reaction refers to, for example?

From your application, I think you just want a single “O2_s” species, which can participate in reactions with either the liquid or the gas-phase O2.

Perhaps something like:

phases:
- name: liquid
  thermo: ideal-gas
  elements: [H, C, O, N, Ar, He]
  species: [O2, RH,  ... ]
  kinetics: gas
  state: {T: 300.0, P: 1 atm}

- name: gas
  thermo: ideal-gas
  elements: [H,C,O]
  species: [O2(g), RH]

- name: interface
  thermo: ideal-surface
  species: [O2(s)]
  reactions: [interface-reactions]
  kinetics: surface

# Gas-liquid interface: species & reactions
interface-reactions:
- equation: O2(s) => O2  # O2 dissolution
  rate-constant: {A: 1.0e-12, b: 0.0, Ea: 0.0}
- equation: O2(s) => O2(g)  # O2 evaporation
  rate-constant: {A: 2.823e-12, b: 0.0, Ea: 0.0}

I am guessing at the reaction directions (surface species on the left hand side?), bu  hopefully you get the idea.

Best,
Steven

——————————————————
Steven C. DeCaluwe, Ph.D | Associate Professor of Mechanical Engineering
COLORADOSCHOOLOFMINES
Brown Building W410B
Golden, CO 80401

Twitter: @CORESresearch
He / Him / His





Reply all
Reply to author
Forward
0 new messages