Skip to content

Commit

Permalink
[1D] Use fixed point temperature closer to unburned gas temperature
Browse files Browse the repository at this point in the history
This improves convergence in cases where the domain is too short to achieve full
oxidation and the maximum temperature within the domain is significantly lower
than the flame temperature computed from equilibrium.
  • Loading branch information
speth committed Mar 25, 2016
1 parent 5a08cf0 commit 22537b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions interfaces/cython/cantera/onedim.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,14 @@ def set_initial_guess(self):
# Pick the location of the fixed temperature point, using an existing
# point if a reasonable choice exists
T = self.T
Tmid = 0.5 * (T0 + Teq)
Tmid = 0.75 * T0 + 0.25 * Teq
i = np.flatnonzero(T < Tmid)[-1] # last point less than Tmid
if Tmid - T[i] < 0.5 * (Tmid - T0):
if Tmid - T[i] < 0.2 * (Tmid - T0):
self.set_fixed_temperature(T[i])
elif T[i+1] - Tmid < 0.5 * (Teq - Tmid):
elif T[i+1] - Tmid < 0.2 * (Teq - Tmid):
self.set_fixed_temperature(T[i+1])
else:
self.set_fixed_temperature(0.5 * (T[i] + T[i+1]))
self.set_fixed_temperature(Tmid)

for n in range(self.gas.n_species):
self.set_profile(self.gas.species_name(n),
Expand Down

0 comments on commit 22537b9

Please sign in to comment.