Radiative heat loss - CounterFlowDiffusionFlame, transport_model = 'Multi'

332 views
Skip to first unread message

Simon Lorentzen

unread,
Apr 28, 2021, 4:49:53 AM4/28/21
to Cantera Users' Group
Hi, 

I am trying to retrieve the radiative_heat_loss from a counter flow diffusion flame, but it only returns an error saying that IdealGasFlow objects have no attribute called radiative_heat_loss. 

Thank you in advance,
Simon

Here is a MWE of the problem I am working on.

import cantera as ct

# ---------- Conditions ---------
T_in = 300 # K
P_in = ct.one_atm

width = 0.0127 # [m] distance between jets

oxidizer = 'O2:0.21 N2:0.79'
fuel = 'CO:0.5 H2:0.5'

T_in_oxidizer = 300 # K
T_in_fuel = 300 # K

V_oxidizer = 0.3175  # m/s
V_fuel = 0.3807 # m/s

# ---------- Initiate gas ----------
gas = ct.Solution('gri30.xml')
gas.X = fuel
gas.TP = T_in, P_in
density_fuel = gas.density_mass
gas.X = oxidizer
gas.TP = T_in, P_in
density_oxidizer = gas.density_mass
gas.set_equivalence_ratio(1, fuel, oxidizer)

mdot_oxidizer = V_oxidizer * density_oxidizer  # kg/s/m^2
mdot_fuel = V_fuel * density_fuel  # kg/s/m^2

# ---------- Initiate flame ----------
f = ct.CounterflowDiffusionFlame(gas, width=width)
f.P = P_in

f.oxidizer_inlet.X = oxidizer
f.fuel_inlet.X = fuel

f.oxidizer_inlet.mdot = mdot_oxidizer  # kg/m^2s
f.fuel_inlet.mdot = mdot_fuel  # kg/m^2s

f.oxidizer_inlet.T = T_in
f.fuel_inlet.T = T_in

f.set_boundary_emissivities(0.0, 0.0)

f.set_refine_criteria(ratio=2.0, slope=0.2, curve=0.2, prune=0.0)

# --------- Solve the flame using mixture-averaged transport model ----------
f.radiation_enabled = True 
f.solve(loglevel=0, auto=True)

# --------- Solve the flame using multi component transport model ----------
f.radiation_enabled = True 
f.transport_model = 'Multi'
f.soret_enabled = True
f.solve(loglevel=0)
qdot = f.flame.radiative_heat_loss
print(qdot)

Ray Speth

unread,
Apr 28, 2021, 9:27:11 AM4/28/21
to Cantera Users' Group

Hi Simon,

What version of Cantera are you using? The radiative_heat_loss property only exists in Python starting in Cantera 2.5. If you're using an older version, you should probably upgrade.

Regards,
Ray

Simon Lorentzen

unread,
Apr 28, 2021, 9:30:17 AM4/28/21
to Cantera Users' Group
Hi Ray, 

Thank you for your reply. 

I am currently not using the Cantera 2.5 version as I am having troubles installing it. 
But then I will look to your website and try again.

Regards,
Simon 

Ray Speth

unread,
Apr 28, 2021, 11:09:35 AM4/28/21
to Cantera Users' Group
Hi Simon,

If you're having problems installing Cantera 2.5, you're welcome to post about that here as well. There are a number of things in the 2.5 release that should make it easier than ever to install Cantera, so if there are still sticking points, we'd like to know about them.

Regards,
Ray

Simon Lorentzen

unread,
Apr 28, 2021, 11:26:09 AM4/28/21
to Cantera Users' Group
Hi again,

That would be great as I still cannot manage to install it. 
I will put out a new message, to keep them tidy.

Regards,
Simon

Daniel Thomas

unread,
Jul 13, 2021, 4:33:11 PM7/13/21
to Cantera Users' Group
The problem Simon pointed out is an issue in Cantera 2.5.1: the CounterflowDiffusionFlame solution will not save to hdf with radiation enabled.  Calling write_hdf() throws the error:

    AttributeError: 'CounterflowDiffusionFlame' object has no attribute 'radiative_heat_loss'


In the attached version of the Cantera example diffusion_flame.py, I've just moved the write_hdf() call to after radiation is enabled.  (Saving to hdf works fine in the original position with radiation off.)


Any ideas on what's going on?


Daniel


diffusion_flame.py

Ingmar Schoegl

unread,
Jul 13, 2021, 7:46:38 PM7/13/21
to Cantera Users' Group
This is a symptom for one of the known issues with 2.5.1 (https://github.com/Cantera/cantera/issues/986 ) and has been fixed in the development version, see https://github.com/Cantera/cantera/pull/993
-Ingmar-



Daniel Thomas

unread,
Jul 14, 2021, 2:42:03 PM7/14/21
to Cantera Users' Group
Hi Ingmar -- Yes, works fine with the development version.  Thanks for the note!  

Daniel

Marie Meulemans

unread,
Jul 6, 2022, 11:43:39 PM7/6/22
to Cantera Users' Group
Hi all,

I am facing the same problem than Simon.

I have deleted Anaconda, to reinstall everything properly. I am now using Cantera 2.6.0 to run an ImpingingJet flame, with radiation and soret enabled, as weel as the multi transport model. 

The following message appears when trying to do the function write_csv():
 'Impinging Jet' object has no attribute 'radiative heat loss'

I have taken a look at the GitHub feed, but it does not match the version of onedim.pyx that I have.
So I tried changing the line saying "return self.flame.radiation_enabled" to "return self.flame.radiative_heat_loss" (line 251)

This seems to work but I am now facing another issue regarding the line 453 "states, other_cols, meta = super().collect_data(domain, other)" where it seems that not all the data are the same type. I have the following message:
The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

It looks like I am not changing the right thing ine onedim.pyx. Could I obtain some help to solve this issue ?

Thanks
Marie
Reply all
Reply to author
Forward
0 new messages