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  R = 4, // density
138  PH , // Perturbational geopotential
139  MU , // bdy perturbation dry air mass in column (we will get mub from the initial data)
140  PC , // p_s - p_top = dry hydrostatic pressure difference between the surface and the model top
141  NumTypes
142  };
143 }
144 
145 namespace MetGridBdyVars {
146  enum {
147  U = 0,
148  V = 1,
149  T = 2,
150  QV = 3,
151  NumTypes
152  };
153 }
154 
155 namespace MetGridTmpSrcVars {
156  enum {
157  Theta = 0,
158  QV = 1,
159  NumTypes
160  };
161 }
162 
163 namespace MetGridTmpDstVars {
164  enum {
165  P = 0,
166  T = 1,
167  Theta = 2,
168  QV = 3,
169  NumTypes
170  };
171 }
172 
173 namespace Vars {
174  enum {
175  cons = 0,
179  NumTypes
180  };
181 }
182 
183 namespace GpVars {
184  enum {
185  gpx = 0,
188  };
189 }
190 
191 namespace IntVars {
192  enum {
193  cons = 0,
197  NumTypes
198  };
199 }
200 
201 // We separate out horizontal and vertical turbulent diffusivities
202 // These are the same for LES, but different for PBL models
203 namespace EddyDiff {
204  enum {
205  Mom_h = 0,
216  HGAMT_v, // MRF countergradient for heat (HGAMT/h, units K/m), zero outside PBL
217  HGAMQ_v, // MRF countergradient for moisture (HGAMQ/h, units kg/kg/m), zero outside PBL
218  HGAMU_v, // YSU countergradient for x-momentum (units m/s/m), zero outside PBL
219  HGAMV_v, // YSU countergradient for y-momentum (units m/s/m), zero outside PBL
220  NumDiffs
221  };
222 }
223 
224 enum struct ERF_BC {
225  symmetry,
226  inflow,
227  outflow,
229  ho_outflow,
230  open,
231  no_slip_wall,
232  slip_wall,
233  periodic,
235  undefined
236 };
237 
238 // NOTE: the first of these must match up with the BCType enum
239 // in amrex/Src/Base/AMReX_BC_TYPES.H. We had extras at
240 // the end to use locally
241 namespace ERFBCType {
243  bogus = -666,
245  int_dir = 0,
247  foextrap = 2,
248  ext_dir = 3,
249  hoextrap = 4,
253  neumann = 104,
254  neumann_int = 105,
255  open = 106,
256  ext_dir_upwind = 107
257 };
258 }
259 
260 enum struct AdvType : int {
261  Centered_2nd = 101,
262  Upwind_3rd = 102,
263  Upwind_3rd_SL = 103,
264  Centered_4th = 104,
265  Upwind_5th = 105,
266  Centered_6th = 106,
267  Weno_3 = 107,
268  Weno_3Z = 108,
269  Weno_5 = 109,
270  Weno_5Z = 110,
271  Weno_3MZQ = 111,
272  Weno_7 = 112,
273  Weno_7Z = 113,
274  Unknown = 114
275 };
276 #endif
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AdvType
Definition: ERF_IndexDefines.H:260
@ Upwind_3rd_SL
@ Centered_4th
@ Centered_6th
@ Centered_2nd
ERF_BC
Definition: ERF_IndexDefines.H:224
@ 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:241
mathematicalBndryTypes
Definition: ERF_IndexDefines.H:242
@ neumann
Definition: ERF_IndexDefines.H:253
@ ext_dir_ingested
Definition: ERF_IndexDefines.H:252
@ open
Definition: ERF_IndexDefines.H:255
@ reflect_odd
Definition: ERF_IndexDefines.H:244
@ hoextrap
Definition: ERF_IndexDefines.H:249
@ foextrap
Definition: ERF_IndexDefines.H:247
@ ext_dir
Definition: ERF_IndexDefines.H:248
@ ext_dir_prim
Definition: ERF_IndexDefines.H:251
@ bogus
Definition: ERF_IndexDefines.H:243
@ surface_layer
Definition: ERF_IndexDefines.H:250
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:256
@ int_dir
Definition: ERF_IndexDefines.H:245
@ neumann_int
Definition: ERF_IndexDefines.H:254
@ reflect_even
Definition: ERF_IndexDefines.H:246
Definition: ERF_IndexDefines.H:203
@ Theta_v
Definition: ERF_IndexDefines.H:211
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:215
@ Scalar_v
Definition: ERF_IndexDefines.H:213
@ Mom_h
Definition: ERF_IndexDefines.H:205
@ HGAMU_v
Definition: ERF_IndexDefines.H:218
@ Q_v
Definition: ERF_IndexDefines.H:214
@ Q_h
Definition: ERF_IndexDefines.H:209
@ Mom_v
Definition: ERF_IndexDefines.H:210
@ HGAMQ_v
Definition: ERF_IndexDefines.H:217
@ HGAMT_v
Definition: ERF_IndexDefines.H:216
@ Scalar_h
Definition: ERF_IndexDefines.H:208
@ KE_v
Definition: ERF_IndexDefines.H:212
@ NumDiffs
Definition: ERF_IndexDefines.H:220
@ Theta_h
Definition: ERF_IndexDefines.H:206
@ HGAMV_v
Definition: ERF_IndexDefines.H:219
@ KE_h
Definition: ERF_IndexDefines.H:207
Definition: ERF_IndexDefines.H:183
@ gpz
Definition: ERF_IndexDefines.H:187
@ gpy
Definition: ERF_IndexDefines.H:186
@ gpx
Definition: ERF_IndexDefines.H:185
Definition: ERF_IndexDefines.H:191
@ NumTypes
Definition: ERF_IndexDefines.H:197
@ ymom
Definition: ERF_IndexDefines.H:195
@ cons
Definition: ERF_IndexDefines.H:193
@ zmom
Definition: ERF_IndexDefines.H:196
@ xmom
Definition: ERF_IndexDefines.H:194
Definition: ERF_IndexDefines.H:145
@ U
Definition: ERF_IndexDefines.H:147
@ NumTypes
Definition: ERF_IndexDefines.H:151
@ V
Definition: ERF_IndexDefines.H:148
@ QV
Definition: ERF_IndexDefines.H:150
@ T
Definition: ERF_IndexDefines.H:149
Definition: ERF_IndexDefines.H:163
@ P
Definition: ERF_IndexDefines.H:165
@ Theta
Definition: ERF_IndexDefines.H:167
@ QV
Definition: ERF_IndexDefines.H:168
@ T
Definition: ERF_IndexDefines.H:166
@ NumTypes
Definition: ERF_IndexDefines.H:169
Definition: ERF_IndexDefines.H:155
@ Theta
Definition: ERF_IndexDefines.H:157
@ QV
Definition: ERF_IndexDefines.H:158
@ NumTypes
Definition: ERF_IndexDefines.H:159
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:173
@ xvel
Definition: ERF_IndexDefines.H:176
@ cons
Definition: ERF_IndexDefines.H:175
@ zvel
Definition: ERF_IndexDefines.H:178
@ NumTypes
Definition: ERF_IndexDefines.H:179
@ yvel
Definition: ERF_IndexDefines.H:177
Definition: ERF_IndexDefines.H:131
@ T
Definition: ERF_IndexDefines.H:135
@ R
Definition: ERF_IndexDefines.H:137
@ QV
Definition: ERF_IndexDefines.H:136
@ V
Definition: ERF_IndexDefines.H:134
@ PC
Definition: ERF_IndexDefines.H:140
@ NumTypes
Definition: ERF_IndexDefines.H:141
@ MU
Definition: ERF_IndexDefines.H:139
@ U
Definition: ERF_IndexDefines.H:133
@ PH
Definition: ERF_IndexDefines.H:138