ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ERF_AdvectionSrcForMom_N.H
Go to the documentation of this file.
1 #include "ERF_IndexDefines.H"
2 #include "ERF_Interpolation.H"
3 
4 /**
5  * Function for computing the advective tendency for the x-component of momentum
6  * without metric terms and for higher-order stencils
7  *
8  * @param[in] i,j,k indices of x-face at which to create tendency
9  * @param[in] rho_u x-component of momentum
10  * @param[in] rho_v y-component of momentum
11  * @param[in] rho_w z-component of momentum
12  * @param[in] u x-component of velocity
13  * @param[in] cellSizeInv inverse of the mesh spacing
14  * @param[in] mf_u map factor on x-faces
15  * @param[in] mf_v map factor on y-faces
16  */
17 template<typename InterpType_H, typename InterpType_V>
18 AMREX_GPU_DEVICE
19 AMREX_FORCE_INLINE
20 amrex::Real
21 AdvectionSrcForXMom_N (int i, int j, int k,
22  const amrex::Array4<const amrex::Real>& rho_u,
23  const amrex::Array4<const amrex::Real>& rho_v,
24  const amrex::Array4<const amrex::Real>& rho_w,
25  InterpType_H interp_u_h,
26  InterpType_V interp_u_v,
27  const amrex::Array4<const amrex::Real>& mf_ux_inv,
28  const amrex::Array4<const amrex::Real>& mf_uy_inv,
29  const amrex::Array4<const amrex::Real>& mf_vx_inv,
30  const amrex::Real dxInv, const amrex::Real dyInv, const amrex::Real dzInv)
31 {
32  amrex::Real advectionSrc;
33 
34  amrex::Real rho_u_avg_lo, rho_u_avg_hi;
35  amrex::Real rho_v_avg_lo, rho_v_avg_hi;
36  amrex::Real rho_w_avg_lo, rho_w_avg_hi;
37 
38  amrex::Real xflux_hi; amrex::Real xflux_lo;
39  amrex::Real yflux_hi; amrex::Real yflux_lo;
40  amrex::Real zflux_hi; amrex::Real zflux_lo;
41 
42  amrex::Real interp_hi(0.), interp_lo(0.);
43 
44  rho_u_avg_hi = 0.5 * (rho_u(i+1, j, k) * mf_uy_inv(i+1,j,0) + rho_u(i, j, k) * mf_uy_inv(i,j,0));
45  interp_u_h.InterpolateInX(i+1,j,k,0,interp_hi,rho_u_avg_hi);
46  xflux_hi = rho_u_avg_hi * interp_hi;
47 
48  rho_u_avg_lo = 0.5 * (rho_u(i-1, j, k) * mf_uy_inv(i-1,j,0) + rho_u(i, j, k) * mf_uy_inv(i,j,0));
49  interp_u_h.InterpolateInX(i,j,k,0,interp_lo,rho_u_avg_lo);
50  xflux_lo = rho_u_avg_lo * interp_lo;
51 
52  rho_v_avg_hi = 0.5 * (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));
53  interp_u_h.InterpolateInY(i,j+1,k,0,interp_hi,rho_v_avg_hi);
54  yflux_hi = rho_v_avg_hi * interp_hi;
55 
56  rho_v_avg_lo = 0.5 * (rho_v(i, j , k) * mf_vx_inv(i,j ,0) + rho_v(i-1, j , k) * mf_vx_inv(i-1,j ,0));
57  interp_u_h.InterpolateInY(i,j,k,0,interp_lo,rho_v_avg_lo);
58  yflux_lo = rho_v_avg_lo * interp_lo;
59 
60  rho_w_avg_hi = 0.5 * (rho_w(i, j, k+1) + rho_w(i-1, j, k+1));
61  interp_u_v.InterpolateInZ(i,j,k+1,0,interp_hi,rho_w_avg_hi);
62  zflux_hi = rho_w_avg_hi * interp_hi;
63 
64  rho_w_avg_lo = 0.5 * (rho_w(i, j, k ) + rho_w(i-1, j, k ));
65  interp_u_v.InterpolateInZ(i,j,k,0,interp_lo,rho_w_avg_lo);
66  zflux_lo = rho_w_avg_lo * interp_lo;
67 
68  amrex::Real mfsq = 1 / (mf_ux_inv(i,j,0) * mf_uy_inv(i,j,0));
69 
70  advectionSrc = (xflux_hi - xflux_lo) * dxInv * mfsq
71  + (yflux_hi - yflux_lo) * dyInv * mfsq
72  + (zflux_hi - zflux_lo) * dzInv;
73 
74  return advectionSrc;
75 }
76 
77 /**
78  * Function for computing the advective tendency for the y-component of momentum
79  * without metric terms and for higher-order stencils
80  *
81  * @param[in] i,j,k indices of y-face at which to create tendency
82  * @param[in] rho_u x-component of momentum
83  * @param[in] rho_v y-component of momentum
84  * @param[in] rho_w z-component of momentum
85  * @param[in] v y-component of velocity
86  * @param[in] cellSizeInv inverse of the mesh spacing
87  * @param[in] mf_u map factor on x-faces
88  * @param[in] mf_v map factor on y-faces
89  */
90 template<typename InterpType_H, typename InterpType_V>
91 AMREX_GPU_DEVICE
92 AMREX_FORCE_INLINE
93 amrex::Real
94 AdvectionSrcForYMom_N (int i, int j, int k,
95  const amrex::Array4<const amrex::Real>& rho_u,
96  const amrex::Array4<const amrex::Real>& rho_v,
97  const amrex::Array4<const amrex::Real>& rho_w,
98  InterpType_H interp_v_h,
99  InterpType_V interp_v_v,
100  const amrex::Array4<const amrex::Real>& mf_uy_inv,
101  const amrex::Array4<const amrex::Real>& mf_vx_inv,
102  const amrex::Array4<const amrex::Real>& mf_vy_inv,
103  const amrex::Real dxInv, const amrex::Real dyInv, const amrex::Real dzInv)
104 {
105  amrex::Real advectionSrc;
106 
107  amrex::Real rho_u_avg_lo, rho_u_avg_hi;
108  amrex::Real rho_v_avg_lo, rho_v_avg_hi;
109  amrex::Real rho_w_avg_lo, rho_w_avg_hi;
110 
111  amrex::Real xflux_hi; amrex::Real xflux_lo;
112  amrex::Real yflux_hi; amrex::Real yflux_lo;
113  amrex::Real zflux_hi; amrex::Real zflux_lo;
114 
115  amrex::Real interp_hi(0.), interp_lo(0.);
116 
117  rho_u_avg_hi = 0.5 * (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));
118  interp_v_h.InterpolateInX(i+1,j,k,0,interp_hi,rho_u_avg_hi);
119  xflux_hi = rho_u_avg_hi * interp_hi;
120 
121  rho_u_avg_lo = 0.5 * (rho_u(i , j, k) * mf_uy_inv(i ,j ,0) + rho_u(i , j-1, k) * mf_uy_inv(i ,j-1,0));
122  interp_v_h.InterpolateInX(i,j,k,0,interp_lo,rho_u_avg_lo);
123  xflux_lo = rho_u_avg_lo * interp_lo;
124 
125  rho_v_avg_hi = 0.5 * (rho_v(i, j, k) * mf_vx_inv(i ,j ,0) + rho_v(i, j+1, k) * mf_vx_inv(i ,j+1,0));
126  interp_v_h.InterpolateInY(i,j+1,k,0,interp_hi,rho_v_avg_hi);
127  yflux_hi = rho_v_avg_hi * interp_hi;
128 
129  rho_v_avg_lo = 0.5 * (rho_v(i, j, k) * mf_vx_inv(i ,j ,0) + rho_v(i, j-1, k) * mf_vx_inv(i ,j-1,0));
130  interp_v_h.InterpolateInY(i,j,k,0,interp_lo,rho_v_avg_lo);
131  yflux_lo = rho_v_avg_lo * interp_lo;
132 
133  rho_w_avg_hi = 0.5 * (rho_w(i, j, k+1) + rho_w(i, j-1, k+1));
134  interp_v_v.InterpolateInZ(i,j,k+1,0,interp_hi,rho_w_avg_hi);
135  zflux_hi = rho_w_avg_hi * interp_hi;
136 
137  rho_w_avg_lo = 0.5 * (rho_w(i, j, k ) + rho_w(i, j-1, k ));
138  interp_v_v.InterpolateInZ(i,j,k ,0,interp_lo,rho_w_avg_lo);
139  zflux_lo = rho_w_avg_lo * interp_lo;
140 
141  amrex::Real mfsq = 1 / (mf_vx_inv(i,j,0) * mf_vy_inv(i,j,0));
142 
143  advectionSrc = (xflux_hi - xflux_lo) * dxInv * mfsq
144  + (yflux_hi - yflux_lo) * dyInv * mfsq
145  + (zflux_hi - zflux_lo) * dzInv;
146 
147  return advectionSrc;
148 }
149 
150 /**
151  * Function for computing the advective tendency for the z-component of momentum
152  * without metric terms and for higher-order stencils
153  *
154  * @param[in] i,j,k indices of z-face at which to create tendency
155  * @param[in] rho_u x-component of momentum
156  * @param[in] rho_v y-component of momentum
157  * @param[in] rho_w z-component of momentum
158  * @param[in] w z-component of velocity
159  * @param[in] cellSizeInv inverse of the mesh spacing
160  * @param[in] mf_m map factor on cell centers
161  * @param[in] mf_u map factor on x-faces
162  * @param[in] mf_v map factor on y-faces
163  * @param[in] domhi_z maximum k value in the domain
164  */
165 template<typename InterpType_H, typename InterpType_V, typename WallInterpType>
166 AMREX_GPU_DEVICE
167 AMREX_FORCE_INLINE
168 amrex::Real
169 AdvectionSrcForZMom_N (int i, int j, int k,
170  const amrex::Array4<const amrex::Real>& rho_u,
171  const amrex::Array4<const amrex::Real>& rho_v,
172  const amrex::Array4<const amrex::Real>& rho_w,
173  const amrex::Array4<const amrex::Real>& w,
174  InterpType_H interp_w_h,
175  InterpType_V interp_w_v,
176  WallInterpType interp_w_wall,
177  const amrex::Array4<const amrex::Real>& mf_mx,
178  const amrex::Array4<const amrex::Real>& mf_my,
179  const amrex::Array4<const amrex::Real>& mf_uy_inv,
180  const amrex::Array4<const amrex::Real>& mf_vx_inv,
181  const AdvType vert_adv_type,
182  const int lo_z_face, const int hi_z_face,
183  const amrex::Real dxInv, const amrex::Real dyInv, const amrex::Real dzInv)
184 {
185 
186  amrex::Real advectionSrc;
187 
188  amrex::Real rho_u_avg_lo, rho_u_avg_hi;
189  amrex::Real rho_v_avg_lo, rho_v_avg_hi;
190  amrex::Real rho_w_avg_lo, rho_w_avg_hi;
191 
192  amrex::Real xflux_hi; amrex::Real xflux_lo;
193  amrex::Real yflux_hi; amrex::Real yflux_lo;
194  amrex::Real zflux_hi; amrex::Real zflux_lo;
195 
196  amrex::Real interp_hi(0.), interp_lo(0.);
197 
198  rho_u_avg_hi = 0.5 * (rho_u(i+1, j, k) + rho_u(i+1, j, k-1)) * mf_uy_inv(i+1,j ,0);
199  interp_w_h.InterpolateInX(i+1,j,k,0,interp_hi,rho_u_avg_hi);
200  xflux_hi = rho_u_avg_hi * interp_hi;
201 
202  rho_u_avg_lo = 0.5 * (rho_u(i , j, k) + rho_u(i , j, k-1)) * mf_uy_inv(i ,j ,0);
203  interp_w_h.InterpolateInX(i,j,k,0,interp_lo,rho_u_avg_lo);
204  xflux_lo = rho_u_avg_lo * interp_lo;
205 
206  rho_v_avg_hi = 0.5 * (rho_v(i, j+1, k) + rho_v(i, j+1, k-1)) * mf_vx_inv(i ,j+1,0);
207  interp_w_h.InterpolateInY(i,j+1,k,0,interp_hi,rho_v_avg_hi);
208  yflux_hi = rho_v_avg_hi * interp_hi;
209 
210  rho_v_avg_lo = 0.5 * (rho_v(i, j , k) + rho_v(i, j , k-1)) * mf_vx_inv(i ,j ,0);
211  interp_w_h.InterpolateInY(i,j,k,0,interp_lo,rho_v_avg_lo);
212  yflux_lo = rho_v_avg_lo * interp_lo;
213 
214  // int l_spatial_order_hi = std::min(std::min(vert_spatial_order, 2*(hi_z_face-k)), 2*(k+1));
215  // If k == hi_z_face-1, l_spatial_order_hi = 2
216  // If k == hi_z_face-2, l_spatial_order_hi = std::min(vert_spatial_order, 4);
217  // If k == lo_z+face+1, l_spatial_order_hi = std::min(vert_spatial_order, 4);
218 
219  if (k == hi_z_face) {
220  zflux_hi = rho_w(i,j,k) * w(i,j,k);
221  } else {
222  rho_w_avg_hi = 0.5 * (rho_w(i,j,k) + rho_w(i,j,k+1));
223  if (k == hi_z_face-1) {
224  interp_w_wall.InterpolateInZ(i,j,k+1,0,interp_hi,rho_w_avg_hi,AdvType::Centered_2nd);
225  } else if (k == hi_z_face-2 || k == lo_z_face+1) {
226  if (vert_adv_type != AdvType::Centered_2nd && vert_adv_type != AdvType::Upwind_3rd) {
227  interp_w_wall.InterpolateInZ(i,j,k+1,0,interp_hi,rho_w_avg_hi,AdvType::Centered_4th);
228  } else {
229  interp_w_wall.InterpolateInZ(i,j,k+1,0,interp_hi,rho_w_avg_hi,vert_adv_type);
230  }
231  } else {
232  interp_w_v.InterpolateInZ(i,j,k+1,0,interp_hi,rho_w_avg_hi);
233  }
234  zflux_hi = rho_w_avg_hi * interp_hi;
235  }
236 
237  // int l_spatial_order_lo = std::min(std::min(vert_spatial_order, 2*(hi_z_face+1-k)), 2*k);
238  // If k == lo_z_face+1, l_spatial_order_hi = 2
239  // If k == lo_z_face+2, l_spatial_order_hi = std::min(vert_spatial_order, 4);
240  // If k == hi_z_face-1, l_spatial_order_hi = std::min(vert_spatial_order, 4);
241 
242  if (k == lo_z_face) {
243  zflux_lo = rho_w(i,j,k) * w(i,j,k);
244  } else {
245  rho_w_avg_lo = 0.5 * (rho_w(i,j,k) + rho_w(i,j,k-1));
246  if (k == lo_z_face+1) {
247  interp_w_wall.InterpolateInZ(i,j,k,0,interp_lo,rho_w_avg_lo,AdvType::Centered_2nd);
248  } else if (k == lo_z_face+2 || k == hi_z_face-1) {
249  if (vert_adv_type != AdvType::Centered_2nd && vert_adv_type != AdvType::Upwind_3rd) {
250  interp_w_wall.InterpolateInZ(i,j,k,0,interp_lo,rho_w_avg_lo,AdvType::Centered_4th);
251  } else {
252  interp_w_wall.InterpolateInZ(i,j,k,0,interp_lo,rho_w_avg_lo,vert_adv_type);
253  }
254  } else {
255  interp_w_v.InterpolateInZ(i,j,k,0,interp_lo,rho_w_avg_lo);
256  }
257  zflux_lo = rho_w_avg_lo * interp_lo;
258  }
259 
260  amrex::Real mfsq = mf_mx(i,j,0) * mf_my(i,j,0);
261 
262  advectionSrc = (xflux_hi - xflux_lo) * dxInv * mfsq
263  + (yflux_hi - yflux_lo) * dyInv * mfsq
264  + (zflux_hi - zflux_lo) * dzInv;
265 
266  return advectionSrc;
267 }
268 
269 /**
270  * Wrapper function for computing the advective tendency w/ spatial order > 2.
271  */
272 template<typename InterpType_H, typename InterpType_V, typename WallInterpType>
273 void
274 AdvectionSrcForMomWrapper_N (const amrex::Box& bxx, const amrex::Box& bxy, const amrex::Box& bxz,
275  const amrex::Array4<amrex::Real>& rho_u_rhs,
276  const amrex::Array4<amrex::Real>& rho_v_rhs,
277  const amrex::Array4<amrex::Real>& rho_w_rhs,
278  const amrex::Array4<const amrex::Real>& rho_u,
279  const amrex::Array4<const amrex::Real>& rho_v,
280  const amrex::Array4<const amrex::Real>& rho_w,
281  const amrex::Array4<const amrex::Real>& u,
282  const amrex::Array4<const amrex::Real>& v,
283  const amrex::Array4<const amrex::Real>& w,
284  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
285  const amrex::Gpu::DeviceVector<amrex::Real>& stretched_dz_d,
286  const amrex::Array4<const amrex::Real>& mf_mx,
287  const amrex::Array4<const amrex::Real>& mf_ux_inv,
288  const amrex::Array4<const amrex::Real>& mf_vx_inv,
289  const amrex::Array4<const amrex::Real>& mf_my,
290  const amrex::Array4<const amrex::Real>& mf_uy_inv,
291  const amrex::Array4<const amrex::Real>& mf_vy_inv,
292  const amrex::Real upw_frac_h,
293  const amrex::Real upw_frac_v,
294  const AdvType vert_adv_type,
295  const int lo_z_face, const int hi_z_face)
296 {
297  // Instantiate the appropriate structs
298  InterpType_H interp_u_h(u, upw_frac_h); InterpType_V interp_u_v(u, upw_frac_v); // X-MOM
299  InterpType_H interp_v_h(v, upw_frac_h); InterpType_V interp_v_v(v, upw_frac_v); // Y-MOM
300  InterpType_H interp_w_h(w, upw_frac_h); InterpType_V interp_w_v(w, upw_frac_v); // Z-MOM
301  WallInterpType interp_w_wall(w, upw_frac_v); // Z-MOM @ wall
302 
303  auto dxInv = cellSizeInv[0];
304  auto dyInv = cellSizeInv[1];
305 
306  auto dz_ptr = stretched_dz_d.data();
307 
308  amrex::ParallelFor(bxx,
309  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
310  {
311  auto dzInv = 1.0/dz_ptr[k];
312  rho_u_rhs(i, j, k) = -AdvectionSrcForXMom_N(i, j, k, rho_u, rho_v, rho_w,
313  interp_u_h, interp_u_v,
314  mf_ux_inv, mf_uy_inv, mf_vx_inv,
315  dxInv, dyInv, dzInv);
316  });
317 
318  amrex::ParallelFor(bxy,
319  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
320  {
321  auto dzInv = 1.0/dz_ptr[k];
322  rho_v_rhs(i, j, k) = -AdvectionSrcForYMom_N(i, j, k, rho_u, rho_v, rho_w,
323  interp_v_h, interp_v_v,
324  mf_uy_inv, mf_vx_inv, mf_vy_inv,
325  dxInv, dyInv, dzInv);
326  });
327 
328  amrex::ParallelFor(bxz,
329  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
330  {
331  auto dzInv = 2.0/(dz_ptr[k] + dz_ptr[k-1]);
332  rho_w_rhs(i, j, k) = -AdvectionSrcForZMom_N(i, j, k, rho_u, rho_v, rho_w, w,
333  interp_w_h, interp_w_v, interp_w_wall,
334  mf_mx, mf_my, mf_uy_inv, mf_vx_inv,
335  vert_adv_type, lo_z_face, hi_z_face,
336  dxInv, dyInv, dzInv);
337  });
338 }
339 
340 /**
341  * Wrapper function for computing the advective tendency w/ spatial order > 2.
342  */
343 template<typename InterpType_H>
344 void
345 AdvectionSrcForMomVert_N (const amrex::Box& bxx, const amrex::Box& bxy, const amrex::Box& bxz,
346  const amrex::Array4<amrex::Real>& rho_u_rhs,
347  const amrex::Array4<amrex::Real>& rho_v_rhs,
348  const amrex::Array4<amrex::Real>& rho_w_rhs,
349  const amrex::Array4<const amrex::Real>& rho_u,
350  const amrex::Array4<const amrex::Real>& rho_v,
351  const amrex::Array4<const amrex::Real>& rho_w,
352  const amrex::Array4<const amrex::Real>& u,
353  const amrex::Array4<const amrex::Real>& v,
354  const amrex::Array4<const amrex::Real>& w,
355  const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
356  const amrex::Gpu::DeviceVector<amrex::Real>& stretched_dz_d,
357  const amrex::Array4<const amrex::Real>& mf_mx,
358  const amrex::Array4<const amrex::Real>& mf_ux_inv,
359  const amrex::Array4<const amrex::Real>& mf_vx_inv,
360  const amrex::Array4<const amrex::Real>& mf_my,
361  const amrex::Array4<const amrex::Real>& mf_uy_inv,
362  const amrex::Array4<const amrex::Real>& mf_vy_inv,
363  const amrex::Real upw_frac_h,
364  const amrex::Real upw_frac_v,
365  const AdvType vert_adv_type,
366  const int lo_z_face, const int hi_z_face)
367 {
368  if (vert_adv_type == AdvType::Centered_2nd) {
369  AdvectionSrcForMomWrapper_N<InterpType_H,CENTERED2,UPWINDALL>(bxx, bxy, bxz,
370  rho_u_rhs, rho_v_rhs, rho_w_rhs,
371  rho_u, rho_v, rho_w, u, v, w,
372  cellSizeInv, stretched_dz_d,
373  mf_mx, mf_ux_inv, mf_vx_inv,
374  mf_my, mf_uy_inv, mf_vy_inv,
375  upw_frac_h, upw_frac_v,
376  vert_adv_type,
377  lo_z_face, hi_z_face);
378  } else if (vert_adv_type == AdvType::Upwind_3rd) {
379  AdvectionSrcForMomWrapper_N<InterpType_H,UPWIND3,UPWINDALL>(bxx, bxy, bxz,
380  rho_u_rhs, rho_v_rhs, rho_w_rhs,
381  rho_u, rho_v, rho_w, u, v, w,
382  cellSizeInv, stretched_dz_d,
383  mf_mx, mf_ux_inv, mf_vx_inv,
384  mf_my, mf_uy_inv, mf_vy_inv,
385  upw_frac_h, upw_frac_v,
386  vert_adv_type,
387  lo_z_face, hi_z_face);
388  } else if (vert_adv_type == AdvType::Centered_4th) {
389  AdvectionSrcForMomWrapper_N<InterpType_H,CENTERED4,UPWINDALL>(bxx, bxy, bxz,
390  rho_u_rhs, rho_v_rhs, rho_w_rhs,
391  rho_u, rho_v, rho_w, u, v, w,
392  cellSizeInv, stretched_dz_d,
393  mf_mx, mf_ux_inv, mf_vx_inv,
394  mf_my, mf_uy_inv, mf_vy_inv,
395  upw_frac_h, upw_frac_v,
396  vert_adv_type,
397  lo_z_face, hi_z_face);
398  } else if (vert_adv_type == AdvType::Upwind_5th) {
399  AdvectionSrcForMomWrapper_N<InterpType_H,UPWIND5,UPWINDALL>(bxx, bxy, bxz,
400  rho_u_rhs, rho_v_rhs, rho_w_rhs,
401  rho_u, rho_v, rho_w, u, v, w,
402  cellSizeInv, stretched_dz_d,
403  mf_mx, mf_ux_inv, mf_vx_inv,
404  mf_my, mf_uy_inv, mf_vy_inv,
405  upw_frac_h, upw_frac_v,
406  vert_adv_type,
407  lo_z_face, hi_z_face);
408  } else if (vert_adv_type == AdvType::Centered_6th) {
409  AdvectionSrcForMomWrapper_N<InterpType_H,CENTERED6,UPWINDALL>(bxx, bxy, bxz,
410  rho_u_rhs, rho_v_rhs, rho_w_rhs,
411  rho_u, rho_v, rho_w, u, v, w,
412  cellSizeInv, stretched_dz_d,
413  mf_mx, mf_ux_inv, mf_vx_inv,
414  mf_my, mf_uy_inv, mf_vy_inv,
415  upw_frac_h, upw_frac_v,
416  vert_adv_type,
417  lo_z_face, hi_z_face);
418  } else {
419  AMREX_ASSERT_WITH_MESSAGE(false, "Unknown advection scheme!");
420  }
421 }
void AdvectionSrcForMomVert_N(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 > &rho_w, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Gpu::DeviceVector< amrex::Real > &stretched_dz_d, 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_N.H:345
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForYMom_N(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 > &rho_w, InterpType_H interp_v_h, InterpType_V interp_v_v, 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, const amrex::Real dxInv, const amrex::Real dyInv, const amrex::Real dzInv)
Definition: ERF_AdvectionSrcForMom_N.H:94
void AdvectionSrcForMomWrapper_N(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 > &rho_w, const amrex::Array4< const amrex::Real > &u, const amrex::Array4< const amrex::Real > &v, const amrex::Array4< const amrex::Real > &w, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Gpu::DeviceVector< amrex::Real > &stretched_dz_d, 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_N.H:274
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForZMom_N(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 > &rho_w, const amrex::Array4< const amrex::Real > &w, InterpType_H interp_w_h, InterpType_V interp_w_v, WallInterpType interp_w_wall, 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, const amrex::Real dxInv, const amrex::Real dyInv, const amrex::Real dzInv)
Definition: ERF_AdvectionSrcForMom_N.H:169
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real AdvectionSrcForXMom_N(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 > &rho_w, InterpType_H interp_u_h, InterpType_V interp_u_v, 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, const amrex::Real dxInv, const amrex::Real dyInv, const amrex::Real dzInv)
Definition: ERF_AdvectionSrcForMom_N.H:21
AdvType
Definition: ERF_IndexDefines.H:221
@ Centered_4th
@ Centered_6th
@ Centered_2nd