/
couette_validation.py
61 lines (42 loc) · 1.02 KB
/
couette_validation.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# coding: utf-8
# ## Validation
# In[1]:
from __future__ import division
import sapy.modal as sa
import sapy.post as po
import sapy.sensitivity as sn
import pdb as pdb
# In[2]:
option = {'flow': 'couette',
'n_points': 80,
'lc': 0.16739,
'Ymax': 1000,
'yi': 10,
'alpha': 1.5,
'Re': 500,
'variables': 'p_u_v',
'equation': 'LNS',
'mapping': ['semi_infinite_PB', [0, (46.7/13.8)]],
'Froude': 0.02,
'slope': 1.3e-5}
# In[3]:
f = sa.fluid(option)
f.diff_matrix()
f.set_couette()
f.integ_matrix()
f.set_operator_variables()
f.solve_eig()
f.adjoint_spectrum('cont')
f.solve_eig_adj()
f.save_sim('cou_cont')
# In[4]:
v = po.viz('cou_cont.npz')
v.plot_velocity()
v.plot_spectrum()
# In[5]:
# 56 62 73
om = sn.sensitivity('cou_cont.npz', 73)
a, b, c, d = om.c_per(obj='norm')
print (a, b, c,d)
#om.sens_spectrum('ke_cd_N001_puv.png', 1e-7, 1e-4, 189, obj='u', shape='gauss') # eps, gamma
om.validation(1, 1e-7, 1e-4, 69, 'gauss')