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 IntVars {
149  enum {
150  cons = 0,
154  NumTypes
155  };
156 }
157 
158 // We separate out horizontal and vertical turbulent diffusivities
159 // These are the same for LES, but different for PBL models
160 namespace EddyDiff {
161  enum {
162  Mom_h = 0,
173  NumDiffs
174  };
175 }
176 
177 enum struct ERF_BC {
179 };
180 
181 // NOTE: the first of these must match up with the BCType enum
182 // in amrex/Src/Base/AMReX_BC_TYPES.H. We had extras at
183 // the end to use locally
184 namespace ERFBCType {
186  bogus = -666,
188  int_dir = 0,
190  foextrap = 2,
191  ext_dir = 3,
192  MOST = 101,
195  neumann = 104,
196  neumann_int = 105,
197  open = 106,
198  hoextrapcc = 107,
199  ext_dir_upwind = 108
200 };
201 }
202 
203 enum struct AdvType : int {
204  Centered_2nd = 101,
205  Upwind_3rd = 102,
206  Centered_4th = 103,
207  Upwind_5th = 104,
208  Centered_6th = 105,
209  Weno_3 = 106,
210  Weno_3Z = 107,
211  Weno_5 = 108,
212  Weno_5Z = 109,
213  Weno_3MZQ = 110,
214  Weno_7 = 111,
215  Weno_7Z = 112,
216  Unknown = 113
217 };
218 #endif
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AdvType
Definition: ERF_IndexDefines.H:203
@ Centered_4th
@ Centered_6th
@ Centered_2nd
ERF_BC
Definition: ERF_IndexDefines.H:177
@ ho_outflow
@ inflow_outflow
@ no_slip_wall
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:184
mathematicalBndryTypes
Definition: ERF_IndexDefines.H:185
@ neumann
Definition: ERF_IndexDefines.H:195
@ ext_dir_ingested
Definition: ERF_IndexDefines.H:194
@ open
Definition: ERF_IndexDefines.H:197
@ reflect_odd
Definition: ERF_IndexDefines.H:187
@ MOST
Definition: ERF_IndexDefines.H:192
@ foextrap
Definition: ERF_IndexDefines.H:190
@ ext_dir
Definition: ERF_IndexDefines.H:191
@ ext_dir_prim
Definition: ERF_IndexDefines.H:193
@ bogus
Definition: ERF_IndexDefines.H:186
@ hoextrapcc
Definition: ERF_IndexDefines.H:198
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:199
@ int_dir
Definition: ERF_IndexDefines.H:188
@ neumann_int
Definition: ERF_IndexDefines.H:196
@ reflect_even
Definition: ERF_IndexDefines.H:189
Definition: ERF_IndexDefines.H:160
@ Theta_v
Definition: ERF_IndexDefines.H:168
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:172
@ Scalar_v
Definition: ERF_IndexDefines.H:170
@ Mom_h
Definition: ERF_IndexDefines.H:162
@ Q_v
Definition: ERF_IndexDefines.H:171
@ Q_h
Definition: ERF_IndexDefines.H:166
@ Mom_v
Definition: ERF_IndexDefines.H:167
@ Scalar_h
Definition: ERF_IndexDefines.H:165
@ KE_v
Definition: ERF_IndexDefines.H:169
@ NumDiffs
Definition: ERF_IndexDefines.H:173
@ Theta_h
Definition: ERF_IndexDefines.H:163
@ KE_h
Definition: ERF_IndexDefines.H:164
Definition: ERF_IndexDefines.H:148
@ NumTypes
Definition: ERF_IndexDefines.H:154
@ ymom
Definition: ERF_IndexDefines.H:152
@ cons
Definition: ERF_IndexDefines.H:150
@ zmom
Definition: ERF_IndexDefines.H:153
@ xmom
Definition: ERF_IndexDefines.H:151
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