Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write_csv does not work for impingJet with radiation_enabled #986

Closed
walz00g opened this issue Mar 2, 2021 · 4 comments · Fixed by #993
Closed

Write_csv does not work for impingJet with radiation_enabled #986

walz00g opened this issue Mar 2, 2021 · 4 comments · Fixed by #993

Comments

@walz00g
Copy link

walz00g commented Mar 2, 2021

When analyzing a stagnation flame including radiation, write_csv fails although the solver completed successfully.

import cantera as ct
gas = ct.Solution('GRI30.yaml')
gas.TPX = 293.150000, 405300.000000, 'O2:0.195618, CH4:0.068466, N2:0.735915'
f = ct.ImpingingJet(gas=gas, width=0.010000)
f.inlet.mdot = 0.600000
f.inlet.X = 'O2:0.195618, CH4:0.068466, N2:0.735915'
f.inlet.T = 293.150000
f.inlet.spread_rate = 14.000000
f.surface.T = 445.000000
f.set_grid_min(1.00e-04)
print ('Simulation with radiation, multicomponent diffusion and Soret effect :')
f.transport_model = 'Multi'
f.energy_enabled = True
f.soret_enabled = True
f.radiation_enabled = True
f.set_refine_criteria(ratio = 3.000000, slope = 0.030000, curve = 0.075000, prune = 0.010000)
f.set_initial_guess(products='equil')
f.solve(loglevel=1, refine_grid=True, auto=True)
f.write_csv('result.csv',quiet=False)

@bryanwweber
Copy link
Member

bryanwweber commented Mar 2, 2021

Hi! Thank you for reporting this. Can you also include any error messages you get as a result of running this code? Thanks! Please also include the other information requested in the template, including the version of Cantera and how you installed it.

@ischoegl
Copy link
Member

ischoegl commented Mar 2, 2021

Confirming on 2.5.1 (stock conda) based on the input provided ...

    f.write_csv('result.csv',quiet=False)
  File "/home/ischoegl/.pyenv/versions/miniconda3-latest/envs/cantera-2.5.1/lib/python3.8/site-packages/cantera/onedim.py", line 436, in write_csv
    self.to_solution_array().write_csv(filename, cols=cols)
  File "/home/ischoegl/.pyenv/versions/miniconda3-latest/envs/cantera-2.5.1/lib/python3.8/site-packages/cantera/onedim.py", line 453, in to_solution_array
    states, other_cols, meta = super().collect_data(domain, other)
  File "interfaces/cython/cantera/onedim.pyx", line 981, in cantera._cantera.Sim1D.collect_data
AttributeError: 'ImpingingJet' object has no attribute 'radiative_heat_loss'

@walz00g
Copy link
Author

walz00g commented Mar 3, 2021

I get the following output:

Simulation with radiation, multicomponent diffusion and Soret effect :

************ Solving on 6 point grid with energy equation enabled ************

..............................................................................
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 3.204e-05 5.296
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0008211 5.003
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.01403 3.446
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.02996 2.18
Attempt Newton solution of steady-state problem... success.

Problem solved on [6] point grid(s).

..............................................................................
grid refinement disabled.

******************** Solving with grid refinement enabled ********************

..............................................................................
Attempt Newton solution of steady-state problem... success.

Problem solved on [6] point grid(s).

..............................................................................
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 4
to resolve C2H2 C2H4 C2H6 C3H8 CH2 CH2(S) CH2CO CH2O CH2OH CH3 CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCOH HCN HCNO HCO HNCO HO2 N2 N2O NO NO2 O O2 OH T spread_rate velocity
##############################################################################

..............................................................................
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0001709 5.062
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.004379 4.061
Attempt Newton solution of steady-state problem... success.

Problem solved on [11] point grid(s).

..............................................................................
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9
to resolve C2H2 C2H4 C2H6 C3H8 CH2 CH2(S) CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCOH HCN HCNO HCO HNCO HO2 N2 N2O NO NO2 O O2 OH T spread_rate velocity
##############################################################################

..............................................................................
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0001709 4.986
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.004379 3.832
Attempt Newton solution of steady-state problem... success.

Problem solved on [21] point grid(s).

..............................................................................
##############################################################################
Refining grid in flame.
New points inserted after grid points 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
to resolve C2H2 C2H3 C2H4 C2H5 C2H6 C3H8 CH2 CH2(S) CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCNO HCO HNCO HO2 N2
N2O NO NO2 O O2 OH T spread_rate velocity
##############################################################################

..............................................................................
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 8.543e-05 5.793
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 8.109e-05 5.42
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0009237 4.535
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 3.082e-05 6.172
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0001317 5.374
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0015 4.389
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 2.815e-05 5.964
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 8.017e-05 5.537
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0009132 4.546
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.005201 3.134
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 9.762e-05 5.498
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 9.267e-05 5.449
Attempt Newton solution of steady-state problem... success.

Problem solved on [41] point grid(s).

..............................................................................
##############################################################################
Refining grid in flame.
New points inserted after grid points 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
to resolve C2H2 C2H3 C2H4 C2H5 C2H6 C3H8 CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCNO HCO HNCO
HO2 N2 N2O NO NO2 O O2 OH T spread_rate velocity
##############################################################################

..............................................................................
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 7.594e-05 5.563
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 8.109e-05 5.483
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0002053 5.112
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 3.653e-05 5.463
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0001387 5.43
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 7.406e-05 5.382
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0001055 5.539
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0002252 5.068
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 6.013e-05 5.805
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 0.0006849 4.641
Attempt Newton solution of steady-state problem... failure.
Take 10 timesteps 2.285e-05 6.271
Attempt Newton solution of steady-state problem... success.

Problem solved on [76] point grid(s).

..............................................................................
##############################################################################
Refining grid in flame.
New points inserted after grid points 4
to resolve H2
##############################################################################

..............................................................................
Attempt Newton solution of steady-state problem... success.

Problem solved on [77] point grid(s).

..............................................................................
no new points needed in flame

******************* Solving with multicomponent transport ********************

************************ Solving with Soret diffusion ************************

..............................................................................
Attempt Newton solution of steady-state problem... success.

Problem solved on [77] point grid(s).

..............................................................................
no new points needed in flame
Traceback (most recent call last):
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Users\walz00g.vscode\extensions\ms-python.python-2021.2.582707922\pythonFiles\lib\python\debugpy_main
.py", line 45, in
cli.main()
File "c:\Users\walz00g.vscode\extensions\ms-python.python-2021.2.582707922\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
run()
File "c:\Users\walz00g.vscode\extensions\ms-python.python-2021.2.582707922\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("main"))
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "c:\GeneACArbeitsordner\geneacPyQt\stwa_gw.py", line 22, in
f.write_csv('stwa_gw.csv',quiet=False)
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\onedim.py", line 436, in write_csv
self.to_solution_array().write_csv(filename, cols=cols)
File "C:\Users\walz00g\AppData\Local\Programs\Python\Python39\lib\site-packages\cantera\onedim.py", line 453, in to_solution_array
states, other_cols, meta = super().collect_data(domain, other)
File "interfaces\cython\cantera\onedim.pyx", line 981, in cantera._cantera.Sim1D.collect_data
AttributeError: 'ImpingingJet' object has no attribute 'radiative_heat_loss'

@walz00g walz00g closed this as completed Mar 3, 2021
@walz00g walz00g reopened this Mar 3, 2021
@walz00g
Copy link
Author

walz00g commented Mar 3, 2021

the same as the contributor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants