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 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,
67  num_comps
68  };
69 }
70 
71 // NOTE: we still use this indexing even if no moisture
72 // NOTE: We assume a single boundary condition for all passive scalars
73 // NOTE: and a single boundary condition for all components of the base state
74 namespace BCVars {
75  enum {
76  cons_bc = 0,
91  NumTypes
92  };
93 }
94 
95 namespace RealBdyVars {
96  enum {
97  U = 0,
98  V = 1,
99  T = 2,
100  QV = 3,
101  NumTypes
102  };
103 }
104 
105 namespace WRFBdyVars {
106  enum {
107  U = 0,
108  V = 1,
109  T = 2,
110  QV , // water vapor
111  MU , // bdy perturbation dry air mass in column (we will get mub from the initial data)
112  PC , // p_s - p_top = dry hydrostatic pressure difference between the surface and the model top
113  NumTypes
114  };
115 }
116 
117 namespace MetGridBdyVars {
118  enum {
119  U = 0,
120  V = 1,
121  T = 2,
122  QV,
123  NumTypes
124  };
125 }
126 
127 namespace Vars {
128  enum {
129  cons = 0,
133  NumTypes
134  };
135 }
136 
137 namespace IntVars {
138  enum {
139  cons = 0,
143  NumTypes
144  };
145 }
146 
147 // We separate out horizontal and vertical turbulent diffusivities
148 // These are the same for LES, but different for PBL models
149 namespace EddyDiff {
150  enum {
151  Mom_h = 0,
162  NumDiffs
163  };
164 }
165 
166 enum struct ERF_BC {
168 };
169 
170 // NOTE: the first of these must match up with the BCType enum
171 // in amrex/Src/Base/AMReX_BC_TYPES.H. We had extras at
172 // the end to use locally
173 namespace ERFBCType {
175  bogus = -666,
177  int_dir = 0,
179  foextrap = 2,
180  ext_dir = 3,
181  MOST = 101,
184  neumann = 104,
185  neumann_int = 105,
186  open = 106,
187  hoextrapcc = 107
188 };
189 }
190 
191 enum struct AdvType : int {
192  Centered_2nd = 101,
193  Upwind_3rd = 102,
194  Centered_4th = 103,
195  Upwind_5th = 104,
196  Centered_6th = 105,
197  Weno_3 = 106,
198  Weno_3Z = 107,
199  Weno_5 = 108,
200  Weno_5Z = 109,
201  Weno_3MZQ = 110,
202  Weno_7 = 111,
203  Weno_7Z = 112,
204  Unknown = 113
205 };
206 #endif
#define NBCVAR_max
Definition: ERF_IndexDefines.H:29
AdvType
Definition: ERF_IndexDefines.H:191
@ Centered_4th
@ Centered_6th
@ Centered_2nd
ERF_BC
Definition: ERF_IndexDefines.H:166
@ ho_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:90
@ RhoQ1_bc_comp
Definition: ERF_IndexDefines.H:81
@ NumTypes
Definition: ERF_IndexDefines.H:91
@ 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
@ base_bc
Definition: ERF_IndexDefines.H:87
@ yvel_bc
Definition: ERF_IndexDefines.H:89
@ cons_bc
Definition: ERF_IndexDefines.H:76
@ xvel_bc
Definition: ERF_IndexDefines.H:88
@ RhoQ5_bc_comp
Definition: ERF_IndexDefines.H:85
Definition: ERF_IndexDefines.H:61
@ num_comps
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:173
mathematicalBndryTypes
Definition: ERF_IndexDefines.H:174
@ neumann
Definition: ERF_IndexDefines.H:184
@ ext_dir_ingested
Definition: ERF_IndexDefines.H:183
@ open
Definition: ERF_IndexDefines.H:186
@ reflect_odd
Definition: ERF_IndexDefines.H:176
@ MOST
Definition: ERF_IndexDefines.H:181
@ foextrap
Definition: ERF_IndexDefines.H:179
@ ext_dir
Definition: ERF_IndexDefines.H:180
@ ext_dir_prim
Definition: ERF_IndexDefines.H:182
@ bogus
Definition: ERF_IndexDefines.H:175
@ hoextrapcc
Definition: ERF_IndexDefines.H:187
@ int_dir
Definition: ERF_IndexDefines.H:177
@ neumann_int
Definition: ERF_IndexDefines.H:185
@ reflect_even
Definition: ERF_IndexDefines.H:178
Definition: ERF_IndexDefines.H:149
@ Theta_v
Definition: ERF_IndexDefines.H:157
@ Turb_lengthscale
Definition: ERF_IndexDefines.H:161
@ Scalar_v
Definition: ERF_IndexDefines.H:159
@ Mom_h
Definition: ERF_IndexDefines.H:151
@ Q_v
Definition: ERF_IndexDefines.H:160
@ Q_h
Definition: ERF_IndexDefines.H:155
@ Mom_v
Definition: ERF_IndexDefines.H:156
@ Scalar_h
Definition: ERF_IndexDefines.H:154
@ KE_v
Definition: ERF_IndexDefines.H:158
@ NumDiffs
Definition: ERF_IndexDefines.H:162
@ Theta_h
Definition: ERF_IndexDefines.H:152
@ KE_h
Definition: ERF_IndexDefines.H:153
Definition: ERF_IndexDefines.H:137
@ NumTypes
Definition: ERF_IndexDefines.H:143
@ ymom
Definition: ERF_IndexDefines.H:141
@ cons
Definition: ERF_IndexDefines.H:139
@ zmom
Definition: ERF_IndexDefines.H:142
@ xmom
Definition: ERF_IndexDefines.H:140
Definition: ERF_IndexDefines.H:117
@ U
Definition: ERF_IndexDefines.H:119
@ NumTypes
Definition: ERF_IndexDefines.H:123
@ V
Definition: ERF_IndexDefines.H:120
@ QV
Definition: ERF_IndexDefines.H:122
@ T
Definition: ERF_IndexDefines.H:121
Definition: ERF_IndexDefines.H:95
@ U
Definition: ERF_IndexDefines.H:97
@ NumTypes
Definition: ERF_IndexDefines.H:101
@ QV
Definition: ERF_IndexDefines.H:100
@ T
Definition: ERF_IndexDefines.H:99
@ V
Definition: ERF_IndexDefines.H:98
Definition: ERF_IndexDefines.H:127
@ xvel
Definition: ERF_IndexDefines.H:130
@ cons
Definition: ERF_IndexDefines.H:129
@ zvel
Definition: ERF_IndexDefines.H:132
@ NumTypes
Definition: ERF_IndexDefines.H:133
@ yvel
Definition: ERF_IndexDefines.H:131
Definition: ERF_IndexDefines.H:105
@ T
Definition: ERF_IndexDefines.H:109
@ QV
Definition: ERF_IndexDefines.H:110
@ V
Definition: ERF_IndexDefines.H:108
@ PC
Definition: ERF_IndexDefines.H:112
@ NumTypes
Definition: ERF_IndexDefines.H:113
@ MU
Definition: ERF_IndexDefines.H:111
@ U
Definition: ERF_IndexDefines.H:107