Skip to content

Commit

Permalink
[Examples] Embed fixed temperature file for burner-stabilized flame
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Oct 3, 2023
1 parent 5dacf66 commit 3903cac
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 81 deletions.
2 changes: 0 additions & 2 deletions doc/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@
# 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):
Expand Down
41 changes: 36 additions & 5 deletions samples/python/onedim/flame_fixed_T.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,42 @@
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
Expand Down
74 changes: 0 additions & 74 deletions samples/python/onedim/tdata.dat

This file was deleted.

0 comments on commit 3903cac

Please sign in to comment.