-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_side_short.py
74 lines (47 loc) · 1.68 KB
/
run_side_short.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
62
63
64
65
66
67
68
69
70
71
72
73
74
import numpy as np
from snek5000_cbox.solver import Simul
params = Simul.create_default_params()
aspect_ratio = 1.0
params.prandtl = 0.71
# The onset of oscillatory flow for aspect ration 1.0 is at Ra_c = 1.825e8
params.Ra_side = 1.86e8
params.output.sub_directory = "examples_cbox/simple/SW"
params.oper.dim = 2
nb_elements = ny = 8
params.oper.ny = nb_elements
nx = params.oper.nx = int(nb_elements / aspect_ratio)
params.oper.nz = int(nb_elements / aspect_ratio)
Ly = params.oper.Ly
Lx = params.oper.Lx = Ly / aspect_ratio
Lz = params.oper.Lz = Ly / aspect_ratio
order = params.oper.elem.order = params.oper.elem.order_out = 8
params.oper.mesh_stretch_factor = 0.08 # zero means regular
params.short_name_type_run = f"Ra{params.Ra_side:.3e}_{nx*order}x{ny*order}"
# creation of the coordinates of the points saved by history points
n1d = 5
small = Lx / 10
xs = np.linspace(0, Lx, n1d)
xs[0] = small
xs[-1] = Lx - small
ys = np.linspace(0, Ly, n1d)
ys[0] = small
ys[-1] = Ly - small
coords = [(x, y) for x in xs for y in ys]
if params.oper.dim == 3:
zs = np.linspace(0, Lz, n1d)
zs[0] = small
zs[-1] = Lz - small
coords = [(x, y, z) for x in xs for y in ys for z in zs]
params.output.history_points.coords = coords
params.oper.max.hist = len(coords) + 1
# params.oper.enable_sfd = float(True)
params.nek.general.end_time = 800
params.nek.general.stop_at = "endTime"
params.nek.general.target_cfl = 2.0
params.nek.general.time_stepper = "BDF3"
params.nek.general.extrapolation = "OIFS"
params.nek.general.write_control = "runTime"
params.nek.general.write_interval = 10
params.output.history_points.write_interval = 10
sim = Simul(params)
sim.make.exec("run_fg", nproc=2)