ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_IndexDefines.H
Go to the documentation of this file.
1 #ifndef ERF_INDEX_DEFINES_H_
2 #define ERF_INDEX_DEFINES_H_
3 
4 #include <AMReX_REAL.H>
5 #include <AMReX_Arena.H>
6 
7 /**
8  * Definition of indexing parameters
9 */
10 
11 // This defines the ACTUAL number of non-moisture vars =
12 // rho, rhotheta, rhoKE
13 #define NDRY 3
14 
15 // This defines the ACTUAL number of non-moisture scalar vars
16 #define NSCALARS 1
17 
18 // This defines the MAXIMUM number of moisture vars (six q's plus five n's)
19 #define NMOIST_max 11
20 
21 // This is the number of components if using moisture
22 // We use this to allocate the 1d arrays of boundary condition types,
23 // but not to allocate actual solution data
24 #define NVAR_max (NDRY + NSCALARS + NMOIST_max)
25 
26 // This is the number of components if we assume there is only one passive scalar
27 // We can use this when we assume all passive scalars have the same bc's
28 // We also assume (the final "+1" that the base state components have the same bcs)
29 #define NBCVAR_max (NDRY + 1 + NMOIST_max + 1)
30 
31 // This is the number of components if we assume there is only one passive scalar
32 // We can use this when we assume all passive scalars have the same diffusion coefficients
33 #define NPRIMVAR_max (NDRY + 1 + NMOIST_max)
34 
35 // Cell-centered state variables
36 #define Rho_comp 0
37 #define RhoTheta_comp (Rho_comp+1)
38 #define RhoKE_comp (Rho_comp+2) // for Deardorff LES Model, k-equation RANS, or MYNN PBL Model
39 
40 #define RhoScalar_comp (RhoKE_comp+1)
41 
42 #define RhoQ1_comp (RhoScalar_comp+NSCALARS)
43 #define RhoQ2_comp (RhoQ1_comp+1)
44 #define RhoQ3_comp (RhoQ1_comp+2)
45 #define RhoQ4_comp (RhoQ1_comp+3)
46 #define RhoQ5_comp (RhoQ1_comp+4)
47 #define RhoQ6_comp (RhoQ1_comp+5)
48 #define RhoQ7_comp (RhoQ1_comp+6)
49 #define RhoQ8_comp (RhoQ1_comp+7)
50 #define RhoQ9_comp (RhoQ1_comp+8)
51 #define RhoQ10_comp (RhoQ1_comp+9)
52 #define RhoQ11_comp (RhoQ1_comp+10)
53 
54 // Cell-centered primitive variables
55 #define PrimTheta_comp (RhoTheta_comp -1)
56 #define PrimKE_comp (RhoKE_comp -1)
57 #define PrimScalar_comp (RhoScalar_comp-1)
58 #define PrimQ1_comp (RhoQ1_comp-1)
59 #define PrimQ2_comp (RhoQ2_comp-1)
60 #define PrimQ3_comp (RhoQ3_comp-1)
61 #define PrimQ4_comp (RhoQ4_comp-1)
62 #define PrimQ5_comp (RhoQ5_comp-1)
63 #define PrimQ6_comp (RhoQ6_comp-1)
64 #define PrimQ7_comp (RhoQ7_comp-1)
65 #define PrimQ8_comp (RhoQ8_comp-1)
66 #define PrimQ9_comp (RhoQ9_comp-1)
67 #define PrimQ10_comp (RhoQ10_comp-1)
68 #define PrimQ11_comp (RhoQ11_comp-1)
69 
70 // Base state variables
71 namespace BaseState {
72  enum {
73  r0_comp = 0,
78  num_comps
79  };
80 }
81 
82 // NOTE: we still use this indexing even if no moisture
83 // NOTE: We assume a single boundary condition for all passive scalars
84 namespace BCVars {
85  enum {
86  cons_bc = 0,
105  NumTypes
106  };
107 }
108 
109 // Note that we don't use these, but we need this vector to be long enough
110 // not to segfault when we do the FillPatch operation.
111 namespace BaseBCVars {
112  enum {
118  };
119 }
120 
121 namespace RealBdyVars {
122  enum {
123  U = 0,
124  V = 1,
125  T = 2,
126  QV = 3,
127  NumTypes
128  };
129 }
130 
131 namespace WRFBdyVars {
132  enum {
133  U = 0,
134  V = 1,
135  T = 2,
136  QV = 3, // water vapor
137  PH , // Perturbational geopotential
138  MU , // bdy perturbation dry air mass in column (we will get mub from the initial data)
139  PC , // p_s - p_top = dry hydrostatic pressure difference between the surface and the model top
140  NumTypes
141  };
142 }
143 
144 namespace MetGridBdyVars {
145  enum {
146  U = 0,
147  V = 1,
148  T = 2,
149  QV = 3,
150  NumTypes
151  };
152 }
153 
154 namespace MetGridTmpSrcVars {
155  enum {
156  Theta = 0,
157  QV = 1,
158  NumTypes
159  };
160 }
161 
162 namespace MetGridTmpDstVars {
163  enum {
164  P = 0,
165  T = 1,
166  Theta = 2,
167  QV = 3,
168  NumTypes
169  };
170 }
171 
172 namespace Vars {
173  enum {
174  cons = 0,
178  NumTypes
179  };
180 }
181 
182 namespace GpVars {
183  enum {
184  gpx = 0,
187  };
188 }
189 
190 namespace IntVars {
191  enum {
192  cons = 0,
196  NumTypes
197  };
198 }
199 
200 // We separate out horizontal and vertical turbulent diffusivities
201 // These are the same for LES, but different for PBL models
202 namespace EddyDiff {
203  enum {
204  Mom_h = 0,
215  NumDiffs
216  };
217 }
218 
219 enum struct ERF_BC {
220  symmetry,
221  inflow,
222  outflow,
224  ho_outflow,
225  open,
226  no_slip_wall,
227  slip_wall,
228  periodic,
230  undefined
231 };
232 
233 // NOTE: the first of these must match up with the BCType enum
234 // in amrex/Src/Base/AMReX_BC_TYPES.H. We had extras at
235 // the end to use locally
236 namespace ERFBCType {
238  bogus = -666,
240  int_dir = 0,
242  foextrap = 2,
243  ext_dir = 3,
244  hoextrap = 4,
248  neumann = 104,
249  neumann_int = 105,
250  open = 106,
251  ext_dir_upwind = 107
252 };
253 }
254 
255 enum struct AdvType : int {
256  Centered_2nd = 101,
257  Upwind_3rd = 102,
258  Upwind_3rd_SL = 103,
259  Centered_4th = 104,
260  Upwind_5th = 105,
261  Centered_6th = 106,
262  Weno_3 = 107,
263  Weno_3Z = 108,
264  Weno_5 = 109,
265  Weno_5Z = 110,
266  Weno_3MZQ = 111,
267  Weno_7 = 112,
268  Weno_7Z = 113,
269  Unknown = 114
270 };
271 #endif
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AdvType
Definition: ERF_IndexDefines.H:255
@ Upwind_3rd_SL
@ Centered_4th
@ Centered_6th
@ Centered_2nd
ERF_BC
Definition: ERF_IndexDefines.H:219
@ ho_outflow
@ inflow_outflow
@ no_slip_wall
@ surface_layer
Definition: ERF_IndexDefines.H:84
@ RhoQ6_bc_comp
Definition: ERF_IndexDefines.H:96
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:90
@ zvel_bc
Definition: ERF_IndexDefines.H:104
@ RhoQ1_bc_comp
Definition: ERF_IndexDefines.H:91
@ NumTypes
Definition: ERF_IndexDefines.H:105
@ RhoQ4_bc_comp
Definition: ERF_IndexDefines.H:94
@ RhoKE_bc_comp
Definition: ERF_IndexDefines.H:89
@ RhoQ7_bc_comp
Definition: ERF_IndexDefines.H:97
@ RhoQ10_bc_comp
Definition: ERF_IndexDefines.H:100
@ RhoQ3_bc_comp
Definition: ERF_IndexDefines.H:93
@ RhoTheta_bc_comp
Definition: ERF_IndexDefines.H:88
@ RhoQ2_bc_comp
Definition: ERF_IndexDefines.H:92
@ Rho_bc_comp
Definition: ERF_IndexDefines.H:87
@ RhoQ11_bc_comp
Definition: ERF_IndexDefines.H:101
@ yvel_bc
Definition: ERF_IndexDefines.H:103
@ cons_bc
Definition: ERF_IndexDefines.H:86
@ xvel_bc
Definition: ERF_IndexDefines.H:102
@ RhoQ9_bc_comp
Definition: ERF_IndexDefines.H:99
@ RhoQ8_bc_comp
Definition: ERF_IndexDefines.H:98
@ RhoQ5_bc_comp
Definition: ERF_IndexDefines.H:95
Definition: ERF_IndexDefines.H:111
@ rho0_bc_comp
Definition: ERF_IndexDefines.H:113
@ th0_bc_comp
Definition: ERF_IndexDefines.H:116
@ qv0_bc_comp
Definition: ERF_IndexDefines.H:117
@ pi0_bc_comp
Definition: ERF_IndexDefines.H:115
@ p0_bc_comp
Definition: ERF_IndexDefines.H:114
Definition: ERF_IndexDefines.H:71
@ num_comps
Definition: ERF_IndexDefines.H:78
@ qv0_comp
Definition: ERF_IndexDefines.H:77
@ pi0_comp
Definition: ERF_IndexDefines.H:75
@ p0_comp
Definition: ERF_IndexDefines.H:74
@ th0_comp
Definition: ERF_IndexDefines.H:76
@ r0_comp
Definition: ERF_IndexDefines.H:73
Definition: ERF_IndexDefines.H:236
mathematicalBndryTypes
Definition: ERF_IndexDefines.H:237
@ neumann
Definition: ERF_IndexDefines.H:248
@ ext_dir_ingested
Definition: ERF_IndexDefines.H:247
@ open
Definition: ERF_IndexDefines.H:250
@ reflect_odd
Definition: ERF_IndexDefines.H:239
@ hoextrap
Definition: ERF_IndexDefines.H:244
@ foextrap
Definition: ERF_IndexDefines.H:242
@ ext_dir
Definition: ERF_IndexDefines.H:243
@ ext_dir_prim
Definition: ERF_IndexDefines.H:246
@ bogus
Definition: ERF_IndexDefines.H:238
@ surface_layer
Definition: ERF_IndexDefines.H:245
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:251
@ int_dir
Definition: ERF_IndexDefines.H:240
@ neumann_int
Definition: ERF_IndexDefines.H:249
@ reflect_even
Definition: ERF_IndexDefines.H:241
Definition: ERF_IndexDefines.H:202
@ Theta_v
Definition: ERF_IndexDefines.H:210
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:214
@ Scalar_v
Definition: ERF_IndexDefines.H:212
@ Mom_h
Definition: ERF_IndexDefines.H:204
@ Q_v
Definition: ERF_IndexDefines.H:213
@ Q_h
Definition: ERF_IndexDefines.H:208
@ Mom_v
Definition: ERF_IndexDefines.H:209
@ Scalar_h
Definition: ERF_IndexDefines.H:207
@ KE_v
Definition: ERF_IndexDefines.H:211
@ NumDiffs
Definition: ERF_IndexDefines.H:215
@ Theta_h
Definition: ERF_IndexDefines.H:205
@ KE_h
Definition: ERF_IndexDefines.H:206
Definition: ERF_IndexDefines.H:182
@ gpz
Definition: ERF_IndexDefines.H:186
@ gpy
Definition: ERF_IndexDefines.H:185
@ gpx
Definition: ERF_IndexDefines.H:184
Definition: ERF_IndexDefines.H:190
@ NumTypes
Definition: ERF_IndexDefines.H:196
@ ymom
Definition: ERF_IndexDefines.H:194
@ cons
Definition: ERF_IndexDefines.H:192
@ zmom
Definition: ERF_IndexDefines.H:195
@ xmom
Definition: ERF_IndexDefines.H:193
Definition: ERF_IndexDefines.H:144
@ U
Definition: ERF_IndexDefines.H:146
@ NumTypes
Definition: ERF_IndexDefines.H:150
@ V
Definition: ERF_IndexDefines.H:147
@ QV
Definition: ERF_IndexDefines.H:149
@ T
Definition: ERF_IndexDefines.H:148
Definition: ERF_IndexDefines.H:162
@ P
Definition: ERF_IndexDefines.H:164
@ Theta
Definition: ERF_IndexDefines.H:166
@ QV
Definition: ERF_IndexDefines.H:167
@ T
Definition: ERF_IndexDefines.H:165
@ NumTypes
Definition: ERF_IndexDefines.H:168
Definition: ERF_IndexDefines.H:154
@ Theta
Definition: ERF_IndexDefines.H:156
@ QV
Definition: ERF_IndexDefines.H:157
@ NumTypes
Definition: ERF_IndexDefines.H:158
Definition: ERF_IndexDefines.H:121
@ U
Definition: ERF_IndexDefines.H:123
@ NumTypes
Definition: ERF_IndexDefines.H:127
@ QV
Definition: ERF_IndexDefines.H:126
@ T
Definition: ERF_IndexDefines.H:125
@ V
Definition: ERF_IndexDefines.H:124
Definition: ERF_IndexDefines.H:172
@ xvel
Definition: ERF_IndexDefines.H:175
@ cons
Definition: ERF_IndexDefines.H:174
@ zvel
Definition: ERF_IndexDefines.H:177
@ NumTypes
Definition: ERF_IndexDefines.H:178
@ yvel
Definition: ERF_IndexDefines.H:176
Definition: ERF_IndexDefines.H:131
@ T
Definition: ERF_IndexDefines.H:135
@ QV
Definition: ERF_IndexDefines.H:136
@ V
Definition: ERF_IndexDefines.H:134
@ PC
Definition: ERF_IndexDefines.H:139
@ NumTypes
Definition: ERF_IndexDefines.H:140
@ MU
Definition: ERF_IndexDefines.H:138
@ U
Definition: ERF_IndexDefines.H:133
@ PH
Definition: ERF_IndexDefines.H:137