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

Fix adiabatic_flame.py module #49

Closed
ischoegl opened this issue Dec 14, 2020 · 7 comments · Fixed by #54
Closed

Fix adiabatic_flame.py module #49

ischoegl opened this issue Dec 14, 2020 · 7 comments · Fixed by #54
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ischoegl
Copy link
Collaborator

Mixture-averaged and multi-component diffusion used to give different results, see old ctwrap. They no longer do ...

@ischoegl ischoegl mentioned this issue Dec 14, 2020
19 tasks
@ischoegl
Copy link
Collaborator Author

Both groups point to the same flame object ... Python treats everything as a reference

@ischoegl
Copy link
Collaborator Author

This may require a second flame object. Note that simulations can be restarted, see:
https://github.com/Cantera/cantera/blob/d8e62addc8bc535588cbf8d1bd832010b22acf1f/interfaces/cython/cantera/onedim.py#L96

@ischoegl ischoegl added the bug Something isn't working label Dec 14, 2020
@ischoegl ischoegl added this to the v0.2.0 milestone Dec 14, 2020
@DavidAkinpelu
Copy link
Contributor

DavidAkinpelu commented Dec 14, 2020

Process Process-1:
Traceback (most recent call last):
  File "/home/david/anaconda3/envs/ctwrap/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/home/david/anaconda3/envs/ctwrap/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/david/ctwrap/ctwrap/simulation.py", line 752, in worker
    obj.run(group, config, **kwargs)
  File "/home/david/ctwrap/ctwrap/simulation.py", line 143, in run
    self.data = self._module.run(name, **config, **kwargs)
  File "/home/david/ctwrap/ctwrap/modules/adiabatic_flame.py", line 104, in run
    g.solve(loglevel)  # don't use 'auto' on subsequent solves
  File "/home/david/anaconda3/envs/ctwrap/lib/python3.7/site-packages/cantera/onedim.py", line 864, in solve
    return super().solve(loglevel, refine_grid, auto)
  File "interfaces/cython/cantera/onedim.pyx", line 1139, in cantera._cantera.Sim1D.solve
cantera._cantera.CanteraError: 
***********************************************************************
CanteraError thrown by OneDim::timeStep:
Time integration failed.
***********************************************************************

@DavidAkinpelu
Copy link
Contributor

This is what I am trying to do.

    # set up flame object
    width = domain.width.m_as('meter')
    f = ct.FreeFlame(gas, width=width)
    f.set_refine_criteria(ratio=3, slope=0.06, curve=0.12)
    if loglevel > 0:
        f.show_solution()

    out = {}

    # Solve with mixture-averaged transport model
    f.transport_model = 'Mix'
    f.solve(loglevel=loglevel, auto=True)

    # Solve with the energy equation enabled
    if loglevel > 0:
        f.show_solution()
    msg = '    {0:s}: mixture-averaged flamespeed = {1:7f} m/s'
    print(msg.format(name, f.velocity[0]))

    group = name + "_mix"
    out[group] = f

    f_sol = f.to_solution_array()

    # Solve with multi-component transport properties
    g = ct.FreeFlame(gas, width=width)
    g.set_initial_guess(data=f_sol)
    g.set_refine_criteria(ratio=3, slope=0.06, curve=0.12)
    g.transport_model = 'Multi'
    g.solve(loglevel)  # don't use 'auto' on subsequent solves
    if loglevel > 0:
        g.show_solution()
    msg = '    {0:s}: multi-component flamespeed  = {1:7f} m/s'
    print(msg.format(name, g.velocity[0]))

@ischoegl
Copy link
Collaborator Author

Ok. The restart doesn’t appear to work. Can you troubleshoot this in a jupyter notebook (I.e. without ctwrap)

@DavidAkinpelu
Copy link
Contributor

Okay

@ischoegl
Copy link
Collaborator Author

When you set g, the gas won’t have the correct composition any longer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants