please helpme: CanteraError thrown by Phase::setTemperature

22 views
Skip to first unread message

agus prasetyo nuryadi

unread,
Jul 19, 2024, 9:36:46 AM (3 days ago) Jul 19
to Cantera Users' Group
Hello Everyone,

please help me,

I am trying to calculate the laminar flame speed of dodecane using Cantera, While solving for the flame speed I encountered the below error:

cantera._cantera.CanteraError:
***********************************************************************
CanteraError thrown by Phase::setTemperature:
temperature must be positive
***********************************************************************

This error pops up . I have attached below the .cti file of the mechanism along with the script used for flame speed calculation. Any suggestion will be useful. 

Thank You
Agus

NC12H26.cti
scripts__.py

Bryan Weber

unread,
Jul 21, 2024, 8:22:53 PM (17 hours ago) Jul 21
to Cantera Users' Group
Hi,

The main thing that I note in your simulation is this section:

# Tolerance properties
tol_ss = [1.0e-5, 1.0e-9]  # [rtol atol] for steady-state problem
tol_ts = [1.0e-5, 1.0e-9]  # [rtol atol] for time stepping

f.flame.set_steady_tolerances(default=tol_ss)
f.flame.set_transient_tolerances(default=tol_ts)

f.set_refine_criteria(ratio=2.0, slope=0.05, curve=0.05, prune=0.05)
f.set_max_jac_age(10, 10)
f.set_time_step(1e-8, [10, 20, 40, 80, 100, 100, 150])
f.max_time_step_count = 500

f.solve(loglevel, refine_grid)


On the first time you solve the system, you should not set any of these properties. The solver works much better if it can find a crude solution and iterate to a fine solution. As such, I suggest you replace all of this with the following:

f.solve(loglevel, auto=True)
f.set_refine_criteria(ratio=3.0, slope=0.3, curve=0.3, prune=0.01)
f.solve(loglevel)
f.set_refine_criteria(ratio=2.0, slope=0.1, curve=0.1, prune=0.01)

From there, you can continue to refine parameters as necessary. In addition, I recommend that you do not set any of the `max_jac_age`, `time_step` or `time_step_count` properties, as the defaults for these are likely to give you the best chance at a solution.

Best,
Bryan

agus prasetyo nuryadi

unread,
3:23 AM (10 hours ago) 3:23 AM
to canter...@googlegroups.com
Hi Bryan,

I see, thank you very much for your help.

Best,
Agus

--
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/497920df-bbf6-4fd1-a9d0-3d4ac1f5871an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages