ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 , // 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,
134  NumTypes
135  };
136 }
137 
138 namespace Vars {
139  enum {
140  cons = 0,
144  NumTypes
145  };
146 }
147 
148 namespace GpVars {
149  enum {
150  gpx = 0,
153  };
154 }
155 
156 namespace IntVars {
157  enum {
158  cons = 0,
162  NumTypes
163  };
164 }
165 
166 // We separate out horizontal and vertical turbulent diffusivities
167 // These are the same for LES, but different for PBL models
168 namespace EddyDiff {
169  enum {
170  Mom_h = 0,
181  NumDiffs
182  };
183 }
184 
185 enum struct ERF_BC {
186  symmetry,
187  inflow,
188  outflow,
190  ho_outflow,
191  open,
192  no_slip_wall,
193  slip_wall,
194  periodic,
196  undefined
197 };
198 
199 // NOTE: the first of these must match up with the BCType enum
200 // in amrex/Src/Base/AMReX_BC_TYPES.H. We had extras at
201 // the end to use locally
202 namespace ERFBCType {
204  bogus = -666,
206  int_dir = 0,
208  foextrap = 2,
209  ext_dir = 3,
213  neumann = 104,
214  neumann_int = 105,
215  open = 106,
216  hoextrap = 107,
217  ext_dir_upwind = 108
218 };
219 }
220 
221 enum struct AdvType : int {
222  Centered_2nd = 101,
223  Upwind_3rd = 102,
224  Centered_4th = 103,
225  Upwind_5th = 104,
226  Centered_6th = 105,
227  Weno_3 = 106,
228  Weno_3Z = 107,
229  Weno_5 = 108,
230  Weno_5Z = 109,
231  Weno_3MZQ = 110,
232  Weno_7 = 111,
233  Weno_7Z = 112,
234  Unknown = 113
235 };
236 #endif
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AdvType
Definition: ERF_IndexDefines.H:221
@ Centered_4th
@ Centered_6th
@ Centered_2nd
ERF_BC
Definition: ERF_IndexDefines.H:185
@ 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:202
mathematicalBndryTypes
Definition: ERF_IndexDefines.H:203
@ neumann
Definition: ERF_IndexDefines.H:213
@ ext_dir_ingested
Definition: ERF_IndexDefines.H:212
@ open
Definition: ERF_IndexDefines.H:215
@ reflect_odd
Definition: ERF_IndexDefines.H:205
@ hoextrap
Definition: ERF_IndexDefines.H:216
@ foextrap
Definition: ERF_IndexDefines.H:208
@ ext_dir
Definition: ERF_IndexDefines.H:209
@ ext_dir_prim
Definition: ERF_IndexDefines.H:211
@ bogus
Definition: ERF_IndexDefines.H:204
@ surface_layer
Definition: ERF_IndexDefines.H:210
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:217
@ int_dir
Definition: ERF_IndexDefines.H:206
@ neumann_int
Definition: ERF_IndexDefines.H:214
@ reflect_even
Definition: ERF_IndexDefines.H:207
Definition: ERF_IndexDefines.H:168
@ Theta_v
Definition: ERF_IndexDefines.H:176
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:180
@ Scalar_v
Definition: ERF_IndexDefines.H:178
@ Mom_h
Definition: ERF_IndexDefines.H:170
@ Q_v
Definition: ERF_IndexDefines.H:179
@ Q_h
Definition: ERF_IndexDefines.H:174
@ Mom_v
Definition: ERF_IndexDefines.H:175
@ Scalar_h
Definition: ERF_IndexDefines.H:173
@ KE_v
Definition: ERF_IndexDefines.H:177
@ NumDiffs
Definition: ERF_IndexDefines.H:181
@ Theta_h
Definition: ERF_IndexDefines.H:171
@ KE_h
Definition: ERF_IndexDefines.H:172
Definition: ERF_IndexDefines.H:148
@ gpz
Definition: ERF_IndexDefines.H:152
@ gpy
Definition: ERF_IndexDefines.H:151
@ gpx
Definition: ERF_IndexDefines.H:150
Definition: ERF_IndexDefines.H:156
@ NumTypes
Definition: ERF_IndexDefines.H:162
@ ymom
Definition: ERF_IndexDefines.H:160
@ cons
Definition: ERF_IndexDefines.H:158
@ zmom
Definition: ERF_IndexDefines.H:161
@ xmom
Definition: ERF_IndexDefines.H:159
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: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:138
@ xvel
Definition: ERF_IndexDefines.H:141
@ cons
Definition: ERF_IndexDefines.H:140
@ zvel
Definition: ERF_IndexDefines.H:143
@ NumTypes
Definition: ERF_IndexDefines.H:144
@ yvel
Definition: ERF_IndexDefines.H:142
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