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
19 #define NMOIST_max 6
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 
49 // Cell-centered primitive variables
50 #define PrimTheta_comp (RhoTheta_comp -1)
51 #define PrimKE_comp (RhoKE_comp -1)
52 #define PrimScalar_comp (RhoScalar_comp-1)
53 #define PrimQ1_comp (RhoQ1_comp-1)
54 #define PrimQ2_comp (RhoQ2_comp-1)
55 #define PrimQ3_comp (RhoQ3_comp-1)
56 #define PrimQ4_comp (RhoQ4_comp-1)
57 #define PrimQ5_comp (RhoQ5_comp-1)
58 #define PrimQ6_comp (RhoQ6_comp-1)
59 
60 // Base state variables
61 namespace BaseState {
62  enum {
63  r0_comp = 0,
68  num_comps
69  };
70 }
71 
72 // NOTE: we still use this indexing even if no moisture
73 // NOTE: We assume a single boundary condition for all passive scalars
74 namespace BCVars {
75  enum {
76  cons_bc = 0,
90  NumTypes
91  };
92 }
93 
94 // Note that we don't use these, but we need this vector to be long enough
95 // not to segfault when we do the FillPatch operation.
96 namespace BaseBCVars {
97  enum {
103  };
104 }
105 
106 namespace RealBdyVars {
107  enum {
108  U = 0,
109  V = 1,
110  T = 2,
111  QV = 3,
112  NumTypes
113  };
114 }
115 
116 namespace WRFBdyVars {
117  enum {
118  U = 0,
119  V = 1,
120  T = 2,
121  QV = 3, // water vapor
122  MU , // bdy perturbation dry air mass in column (we will get mub from the initial data)
123  PC , // p_s - p_top = dry hydrostatic pressure difference between the surface and the model top
124  NumTypes
125  };
126 }
127 
128 namespace MetGridBdyVars {
129  enum {
130  U = 0,
131  V = 1,
132  T = 2,
133  QV = 3,
134  NumTypes
135  };
136 }
137 
138 namespace MetGridTmpSrcVars {
139  enum {
140  Theta = 0,
141  QV = 1,
142  NumTypes
143  };
144 }
145 
146 namespace MetGridTmpDstVars {
147  enum {
148  P = 0,
149  T = 1,
150  NumTypes
151  };
152 }
153 
154 namespace Vars {
155  enum {
156  cons = 0,
160  NumTypes
161  };
162 }
163 
164 namespace GpVars {
165  enum {
166  gpx = 0,
169  };
170 }
171 
172 namespace IntVars {
173  enum {
174  cons = 0,
178  NumTypes
179  };
180 }
181 
182 // We separate out horizontal and vertical turbulent diffusivities
183 // These are the same for LES, but different for PBL models
184 namespace EddyDiff {
185  enum {
186  Mom_h = 0,
197  NumDiffs
198  };
199 }
200 
201 enum struct ERF_BC {
202  symmetry,
203  inflow,
204  outflow,
206  ho_outflow,
207  open,
208  no_slip_wall,
209  slip_wall,
210  periodic,
212  undefined
213 };
214 
215 // NOTE: the first of these must match up with the BCType enum
216 // in amrex/Src/Base/AMReX_BC_TYPES.H. We had extras at
217 // the end to use locally
218 namespace ERFBCType {
220  bogus = -666,
222  int_dir = 0,
224  foextrap = 2,
225  ext_dir = 3,
229  neumann = 104,
230  neumann_int = 105,
231  open = 106,
232  hoextrap = 107,
233  ext_dir_upwind = 108
234 };
235 }
236 
237 enum struct AdvType : int {
238  Centered_2nd = 101,
239  Upwind_3rd = 102,
240  Upwind_3rd_SL = 103,
241  Centered_4th = 104,
242  Upwind_5th = 105,
243  Centered_6th = 106,
244  Weno_3 = 107,
245  Weno_3Z = 108,
246  Weno_5 = 109,
247  Weno_5Z = 110,
248  Weno_3MZQ = 111,
249  Weno_7 = 112,
250  Weno_7Z = 113,
251  Unknown = 114
252 };
253 #endif
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AdvType
Definition: ERF_IndexDefines.H:237
@ Upwind_3rd_SL
@ Centered_4th
@ Centered_6th
@ Centered_2nd
ERF_BC
Definition: ERF_IndexDefines.H:201
@ ho_outflow
@ inflow_outflow
@ no_slip_wall
@ surface_layer
Definition: ERF_IndexDefines.H:74
@ RhoQ6_bc_comp
Definition: ERF_IndexDefines.H:86
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:80
@ zvel_bc
Definition: ERF_IndexDefines.H:89
@ RhoQ1_bc_comp
Definition: ERF_IndexDefines.H:81
@ NumTypes
Definition: ERF_IndexDefines.H:90
@ RhoQ4_bc_comp
Definition: ERF_IndexDefines.H:84
@ RhoKE_bc_comp
Definition: ERF_IndexDefines.H:79
@ RhoQ3_bc_comp
Definition: ERF_IndexDefines.H:83
@ RhoTheta_bc_comp
Definition: ERF_IndexDefines.H:78
@ RhoQ2_bc_comp
Definition: ERF_IndexDefines.H:82
@ Rho_bc_comp
Definition: ERF_IndexDefines.H:77
@ yvel_bc
Definition: ERF_IndexDefines.H:88
@ cons_bc
Definition: ERF_IndexDefines.H:76
@ xvel_bc
Definition: ERF_IndexDefines.H:87
@ RhoQ5_bc_comp
Definition: ERF_IndexDefines.H:85
Definition: ERF_IndexDefines.H:96
@ rho0_bc_comp
Definition: ERF_IndexDefines.H:98
@ th0_bc_comp
Definition: ERF_IndexDefines.H:101
@ qv0_bc_comp
Definition: ERF_IndexDefines.H:102
@ pi0_bc_comp
Definition: ERF_IndexDefines.H:100
@ p0_bc_comp
Definition: ERF_IndexDefines.H:99
Definition: ERF_IndexDefines.H:61
@ num_comps
Definition: ERF_IndexDefines.H:68
@ qv0_comp
Definition: ERF_IndexDefines.H:67
@ pi0_comp
Definition: ERF_IndexDefines.H:65
@ p0_comp
Definition: ERF_IndexDefines.H:64
@ th0_comp
Definition: ERF_IndexDefines.H:66
@ r0_comp
Definition: ERF_IndexDefines.H:63
Definition: ERF_IndexDefines.H:218
mathematicalBndryTypes
Definition: ERF_IndexDefines.H:219
@ neumann
Definition: ERF_IndexDefines.H:229
@ ext_dir_ingested
Definition: ERF_IndexDefines.H:228
@ open
Definition: ERF_IndexDefines.H:231
@ reflect_odd
Definition: ERF_IndexDefines.H:221
@ hoextrap
Definition: ERF_IndexDefines.H:232
@ foextrap
Definition: ERF_IndexDefines.H:224
@ ext_dir
Definition: ERF_IndexDefines.H:225
@ ext_dir_prim
Definition: ERF_IndexDefines.H:227
@ bogus
Definition: ERF_IndexDefines.H:220
@ surface_layer
Definition: ERF_IndexDefines.H:226
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:233
@ int_dir
Definition: ERF_IndexDefines.H:222
@ neumann_int
Definition: ERF_IndexDefines.H:230
@ reflect_even
Definition: ERF_IndexDefines.H:223
Definition: ERF_IndexDefines.H:184
@ Theta_v
Definition: ERF_IndexDefines.H:192
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:196
@ Scalar_v
Definition: ERF_IndexDefines.H:194
@ Mom_h
Definition: ERF_IndexDefines.H:186
@ Q_v
Definition: ERF_IndexDefines.H:195
@ Q_h
Definition: ERF_IndexDefines.H:190
@ Mom_v
Definition: ERF_IndexDefines.H:191
@ Scalar_h
Definition: ERF_IndexDefines.H:189
@ KE_v
Definition: ERF_IndexDefines.H:193
@ NumDiffs
Definition: ERF_IndexDefines.H:197
@ Theta_h
Definition: ERF_IndexDefines.H:187
@ KE_h
Definition: ERF_IndexDefines.H:188
Definition: ERF_IndexDefines.H:164
@ gpz
Definition: ERF_IndexDefines.H:168
@ gpy
Definition: ERF_IndexDefines.H:167
@ gpx
Definition: ERF_IndexDefines.H:166
Definition: ERF_IndexDefines.H:172
@ NumTypes
Definition: ERF_IndexDefines.H:178
@ ymom
Definition: ERF_IndexDefines.H:176
@ cons
Definition: ERF_IndexDefines.H:174
@ zmom
Definition: ERF_IndexDefines.H:177
@ xmom
Definition: ERF_IndexDefines.H:175
Definition: ERF_IndexDefines.H:128
@ U
Definition: ERF_IndexDefines.H:130
@ NumTypes
Definition: ERF_IndexDefines.H:134
@ V
Definition: ERF_IndexDefines.H:131
@ QV
Definition: ERF_IndexDefines.H:133
@ T
Definition: ERF_IndexDefines.H:132
Definition: ERF_IndexDefines.H:146
@ P
Definition: ERF_IndexDefines.H:148
@ T
Definition: ERF_IndexDefines.H:149
@ NumTypes
Definition: ERF_IndexDefines.H:150
Definition: ERF_IndexDefines.H:138
@ Theta
Definition: ERF_IndexDefines.H:140
@ QV
Definition: ERF_IndexDefines.H:141
@ NumTypes
Definition: ERF_IndexDefines.H:142
Definition: ERF_IndexDefines.H:106
@ U
Definition: ERF_IndexDefines.H:108
@ NumTypes
Definition: ERF_IndexDefines.H:112
@ QV
Definition: ERF_IndexDefines.H:111
@ T
Definition: ERF_IndexDefines.H:110
@ V
Definition: ERF_IndexDefines.H:109
Definition: ERF_IndexDefines.H:154
@ xvel
Definition: ERF_IndexDefines.H:157
@ cons
Definition: ERF_IndexDefines.H:156
@ zvel
Definition: ERF_IndexDefines.H:159
@ NumTypes
Definition: ERF_IndexDefines.H:160
@ yvel
Definition: ERF_IndexDefines.H:158
Definition: ERF_IndexDefines.H:116
@ T
Definition: ERF_IndexDefines.H:120
@ QV
Definition: ERF_IndexDefines.H:121
@ V
Definition: ERF_IndexDefines.H:119
@ PC
Definition: ERF_IndexDefines.H:123
@ NumTypes
Definition: ERF_IndexDefines.H:124
@ MU
Definition: ERF_IndexDefines.H:122
@ U
Definition: ERF_IndexDefines.H:118