ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_AdvectionSrcForMom_T.H
Go to the documentation of this file.
1 #include <ERF_IndexDefines.H>
2 #include <ERF_TerrainMetrics.H>
3 #include <ERF_Interpolation.H>
4 
5 /**
6  * Function for computing the advective tendency for the x-component of momentum
7  * with metric terms and for spatial order > 2
8  *
9  * @tparam InterpType_H horizontal interpolation type
10  * @tparam InterpType_V vertical interpolation type
11  * @param[in] i i-index of x-face at which to create tendency
12  * @param[in] j j-index of x-face at which to create tendency
13  * @param[in] k k-index of x-face at which to create tendency
14  * @param[in] rho_u x-component of momentum
15  * @param[in] rho_v y-component of momentum
16  * @param[in] Omega component of the momentum normal to the z-coordinate surface
17  * @param[in] z_nd height coordinate at nodes
18  * @param[in] ax Area fractions on x-faces
19  * @param[in] az Area fractions on z-faces
20  * @param[in] detJ Jacobian of the metric transformation (= 1 if use_terrain is false)
21  * @param[in] interp_u_h horizontal interpolator for x-component velocity
22  * @param[in] interp_u_v vertical interpolator for x-component velocity
23  * @param[in] cellSizeInv inverse of the grid spacing
24  * @param[in] mf_ux_inv inverse x map factor on x-faces
25  * @param[in] mf_uy_inv inverse y map factor on x-faces
26  * @param[in] mf_vx_inv inverse x map factor on y-faces
27  * @return advective tendency for x-momentum
28  */
29 template<typename InterpType_H, typename InterpType_V>
30 AMREX_GPU_DEVICE
31 AMREX_FORCE_INLINE
33 AdvectionSrcForXMom (int i, int j, int k,
34  const amrex::Array4<const amrex::Real>& rho_u,
35  const amrex::Array4<const amrex::Real>& rho_v,
36  const amrex::Array4<const amrex::Real>& Omega,
37  const amrex::Array4<const amrex::Real>& z_nd,
38  const amrex::Array4<const amrex::Real>& ax,
39  const amrex::Array4<const amrex::Real>& /*ay*/,
40  const amrex::Array4<const amrex::Real>& az,
41  const amrex::Array4<const amrex::Real>& detJ,
42  InterpType_H interp_u_h,
43  InterpType_V interp_u_v,
44  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
45  const amrex::Array4<const amrex::Real>& mf_ux_inv,
46  const amrex::Array4<const amrex::Real>& mf_uy_inv,
47  const amrex::Array4<const amrex::Real>& mf_vx_inv)
48 {
49  amrex::Real advectionSrc;
50  auto dxInv = cellSizeInv[0], dyInv = cellSizeInv[1], dzInv = cellSizeInv[2];
51 
52  amrex::Real rho_u_avg_lo, rho_u_avg_hi;
53  amrex::Real rho_v_avg_lo, rho_v_avg_hi;
54  amrex::Real Omega_avg_lo, Omega_avg_hi;
55 
56  amrex::Real interp_hi(zero), interp_lo(zero);
57 
58  // ****************************************************************************************
59  // X-fluxes (at cell centers)
60  // ****************************************************************************************
61  // average in the i direction, inverse mapfac 1/m_y = Δy/Δη
62  rho_u_avg_hi = myhalf * (rho_u(i+1, j, k) * mf_uy_inv(i+1, j, 0) + rho_u(i, j, k) * mf_uy_inv(i, j, 0));
63  rho_u_avg_lo = myhalf * (rho_u(i-1, j, k) * mf_uy_inv(i-1, j, 0) + rho_u(i, j, k) * mf_uy_inv(i, j, 0));
64 
65  interp_u_h.InterpolateInX(i+1,j,k,0,interp_hi,rho_u_avg_hi);
66  interp_u_h.InterpolateInX(i ,j,k,0,interp_lo,rho_u_avg_lo);
67 
68  // note: ax = (face height averaged over y) * dzInv = Δz/Δζ
69  amrex::Real centFluxXXNext = rho_u_avg_hi * interp_hi * myhalf * (ax(i,j,k) + ax(i+1,j,k));
70  amrex::Real centFluxXXPrev = rho_u_avg_lo * interp_lo * myhalf * (ax(i,j,k) + ax(i-1,j,k));
71 
72  // ****************************************************************************************
73  // Y-fluxes (at edges in k-direction)
74  // ****************************************************************************************
75  // average in the i direction, inverse mapfac 1/m_x = Δx/Δξ
76  rho_v_avg_hi = myhalf * (rho_v(i, j+1, k) * mf_vx_inv(i, j+1, 0) + rho_v(i-1, j+1, k) * mf_vx_inv(i-1, j+1, 0));
77  rho_v_avg_lo = myhalf * (rho_v(i, j , k) * mf_vx_inv(i, j , 0) + rho_v(i-1, j , k) * mf_vx_inv(i-1, j , 0));
78 
79  interp_u_h.InterpolateInY(i,j+1,k,0,interp_hi,rho_v_avg_hi);
80  interp_u_h.InterpolateInY(i,j ,k,0,interp_lo,rho_v_avg_lo);
81 
82  amrex::Real edgeFluxXYNext = rho_v_avg_hi * interp_hi * Compute_h_zeta_AtEdgeCenterK(i,j+1,k,cellSizeInv,z_nd);
83  amrex::Real edgeFluxXYPrev = rho_v_avg_lo * interp_lo * Compute_h_zeta_AtEdgeCenterK(i,j ,k,cellSizeInv,z_nd);
84 
85  // ****************************************************************************************
86  // Z-fluxes (at edges in j-direction)
87  // ****************************************************************************************
88  // average in the i direction
89  Omega_avg_hi = myhalf * (Omega(i, j, k+1) + Omega(i-1, j, k+1));
90  Omega_avg_lo = myhalf * (Omega(i, j, k ) + Omega(i-1, j, k ));
91 
92  interp_u_v.InterpolateInZ(i,j,k+1,0,interp_hi,Omega_avg_hi);
93  interp_u_v.InterpolateInZ(i,j,k ,0,interp_lo,Omega_avg_lo);
94 
95  amrex::Real edgeFluxXZNext = Omega_avg_hi * interp_hi * myhalf * (az(i, j, k+1) + az(i-1, j, k+1));
96  amrex::Real edgeFluxXZPrev = Omega_avg_lo * interp_lo * myhalf * (az(i, j, k ) + az(i-1, j, k ));
97 
98  // ****************************************************************************************
99 
100  amrex::Real mfsq = one / (mf_ux_inv(i,j,0) * mf_uy_inv(i,j,0)); // == m_x * m_y = (Δξ/Δx) * (Δη/Δy)
101 
102  advectionSrc = (centFluxXXNext - centFluxXXPrev) * dxInv * mfsq // ~ ρuu(Δy/Δη)(Δz/Δζ) * (1/Δξ) * (Δξ/Δx)*(Δη/Δy) = ρuu(Δz/Δζ) * (1/Δx)
103  + (edgeFluxXYNext - edgeFluxXYPrev) * dyInv * mfsq // ~ ρvu(Δx/Δξ)(Δz/Δζ) * (1/Δη) * (Δξ/Δx)*(Δη/Δy) = ρvu(Δz/Δζ) * (1/Δy)
104  + (edgeFluxXZNext - edgeFluxXZPrev) * dzInv; // ~ Ωu * (1/Δζ)
105  advectionSrc /= myhalf*(detJ(i,j,k) + detJ(i-1,j,k)); // ... then divide by (Δz/Δζ) to get back 1/Δx, 1/Δy, and 1/Δz for differencing
106 
107  return advectionSrc;
108 }
109 
110 /**
111  * Function for computing the advective tendency for the y-component of momentum
112  * with metric terms and for spatial order > 2
113  *
114  * @tparam InterpType_H horizontal interpolation type
115  * @tparam InterpType_V vertical interpolation type
116  * @param[in] i i-index of y-face at which to create tendency
117  * @param[in] j j-index of y-face at which to create tendency
118  * @param[in] k k-index of y-face at which to create tendency
119  * @param[in] rho_u x-component of momentum
120  * @param[in] rho_v y-component of momentum
121  * @param[in] Omega component of the momentum normal to the z-coordinate surface
122  * @param[in] z_nd height coordinate at nodes
123  * @param[in] ay Area fractions on y-faces
124  * @param[in] az Area fractions on z-faces
125  * @param[in] detJ Jacobian of the metric transformation (= 1 if use_terrain is false)
126  * @param[in] interp_v_h horizontal interpolator for y-component velocity
127  * @param[in] interp_v_v vertical interpolator for y-component velocity
128  * @param[in] cellSizeInv inverse of the grid spacing
129  * @param[in] mf_uy_inv inverse y map factor on x-faces
130  * @param[in] mf_vx_inv inverse x map factor on y-faces
131  * @param[in] mf_vy_inv inverse y map factor on y-faces
132  * @return advective tendency for y-momentum
133  */
134 template<typename InterpType_H, typename InterpType_V>
135 AMREX_GPU_DEVICE
136 AMREX_FORCE_INLINE
138 AdvectionSrcForYMom (int i, int j, int k,
139  const amrex::Array4<const amrex::Real>& rho_u,
140  const amrex::Array4<const amrex::Real>& rho_v,
141  const amrex::Array4<const amrex::Real>& Omega,
142  const amrex::Array4<const amrex::Real>& z_nd,
143  const amrex::Array4<const amrex::Real>& /*ax*/,
144  const amrex::Array4<const amrex::Real>& ay,
145  const amrex::Array4<const amrex::Real>& az,
146  const amrex::Array4<const amrex::Real>& detJ,
147  InterpType_H interp_v_h,
148  InterpType_V interp_v_v,
149  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
150  const amrex::Array4<const amrex::Real>& mf_uy_inv,
151  const amrex::Array4<const amrex::Real>& mf_vx_inv,
152  const amrex::Array4<const amrex::Real>& mf_vy_inv)
153 {
154  amrex::Real advectionSrc;
155  auto dxInv = cellSizeInv[0], dyInv = cellSizeInv[1], dzInv = cellSizeInv[2];
156 
157  amrex::Real rho_u_avg_lo, rho_u_avg_hi;
158  amrex::Real rho_v_avg_lo, rho_v_avg_hi;
159  amrex::Real Omega_avg_lo, Omega_avg_hi;
160 
161  amrex::Real interp_hi(zero), interp_lo(zero);
162 
163  // ****************************************************************************************
164  // X-fluxes (at edges in k-direction)
165  // ****************************************************************************************
166  // average in the j direction, inverse mapfac 1/m_y = Δy/Δη
167  rho_u_avg_hi = myhalf * (rho_u(i+1, j, k) * mf_uy_inv(i+1, j, 0) + rho_u(i+1, j-1, k) * mf_uy_inv(i+1, j-1, 0));
168  rho_u_avg_lo = myhalf * (rho_u(i , j, k) * mf_uy_inv(i , j, 0) + rho_u(i , j-1, k) * mf_uy_inv(i , j-1, 0));
169 
170  interp_v_h.InterpolateInX(i+1,j,k,0,interp_hi,rho_u_avg_hi);
171  interp_v_h.InterpolateInX(i ,j,k,0,interp_lo,rho_u_avg_lo);
172 
173  amrex::Real edgeFluxYXNext = rho_u_avg_hi * interp_hi * Compute_h_zeta_AtEdgeCenterK(i+1,j,k,cellSizeInv,z_nd);
174  amrex::Real edgeFluxYXPrev = rho_u_avg_lo * interp_lo * Compute_h_zeta_AtEdgeCenterK(i ,j,k,cellSizeInv,z_nd);
175 
176  // ****************************************************************************************
177  // Y-fluxes (at cell centers)
178  // ****************************************************************************************
179  // average in the j direction, inverse mapfac 1/m_x = Δx/Δξ
180  rho_v_avg_hi = myhalf * (rho_v(i, j+1, k) * mf_vx_inv(i, j+1, 0) + rho_v(i, j, k) * mf_vx_inv(i, j, 0));
181  rho_v_avg_lo = myhalf * (rho_v(i, j-1, k) * mf_vx_inv(i, j-1, 0) + rho_v(i, j, k) * mf_vx_inv(i, j, 0));
182 
183  interp_v_h.InterpolateInY(i,j+1,k,0,interp_hi,rho_v_avg_hi);
184  interp_v_h.InterpolateInY(i,j ,k,0,interp_lo,rho_v_avg_lo);
185 
186  // note: ay = (face height averaged over x) * dzInv = Δz/Δζ
187  amrex::Real centFluxYYNext = rho_v_avg_hi * interp_hi * myhalf * (ay(i,j,k) + ay(i,j+1,k));
188  amrex::Real centFluxYYPrev = rho_v_avg_lo * interp_lo * myhalf * (ay(i,j,k) + ay(i,j-1,k));
189 
190  // ****************************************************************************************
191  // Z-fluxes (at edges in i-direction)
192  // ****************************************************************************************
193  // average in the j direction
194  Omega_avg_hi = myhalf * (Omega(i, j, k+1) + Omega(i, j-1, k+1));
195  Omega_avg_lo = myhalf * (Omega(i, j, k ) + Omega(i, j-1, k ));
196 
197  interp_v_v.InterpolateInZ(i,j,k+1,0,interp_hi,Omega_avg_hi);
198  interp_v_v.InterpolateInZ(i,j,k ,0,interp_lo,Omega_avg_lo);
199 
200  amrex::Real edgeFluxYZNext = Omega_avg_hi * interp_hi * myhalf * (az(i, j, k+1) + az(i, j-1, k+1));
201  amrex::Real edgeFluxYZPrev = Omega_avg_lo * interp_lo * myhalf * (az(i, j, k ) + az(i, j-1, k ));
202 
203  // ****************************************************************************************
204 
205  amrex::Real mfsq = one / (mf_vx_inv(i,j,0) * mf_vy_inv(i,j,0)); // == m_x * m_y = (Δξ/Δx) * (Δη/Δy)
206 
207  advectionSrc = (edgeFluxYXNext - edgeFluxYXPrev) * dxInv * mfsq // ~ ρuv(Δy/Δη)(Δz/Δζ) * (1/Δξ) * (Δξ/Δx)*(Δη/Δy) = ρuu(Δz/Δζ) * (1/Δx)
208  + (centFluxYYNext - centFluxYYPrev) * dyInv * mfsq // ~ ρvv(Δx/Δξ)(Δz/Δζ) * (1/Δη) * (Δξ/Δx)*(Δη/Δy) = ρvu(Δz/Δζ) * (1/Δy)
209  + (edgeFluxYZNext - edgeFluxYZPrev) * dzInv; // ~ Ωv * (1/Δζ)
210  advectionSrc /= myhalf*(detJ(i,j,k) + detJ(i,j-1,k)); // ... then divide by (Δz/Δζ) to get back 1/Δx, 1/Δy, and 1/Δz for differencing
211 
212  return advectionSrc;
213 }
214 
215 /**
216  * Function for computing the advective tendency for the z-component of momentum
217  * with metric terms and for spatial order > 2
218  *
219  * @tparam InterpType_H horizontal interpolation type
220  * @tparam InterpType_V vertical interpolation type
221  * @tparam WallInterpType wall-aware vertical interpolation type
222  * @param[in] i i-index of z-face at which to create tendency
223  * @param[in] j j-index of z-face at which to create tendency
224  * @param[in] k k-index of z-face at which to create tendency
225  * @param[in] rho_u x-component of momentum
226  * @param[in] rho_v y-component of momentum
227  * @param[in] Omega component of the momentum normal to the z-coordinate surface
228  * @param[in] w z-component of velocity
229  * @param[in] z_nd height coordinate at nodes
230  * @param[in] az Area fractions on z-faces
231  * @param[in] detJ Jacobian of the metric transformation (= 1 if use_terrain is false)
232  * @param[in] interp_omega_h horizontal interpolator for z-coordinate-normal momentum
233  * @param[in] interp_omega_v vertical interpolator for z-coordinate-normal momentum
234  * @param[in] interp_omega_wall wall-aware vertical interpolator for z-coordinate-normal momentum
235  * @param[in] cellSizeInv inverse of the grid spacing
236  * @param[in] mf_mx x map factor on cell centers
237  * @param[in] mf_my y map factor on cell centers
238  * @param[in] mf_uy_inv inverse y map factor on x-faces
239  * @param[in] mf_vx_inv inverse x map factor on y-faces
240  * @param[in] vert_adv_type vertical advection stencil
241  * @param[in] lo_z_face minimum z-face k-index at this level
242  * @param[in] hi_z_face maximum z-face k-index at this level
243  * @return advective tendency for z-momentum
244  */
245 template<typename InterpType_H, typename InterpType_V, typename WallInterpType>
246 AMREX_GPU_DEVICE
247 AMREX_FORCE_INLINE
249 AdvectionSrcForZMom (int i, int j, int k,
250  const amrex::Array4<const amrex::Real>& rho_u,
251  const amrex::Array4<const amrex::Real>& rho_v,
252  const amrex::Array4<const amrex::Real>& Omega,
253  const amrex::Array4<const amrex::Real>& w,
254  const amrex::Array4<const amrex::Real>& z_nd,
255  const amrex::Array4<const amrex::Real>& /*ax*/,
256  const amrex::Array4<const amrex::Real>& /*ay*/,
257  const amrex::Array4<const amrex::Real>& az,
258  const amrex::Array4<const amrex::Real>& detJ,
259  InterpType_H interp_omega_h,
260  InterpType_V interp_omega_v,
261  WallInterpType interp_omega_wall,
262  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
263  const amrex::Array4<const amrex::Real>& mf_mx,
264  const amrex::Array4<const amrex::Real>& mf_my,
265  const amrex::Array4<const amrex::Real>& mf_uy_inv,
266  const amrex::Array4<const amrex::Real>& mf_vx_inv,
267  const AdvType vert_adv_type,
268  const int lo_z_face, const int hi_z_face)
269 {
270  amrex::Real advectionSrc;
271  auto dxInv = cellSizeInv[0], dyInv = cellSizeInv[1], dzInv = cellSizeInv[2];
272 
273  amrex::Real rho_u_avg_lo, rho_u_avg_hi;
274  amrex::Real rho_v_avg_lo, rho_v_avg_hi;
275  amrex::Real Omega_avg_lo, Omega_avg_hi;
276 
277  amrex::Real interp_hi(zero), interp_lo(zero);
278 
279  // ****************************************************************************************
280  // x-fluxes (at edges in j-direction)
281  // ****************************************************************************************
282  // average in the k direction, inverse mapfac 1/m_y = Δy/Δη
283  rho_u_avg_hi = myhalf * (rho_u(i+1, j, k) + rho_u(i+1, j, k-1)) * mf_uy_inv(i+1,j ,0);
284  rho_u_avg_lo = myhalf * (rho_u(i , j, k) + rho_u(i , j, k-1)) * mf_uy_inv(i ,j ,0);
285 
286  interp_omega_h.InterpolateInX(i+1,j,k,0,interp_hi,rho_u_avg_hi);
287  interp_omega_h.InterpolateInX(i ,j,k,0,interp_lo,rho_u_avg_lo);
288 
289  amrex::Real edgeFluxZXNext = rho_u_avg_hi * interp_hi * Compute_h_zeta_AtEdgeCenterJ(i+1,j,k,cellSizeInv,z_nd);
290  amrex::Real edgeFluxZXPrev = rho_u_avg_lo * interp_lo * Compute_h_zeta_AtEdgeCenterJ(i ,j,k,cellSizeInv,z_nd);
291 
292  // ****************************************************************************************
293  // y-fluxes (at edges in i-direction)
294  // ****************************************************************************************
295  // average in the k direction, inverse mapfac 1/m_x = Δx/Δξ
296  rho_v_avg_hi = myhalf * (rho_v(i, j+1, k) + rho_v(i, j+1, k-1)) * mf_vx_inv(i ,j+1,0);
297  rho_v_avg_lo = myhalf * (rho_v(i, j , k) + rho_v(i, j , k-1)) * mf_vx_inv(i ,j ,0);
298 
299  interp_omega_h.InterpolateInY(i,j+1,k,0,interp_hi,rho_v_avg_hi);
300  interp_omega_h.InterpolateInY(i,j ,k,0,interp_lo,rho_v_avg_lo);
301 
302  amrex::Real edgeFluxZYNext = rho_v_avg_hi * interp_hi * Compute_h_zeta_AtEdgeCenterI(i,j+1,k,cellSizeInv,z_nd);
303  amrex::Real edgeFluxZYPrev = rho_v_avg_lo * interp_lo * Compute_h_zeta_AtEdgeCenterI(i,j ,k,cellSizeInv,z_nd);
304 
305  // ****************************************************************************************
306  // z-fluxes (at cell centers)
307  // ****************************************************************************************
308 
309  Omega_avg_hi = (k == hi_z_face) ? Omega(i,j,k) * az(i,j,k) :
310  fourth * (Omega(i,j,k) + Omega(i,j,k+1)) * (az(i,j,k) + az(i,j,k+1));
311  amrex::Real centFluxZZNext = Omega_avg_hi;
312 
313  // int l_spatial_order_hi = std::min(std::min(vert_spatial_order, 2*(hi_z_face-k)), 2*(k+1));
314  // If k == hi_z_face-1, l_spatial_order_hi = 2
315  // If k == hi_z_face-2, l_spatial_order_hi = std::min(vert_spatial_order, 4);
316  // If k == lo_z_face+11 , l_spatial_order_hi = std::min(vert_spatial_order, 4);
317  if (k == hi_z_face) {
318  centFluxZZNext *= w(i,j,k);
319  } else {
320  if (k == hi_z_face-1)
321  {
322  interp_omega_wall.InterpolateInZ(i,j,k+1,0,interp_hi,Omega_avg_hi,AdvType::Centered_2nd);
323  } else if (k == hi_z_face-2 || k == lo_z_face+1) {
324  if (vert_adv_type != AdvType::Centered_2nd && vert_adv_type != AdvType::Upwind_3rd) {
325  interp_omega_wall.InterpolateInZ(i,j,k+1,0,interp_hi,Omega_avg_hi,AdvType::Centered_4th);
326  } else {
327  interp_omega_wall.InterpolateInZ(i,j,k+1,0,interp_hi,Omega_avg_hi,vert_adv_type);
328  }
329  } else {
330  interp_omega_v.InterpolateInZ(i,j,k+1,0,interp_hi,Omega_avg_hi);
331  }
332  centFluxZZNext *= interp_hi;
333  }
334 
335  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
336 
337  Omega_avg_lo = (k == 0) ? Omega(i,j,k) * az(i,j,k) :
338  fourth * (Omega(i,j,k) + Omega(i,j,k-1)) * (az(i,j,k) + az(i,j,k-1));
339  amrex::Real centFluxZZPrev = Omega_avg_lo;
340 
341  // int l_spatial_order_lo = std::min(std::min(vert_spatial_order, 2*(hi_z_face+1-k)), 2*k);
342  // If k == hi_z_face-1, l_spatial_order_hi = 2
343  // If k == hi_z_face-2, l_spatial_order_hi = std::min(vert_spatial_order, 4);
344  // If k == lo_z_face+1, l_spatial_order_hi = std::min(vert_spatial_order, 4);
345  if (k == 0) {
346  centFluxZZPrev *= w(i,j,k);
347  } else {
348  if (k == lo_z_face+1) {
349  interp_omega_wall.InterpolateInZ(i,j,k,0,interp_lo,Omega_avg_lo,AdvType::Centered_2nd);
350  } else if (k == lo_z_face+2 || k == hi_z_face-1) {
351  if (vert_adv_type != AdvType::Centered_2nd && vert_adv_type != AdvType::Upwind_3rd) {
352  interp_omega_wall.InterpolateInZ(i,j,k,0,interp_lo,Omega_avg_lo,AdvType::Centered_4th);
353  } else {
354  interp_omega_wall.InterpolateInZ(i,j,k,0,interp_lo,Omega_avg_lo,vert_adv_type);
355  }
356  } else {
357  interp_omega_v.InterpolateInZ(i,j,k,0,interp_lo,Omega_avg_lo);
358  }
359  centFluxZZPrev *= interp_lo;
360  }
361 
362  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
363 
364  amrex::Real mfsq = mf_mx(i,j,0) * mf_my(i,j,0);
365 
366  advectionSrc = (edgeFluxZXNext - edgeFluxZXPrev) * dxInv * mfsq
367  + (edgeFluxZYNext - edgeFluxZYPrev) * dyInv * mfsq
368  + (centFluxZZNext - centFluxZZPrev) * dzInv;
369 
370  amrex::Real denom = myhalf*(detJ(i,j,k) + detJ(i,j,k-1));
371  advectionSrc /= denom;
372 
373  return advectionSrc;
374 }
375 
376 /**
377  * Wrapper function for computing the advective tendency w/ spatial order > two
378  *
379  * @tparam InterpType_H horizontal interpolation type
380  * @tparam InterpType_V vertical interpolation type
381  * @tparam WallInterpType wall-aware vertical interpolation type
382  * @param[in] bxx box over which x-momentum is updated
383  * @param[in] bxy box over which y-momentum is updated
384  * @param[in] bxz box over which z-momentum is updated
385  * @param[out] rho_u_rhs tendency for the x-momentum equation
386  * @param[out] rho_v_rhs tendency for the y-momentum equation
387  * @param[out] rho_w_rhs tendency for the z-momentum equation
388  * @param[in] rho_u x-component of momentum
389  * @param[in] rho_v y-component of momentum
390  * @param[in] Omega component of the momentum normal to the z-coordinate surface
391  * @param[in] u x-component of velocity
392  * @param[in] v y-component of velocity
393  * @param[in] w z-component of velocity
394  * @param[in] z_nd height coordinate at nodes
395  * @param[in] ax area fractions on x-faces
396  * @param[in] ay area fractions on y-faces
397  * @param[in] az area fractions on z-faces
398  * @param[in] detJ Jacobian of the metric transformation
399  * @param[in] cellSizeInv inverse grid spacing
400  * @param[in] mf_mx x map factor on cell centers
401  * @param[in] mf_ux_inv inverse x map factor on x-faces
402  * @param[in] mf_vx_inv inverse x map factor on y-faces
403  * @param[in] mf_my y map factor on cell centers
404  * @param[in] mf_uy_inv inverse y map factor on x-faces
405  * @param[in] mf_vy_inv inverse y map factor on y-faces
406  * @param[in] upw_frac_h horizontal upwind blending fraction
407  * @param[in] upw_frac_v vertical upwind blending fraction
408  * @param[in] vert_adv_type vertical advection stencil
409  * @param[in] lo_z_face minimum z-face k-index at this level
410  * @param[in] hi_z_face maximum z-face k-index at this level
411  */
412 template<typename InterpType_H, typename InterpType_V, typename WallInterpType>
413 void
414 AdvectionSrcForMomWrapper (const amrex::Box& bxx, const amrex::Box& bxy, const amrex::Box& bxz,
415  const amrex::Array4<amrex::Real>& rho_u_rhs,
416  const amrex::Array4<amrex::Real>& rho_v_rhs,
417  const amrex::Array4<amrex::Real>& rho_w_rhs,
418  const amrex::Array4<const amrex::Real>& rho_u,
419  const amrex::Array4<const amrex::Real>& rho_v,
420  const amrex::Array4<const amrex::Real>& Omega,
421  const amrex::Array4<const amrex::Real>& u,
422  const amrex::Array4<const amrex::Real>& v,
423  const amrex::Array4<const amrex::Real>& w,
424  const amrex::Array4<const amrex::Real>& z_nd,
425  const amrex::Array4<const amrex::Real>& ax,
426  const amrex::Array4<const amrex::Real>& ay,
427  const amrex::Array4<const amrex::Real>& az,
428  const amrex::Array4<const amrex::Real>& detJ,
429  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
430  const amrex::Array4<const amrex::Real>& mf_mx,
431  const amrex::Array4<const amrex::Real>& mf_ux_inv,
432  const amrex::Array4<const amrex::Real>& mf_vx_inv,
433  const amrex::Array4<const amrex::Real>& mf_my,
434  const amrex::Array4<const amrex::Real>& mf_uy_inv,
435  const amrex::Array4<const amrex::Real>& mf_vy_inv,
436  const amrex::Real upw_frac_h,
437  const amrex::Real upw_frac_v,
438  const AdvType vert_adv_type,
439  const int lo_z_face, const int hi_z_face)
440 {
441  // Instantiate the appropriate structs
442  InterpType_H interp_u_h(u, upw_frac_h); InterpType_V interp_u_v(u, upw_frac_v); // X-MOM
443  InterpType_H interp_v_h(v, upw_frac_h); InterpType_V interp_v_v(v, upw_frac_v); // Y-MOM
444  InterpType_H interp_w_h(w, upw_frac_h); InterpType_V interp_w_v(w, upw_frac_v); // Z-MOM
445  WallInterpType interp_w_wall(w, upw_frac_v); // Z-MOM @ wall
446 
447  amrex::ParallelFor(bxx,
448  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
449  {
450  rho_u_rhs(i, j, k) = -AdvectionSrcForXMom(i, j, k, rho_u, rho_v, Omega, z_nd, ax, ay, az, detJ,
451  interp_u_h, interp_u_v,
452  cellSizeInv, mf_ux_inv, mf_uy_inv, mf_vx_inv);
453  });
454 
455  amrex::ParallelFor(bxy,
456  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
457  {
458  rho_v_rhs(i, j, k) = -AdvectionSrcForYMom(i, j, k, rho_u, rho_v, Omega, z_nd, ax, ay, az, detJ,
459  interp_v_h, interp_v_v,
460  cellSizeInv, mf_uy_inv, mf_vx_inv, mf_vy_inv);
461  });
462 
463  amrex::ParallelFor(bxz,
464  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
465  {
466  rho_w_rhs(i, j, k) = -AdvectionSrcForZMom(i, j, k, rho_u, rho_v, Omega, w, z_nd, ax, ay, az, detJ,
467  interp_w_h, interp_w_v, interp_w_wall,
468  cellSizeInv, mf_mx, mf_my, mf_uy_inv, mf_vx_inv,
469  vert_adv_type, lo_z_face, hi_z_face);
470  });
471 }
472 
473 /**
474  * Wrapper function for computing the advective tendency w/ spatial order > two
475  *
476  * @tparam InterpType_H horizontal interpolation type
477  * @param[in] bxx box over which x-momentum is updated
478  * @param[in] bxy box over which y-momentum is updated
479  * @param[in] bxz box over which z-momentum is updated
480  * @param[out] rho_u_rhs tendency for the x-momentum equation
481  * @param[out] rho_v_rhs tendency for the y-momentum equation
482  * @param[out] rho_w_rhs tendency for the z-momentum equation
483  * @param[in] rho_u x-component of momentum
484  * @param[in] rho_v y-component of momentum
485  * @param[in] Omega component of the momentum normal to the z-coordinate surface
486  * @param[in] u x-component of velocity
487  * @param[in] v y-component of velocity
488  * @param[in] w z-component of velocity
489  * @param[in] z_nd height coordinate at nodes
490  * @param[in] ax area fractions on x-faces
491  * @param[in] ay area fractions on y-faces
492  * @param[in] az area fractions on z-faces
493  * @param[in] detJ Jacobian of the metric transformation
494  * @param[in] cellSizeInv inverse grid spacing
495  * @param[in] mf_mx x map factor on cell centers
496  * @param[in] mf_ux_inv inverse x map factor on x-faces
497  * @param[in] mf_vx_inv inverse x map factor on y-faces
498  * @param[in] mf_my y map factor on cell centers
499  * @param[in] mf_uy_inv inverse y map factor on x-faces
500  * @param[in] mf_vy_inv inverse y map factor on y-faces
501  * @param[in] upw_frac_h horizontal upwind blending fraction
502  * @param[in] upw_frac_v vertical upwind blending fraction
503  * @param[in] vert_adv_type vertical advection stencil
504  * @param[in] lo_z_face minimum z-face k-index at this level
505  * @param[in] hi_z_face maximum z-face k-index at this level
506  */
507 template<typename InterpType_H>
508 void
509 AdvectionSrcForMomVert (const amrex::Box& bxx, const amrex::Box& bxy, const amrex::Box& bxz,
510  const amrex::Array4<amrex::Real>& rho_u_rhs,
511  const amrex::Array4<amrex::Real>& rho_v_rhs,
512  const amrex::Array4<amrex::Real>& rho_w_rhs,
513  const amrex::Array4<const amrex::Real>& rho_u,
514  const amrex::Array4<const amrex::Real>& rho_v,
515  const amrex::Array4<const amrex::Real>& Omega,
516  const amrex::Array4<const amrex::Real>& u,
517  const amrex::Array4<const amrex::Real>& v,
518  const amrex::Array4<const amrex::Real>& w,
519  const amrex::Array4<const amrex::Real>& z_nd,
520  const amrex::Array4<const amrex::Real>& ax,
521  const amrex::Array4<const amrex::Real>& ay,
522  const amrex::Array4<const amrex::Real>& az,
523  const amrex::Array4<const amrex::Real>& detJ,
524  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
525  const amrex::Array4<const amrex::Real>& mf_mx,
526  const amrex::Array4<const amrex::Real>& mf_ux_inv,
527  const amrex::Array4<const amrex::Real>& mf_vx_inv,
528  const amrex::Array4<const amrex::Real>& mf_my,
529  const amrex::Array4<const amrex::Real>& mf_uy_inv,
530  const amrex::Array4<const amrex::Real>& mf_vy_inv,
531  const amrex::Real upw_frac_h,
532  const amrex::Real upw_frac_v,
533  const AdvType vert_adv_type,
534  const int lo_z_face, const int hi_z_face)
535 {
536  if (vert_adv_type == AdvType::Centered_2nd) {
537  AdvectionSrcForMomWrapper<InterpType_H,CENTERED2,UPWINDALL>(bxx, bxy, bxz,
538  rho_u_rhs, rho_v_rhs, rho_w_rhs,
539  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
540  cellSizeInv,
541  mf_mx, mf_ux_inv, mf_vx_inv,
542  mf_my, mf_uy_inv, mf_vy_inv,
543  upw_frac_h, upw_frac_v,
544  vert_adv_type, lo_z_face, hi_z_face);
545  } else if (vert_adv_type == AdvType::Upwind_3rd) {
546  AdvectionSrcForMomWrapper<InterpType_H,UPWIND3,UPWINDALL>(bxx, bxy, bxz,
547  rho_u_rhs, rho_v_rhs, rho_w_rhs,
548  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
549  cellSizeInv,
550  mf_mx, mf_ux_inv, mf_vx_inv,
551  mf_my, mf_uy_inv, mf_vy_inv,
552  upw_frac_h, upw_frac_v,
553  vert_adv_type, lo_z_face, hi_z_face);
554  } else if (vert_adv_type == AdvType::Centered_4th) {
555  AdvectionSrcForMomWrapper<InterpType_H,CENTERED4,UPWINDALL>(bxx, bxy, bxz,
556  rho_u_rhs, rho_v_rhs, rho_w_rhs,
557  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
558  cellSizeInv,
559  mf_mx, mf_ux_inv, mf_vx_inv,
560  mf_my, mf_uy_inv, mf_vy_inv,
561  upw_frac_h, upw_frac_v,
562  vert_adv_type, lo_z_face, hi_z_face);
563  } else if (vert_adv_type == AdvType::Upwind_5th) {
564  AdvectionSrcForMomWrapper<InterpType_H,UPWIND5,UPWINDALL>(bxx, bxy, bxz,
565  rho_u_rhs, rho_v_rhs, rho_w_rhs,
566  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
567  cellSizeInv,
568  mf_mx, mf_ux_inv, mf_vx_inv,
569  mf_my, mf_uy_inv, mf_vy_inv,
570  upw_frac_h, upw_frac_v,
571  vert_adv_type, lo_z_face, hi_z_face);
572  } else if (vert_adv_type == AdvType::Centered_6th) {
573  AdvectionSrcForMomWrapper<InterpType_H,CENTERED6,UPWINDALL>(bxx, bxy, bxz,
574  rho_u_rhs, rho_v_rhs, rho_w_rhs,
575  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
576  cellSizeInv,
577  mf_mx, mf_ux_inv, mf_vx_inv,
578  mf_my, mf_uy_inv, mf_vy_inv,
579  upw_frac_h, upw_frac_v,
580  vert_adv_type, lo_z_face, hi_z_face);
581 
582  } else if (vert_adv_type == AdvType::Weno_3) {
583  AdvectionSrcForMomWrapper<InterpType_H,WENO3,UPWINDALL>(bxx, bxy, bxz,
584  rho_u_rhs, rho_v_rhs, rho_w_rhs,
585  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
586  cellSizeInv,
587  mf_mx, mf_ux_inv, mf_vx_inv,
588  mf_my, mf_uy_inv, mf_vy_inv,
589  upw_frac_h, upw_frac_v,
590  vert_adv_type, lo_z_face, hi_z_face);
591  } else if (vert_adv_type == AdvType::Weno_3Z) {
592  AdvectionSrcForMomWrapper<InterpType_H,WENO_Z3,UPWINDALL>(bxx, bxy, bxz,
593  rho_u_rhs, rho_v_rhs, rho_w_rhs,
594  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
595  cellSizeInv,
596  mf_mx, mf_ux_inv, mf_vx_inv,
597  mf_my, mf_uy_inv, mf_vy_inv,
598  upw_frac_h, upw_frac_v,
599  vert_adv_type, lo_z_face, hi_z_face);
600  } else if (vert_adv_type == AdvType::Weno_3MZQ) {
601  AdvectionSrcForMomWrapper<InterpType_H,WENO_MZQ3,UPWINDALL>(bxx, bxy, bxz,
602  rho_u_rhs, rho_v_rhs, rho_w_rhs,
603  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
604  cellSizeInv,
605  mf_mx, mf_ux_inv, mf_vx_inv,
606  mf_my, mf_uy_inv, mf_vy_inv,
607  upw_frac_h, upw_frac_v,
608  vert_adv_type, lo_z_face, hi_z_face);
609  } else if (vert_adv_type == AdvType::Weno_5) {
610  AdvectionSrcForMomWrapper<InterpType_H,WENO5,UPWINDALL>(bxx, bxy, bxz,
611  rho_u_rhs, rho_v_rhs, rho_w_rhs,
612  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
613  cellSizeInv,
614  mf_mx, mf_ux_inv, mf_vx_inv,
615  mf_my, mf_uy_inv, mf_vy_inv,
616  upw_frac_h, upw_frac_v,
617  vert_adv_type, lo_z_face, hi_z_face);
618  } else if (vert_adv_type == AdvType::Weno_5Z) {
619  AdvectionSrcForMomWrapper<InterpType_H,WENO_Z5,UPWINDALL>(bxx, bxy, bxz,
620  rho_u_rhs, rho_v_rhs, rho_w_rhs,
621  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
622  cellSizeInv,
623  mf_mx, mf_ux_inv, mf_vx_inv,
624  mf_my, mf_uy_inv, mf_vy_inv,
625  upw_frac_h, upw_frac_v,
626  vert_adv_type, lo_z_face, hi_z_face);
627  } else if (vert_adv_type == AdvType::Weno_7) {
628  AdvectionSrcForMomWrapper<InterpType_H,WENO7,UPWINDALL>(bxx, bxy, bxz,
629  rho_u_rhs, rho_v_rhs, rho_w_rhs,
630  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
631  cellSizeInv,
632  mf_mx, mf_ux_inv, mf_vx_inv,
633  mf_my, mf_uy_inv, mf_vy_inv,
634  upw_frac_h, upw_frac_v,
635  vert_adv_type, lo_z_face, hi_z_face);
636  } else if (vert_adv_type == AdvType::Weno_7Z) {
637  AdvectionSrcForMomWrapper<InterpType_H,WENO_Z7,UPWINDALL>(bxx, bxy, bxz,
638  rho_u_rhs, rho_v_rhs, rho_w_rhs,
639  rho_u, rho_v, Omega, u, v, w, z_nd, ax, ay, az, detJ,
640  cellSizeInv,
641  mf_mx, mf_ux_inv, mf_vx_inv,
642  mf_my, mf_uy_inv, mf_vy_inv,
643  upw_frac_h, upw_frac_v,
644  vert_adv_type, lo_z_face, hi_z_face);
645  } else {
646  AMREX_ASSERT_WITH_MESSAGE(false, "Unknown advection scheme!");
647  }
648 }
void AdvectionSrcForMomWrapper(const amrex::Box &bxx, const amrex::Box &bxy, const amrex::Box &bxz, const amrex::Array4< amrex::Real > &rho_u_rhs, const amrex::Array4< amrex::Real > &rho_v_rhs, const amrex::Array4< amrex::Real > &rho_w_rhs, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< const amrex::Real > &z_nd, const amrex::Array4< const amrex::Real > &ax, const amrex::Array4< const amrex::Real > &ay, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_mx, const amrex::Array4< const amrex::Real > &mf_ux_inv, const amrex::Array4< const amrex::Real > &mf_vx_inv, const amrex::Array4< const amrex::Real > &mf_my, const amrex::Array4< const amrex::Real > &mf_uy_inv, const amrex::Array4< const amrex::Real > &mf_vy_inv, const amrex::Real upw_frac_h, const amrex::Real upw_frac_v, const AdvType vert_adv_type, const int lo_z_face, const int hi_z_face)
Definition: ERF_AdvectionSrcForMom_T.H:414
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForZMom(int i, int j, int k, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< const amrex::Real > &z_nd, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, InterpType_H interp_omega_h, InterpType_V interp_omega_v, WallInterpType interp_omega_wall, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_mx, const amrex::Array4< const amrex::Real > &mf_my, const amrex::Array4< const amrex::Real > &mf_uy_inv, const amrex::Array4< const amrex::Real > &mf_vx_inv, const AdvType vert_adv_type, const int lo_z_face, const int hi_z_face)
Definition: ERF_AdvectionSrcForMom_T.H:249
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForYMom(int i, int j, int k, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &z_nd, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &ay, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, InterpType_H interp_v_h, InterpType_V interp_v_v, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_uy_inv, const amrex::Array4< const amrex::Real > &mf_vx_inv, const amrex::Array4< const amrex::Real > &mf_vy_inv)
Definition: ERF_AdvectionSrcForMom_T.H:138
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForXMom(int i, int j, int k, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &z_nd, const amrex::Array4< const amrex::Real > &ax, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, InterpType_H interp_u_h, InterpType_V interp_u_v, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_ux_inv, const amrex::Array4< const amrex::Real > &mf_uy_inv, const amrex::Array4< const amrex::Real > &mf_vx_inv)
Definition: ERF_AdvectionSrcForMom_T.H:33
void AdvectionSrcForMomVert(const amrex::Box &bxx, const amrex::Box &bxy, const amrex::Box &bxz, const amrex::Array4< amrex::Real > &rho_u_rhs, const amrex::Array4< amrex::Real > &rho_v_rhs, const amrex::Array4< amrex::Real > &rho_w_rhs, const amrex::Array4< const amrex::Real > &rho_u, const amrex::Array4< const amrex::Real > &rho_v, const amrex::Array4< const amrex::Real > &Omega, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::Array4< const amrex::Real > &z_nd, const amrex::Array4< const amrex::Real > &ax, const amrex::Array4< const amrex::Real > &ay, const amrex::Array4< const amrex::Real > &az, const amrex::Array4< const amrex::Real > &detJ, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &mf_mx, const amrex::Array4< const amrex::Real > &mf_ux_inv, const amrex::Array4< const amrex::Real > &mf_vx_inv, const amrex::Array4< const amrex::Real > &mf_my, const amrex::Array4< const amrex::Real > &mf_uy_inv, const amrex::Array4< const amrex::Real > &mf_vy_inv, const amrex::Real upw_frac_h, const amrex::Real upw_frac_v, const AdvType vert_adv_type, const int lo_z_face, const int hi_z_face)
Definition: ERF_AdvectionSrcForMom_T.H:509
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real fourth
Definition: ERF_Constants.H:14
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
AdvType
Definition: ERF_IndexDefines.H:261
@ Centered_4th
@ Centered_6th
@ Centered_2nd
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:17
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
Real w
Definition: ERF_Plotfile2DInterpolator.cpp:22
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterJ(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:275
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterK(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:230
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterI(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:319
AMREX_ASSERT_WITH_MESSAGE(wbar_cutoff_min > wbar_cutoff_max, "ERROR: wbar_cutoff_min < wbar_cutoff_max")