-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_section.py
42 lines (30 loc) · 1.05 KB
/
plot_section.py
1
2
3
4
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
31
32
33
34
35
36
37
38
39
40
41
42
"""Plot displacement and LD in a section (plane in physical space)"""
import numpy as np
from ldflow.flow import abc, turb_frozen, tgv_2d
from ldflow.section import make_section
PARAMETERS = {
"flow": "abc", # "abc", "tgv_2d", "turb_frozen_3d"
"section": "z",
"value": 0,
"n_points": 200, # number of point along each dimension
"tau": 20, # integration time
"p_value": 2, # Lp norm
"gradient_power": 0.75, # tweak to make features stand out
}
if PARAMETERS["flow"] == "abc":
field = abc(a=np.sqrt(3), b=np.sqrt(2), c=1.0)
elif PARAMETERS["flow"] == "tgv_2d":
field = tgv_2d()
elif PARAMETERS["flow"] == "turb_frozen_3d":
# field = turb_frozen(n_grid=128, file='v000121.csv', print_info=True)
# field = turb_frozen(n_grid=128, file='v006018.csv', print_info=True)
field = turb_frozen(n_grid=128, file='v014863.csv', print_info=True)
else:
raise Exception("This flow is not implemented")
def run():
make_section(
field=field,
parameters=PARAMETERS,
)
if __name__ == "__main__":
run()