Flame Speed with Convergence Analysis#

Requires: cantera >= 3.0.0, matplotlib >= 2.0, pandas

In this example we simulate a freely-propagating, adiabatic, 1-D flame and

  • Calculate its laminar burning velocity

  • Estimate the uncertainty in the laminar burning velocity calculation due to grid size.

Tags: Python combustion 1D flow flame speed premixed flame plotting

The figure below illustrates the setup, in a flame-fixed co-ordinate system. The reactants enter with density \(\rho_u\), temperature \(T_u\) and speed \(S_u\). The products exit the flame at speed \(S_b\), density \(\rho_b\), and temperature \(T_b\).

Freely Propagating Flame

Import Modules#

import cantera as ct
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import matplotlib
import scipy
import scipy.optimize

Define plotting preference#

plt.style.use("ggplot")
plt.style.use("seaborn-v0_8-deep")
plt.rcParams["figure.constrained_layout.use"] = True

Estimate uncertainty from grid size and speeds#

def extrapolate_uncertainty(grids, speeds, plot=True):
    """
    Given a list of grid sizes and a corresponding list of flame speeds,
    extrapolate and estimate the uncertainty in the final flame speed.
    Also makes a plot, unless called with `plot=False`.
    """
    grids = list(grids)
    speeds = list(speeds)

    def speed_from_grid_size(grid_size, true_speed, error):
        """
        Given a grid size (or an array or list of grid sizes)
        return a prediction (or array of predictions)
        of the computed flame speed, based on
        the parameters `true_speed` and `error`.

        It seems, from experience, that error scales roughly with
        1/grid_size, so we assume that form.
        """
        return true_speed + error / np.array(grid_size)

    # Fit the chosen form of speed_from_grid_size, to the last four
    # speed and grid size values.
    popt, pcov = scipy.optimize.curve_fit(speed_from_grid_size, grids[-4:], speeds[-4:])

    # How bad the fit was gives you some error, `percent_error_in_true_speed`.
    perr = np.sqrt(np.diag(pcov))
    true_speed_estimate = popt[0]
    percent_error_in_true_speed = perr[0] / popt[0]
    print(
        f"Fitted true_speed is {popt[0] * 100:.4f} ± {perr[0] * 100:.4f} cm/s "
        f"({percent_error_in_true_speed:.1%})"
    )

    # How far your extrapolated infinite grid value is from your extrapolated
    # (or interpolated) final grid value, gives you some other error, `estimated_percent_error`
    estimated_percent_error = (
        speed_from_grid_size(grids[-1], *popt) - true_speed_estimate
    ) / true_speed_estimate
    print(f"Estimated error in final calculation {estimated_percent_error:.1%}")

    # The total estimated error is the sum of these two errors.
    total_percent_error_estimate = abs(percent_error_in_true_speed) + abs(
        estimated_percent_error
    )
    print(f"Estimated total error {total_percent_error_estimate:.1%}")

    if plot:
        fig, ax = plt.subplots()
        ax.semilogx(grids, speeds, "o-")
        ax.set_ylim(
            min(speeds[-5:] + [true_speed_estimate - perr[0]]) * 0.95,
            max(speeds[-5:] + [true_speed_estimate + perr[0]]) * 1.05,
        )
        ax.plot(grids[-4:], speeds[-4:], "or")
        extrapolated_grids = grids + [grids[-1] * i for i in range(2, 8)]
        ax.plot(
            extrapolated_grids, speed_from_grid_size(extrapolated_grids, *popt), ":r"
        )
        ax.set_xlim(*ax.get_xlim())  # Prevent automatic expansion of axis limits
        ax.hlines(true_speed_estimate, *ax.get_xlim(), colors="r", linestyles="dashed")
        ax.hlines(
            true_speed_estimate + perr[0],
            *ax.get_xlim(),
            colors="r",
            linestyles="dashed",
            alpha=0.3,
        )
        ax.hlines(
            true_speed_estimate - perr[0],
            *ax.get_xlim(),
            colors="r",
            linestyles="dashed",
            alpha=0.3,
        )
        ax.fill_between(
            ax.get_xlim(),
            true_speed_estimate - perr[0],
            true_speed_estimate + perr[0],
            facecolor="red",
            alpha=0.1,
        )

        above = popt[1] / abs(
            popt[1]
        )  # will be +1 if approach from above or -1 if approach from below

        ax.annotate(
            "",
            xy=(grids[-1], true_speed_estimate),
            xycoords="data",
            xytext=(grids[-1], speed_from_grid_size(grids[-1], *popt)),
            textcoords="data",
            arrowprops=dict(
                arrowstyle="|-|, widthA=0.5, widthB=0.5",
                linewidth=1,
                connectionstyle="arc3",
                color="black",
                shrinkA=0,
                shrinkB=0,
            ),
        )

        ax.annotate(
            f"{abs(estimated_percent_error):.1%}",
            xy=(grids[-1], speed_from_grid_size(grids[-1], *popt)),
            xycoords="data",
            xytext=(5, 15 * above),
            va="center",
            textcoords="offset points",
            arrowprops=dict(arrowstyle="->", connectionstyle="arc3"),
        )

        ax.annotate(
            "",
            xy=(grids[-1] * 4, true_speed_estimate - (above * perr[0])),
            xycoords="data",
            xytext=(grids[-1] * 4, true_speed_estimate),
            textcoords="data",
            arrowprops=dict(
                arrowstyle="|-|, widthA=0.5, widthB=0.5",
                linewidth=1,
                connectionstyle="arc3",
                color="black",
                shrinkA=0,
                shrinkB=0,
            ),
        )
        ax.annotate(
            f"{abs(percent_error_in_true_speed):.1%}",
            xy=(grids[-1] * 4, true_speed_estimate - (above * perr[0])),
            xycoords="data",
            xytext=(5, -15 * above),
            va="center",
            textcoords="offset points",
            arrowprops=dict(arrowstyle="->", connectionstyle="arc3"),
        )

        ax.set(xlabel="Grid size", ylabel="Flame speed (m/s)")

    return true_speed_estimate, total_percent_error_estimate
def make_callback(flame):
    """
    Create and return a callback function that you will attach to
    a flame solver. The reason we define a function to make the callback function,
    instead of just defining the callback function, is so that it can store
    a pair of lists that persist between function calls, to store the
    values of grid size and flame speed.

    This factory returns the callback function, and the two lists:
    (callback, speeds, grids)
    """
    speeds = []
    grids = []

    def callback(_):
        speed = flame.velocity[0]
        grid = len(flame.grid)
        speeds.append(speed)
        grids.append(grid)
        print(f"Iteration {len(grids)}")
        print(f"Current flame speed is is {speed * 100:.4f} cm/s")
        if len(grids) < 5:
            return 1.0  #
        try:
            extrapolate_uncertainty(grids, speeds)
        except Exception as e:
            print("Couldn't estimate uncertainty. " + str(e))
            return 1.0  # continue anyway
        return 1.0

    return callback, speeds, grids

Define the reactant conditions, gas mixture and kinetic mechanism associated with the gas#

# Inlet Temperature in Kelvin and Inlet Pressure in Pascals
# In this case we are setting the inlet T and P to room temperature conditions
To = 300
Po = 101325

# Define the gas mixture and kinetics
# In this case, we are choosing a GRI3.0 gas
gas = ct.Solution("gri30.yaml")

# Create a stoichiometric CH4/Air premixed mixture
gas.set_equivalence_ratio(1.0, "CH4", {"O2": 1.0, "N2": 3.76})
gas.TP = To, Po

Define flame simulation conditions#

# Domain width in metres
width = 0.014

# Create the flame object
flame = ct.FreeFlame(gas, width=width)

# Define logging level
loglevel = 1

# Define tight tolerances for the solver
refine_criteria = {"ratio": 2, "slope": 0.01, "curve": 0.01}
flame.set_refine_criteria(**refine_criteria)

# Set maximum number of grid points to be very high (otherwise default is 1000)
flame.set_max_grid_points(flame.domains[flame.domain_index("flame")], 1e4)

# Set up the the callback function and lists of speeds and grids
callback, speeds, grids = make_callback(flame)
flame.set_steady_callback(callback)

Solve#

After the first five iterations, it will start to estimate the uncertainty.

flame.solve(loglevel=loglevel, auto=True)

Su0 = flame.velocity[0]
print(f"Flame Speed is: {Su0 * 100:.2f} cm/s")
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
************ Solving on 8 point grid with energy equation enabled ************

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.493

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003649  log(ss)= 4.613

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.006235   log(ss)= 3.334

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [9] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.028 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 0 1 2 3 4 5 6 7
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH3 NO NO2 O O2 OH T point 0 point 6 velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.75

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.041e-05  log(ss)= 5.661

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001948  log(ss)= 5.54

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.951e-05  log(ss)= 6.217

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003333  log(ss)= 5.466

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.977e-05  log(ss)= 6.035

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 1
Current flame speed is is 37.7200 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 2
Current flame speed is is 37.7202 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH NH2 NO NO2 O O2 OH T point 1 point 12 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001709  log(ss)= 5.031

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [32] point grid(s).
Iteration 3
Current flame speed is is 28.9151 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 2 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
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH NH2 NH3 NO NO2 O O2 OH T point 2 point 23 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 7.594e-05  log(ss)= 5.497

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [59] point grid(s).
Iteration 4
Current flame speed is is 39.1383 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCNN HCNO HCO HNCO HO2 N N2 N2O NCO NH NH2 NH3 NO NO2 O O2 OH T point 42 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [107] point grid(s).
Iteration 5
Current flame speed is is 37.7735 cm/s
Fitted true_speed is 36.6472 ± 5.2408 cm/s (14.3%)
Estimated error in final calculation -0.7%
Estimated total error 15.0%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 9 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 103 104 105
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NO NO2 O O2 OH T point 74 point 9 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [181] point grid(s).
Iteration 6
Current flame speed is is 37.3888 cm/s
Fitted true_speed is 41.1620 ± 3.0049 cm/s (7.3%)
Estimated error in final calculation -4.6%
Estimated total error 11.9%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 10 15 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 102 172 173 177 178 179
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NO NO2 O O2 OH T point 10 point 102 point 15 point 172 point 173 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [251] point grid(s).
Iteration 7
Current flame speed is is 37.3091 cm/s
Fitted true_speed is 36.6078 ± 0.1725 cm/s (0.5%)
Estimated error in final calculation 1.6%
Estimated total error 2.0%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 120 121 122 123 124 125 126 127 248 249
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [337] point grid(s).
Iteration 8
Current flame speed is is 37.3150 cm/s
Fitted true_speed is 37.0292 ± 0.0822 cm/s (0.2%)
Estimated error in final calculation 0.6%
Estimated total error 0.8%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 331
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCO HNCO HO2 N2 NO NO2 O O2 OH T point 331 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [428] point grid(s).
Iteration 9
Current flame speed is is 37.3516 cm/s
Fitted true_speed is 37.2883 ± 0.0617 cm/s (0.2%)
Estimated error in final calculation 0.1%
Estimated total error 0.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 228 420
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCO HO2 N2 NO2 O O2 OH T point 228 point 420 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [570] point grid(s).
Iteration 10
Current flame speed is is 37.3915 cm/s
Fitted true_speed is 37.4425 ± 0.0330 cm/s (0.1%)
Estimated error in final calculation -0.2%
Estimated total error 0.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO H H2 H2O H2O2 HCCO HCN HCO HO2 N2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [793] point grid(s).
Iteration 11
Current flame speed is is 37.4209 cm/s
Fitted true_speed is 37.5002 ± 0.0032 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
    to resolve C2H2 C2H3 C2H4 C2H5 C2H6 C3H8 CH CH2 CH2CO CH2OH CH3 CH3CHO CH3O CO H2O2 HCCO HCO HO2 OH
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [1042] point grid(s).
Iteration 12
Current flame speed is is 37.4537 cm/s
Fitted true_speed is 37.5175 ± 0.0092 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 217
    to resolve CH3O
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [1043] point grid(s).
Iteration 13
Current flame speed is is 37.4576 cm/s
Fitted true_speed is 37.5313 ± 0.0131 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%
no new points needed in flame
Flame Speed is: 37.46 cm/s

Use the final lists of grid sizes and flame speeds to make one final extrapolation “best guess”

flame speed convergence analysis
Fitted true_speed is 37.5313 ± 0.0131 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%

np.float64(0.3753128118313917)

Analyze the error predictions#

Now let’s see how good our error estimates were, with hindsight.

If we assume that the final answer, with a very fine grid, has actually converged and is is the “truth”, then we can find out how large the errors were in the previous values, and compare these with our estimated errors. This will show if our estimates are reasonable, or conservative, or too optimistic.

def analyze_errors(grids, speeds, true_speed):
    """
    If we assume that the final answer, with a very fine grid,
    has actually converged and is is the "truth", then we can
    find out how large the errors were in the previous values,
    and compare these with our estimated errors.
    This will show if our estimates are reasonable, or conservative, or too optimistic.
    """
    true_speed_estimates = np.full_like(speeds, np.nan)
    total_percent_error_estimates = np.full_like(speeds, np.nan)
    actual_extrapolated_percent_errors = np.full_like(speeds, np.nan)
    actual_raw_percent_errors = np.full_like(speeds, np.nan)
    for i in range(3, len(grids)):
        print(grids[: i + 1])
        true_speed_estimate, total_percent_error_estimate = extrapolate_uncertainty(
            grids[: i + 1], speeds[: i + 1], plot=False
        )
        actual_extrapolated_percent_error = (
            abs(true_speed_estimate - true_speed) / true_speed
        )
        actual_raw_percent_error = abs(speeds[i] - true_speed) / true_speed
        print(
            "Actual extrapolated error (with hindsight) "
            f"{actual_extrapolated_percent_error:.1%}"
        )
        print(f"Actual raw error (with hindsight) {actual_raw_percent_error:.1%}")

        true_speed_estimates[i] = true_speed_estimate
        total_percent_error_estimates[i] = total_percent_error_estimate
        actual_extrapolated_percent_errors[i] = actual_extrapolated_percent_error
        actual_raw_percent_errors[i] = actual_raw_percent_error
        print()

    fig, ax = plt.subplots()
    ax.loglog(grids, actual_raw_percent_errors * 100, "o-", label="raw error")
    ax.loglog(
        grids,
        actual_extrapolated_percent_errors * 100,
        "o-",
        label="extrapolated error",
    )
    ax.loglog(
        grids, total_percent_error_estimates * 100, "o-", label="estimated error"
    )
    ax.set(xlabel="Grid size", ylabel="Error in flame speed (%)")
    ax.legend()
    ax.set_title(flame.get_refine_criteria())
    ax.get_yaxis().set_major_formatter(matplotlib.ticker.PercentFormatter())
    flame.get_refine_criteria()

    data = pd.DataFrame(
        data={
            "actual error in raw value": actual_raw_percent_errors * 100,
            "actual error in extrapolated value": actual_extrapolated_percent_errors
            * 100,
            "estimated error": total_percent_error_estimates * 100,
        },
        index=grids,
    )
    return data


analyze_errors(grids, speeds, best_true_speed_estimate)
{'ratio': 2.0, 'slope': 0.01, 'curve': 0.01, 'prune': 0.0}
[17, 17, 32, 59]
Fitted true_speed is 34.1253 ± 7.0514 cm/s (20.7%)
Estimated error in final calculation 2.1%
Estimated total error 22.8%
Actual extrapolated error (with hindsight) 9.1%
Actual raw error (with hindsight) 4.3%

[17, 17, 32, 59, 107]
Fitted true_speed is 36.6472 ± 5.2408 cm/s (14.3%)
Estimated error in final calculation -0.7%
Estimated total error 15.0%
Actual extrapolated error (with hindsight) 2.4%
Actual raw error (with hindsight) 0.6%

[17, 17, 32, 59, 107, 181]
Fitted true_speed is 41.1620 ± 3.0049 cm/s (7.3%)
Estimated error in final calculation -4.6%
Estimated total error 11.9%
Actual extrapolated error (with hindsight) 9.7%
Actual raw error (with hindsight) 0.4%

[17, 17, 32, 59, 107, 181, 251]
Fitted true_speed is 36.6078 ± 0.1725 cm/s (0.5%)
Estimated error in final calculation 1.6%
Estimated total error 2.0%
Actual extrapolated error (with hindsight) 2.5%
Actual raw error (with hindsight) 0.6%

[17, 17, 32, 59, 107, 181, 251, 337]
Fitted true_speed is 37.0292 ± 0.0822 cm/s (0.2%)
Estimated error in final calculation 0.6%
Estimated total error 0.8%
Actual extrapolated error (with hindsight) 1.3%
Actual raw error (with hindsight) 0.6%

[17, 17, 32, 59, 107, 181, 251, 337, 428]
Fitted true_speed is 37.2883 ± 0.0617 cm/s (0.2%)
Estimated error in final calculation 0.1%
Estimated total error 0.3%
Actual extrapolated error (with hindsight) 0.6%
Actual raw error (with hindsight) 0.5%

[17, 17, 32, 59, 107, 181, 251, 337, 428, 570]
Fitted true_speed is 37.4425 ± 0.0330 cm/s (0.1%)
Estimated error in final calculation -0.2%
Estimated total error 0.3%
Actual extrapolated error (with hindsight) 0.2%
Actual raw error (with hindsight) 0.4%

[17, 17, 32, 59, 107, 181, 251, 337, 428, 570, 793]
Fitted true_speed is 37.5002 ± 0.0032 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%
Actual extrapolated error (with hindsight) 0.1%
Actual raw error (with hindsight) 0.3%

[17, 17, 32, 59, 107, 181, 251, 337, 428, 570, 793, 1042]
Fitted true_speed is 37.5175 ± 0.0092 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%
Actual extrapolated error (with hindsight) 0.0%
Actual raw error (with hindsight) 0.2%

[17, 17, 32, 59, 107, 181, 251, 337, 428, 570, 793, 1042, 1043]
Fitted true_speed is 37.5313 ± 0.0131 cm/s (0.0%)
Estimated error in final calculation -0.2%
Estimated total error 0.2%
Actual extrapolated error (with hindsight) 0.0%
Actual raw error (with hindsight) 0.2%
actual error in raw value actual error in extrapolated value estimated error
17 NaN NaN NaN
17 NaN NaN NaN
32 NaN NaN NaN
59 4.281769 9.075094 22.757240
107 0.645268 2.355644 14.967352
181 0.379666 9.673881 11.861242
251 0.592074 2.460562 2.045202
337 0.576373 1.337766 0.835049
428 0.478869 0.647471 0.254727
570 0.372459 0.236426 0.259108
793 0.294216 0.082943 0.219397
1042 0.206778 0.036834 0.207700
1043 0.196253 0.000000 0.242763


Repeat with less tight refine criteria#

refine_criteria = {"ratio": 3, "slope": 0.1, "curve": 0.1}

# Reset the gas
gas.set_equivalence_ratio(1.0, "CH4", {"O2": 1.0, "N2": 3.76})
gas.TP = To, Po

# Create a new flame object
flame = ct.FreeFlame(gas, width=width)

flame.set_refine_criteria(**refine_criteria)
flame.set_max_grid_points(flame.domains[flame.domain_index("flame")], 1e4)

callback, speeds, grids = make_callback(flame)
flame.set_steady_callback(callback)

# Define logging level
loglevel = 1

flame.solve(loglevel=loglevel, auto=True)

Su0 = flame.velocity[0]
print(f"Flame Speed is: {Su0 * 100:.2f} cm/s")

# Use the best true speed estimate from the fine grid tight criteria above
analyze_errors(grids, speeds, best_true_speed_estimate)
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • {'ratio': 3.0, 'slope': 0.1, 'curve': 0.1, 'prune': 0.0}
************ Solving on 8 point grid with energy equation enabled ************

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.493

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003649  log(ss)= 4.613

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.006235   log(ss)= 3.334

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [9] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.028 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 0 1 2 3 4 5 6 7
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH3 NO NO2 O O2 OH T velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.75

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.041e-05  log(ss)= 5.661

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001948  log(ss)= 5.54

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.951e-05  log(ss)= 6.217

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003333  log(ss)= 5.466

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.977e-05  log(ss)= 6.035

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 1
Current flame speed is is 37.7200 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 2
Current flame speed is is 37.7202 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 3 4 5 6 7 8 9
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH NH2 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001709  log(ss)= 5.031

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [24] point grid(s).
Iteration 3
Current flame speed is is 28.9255 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 6 7 8 9 10 11 12 13 14 19
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH NH2 NH3 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 7.594e-05  log(ss)= 5.496

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [34] point grid(s).
Iteration 4
Current flame speed is is 39.1617 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 8 9 10 11 12 13 14 15 16 17 20
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCNN HCNO HCO HNCO HO2 N N2 N2O NCO NH NH2 NH3 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [45] point grid(s).
Iteration 5
Current flame speed is is 37.8532 cm/s
Fitted true_speed is 38.2127 ± 8.2281 cm/s (21.5%)
Estimated error in final calculation -3.5%
Estimated total error 25.0%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 11 12 13 14 15 16 17 18 19 20 21 22 23
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [58] point grid(s).
Iteration 6
Current flame speed is is 37.5887 cm/s
Fitted true_speed is 45.7278 ± 5.3915 cm/s (11.8%)
Estimated error in final calculation -13.4%
Estimated total error 25.2%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 54
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [77] point grid(s).
Iteration 7
Current flame speed is is 37.7312 cm/s
Fitted true_speed is 36.2388 ± 0.7516 cm/s (2.1%)
Estimated error in final calculation 3.2%
Estimated total error 5.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO H H2 H2O H2O2 HCCO HCCOH HCN HCO HNCO HO2 N2 NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [105] point grid(s).
Iteration 8
Current flame speed is is 37.9687 cm/s
Fitted true_speed is 37.9306 ± 0.3235 cm/s (0.9%)
Estimated error in final calculation -0.2%
Estimated total error 1.1%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 30 31 32 33 34 35 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CO CH2OH CH3 CH3CHO CH3O HCCO HCO
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [134] point grid(s).
Iteration 9
Current flame speed is is 38.2864 cm/s
Fitted true_speed is 38.6933 ± 0.1932 cm/s (0.5%)
Estimated error in final calculation -1.3%
Estimated total error 1.8%
no new points needed in flame
Flame Speed is: 38.29 cm/s
[17, 17, 24, 34]
Fitted true_speed is 34.1328 ± 11.2002 cm/s (32.8%)
Estimated error in final calculation 3.2%
Estimated total error 36.0%
Actual extrapolated error (with hindsight) 9.1%
Actual raw error (with hindsight) 4.3%

[17, 17, 24, 34, 45]
Fitted true_speed is 38.2127 ± 8.2281 cm/s (21.5%)
Estimated error in final calculation -3.5%
Estimated total error 25.0%
Actual extrapolated error (with hindsight) 1.8%
Actual raw error (with hindsight) 0.9%

[17, 17, 24, 34, 45, 58]
Fitted true_speed is 45.7278 ± 5.3915 cm/s (11.8%)
Estimated error in final calculation -13.4%
Estimated total error 25.2%
Actual extrapolated error (with hindsight) 21.8%
Actual raw error (with hindsight) 0.2%

[17, 17, 24, 34, 45, 58, 77]
Fitted true_speed is 36.2388 ± 0.7516 cm/s (2.1%)
Estimated error in final calculation 3.2%
Estimated total error 5.3%
Actual extrapolated error (with hindsight) 3.4%
Actual raw error (with hindsight) 0.5%

[17, 17, 24, 34, 45, 58, 77, 105]
Fitted true_speed is 37.9306 ± 0.3235 cm/s (0.9%)
Estimated error in final calculation -0.2%
Estimated total error 1.1%
Actual extrapolated error (with hindsight) 1.1%
Actual raw error (with hindsight) 1.2%

[17, 17, 24, 34, 45, 58, 77, 105, 134]
Fitted true_speed is 38.6933 ± 0.1932 cm/s (0.5%)
Estimated error in final calculation -1.3%
Estimated total error 1.8%
Actual extrapolated error (with hindsight) 3.1%
Actual raw error (with hindsight) 2.0%
actual error in raw value actual error in extrapolated value estimated error
17 NaN NaN NaN
17 NaN NaN NaN
24 NaN NaN NaN
34 4.344206 9.055009 36.008025
45 0.857862 1.815665 25.045548
58 0.152931 21.839041 25.223109
77 0.532588 3.443707 5.304663
105 1.165439 1.063967 1.088027
134 2.011916 3.096213 1.805893


Default (loose) criteria#

flame = ct.FreeFlame(gas, width=width)
refine_criteria = flame.get_refine_criteria()
refine_criteria.update({"prune": 0})
refine_criteria

gas.set_equivalence_ratio(1.0, "CH4", {"O2": 1.0, "N2": 3.76})
gas.TP = To, Po

# Create a new flame object
flame = ct.FreeFlame(gas, width=width)

flame.set_refine_criteria(**refine_criteria)
flame.set_max_grid_points(flame.domains[flame.domain_index("flame")], 1e4)

callback, speeds, grids = make_callback(flame)
flame.set_steady_callback(callback)

# Define logging level
loglevel = 1

flame.solve(loglevel=loglevel, auto=True)

Su0 = flame.velocity[0]
print(f"Flame Speed is: {Su0 * 100:.2f} cm/s")

analyze_errors(grids, speeds, best_true_speed_estimate)
  • flame speed convergence analysis
  • flame speed convergence analysis
  • {'ratio': 10.0, 'slope': 0.8, 'curve': 0.8, 'prune': 0.0}
************ Solving on 8 point grid with energy equation enabled ************

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.493

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003649  log(ss)= 4.613

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.006235   log(ss)= 3.334

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [9] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.028 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 2 3 4 5
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CO CO2 H H2 H2O2 HCCO HCN HCNO HCO HNCO HO2 N2 N2O NH3 NO2 O O2 OH
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.75

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.041e-05  log(ss)= 5.661

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001948  log(ss)= 5.543

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 9.753e-06  log(ss)= 6.508

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001666  log(ss)= 5.443

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 8.788e-06  log(ss)= 6.658

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0002252  log(ss)= 4.757

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [13] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.056 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 3 4 5
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCN HCO HNCO HO2 N N2 NCO NO NO2 O O2 OH T velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.76

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.041e-05  log(ss)= 5.687

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0007794  log(ss)= 4.522

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.463e-05  log(ss)= 6.467

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 8.332e-05  log(ss)= 5.943

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.483e-05  log(ss)= 6.238

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 8.446e-05  log(ss)= 6.077

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 4.509e-05  log(ss)= 5.768

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0005136  log(ss)= 4.922

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.286e-05  log(ss)= 6.706

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003295  log(ss)= 4.685

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.008444   log(ss)= 2.695

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [16] point grid(s).
Iteration 1
Current flame speed is is 37.7339 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [16] point grid(s).
Iteration 2
Current flame speed is is 37.7337 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 4 5 6
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCN HCO HNCO HO2 N N2 NCO NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001709  log(ss)= 5.036

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [19] point grid(s).
Iteration 3
Current flame speed is is 29.0621 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 5 6 7 8
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CO H H2 H2O2 HCCO HCCOH HCN HCNO HCO HNCO N2 NH3 NO2 O OH
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 7.594e-05  log(ss)= 5.505

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [23] point grid(s).
Iteration 4
Current flame speed is is 40.2404 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 6 7 8 9 10
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO H2O H2O2 HCCO HCCOH HCN HCNO HCO HNCO N N2 NCO O OH velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [28] point grid(s).
Iteration 5
Current flame speed is is 39.8788 cm/s
Fitted true_speed is 45.8608 ± 14.4144 cm/s (31.4%)
Estimated error in final calculation -14.6%
Estimated total error 46.1%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 9 10 11 12
    to resolve C C2H2 C2H3 C2H4 C2H5 C3H7 C3H8 CH2 CH2(S) CH2OH CH3CHO HCCO HCCOH HCNO HCO
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [32] point grid(s).
Iteration 6
Current flame speed is is 42.1753 cm/s
Fitted true_speed is 60.8599 ± 8.3884 cm/s (13.8%)
Estimated error in final calculation -29.0%
Estimated total error 42.8%
no new points needed in flame
Flame Speed is: 42.18 cm/s
[16, 16, 19, 23]
Fitted true_speed is 37.6557 ± 21.1380 cm/s (56.1%)
Estimated error in final calculation -3.1%
Estimated total error 59.2%
Actual extrapolated error (with hindsight) 0.3%
Actual raw error (with hindsight) 7.2%

[16, 16, 19, 23, 28]
Fitted true_speed is 45.8608 ± 14.4144 cm/s (31.4%)
Estimated error in final calculation -14.6%
Estimated total error 46.1%
Actual extrapolated error (with hindsight) 22.2%
Actual raw error (with hindsight) 6.3%

[16, 16, 19, 23, 28, 32]
Fitted true_speed is 60.8599 ± 8.3884 cm/s (13.8%)
Estimated error in final calculation -29.0%
Estimated total error 42.8%
Actual extrapolated error (with hindsight) 62.2%
Actual raw error (with hindsight) 12.4%
actual error in raw value actual error in extrapolated value estimated error
16 NaN NaN NaN
16 NaN NaN NaN
19 NaN NaN NaN
23 7.218335 0.331511 59.191320
28 6.254818 22.193552 46.069401
32 12.373704 62.157871 42.777567


Middling refine criteria#

refine_criteria = {"ratio": 3, "slope": 0.1, "curve": 0.1}

# Reset the gas
gas.set_equivalence_ratio(1.0, "CH4", {"O2": 1.0, "N2": 3.76})
gas.TP = To, Po

# Create a new flame object
flame = ct.FreeFlame(gas, width=width)

flame.set_refine_criteria(**refine_criteria)
flame.set_max_grid_points(flame.domains[flame.domain_index("flame")], 1e4)

callback, speeds, grids = make_callback(flame)
flame.set_steady_callback(callback)

# Define logging level
loglevel = 1

flame.solve(loglevel=loglevel, auto=True)

Su0 = flame.velocity[0]
print(f"Flame Speed is: {Su0 * 100:.2f} cm/s")
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
************ Solving on 8 point grid with energy equation enabled ************

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.493

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003649  log(ss)= 4.613

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.006235   log(ss)= 3.334

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [9] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.028 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 0 1 2 3 4 5 6 7
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH3 NO NO2 O O2 OH T velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.136e-05  log(ss)= 5.75

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.041e-05  log(ss)= 5.661

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001948  log(ss)= 5.54

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.951e-05  log(ss)= 6.217

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0003333  log(ss)= 5.466

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 1.977e-05  log(ss)= 6.035

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 1
Current flame speed is is 37.7200 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 2
Current flame speed is is 37.7202 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 3 4 5 6 7 8 9
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH NH2 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001709  log(ss)= 5.031

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [24] point grid(s).
Iteration 3
Current flame speed is is 28.9255 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 6 7 8 9 10 11 12 13 14 19
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NH NH2 NH3 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 7.594e-05  log(ss)= 5.496

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [34] point grid(s).
Iteration 4
Current flame speed is is 39.1617 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 8 9 10 11 12 13 14 15 16 17 20
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO CO2 H H2 H2O H2O2 HCCO HCCOH HCN HCNN HCNO HCO HNCO HO2 N N2 N2O NCO NH NH2 NH3 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [45] point grid(s).
Iteration 5
Current flame speed is is 37.8532 cm/s
Fitted true_speed is 38.2127 ± 8.2281 cm/s (21.5%)
Estimated error in final calculation -3.5%
Estimated total error 25.0%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 11 12 13 14 15 16 17 18 19 20 21 22 23
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 N2O NCO NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [58] point grid(s).
Iteration 6
Current flame speed is is 37.5887 cm/s
Fitted true_speed is 45.7278 ± 5.3915 cm/s (11.8%)
Estimated error in final calculation -13.4%
Estimated total error 25.2%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 54
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH 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 N N2 NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [77] point grid(s).
Iteration 7
Current flame speed is is 37.7312 cm/s
Fitted true_speed is 36.2388 ± 0.7516 cm/s (2.1%)
Estimated error in final calculation 3.2%
Estimated total error 5.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
    to resolve C C2H C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CHO CH2CO CH2O CH2OH CH3 CH3CHO CH3O CH3OH CH4 CO H H2 H2O H2O2 HCCO HCCOH HCN HCO HNCO HO2 N2 NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [105] point grid(s).
Iteration 8
Current flame speed is is 37.9687 cm/s
Fitted true_speed is 37.9306 ± 0.3235 cm/s (0.9%)
Estimated error in final calculation -0.2%
Estimated total error 1.1%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 30 31 32 33 34 35 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
    to resolve C C2H2 C2H3 C2H4 C2H5 C2H6 C3H7 C3H8 CH CH2 CH2(S) CH2CO CH2OH CH3 CH3CHO CH3O HCCO HCO
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [134] point grid(s).
Iteration 9
Current flame speed is is 38.2864 cm/s
Fitted true_speed is 38.6933 ± 0.1932 cm/s (0.5%)
Estimated error in final calculation -1.3%
Estimated total error 1.8%
no new points needed in flame
Flame Speed is: 38.29 cm/s
{'ratio': 3.0, 'slope': 0.1, 'curve': 0.1, 'prune': 0.0}
[17, 17, 24, 34]
Fitted true_speed is 34.1328 ± 11.2002 cm/s (32.8%)
Estimated error in final calculation 3.2%
Estimated total error 36.0%
Actual extrapolated error (with hindsight) 9.1%
Actual raw error (with hindsight) 4.3%

[17, 17, 24, 34, 45]
Fitted true_speed is 38.2127 ± 8.2281 cm/s (21.5%)
Estimated error in final calculation -3.5%
Estimated total error 25.0%
Actual extrapolated error (with hindsight) 1.8%
Actual raw error (with hindsight) 0.9%

[17, 17, 24, 34, 45, 58]
Fitted true_speed is 45.7278 ± 5.3915 cm/s (11.8%)
Estimated error in final calculation -13.4%
Estimated total error 25.2%
Actual extrapolated error (with hindsight) 21.8%
Actual raw error (with hindsight) 0.2%

[17, 17, 24, 34, 45, 58, 77]
Fitted true_speed is 36.2388 ± 0.7516 cm/s (2.1%)
Estimated error in final calculation 3.2%
Estimated total error 5.3%
Actual extrapolated error (with hindsight) 3.4%
Actual raw error (with hindsight) 0.5%

[17, 17, 24, 34, 45, 58, 77, 105]
Fitted true_speed is 37.9306 ± 0.3235 cm/s (0.9%)
Estimated error in final calculation -0.2%
Estimated total error 1.1%
Actual extrapolated error (with hindsight) 1.1%
Actual raw error (with hindsight) 1.2%

[17, 17, 24, 34, 45, 58, 77, 105, 134]
Fitted true_speed is 38.6933 ± 0.1932 cm/s (0.5%)
Estimated error in final calculation -1.3%
Estimated total error 1.8%
Actual extrapolated error (with hindsight) 3.1%
Actual raw error (with hindsight) 2.0%
actual error in raw value actual error in extrapolated value estimated error
17 NaN NaN NaN
17 NaN NaN NaN
24 NaN NaN NaN
34 4.344206 9.055009 36.008025
45 0.857862 1.815665 25.045548
58 0.152931 21.839041 25.223109
77 0.532588 3.443707 5.304663
105 1.165439 1.063967 1.088027
134 2.011916 3.096213 1.805893


Try a Hydrogen flame (still with GRI mech)#

# Tight criteria
refine_criteria = {"ratio": 2, "slope": 0.01, "curve": 0.01}

# Reset the gas
gas.set_equivalence_ratio(1.0, "H2", {"O2": 1.0, "N2": 3.76})
gas.TP = To, Po

# Create a new flame object
flame = ct.FreeFlame(gas, width=width)

flame.set_refine_criteria(**refine_criteria)
flame.set_max_grid_points(flame.domains[flame.domain_index("flame")], 1e4)

callback, speeds, grids = make_callback(flame)
flame.set_steady_callback(callback)

# Define logging level
loglevel = 1

flame.solve(loglevel=loglevel, auto=True)

Su0 = flame.velocity[0]
print(f"Flame Speed is: {Su0 * 100:.2f} cm/s")
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
************ Solving on 8 point grid with energy equation enabled ************

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 4.746e-06  log(ss)= 7.177

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001216  log(ss)= 5.206

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [9] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.028 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 0 1 2 3 4 5 6 7
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T point 0 point 6 velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.56e-06   log(ss)= 7.324

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.703e-05  log(ss)= 6.008

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 1
Current flame speed is is 130.4379 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 2
Current flame speed is is 130.4378 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T point 1 point 12 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001709  log(ss)= 4.991

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [32] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.056 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 2 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T point 2 point 23 velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.373e-06  log(ss)= 7.465

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 6.007e-06  log(ss)= 7.356

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 6.842e-05  log(ss)= 5.897

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [57] point grid(s).
Iteration 3
Current flame speed is is 266.3981 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [57] point grid(s).
Iteration 4
Current flame speed is is 266.3976 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 7 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T point 40 point 7 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0002563  log(ss)= 4.29

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [102] point grid(s).
Iteration 5
Current flame speed is is 338.1343 cm/s
Fitted true_speed is 348.7820 ± 20.7897 cm/s (6.0%)
Estimated error in final calculation -10.7%
Estimated total error 16.6%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 6 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T point 6 point 69 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [169] point grid(s).
Iteration 6
Current flame speed is is 291.7385 cm/s
Fitted true_speed is 338.2877 ± 43.0117 cm/s (12.7%)
Estimated error in final calculation -6.6%
Estimated total error 19.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 58 59 60 61 62 63 166 167
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [209] point grid(s).
Iteration 7
Current flame speed is is 262.8029 cm/s
Fitted true_speed is 294.8357 ± 45.5419 cm/s (15.4%)
Estimated error in final calculation -0.9%
Estimated total error 16.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 85 205 206 207
    to resolve H H2 H2O H2O2 HO2 N2 N2O NO O O2 OH T point 85 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [254] point grid(s).
Iteration 8
Current flame speed is is 248.0358 cm/s
Fitted true_speed is 192.8185 ± 11.3247 cm/s (5.9%)
Estimated error in final calculation 30.9%
Estimated total error 36.7%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 105 128 246 250 251 252
    to resolve H H2 H2O H2O2 HO2 N2 NO O O2 OH T point 105 point 128 point 246 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [309] point grid(s).
Iteration 9
Current flame speed is is 240.5816 cm/s
Fitted true_speed is 174.5868 ± 10.8210 cm/s (6.2%)
Estimated error in final calculation 35.8%
Estimated total error 42.0%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 26 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 296 305 306 307
    to resolve H H2 H2O H2O2 HO2 N2 NO O O2 OH T point 26 point 296 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [376] point grid(s).
Iteration 10
Current flame speed is is 236.8064 cm/s
Fitted true_speed is 202.1666 ± 6.5242 cm/s (3.2%)
Estimated error in final calculation 16.2%
Estimated total error 19.4%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 25 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 368 373 374
    to resolve H H2 H2O H2O2 HO2 N2 NO O O2 OH T point 25 point 368 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [471] point grid(s).
Iteration 11
Current flame speed is is 234.8980 cm/s
Fitted true_speed is 218.3274 ± 3.5282 cm/s (1.6%)
Estimated error in final calculation 7.1%
Estimated total error 8.7%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
    to resolve H H2 H2O H2O2 HO2 N2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [616] point grid(s).
Iteration 12
Current flame speed is is 233.9327 cm/s
Fitted true_speed is 226.6729 ± 1.8472 cm/s (0.8%)
Estimated error in final calculation 2.9%
Estimated total error 3.8%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
    to resolve H H2 H2O H2O2 HO2 N2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [814] point grid(s).
Iteration 13
Current flame speed is is 233.4622 cm/s
Fitted true_speed is 230.3336 ± 0.7462 cm/s (0.3%)
Estimated error in final calculation 1.2%
Estimated total error 1.6%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 69 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 470
    to resolve H2O2 HO2 OH T point 470 point 69 velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [931] point grid(s).
Iteration 14
Current flame speed is is 233.1788 cm/s
Fitted true_speed is 231.4467 ± 0.1832 cm/s (0.1%)
Estimated error in final calculation 0.7%
Estimated total error 0.8%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 588
    to resolve HO2 point 588
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [974] point grid(s).
Iteration 15
Current flame speed is is 233.1398 cm/s
Fitted true_speed is 231.7637 ± 0.1081 cm/s (0.0%)
Estimated error in final calculation 0.6%
Estimated total error 0.6%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 197 282
    to resolve point 197 point 282
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [976] point grid(s).
Iteration 16
Current flame speed is is 233.1284 cm/s
Fitted true_speed is 231.4473 ± 0.1372 cm/s (0.1%)
Estimated error in final calculation 0.7%
Estimated total error 0.8%
no new points needed in flame
Flame Speed is: 233.13 cm/s

get a new best true speed estimate

flame speed convergence analysis
Fitted true_speed is 231.4473 ± 0.1372 cm/s (0.1%)
Estimated error in final calculation 0.7%
Estimated total error 0.8%
{'ratio': 2.0, 'slope': 0.01, 'curve': 0.01, 'prune': 0.0}
[17, 17, 57, 57]
Fitted true_speed is 324.1808 ± 0.0002 cm/s (0.0%)
Estimated error in final calculation -17.8%
Estimated total error 17.8%
Actual extrapolated error (with hindsight) 40.1%
Actual raw error (with hindsight) 15.1%

[17, 17, 57, 57, 102]
Fitted true_speed is 348.7820 ± 20.7897 cm/s (6.0%)
Estimated error in final calculation -10.7%
Estimated total error 16.6%
Actual extrapolated error (with hindsight) 50.7%
Actual raw error (with hindsight) 46.1%

[17, 17, 57, 57, 102, 169]
Fitted true_speed is 338.2877 ± 43.0117 cm/s (12.7%)
Estimated error in final calculation -6.6%
Estimated total error 19.3%
Actual extrapolated error (with hindsight) 46.2%
Actual raw error (with hindsight) 26.0%

[17, 17, 57, 57, 102, 169, 209]
Fitted true_speed is 294.8357 ± 45.5419 cm/s (15.4%)
Estimated error in final calculation -0.9%
Estimated total error 16.3%
Actual extrapolated error (with hindsight) 27.4%
Actual raw error (with hindsight) 13.5%

[17, 17, 57, 57, 102, 169, 209, 254]
Fitted true_speed is 192.8185 ± 11.3247 cm/s (5.9%)
Estimated error in final calculation 30.9%
Estimated total error 36.7%
Actual extrapolated error (with hindsight) 16.7%
Actual raw error (with hindsight) 7.2%

[17, 17, 57, 57, 102, 169, 209, 254, 309]
Fitted true_speed is 174.5868 ± 10.8210 cm/s (6.2%)
Estimated error in final calculation 35.8%
Estimated total error 42.0%
Actual extrapolated error (with hindsight) 24.6%
Actual raw error (with hindsight) 3.9%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376]
Fitted true_speed is 202.1666 ± 6.5242 cm/s (3.2%)
Estimated error in final calculation 16.2%
Estimated total error 19.4%
Actual extrapolated error (with hindsight) 12.7%
Actual raw error (with hindsight) 2.3%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376, 471]
Fitted true_speed is 218.3274 ± 3.5282 cm/s (1.6%)
Estimated error in final calculation 7.1%
Estimated total error 8.7%
Actual extrapolated error (with hindsight) 5.7%
Actual raw error (with hindsight) 1.5%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376, 471, 616]
Fitted true_speed is 226.6729 ± 1.8472 cm/s (0.8%)
Estimated error in final calculation 2.9%
Estimated total error 3.8%
Actual extrapolated error (with hindsight) 2.1%
Actual raw error (with hindsight) 1.1%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376, 471, 616, 814]
Fitted true_speed is 230.3336 ± 0.7462 cm/s (0.3%)
Estimated error in final calculation 1.2%
Estimated total error 1.6%
Actual extrapolated error (with hindsight) 0.5%
Actual raw error (with hindsight) 0.9%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376, 471, 616, 814, 931]
Fitted true_speed is 231.4467 ± 0.1832 cm/s (0.1%)
Estimated error in final calculation 0.7%
Estimated total error 0.8%
Actual extrapolated error (with hindsight) 0.0%
Actual raw error (with hindsight) 0.7%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376, 471, 616, 814, 931, 974]
Fitted true_speed is 231.7637 ± 0.1081 cm/s (0.0%)
Estimated error in final calculation 0.6%
Estimated total error 0.6%
Actual extrapolated error (with hindsight) 0.1%
Actual raw error (with hindsight) 0.7%

[17, 17, 57, 57, 102, 169, 209, 254, 309, 376, 471, 616, 814, 931, 974, 976]
Fitted true_speed is 231.4473 ± 0.1372 cm/s (0.1%)
Estimated error in final calculation 0.7%
Estimated total error 0.8%
Actual extrapolated error (with hindsight) 0.0%
Actual raw error (with hindsight) 0.7%
actual error in raw value actual error in extrapolated value estimated error
17 NaN NaN NaN
17 NaN NaN NaN
57 NaN NaN NaN
57 15.100768 40.066795 17.824380
102 46.095568 50.696071 16.632392
169 26.049630 46.161856 19.272103
209 13.547621 27.387804 16.311032
254 7.167270 16.690129 36.734136
309 3.946571 24.567373 41.955245
376 2.315447 12.651125 19.387024
471 1.490897 5.668654 8.693307
616 1.073847 2.062856 3.750758
814 0.870567 0.481193 1.565018
931 0.748096 0.000266 0.822162
974 0.731241 0.136702 0.642227
976 0.726348 0.000000 0.783220


Middling refine criteria, Hydrogen flame#

refine_criteria = {"ratio": 3, "slope": 0.1, "curve": 0.1}

# Reset the gas
gas.set_equivalence_ratio(1.0, "H2", {"O2": 1.0, "N2": 3.76})
gas.TP = To, Po

# Create a new flame object
flame = ct.FreeFlame(gas, width=width)

flame.set_refine_criteria(**refine_criteria)
flame.set_max_grid_points(flame.domains[flame.domain_index("flame")], 1e4)

callback, speeds, grids = make_callback(flame)
flame.set_steady_callback(callback)

# Define logging level
loglevel = 1

flame.solve(loglevel=loglevel, auto=True)

Su0 = flame.velocity[0]
print(f"Flame Speed is: {Su0 * 100:.2f} cm/s")
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
  • flame speed convergence analysis
************ Solving on 8 point grid with energy equation enabled ************

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 4.746e-06  log(ss)= 7.177

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001216  log(ss)= 5.206

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [9] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.028 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 0 1 2 3 4 5 6 7
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.56e-06   log(ss)= 7.324

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 2.703e-05  log(ss)= 6.008

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 1
Current flame speed is is 130.4379 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [17] point grid(s).
Iteration 2
Current flame speed is is 130.4378 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 3 4 5 6 7 8 9 12 13 14 15
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001709  log(ss)= 4.991

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [28] point grid(s).
Expanding domain to accommodate flame thickness. New width: 0.056 m
##############################################################################
Refining grid in flame.
    New points inserted after grid points 6 7 8 9 10 11 12 13
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T velocity
##############################################################################

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 3.56e-06   log(ss)= 7.489

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 9.01e-06   log(ss)= 7.205

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0001026  log(ss)= 5.524

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [36] point grid(s).
Iteration 3
Current flame speed is is 266.3992 cm/s
grid refinement disabled.

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

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [36] point grid(s).
Iteration 4
Current flame speed is is 266.3977 cm/s
##############################################################################
Refining grid in flame.
    New points inserted after grid points 9 10 11 12 13 14 15
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve failed.

Attempt 10 timesteps.
Final timestep info: dt= 0.0002563  log(ss)= 4.159

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [43] point grid(s).
Iteration 5
Current flame speed is is 338.1343 cm/s
Fitted true_speed is 425.6833 ± 37.1255 cm/s (8.7%)
Estimated error in final calculation -27.8%
Estimated total error 36.6%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 12 13 14 15 16 17 18 19
    to resolve H H2 H2O H2O2 HO2 N N2 N2O NNH NO NO2 O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [51] point grid(s).
Iteration 6
Current flame speed is is 291.7345 cm/s
Fitted true_speed is 407.7913 ± 124.8083 cm/s (30.6%)
Estimated error in final calculation -22.9%
Estimated total error 53.5%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 14 15 16 17 18 19 20 21 22 23
    to resolve H H2 H2O H2O2 HO2 N2 N2O NNH NO O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [61] point grid(s).
Iteration 7
Current flame speed is is 262.7958 cm/s
Fitted true_speed is 267.9033 ± 110.0674 cm/s (41.1%)
Estimated error in final calculation 6.1%
Estimated total error 47.2%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 17 18 19 20 21 22 23 24 25 26 27 28 29
    to resolve H H2 H2O H2O2 HO2 N2 NO O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [74] point grid(s).
Iteration 8
Current flame speed is is 247.9646 cm/s
Fitted true_speed is 115.6064 ± 22.0935 cm/s (19.1%)
Estimated error in final calculation 108.9%
Estimated total error 128.1%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
    to resolve H H2 H2O H2O2 HO2 N2 NO O O2 OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [92] point grid(s).
Iteration 9
Current flame speed is is 240.4975 cm/s
Fitted true_speed is 172.3652 ± 15.3920 cm/s (8.9%)
Estimated error in final calculation 36.9%
Estimated total error 45.9%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
    to resolve H2O2 HO2 N2 O OH T velocity
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [113] point grid(s).
Iteration 10
Current flame speed is is 236.3507 cm/s
Fitted true_speed is 203.6938 ± 6.4115 cm/s (3.1%)
Estimated error in final calculation 15.1%
Estimated total error 18.3%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 27 28 29 30 31 32 33 34 35 36 37 38 39 40
    to resolve H2O2 HO2
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [127] point grid(s).
Iteration 11
Current flame speed is is 234.0603 cm/s
Fitted true_speed is 214.6007 ± 1.3560 cm/s (0.6%)
Estimated error in final calculation 9.0%
Estimated total error 9.6%
##############################################################################
Refining grid in flame.
    New points inserted after grid points 39 40 41 42 43
    to resolve HO2
##############################################################################

Attempt Newton solution of steady-state problem.
Newton steady-state solve succeeded.

Problem solved on [132] point grid(s).
Iteration 12
Current flame speed is is 233.7520 cm/s
Fitted true_speed is 217.7925 ± 0.5751 cm/s (0.3%)
Estimated error in final calculation 7.3%
Estimated total error 7.5%
no new points needed in flame
Flame Speed is: 233.75 cm/s
{'ratio': 3.0, 'slope': 0.1, 'curve': 0.1, 'prune': 0.0}
[17, 17, 36, 36]
Fitted true_speed is 388.0474 ± 0.0012 cm/s (0.0%)
Estimated error in final calculation -31.3%
Estimated total error 31.3%
Actual extrapolated error (with hindsight) 67.7%
Actual raw error (with hindsight) 15.1%

[17, 17, 36, 36, 43]
Fitted true_speed is 425.6833 ± 37.1255 cm/s (8.7%)
Estimated error in final calculation -27.8%
Estimated total error 36.6%
Actual extrapolated error (with hindsight) 83.9%
Actual raw error (with hindsight) 46.1%

[17, 17, 36, 36, 43, 51]
Fitted true_speed is 407.7913 ± 124.8083 cm/s (30.6%)
Estimated error in final calculation -22.9%
Estimated total error 53.5%
Actual extrapolated error (with hindsight) 76.2%
Actual raw error (with hindsight) 26.0%

[17, 17, 36, 36, 43, 51, 61]
Fitted true_speed is 267.9033 ± 110.0674 cm/s (41.1%)
Estimated error in final calculation 6.1%
Estimated total error 47.2%
Actual extrapolated error (with hindsight) 15.8%
Actual raw error (with hindsight) 13.5%

[17, 17, 36, 36, 43, 51, 61, 74]
Fitted true_speed is 115.6064 ± 22.0935 cm/s (19.1%)
Estimated error in final calculation 108.9%
Estimated total error 128.1%
Actual extrapolated error (with hindsight) 50.1%
Actual raw error (with hindsight) 7.1%

[17, 17, 36, 36, 43, 51, 61, 74, 92]
Fitted true_speed is 172.3652 ± 15.3920 cm/s (8.9%)
Estimated error in final calculation 36.9%
Estimated total error 45.9%
Actual extrapolated error (with hindsight) 25.5%
Actual raw error (with hindsight) 3.9%

[17, 17, 36, 36, 43, 51, 61, 74, 92, 113]
Fitted true_speed is 203.6938 ± 6.4115 cm/s (3.1%)
Estimated error in final calculation 15.1%
Estimated total error 18.3%
Actual extrapolated error (with hindsight) 12.0%
Actual raw error (with hindsight) 2.1%

[17, 17, 36, 36, 43, 51, 61, 74, 92, 113, 127]
Fitted true_speed is 214.6007 ± 1.3560 cm/s (0.6%)
Estimated error in final calculation 9.0%
Estimated total error 9.6%
Actual extrapolated error (with hindsight) 7.3%
Actual raw error (with hindsight) 1.1%

[17, 17, 36, 36, 43, 51, 61, 74, 92, 113, 127, 132]
Fitted true_speed is 217.7925 ± 0.5751 cm/s (0.3%)
Estimated error in final calculation 7.3%
Estimated total error 7.5%
Actual extrapolated error (with hindsight) 5.9%
Actual raw error (with hindsight) 1.0%
actual error in raw value actual error in extrapolated value estimated error
17 NaN NaN NaN
17 NaN NaN NaN
36 NaN NaN NaN
36 15.100773 67.661214 31.349294
43 46.095574 83.922336 36.560790
51 26.047902 76.191849 53.494631
61 13.544560 15.751318 47.233042
74 7.136531 50.050649 128.051672
92 3.910234 25.527233 45.850260
113 2.118583 11.991311 18.278404
127 1.128991 7.278821 9.599799
132 0.995784 5.899745 7.532729


Total running time of the script: (2 minutes 39.206 seconds)

Gallery generated by Sphinx-Gallery