[Examples] Embed fixed temperature file for burner-stabilized flame

This commit is contained in:
Ray Speth 2023-10-02 22:04:40 -04:00 committed by Ray Speth
parent 5dacf66bda
commit 3903cacf30
3 changed files with 36 additions and 81 deletions

View File

@ -89,8 +89,6 @@ skip_run = {
# multiprocessing can't see functions defined in __main__ when run by
# sphinx-gallery, at least on macOS.
"multiprocessing_viscosity.py",
# __file__ deliberately not available when run by sphinx-gallery
"flame_fixed_T.py",
}
def executable_script(src_file, gallery_conf):

View File

@ -44,11 +44,42 @@ f = ct.BurnerFlame(gas=gas, width=width)
f.burner.mdot = mdot
# %%
# Read temperature vs. position data from a file.
# The file is assumed to have one z, T pair per line, separated by a comma.
# The data file must be stored in the same folder as this script.
data_file = Path(__file__).parent.joinpath('tdata.dat')
zloc, tvalues = np.genfromtxt(str(data_file), delimiter=',', comments='#').T
# Specify temperature vs. position data. For the purposes of this example, the data
# is embedded directly. For more general use, the temperature profile should be stored
# as a separate data file and read in, for example using `np.genfromtxt`.
zloc = np.array([
0. , 0.00015625, 0.00023437, 0.00039063, 0.00046875, 0.00050781,
0.00054688, 0.000625 , 0.00066406, 0.00070312, 0.00074219, 0.00078125,
0.00082031, 0.00085938, 0.00089844, 0.0009375 , 0.00101563, 0.00105469,
0.00109375, 0.00113281, 0.00117187, 0.00121094, 0.00125 , 0.00128906,
0.00132813, 0.00136719, 0.00140625, 0.00144531, 0.00148438, 0.00152344,
0.0015625 , 0.00160156, 0.00164062, 0.00171875, 0.00175781, 0.00179688,
0.00183594, 0.001875 , 0.00191406, 0.00195312, 0.00199219, 0.00203125,
0.00207031, 0.00210938, 0.00214844, 0.0021875 , 0.00222656, 0.00226562,
0.00230469, 0.00234375, 0.00238281, 0.00242187, 0.00246094, 0.0025 ,
0.00257813, 0.00265625, 0.00273437, 0.0028125 , 0.00289062, 0.00296875,
0.00304688, 0.003125 , 0.00328125, 0.0034375 , 0.00359375, 0.00375 ,
0.00390625, 0.0087 , 0.01
])
tvalues = np.array([
373.7 , 465.4070428, 510.4311676, 599.5552837, 643.8342938,
665.9335545, 688.0122338, 732.1284327, 754.1744755, 776.2170662,
798.2588757, 820.3020011, 842.348001 , 864.3979228, 886.4523159,
908.5112198, 952.6396629, 974.7018199, 996.7515831, 1018.777651 ,
1040.765863 , 1062.69948 , 1084.558639 , 1106.320078 , 1127.956918 ,
1149.438472 , 1170.730129 , 1191.793309 , 1212.585506 , 1233.060477 ,
1253.168589 , 1272.857384 , 1292.072391 , 1328.859767 , 1346.323998 ,
1363.101361 , 1379.147594 , 1394.425274 , 1408.905834 , 1422.569115 ,
1435.40408 , 1447.410648 , 1458.597668 , 1468.982722 , 1478.590978 ,
1487.453914 , 1495.607879 , 1503.092709 , 1509.950449 , 1516.224147 ,
1521.956853 , 1527.19079 , 1531.966722 , 1536.32348 , 1543.891739 ,
1550.203579 , 1555.480771 , 1559.908135 , 1563.637879 , 1566.794144 ,
1569.477867 , 1571.77099 , 1575.385829 , 1578.108169 , 1580.194856 ,
1581.820666 , 1583.106578 , 1589.51315 , 1589.578955
])
zloc /= max(zloc)
# set the temperature profile to the values read in

View File

@ -1,74 +0,0 @@
#
# This data file lists temperature vs. height values for a burner-stabilized flame.
# This file is used by example 'fixed_T_flame.py'.
#
0, 373.7
0.00015625, 465.4070428
0.000234375, 510.4311676
0.000390625, 599.5552837
0.00046875, 643.8342938
0.000507813, 665.9335545
0.000546875, 688.0122338
0.000625, 732.1284327
0.000664062, 754.1744755
0.000703125, 776.2170662
0.000742188, 798.2588757
0.00078125, 820.3020011
0.000820313, 842.348001
0.000859375, 864.3979228
0.000898437, 886.4523159
0.0009375, 908.5112198
0.001015625, 952.6396629
0.001054688, 974.7018199
0.00109375, 996.7515831
0.001132813, 1018.777651
0.001171875, 1040.765863
0.001210938, 1062.69948
0.00125, 1084.558639
0.001289062, 1106.320078
0.001328125, 1127.956918
0.001367187, 1149.438472
0.00140625, 1170.730129
0.001445313, 1191.793309
0.001484375, 1212.585506
0.001523438, 1233.060477
0.0015625, 1253.168589
0.001601563, 1272.857384
0.001640625, 1292.072391
0.00171875, 1328.859767
0.001757812, 1346.323998
0.001796875, 1363.101361
0.001835937, 1379.147594
0.001875, 1394.425274
0.001914063, 1408.905834
0.001953125, 1422.569115
0.001992188, 1435.40408
0.00203125, 1447.410648
0.002070313, 1458.597668
0.002109375, 1468.982722
0.002148438, 1478.590978
0.0021875, 1487.453914
0.002226563, 1495.607879
0.002265625, 1503.092709
0.002304688, 1509.950449
0.00234375, 1516.224147
0.002382813, 1521.956853
0.002421875, 1527.19079
0.002460938, 1531.966722
0.0025, 1536.32348
0.002578125, 1543.891739
0.00265625, 1550.203579
0.002734375, 1555.480771
0.0028125, 1559.908135
0.002890625, 1563.637879
0.00296875, 1566.794144
0.003046875, 1569.477867
0.003125, 1571.77099
0.00328125, 1575.385829
0.0034375, 1578.108169
0.00359375, 1580.194856
0.00375, 1581.820666
0.00390625, 1583.106578
0.0087, 1589.51315
0.01, 1589.578955