-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcyl_wake_cont.py
More file actions
50 lines (41 loc) · 1.85 KB
/
Copy pathcyl_wake_cont.py
File metadata and controls
50 lines (41 loc) · 1.85 KB
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
from optcont_main import optcon_nse
from dolfin import Expression
# the target signal
# for cylinder wake, y[1] -> 0 means stabilization
ystar = [None, Expression('0.0', t=0)]
spec_tip_dict = dict(nwtn_adi_dict=dict(
adi_max_steps=199,
adi_newZ_reltol=1e-8,
nwtn_max_steps=16,
nwtn_upd_reltol=5e-8,
nwtn_upd_abstol=1e-7,
verbose=True,
full_upd_norm_check=False,
check_lyap_res=False
),
compress_z=False, # whether or not to compress Z
comprz_maxc=100, # compression of the columns of Z by QR
comprz_thresh=5e-5, # threshold for trunc of SVD
save_full_z=False # whether to save the uncompressed Z
)
probsetupdict = dict(problemname='cylinderwake', N=3,
spec_tip_dict=spec_tip_dict,
clearprvveldata=True,
t0=0.0, tE=2.0, Nts=50, stst_control=True,
ini_vel_stokes=True, alphau=1e-4, ystar=ystar)
# for nu=1e-3, i.e. Re = 150, the sys is stable
probsetupdict.update(dict(nu=1e-3, comp_unco_out=False,
use_ric_ini_nu=None))
optcon_nse(**probsetupdict)
# for nu=8e-4 (Re=187.5) we need stabilizing initial guess
probsetupdict.update(dict(nu=8e-4, comp_unco_out=False,
use_ric_ini_nu=1e-3))
optcon_nse(**probsetupdict)
# for nu=6e-4 (Re=250) we need stabilizing initial guess
probsetupdict.update(dict(nu=6e-4, comp_unco_out=False,
use_ric_ini_nu=8e-4))
optcon_nse(**probsetupdict)
# compute the uncontrolled solution
probsetupdict.update(dict(nu=6e-4, comp_unco_out=True,
use_ric_ini_nu=8e-4))
optcon_nse(**probsetupdict)