File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
Exec/science/xrb_spherical/analysis Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+
3+ import sys
4+ import glob
5+ import yt
6+ import numpy as np
7+ from yt .frontends .boxlib .api import CastroDataset
8+
9+ '''
10+ This file tracks the flame front and writes them into a txt file.
11+
12+ Usage: ./front_tracker.py plotFiles_*
13+ '''
14+
15+ def track_flame_front (ds ):
16+ '''
17+ This script tracks the flame front position for a given dataset.
18+ It returns a tuple of the form: (Time, Theta)
19+ Note: time is in milisecond.
20+ '''
21+
22+ time = ds .current_time .in_units ("ms" )
23+
24+ # How to determine the flame front?
25+ # 1) Global max temperature: this can be used to track initial
26+ # detonation resulted from the initial temperature perturbation
27+ # 2) Use vertically averaged max enuc to determine the actual flame front
28+
29+
30+ return timeTheta
31+
32+
33+ if __name__ == "__main__" :
34+
35+ ts = sys .argv [1 :]
36+
37+ timeThetaArray = []
38+ for fname in ts :
39+ ds = CastroDataset (fname )
40+
41+ # Get tuple in form (theta, time)
42+ timeTheta = track_flame_front (ds )
43+ timeThetaArray .append (timeTheta )
44+
45+ # Sort array by time and write to file
46+ timeThetaArray .sort ()
47+ timeThetaArray = np .array (timeThetaArray )
48+
49+ np .savetxt ('front_tracking.dat' , timeThetaArray , delimiter = ',' )
You can’t perform that action at this time.
0 commit comments