1
1
import numpy as np
2
2
3
- from ..flow_solver .utils import options as opts , boundary as bdry
3
+ from ..utils import options as opts
4
+
5
+ from ..flow_solver .utils import boundary as bdry
4
6
5
7
from ..flow_solver .physics import hydrostatics
6
8
7
9
from ..utils .data_structures import DiagnosticState
8
10
9
11
10
12
class UserData (object ):
11
- NSPEC = 1
12
- grav = 9.81 # [m s^{-2}]
13
- omega = 0.0 * 1e-5 # [s^{-1}]
14
-
15
- R_gas = 287.4 # [J kg^{-1} K^{-1}]
16
- R_vap = 461.0
17
- Q_vap = 2.53e06
18
- gamma = 1.4
19
- cp_gas = gamma * R_gas / (gamma - 1.0 )
20
-
21
- p_ref = 1e5
22
- T_ref = 300.00 # [K]
23
- rho_ref = p_ref / (R_gas * T_ref )
24
- N_ref = grav / np .sqrt (cp_gas * T_ref )
25
- Cs = np .sqrt (gamma * R_gas * T_ref )
26
-
27
- h_ref = 10.0e3 # [m]
28
- t_ref = 100.0 # [s]
29
- u_ref = h_ref / t_ref
30
-
31
- i_gravity = np .zeros ((3 ))
32
- i_coriolis = np .zeros ((3 ))
33
13
34
14
def __init__ (self ):
35
- self .h_ref = self .h_ref
36
- self .t_ref = self .t_ref
37
- self .T_ref = self .T_ref
38
- self .p_ref = self .p_ref
39
- self .rho_ref = self .rho_ref
40
- self .u_ref = self .u_ref
41
- self .Nsq_ref = self .N_ref * self .N_ref
42
- self .g_ref = self .grav
43
- self .gamm = self .gamma
44
- self .Rg_over_Rv = self .R_gas / self .R_vap
45
- self .Q = self .Q_vap / (self .R_gas * self .T_ref )
46
- self .R_gas = self .R_gas
15
+ self .grav = 9.81
16
+ self .h_ref = 10.0e3 # [m]
17
+ self .t_ref = 100.0 # [s]
18
+ self .T_ref = 300.00 # [K]
19
+ self .p_ref = 1e5
20
+ self .u_ref = self .h_ref / self .t_ref
21
+ self .R_gas = 287.4
22
+ self .gamm = 1.4
23
+ self .Cs = np .sqrt (self .gamm * self .R_gas * self .T_ref )
24
+ self .cp_gas = self .gamm * self .R_gas / (self .gamm - 1.0 )
25
+ self .N_ref = self .grav / np .sqrt (self .cp_gas * self .T_ref )
47
26
self .Rg = self .R_gas / (self .h_ref ** 2 / self .t_ref ** 2 / self .T_ref )
48
- self .cp_gas = self .cp_gas
49
-
50
- self .nspec = self .NSPEC
51
27
52
28
self .is_nonhydrostatic = 1
53
29
self .is_compressible = 1
@@ -61,16 +37,12 @@ def __init__(self):
61
37
self .coriolis_strength = np .zeros ((3 ))
62
38
63
39
self .gravity_strength [1 ] = self .grav * self .h_ref / (self .R_gas * self .T_ref )
64
- self .coriolis_strength [2 ] = 2.0 * self .omega * self .t_ref
65
40
66
41
gravity_mask = (self .gravity_strength > np .finfo (np .float64 ).eps ) | (np .arange (3 ) == 1 )
67
42
self .i_gravity = gravity_mask .astype (int )
68
43
if np .any (gravity_mask ):
69
44
self .gravity_direction = np .where (gravity_mask )[0 ][- 1 ] # Use last matching index
70
45
71
- coriolis_mask = self .coriolis_strength > np .finfo (np .float64 ).eps
72
- self .i_coriolis = coriolis_mask .astype (int )
73
-
74
46
j = 4.0
75
47
Lx = 1.0 * np .pi * self .Cs / self .N_ref * j
76
48
self .xmin = - Lx / self .h_ref
@@ -80,14 +52,6 @@ def __init__(self):
80
52
self .zmin = - 1.0
81
53
self .zmax = 1.0
82
54
83
- self .u_wind_speed = 0.0 * self .u_ref
84
- self .v_wind_speed = 0.0
85
- self .w_wind_speed = 0.0
86
-
87
- self .bdry_type = np .empty ((3 ), dtype = object )
88
- self .bdry_type [0 ] = opts .BdryType .PERIODIC
89
- self .bdry_type [1 ] = opts .BdryType .WALL
90
- self .bdry_type [2 ] = opts .BdryType .WALL
91
55
self .ATMOSPHERIC_EXTENSION = True
92
56
self .rayleigh_bdry_switch = False
93
57
@@ -103,29 +67,9 @@ def __init__(self):
103
67
self .dtfixed0 = 10.0 / self .t_ref
104
68
self .dtfixed = self .dtfixed0
105
69
106
- self .do_advection = True
107
- self .limiter_type_scalars = opts .LimiterType .NONE
108
- self .limiter_type_velocity = opts .LimiterType .NONE
109
-
110
70
self .tol = 1.0e-30
111
71
self .max_iterations = 10000
112
72
113
- # blending parameters
114
- self .perturb_type = "pos_perturb"
115
- self .blending_mean = "rhoY" # 1.0, rhoY
116
- self .blending_conv = "rho" # theta, rho
117
- self .blending_type = "half" # half, full
118
-
119
- self .continuous_blending = False
120
- self .no_of_pi_initial = 1
121
- self .no_of_pi_transition = 0
122
- self .no_of_hy_initial = 0
123
- self .no_of_hy_transition = 0
124
-
125
- self .blending_weight = 0.0 / 16
126
- self .initial_blending = False
127
- self .initial_projection = True
128
-
129
73
self .tout = [360.0 ]
130
74
# self.tout = np.arange(0,361,1.0)
131
75
# self.tout = np.append(self.tout, [720.0])
@@ -153,11 +97,6 @@ def __init__(self):
153
97
self .stratification = self .stratification_wrapper
154
98
self .init_forcing = self .forcing
155
99
156
- self .rayleigh_forcing = False
157
- self .rayleigh_forcing_type = "func" # func or file
158
- self .rayleigh_forcing_fn = None
159
- self .rayleigh_forcing_path = None
160
-
161
100
def stratification_wrapper (self , dy ):
162
101
return lambda y : self .stratification_function (y , dy )
163
102
@@ -294,11 +233,6 @@ def sol_init(Sol, mpv, elem, node, th, ud, seeds=None):
294
233
if ud .bdry_type [1 ] == opts .BdryType .RAYLEIGH :
295
234
ud .tcy , ud .tny = bdry .get_tau_y (ud , elem , node , 0.5 )
296
235
297
- if ud .rayleigh_forcing :
298
- ud .forcing_tcy , ud .forcing_tny = bdry .get_bottom_tau_y (
299
- ud , elem , node , 0.2 , cutoff = 0.3
300
- )
301
-
302
236
A0 = 1.0e-1 / ud .u_ref
303
237
Msq = ud .Msq
304
238
g = ud .gravity_strength [1 ] * ud .Rg
0 commit comments