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