ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ERF_EBAdvectionSrcForMom.H
Go to the documentation of this file.
1 #include <ERF_IndexDefines.H>
2 #include <ERF_Interpolation.H>
3 
4 /**
5  * Wrapper function for computing the advective tendency w/ spatial order > 2.
6  */
7 template<typename InterpType_H, typename InterpType_V, typename WallInterpType>
8 void
9 EBAdvectionSrcForMomWrapper (const amrex::Vector<amrex::Box>& bxx_grown,
10  const amrex::Vector<amrex::Box>& bxy_grown,
11  const amrex::Vector<amrex::Box>& bxz_grown,
12  const amrex::Array4<const amrex::Real>& rho_u,
13  const amrex::Array4<const amrex::Real>& rho_v,
14  const amrex::Array4<const amrex::Real>& rho_w,
15  const amrex::Array4<const amrex::Real>& u,
16  const amrex::Array4<const amrex::Real>& v,
17  const amrex::Array4<const amrex::Real>& w,
18  const amrex::Array4<const amrex::EBCellFlag>& u_cflag,
19  const amrex::Array4<const amrex::Real>& u_afrac_x,
20  const amrex::Array4<const amrex::Real>& u_afrac_y,
21  const amrex::Array4<const amrex::Real>& u_afrac_z,
22  const amrex::Array4<const amrex::EBCellFlag>& v_cflag,
23  const amrex::Array4<const amrex::Real>& v_afrac_x,
24  const amrex::Array4<const amrex::Real>& v_afrac_y,
25  const amrex::Array4<const amrex::Real>& v_afrac_z,
26  const amrex::Array4<const amrex::EBCellFlag>& w_cflag,
27  const amrex::Array4<const amrex::Real>& w_afrac_x,
28  const amrex::Array4<const amrex::Real>& w_afrac_y,
29  const amrex::Array4<const amrex::Real>& w_afrac_z,
30  const amrex::Array4<const amrex::Real>& mf_ux_inv,
31  const amrex::Array4<const amrex::Real>& mf_vx_inv,
32  const amrex::Array4<const amrex::Real>& mf_uy_inv,
33  const amrex::Array4<const amrex::Real>& mf_vy_inv,
34  const amrex::Real upw_frac_h,
35  const amrex::Real upw_frac_v,
36  const AdvType /*vert_adv_type*/,
37  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_u_arr,
38  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_v_arr,
39  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_w_arr,
40  const int lo_z_face, const int hi_z_face)
41 {
42  // Instantiate the appropriate structs
43  InterpType_H interp_u_horz(u, upw_frac_h); InterpType_V interp_u_vert(u, upw_frac_v); // X-MOM
44  InterpType_H interp_v_horz(v, upw_frac_h); InterpType_V interp_v_vert(v, upw_frac_v); // Y-MOM
45  InterpType_H interp_w_horz(w, upw_frac_h); InterpType_V interp_w_vert(w, upw_frac_v); // Z-MOM
46  // WallInterpType interp_w_wall(w, upw_frac_v); // Z-MOM @ wall
47 
48  const int ncells_u_horz = interp_u_horz.GetUpwindCellNumber();
49  const int ncells_u_vert = interp_u_vert.GetUpwindCellNumber();
50  const int ncells_v_horz = interp_v_horz.GetUpwindCellNumber();
51  const int ncells_v_vert = interp_v_vert.GetUpwindCellNumber();
52  const int ncells_w_horz = interp_w_horz.GetUpwindCellNumber();
53  const int ncells_w_vert = interp_w_vert.GetUpwindCellNumber();
54 
55  // Instantiate structs for lower-order vert/horiz interp (commonly using upw_frac_h)
56  CENTERED2 interp_u_CEN2(u, 0);
57  CENTERED2 interp_v_CEN2(v, 0);
58  CENTERED2 interp_w_CEN2(w, 0);
59 
60  UPWIND3 interp_u_UPW3(u, upw_frac_h);
61  UPWIND3 interp_v_UPW3(v, upw_frac_h);
62  UPWIND3 interp_w_UPW3(w, upw_frac_h);
63 
64  // ---------------------------------------------------- //
65  // x-momentum
66  // ---------------------------------------------------- //
67 
68  amrex::ParallelFor(bxx_grown[0], bxx_grown[1], bxx_grown[2],
69  // x-momentum: x-face
70  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
71  {
72  if ( u_afrac_x(i,j,k) > 0. )
73  {
74  amrex::Real rho_u_avg = 0.5 * (rho_u(i-1,j,k) * mf_ux_inv(i-1,j,0) + rho_u(i,j,k) * mf_ux_inv(i,j,0));
75 
76  int icell = 0;
77 
78  if (rho_u_avg>0.)
79  {
80  for (int ii=0; ii<ncells_u_horz; ++ii) {
81  if (u_cflag(i-ii-1,j,k).isCovered()) {
82  break;
83  }
84  icell++;
85  }
86  }
87  else if (rho_u_avg<0.)
88  {
89  for (int ii=0; ii<ncells_u_horz; ++ii) {
90  if (u_cflag(i+ii,j,k).isCovered()) {
91  break;
92  }
93  icell++;
94  }
95  }
96 
97  // Interpolate u using the highest-order scheme
98 
99  amrex::Real interpx = 0.;
100  if (icell==ncells_u_horz) {
101  interp_u_horz.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
102  } else {
103  if (icell==1) {
104  interp_u_CEN2.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
105  } else if (icell==2) {
106  interp_u_UPW3.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
107  }
108  }
109  flx_u_arr[0](i,j,k) = rho_u_avg * interpx;
110  }
111  else
112  {
113  flx_u_arr[0](i,j,k) = 0.;
114  }
115  },
116  // x-momentum: y-face
117  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
118  {
119  if ( u_afrac_y(i,j,k) > 0. )
120  {
121  amrex::Real rho_v_avg = 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));
122 
123  int jcell = 0;
124 
125  if (rho_v_avg>0.)
126  {
127  for (int jj=0; jj<ncells_u_horz; ++jj) {
128  if (u_cflag(i,j-jj-1,k).isCovered()) {
129  break;
130  }
131  jcell++;
132  }
133  }
134  else if (rho_v_avg<0.)
135  {
136  for (int jj=0; jj<ncells_u_horz; ++jj) {
137  if (u_cflag(i,j+jj,k).isCovered()) {
138  break;
139  }
140  jcell++;
141  }
142  }
143 
144  // Interpolate u using the highest-order scheme
145 
146  amrex::Real interpy = 0.;
147  if (jcell==ncells_u_horz) {
148  interp_u_horz.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
149  } else {
150  if (jcell==1) {
151  interp_u_CEN2.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
152  } else if (jcell==2) {
153  interp_u_UPW3.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
154  }
155  }
156  flx_u_arr[1](i,j,k) = rho_v_avg * interpy;
157  }
158  else
159  {
160  flx_u_arr[1](i,j,k) = 0.;
161  }
162  },
163  // x-momentum: z-face
164  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
165  {
166  if ( u_afrac_z(i,j,k) > 0. )
167  {
168  amrex::Real rho_w_avg = 0.5 * (rho_w(i,j,k) + rho_w(i-1,j,k));
169 
170  int kcell = 0;
171 
172  if (rho_w_avg>0.)
173  {
174  for (int kk=0; kk<ncells_u_vert; ++kk) {
175  if (u_cflag(i,j,k-kk-1).isCovered()) {
176  break;
177  }
178  kcell++;
179  }
180  }
181  else if (rho_w_avg<0.)
182  {
183  for (int kk=0; kk<ncells_u_vert; ++kk) {
184  if (u_cflag(i,j,k+kk).isCovered()) {
185  break;
186  }
187  kcell++;
188  }
189  }
190 
191  // Interpolate u using the highest-order scheme
192 
193  amrex::Real interpz = 0.;
194  if (kcell==ncells_u_vert) {
195  interp_u_vert.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
196  } else {
197  if (kcell==1) {
198  interp_u_CEN2.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
199  } else if (kcell==2) {
200  interp_u_UPW3.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
201  }
202  }
203  flx_u_arr[2](i,j,k) = rho_w_avg * interpz;
204  }
205  else
206  {
207  flx_u_arr[2](i,j,k) = 0.;
208  }
209  });
210 
211  // ---------------------------------------------------- //
212  // y-momentum
213  // ---------------------------------------------------- //
214 
215  amrex::ParallelFor(bxy_grown[0], bxy_grown[1], bxy_grown[2],
216  // y-momentum: x-face
217  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
218  {
219  if ( v_afrac_x(i,j,k) > 0. )
220  {
221  amrex::Real rho_u_avg = 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));
222 
223  int icell = 0;
224 
225  if (rho_u_avg>0.)
226  {
227  for (int ii=0; ii<ncells_v_horz; ++ii) {
228  if (v_cflag(i-ii-1,j,k).isCovered()) {
229  break;
230  }
231  icell++;
232  }
233  }
234  else if (rho_u_avg<0.)
235  {
236  for (int ii=0; ii<ncells_v_horz; ++ii) {
237  if (v_cflag(i+ii,j,k).isCovered()) {
238  break;
239  }
240  icell++;
241  }
242  }
243 
244  // Interpolate v using the highest-order scheme
245 
246  amrex::Real interpx = 0.;
247  if (icell==ncells_v_horz) {
248  interp_v_horz.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
249  } else {
250  if (icell==1) {
251  interp_v_CEN2.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
252  } else if (icell==2) {
253  interp_v_UPW3.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
254  }
255  }
256  flx_v_arr[0](i,j,k) = rho_u_avg * interpx;
257  }
258  else
259  {
260  flx_v_arr[0](i,j,k) = 0.;
261  }
262  },
263  // y-momentum: y-face
264  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
265  {
266  if ( v_afrac_y(i,j,k) > 0. )
267  {
268  amrex::Real rho_v_avg = 0.5 * (rho_v(i,j,k) * mf_vy_inv(i,j,0) + rho_v(i,j-1,k) * mf_vy_inv(i,j-1,0));
269 
270  int jcell = 0;
271 
272  if (rho_v_avg>0.)
273  {
274  for (int jj=0; jj<ncells_v_horz; ++jj) {
275  if (v_cflag(i,j-jj-1,k).isCovered()) {
276  break;
277  }
278  }
279  }
280  else if (rho_v_avg<0.)
281  {
282  for (int jj=0; jj<ncells_v_horz; ++jj) {
283  if (v_cflag(i,j+jj,k).isCovered()) {
284  break;
285  }
286  }
287  }
288 
289  // Interpolate v using the highest-order scheme
290 
291  amrex::Real interpy = 0.;
292  if (jcell==ncells_v_horz) {
293  interp_v_horz.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
294  } else {
295  if (jcell==1) {
296  interp_v_CEN2.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
297  } else if (jcell==2) {
298  interp_v_UPW3.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
299  }
300  }
301  flx_v_arr[1](i,j,k) = rho_v_avg * interpy;
302  }
303  else
304  {
305  flx_v_arr[1](i,j,k) = 0.;
306  }
307  },
308  // y-momentum: z-face
309  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
310  {
311  if ( v_afrac_z(i,j,k) > 0. )
312  {
313  amrex::Real rho_w_avg = 0.5 * (rho_w(i,j,k) + rho_w(i,j-1,k));
314 
315  int kcell = 0;
316 
317  if (rho_w_avg>0.)
318  {
319  for (int kk=0; kk<ncells_v_vert; ++kk) {
320  if (v_cflag(i,j,k-kk-1).isCovered()) {
321  break;
322  }
323  kcell++;
324  }
325  }
326  else if (rho_w_avg<0.)
327  {
328  for (int kk=0; kk<ncells_v_vert; ++kk) {
329  if (v_cflag(i,j,k+kk).isCovered()) {
330  break;
331  }
332  kcell++;
333  }
334  }
335 
336  // Interpolate v using the highest-order scheme
337 
338  amrex::Real interpz = 0.;
339  if (kcell==ncells_v_vert) {
340  interp_v_vert.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
341  } else {
342  if (kcell==1) {
343  interp_v_CEN2.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
344  } else if (kcell==2) {
345  interp_v_UPW3.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
346  }
347  }
348  flx_v_arr[2](i,j,k) = rho_w_avg * interpz;
349  }
350  else
351  {
352  flx_v_arr[2](i,j,k) = 0.;
353  }
354  });
355 
356  // ---------------------------------------------------- //
357  // z-momentum
358  // ---------------------------------------------------- //
359 
360  amrex::ParallelFor(bxz_grown[0], bxz_grown[1], bxz_grown[2],
361  // z-momentum: x-face
362  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
363  {
364  if ( w_afrac_x(i,j,k) > 0. )
365  {
366  amrex::Real rho_u_avg = 0.5 * (rho_u(i,j,k) + rho_u(i,j,k-1)) * mf_ux_inv(i,j,0);
367 
368  int icell = 0;
369 
370  if (rho_u_avg>0.)
371  {
372  for (int ii=0; ii<ncells_w_horz; ++ii) {
373  if (w_cflag(i-ii-1,j,k).isCovered()) {
374  break;
375  }
376  icell++;
377  }
378  }
379  else if (rho_u_avg<0.)
380  {
381  for (int ii=0; ii<ncells_w_horz; ++ii) {
382  if (w_cflag(i+ii,j,k).isCovered()) {
383  break;
384  }
385  icell++;
386  }
387  }
388 
389  // Interpolate w using the highest-order scheme
390 
391  amrex::Real interpx = 0.;
392  if (icell==ncells_w_horz) {
393  interp_w_horz.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
394  } else {
395  if (icell==1) {
396  interp_w_CEN2.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
397  } else if (icell==2) {
398  interp_w_UPW3.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
399  }
400  }
401  flx_w_arr[0](i,j,k) = rho_u_avg * interpx;
402  }
403  else
404  {
405  flx_w_arr[0](i,j,k) = 0.;
406  }
407  },
408  // z-momentum: y-face
409  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
410  {
411  if ( w_afrac_y(i,j,k) > 0. )
412  {
413  amrex::Real rho_v_avg = 0.5 * (rho_v(i,j,k) + rho_v(i,j,k-1)) * mf_vy_inv(i,j,0);
414 
415  int jcell = 0;
416 
417  if (rho_v_avg>0.)
418  {
419  for (int jj=0; jj<ncells_w_horz; ++jj) {
420  if (w_cflag(i,j-jj-1,k).isCovered()) {
421  break;
422  }
423  jcell++;
424  }
425  }
426  else if (rho_v_avg<0.)
427  {
428  for (int jj=0; jj<ncells_w_horz; ++jj) {
429  if (w_cflag(i,j+jj,k).isCovered()) {
430  break;
431  }
432  jcell++;
433  }
434  }
435 
436  // Interpolate w using the highest-order scheme
437 
438  amrex::Real interpy = 0.;
439  if (jcell==ncells_w_horz) {
440  interp_w_horz.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
441  } else {
442  if (jcell==1) {
443  interp_w_CEN2.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
444  } else if (jcell==2) {
445  interp_w_UPW3.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
446  }
447  }
448  flx_w_arr[1](i,j,k) = rho_v_avg * interpy;
449  }
450  else
451  {
452  flx_w_arr[1](i,j,k) = 0.;
453  }
454  },
455  // z-momentum: z-face
456  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
457  {
458  if ( w_afrac_z(i,j,k) > 0. )
459  {
460  if (k==lo_z_face || k==hi_z_face+1) {
461 
462  flx_w_arr[2](i,j,k) = rho_w(i,j,k) * w(i,j,k);
463 
464  } else {
465  amrex::Real rho_w_avg = 0.5 * (rho_w(i,j,k) + rho_w(i,j,k-1));
466 
467  int kcell = 0;
468 
469  if (rho_w_avg>0.)
470  {
471  for (int kk=0; kk<ncells_w_vert; ++kk) {
472  if (w_cflag(i,j,k-kk-1).isCovered()) {
473  break;
474  }
475  kcell++;
476  }
477  }
478  else if (rho_w_avg<0.)
479  {
480  for (int kk=0; kk<ncells_w_vert; ++kk) {
481  if (w_cflag(i,j,k+kk).isCovered()) {
482  break;
483  }
484  kcell++;
485  }
486  }
487 
488  // Adjust available cell numbers near the top and bottom boundaries
489 
490  if (k == hi_z_face || k == lo_z_face+1) {
491  kcell=std::min(kcell,1);
492  } else if (k == hi_z_face-1 || k == lo_z_face+2 ) {
493  kcell=std::min(kcell,2);
494  }
495 
496  // Interpolate w using the highest-order scheme
497 
498  amrex::Real interpz = 0.;
499  if (kcell==ncells_w_vert) {
500  interp_w_vert.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
501  } else {
502  if (kcell==1) {
503  interp_w_CEN2.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
504  } else if (kcell==2) {
505  interp_w_UPW3.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
506  }
507  }
508  flx_w_arr[2](i,j,k) = rho_w_avg * interpz;
509  } // lo_z_face, hi_z_face
510  }
511  else
512  {
513  flx_w_arr[2](i,j,k) = 0.;
514  }
515  });
516 
517 }
518 
519 /**
520  * Wrapper function for computing the advective tendency w/ spatial order > 2.
521  */
522 template<typename InterpType_H>
523 void
524 EBAdvectionSrcForMomVert (const amrex::Vector<amrex::Box>& bxx_grown,
525  const amrex::Vector<amrex::Box>& bxy_grown,
526  const amrex::Vector<amrex::Box>& bxz_grown,
527  const amrex::Array4<const amrex::Real>& rho_u,
528  const amrex::Array4<const amrex::Real>& rho_v,
529  const amrex::Array4<const amrex::Real>& rho_w,
530  const amrex::Array4<const amrex::Real>& u,
531  const amrex::Array4<const amrex::Real>& v,
532  const amrex::Array4<const amrex::Real>& w,
533  const amrex::Array4<const amrex::EBCellFlag>& u_cflag,
534  const amrex::Array4<const amrex::Real>& u_afrac_x,
535  const amrex::Array4<const amrex::Real>& u_afrac_y,
536  const amrex::Array4<const amrex::Real>& u_afrac_z,
537  const amrex::Array4<const amrex::EBCellFlag>& v_cflag,
538  const amrex::Array4<const amrex::Real>& v_afrac_x,
539  const amrex::Array4<const amrex::Real>& v_afrac_y,
540  const amrex::Array4<const amrex::Real>& v_afrac_z,
541  const amrex::Array4<const amrex::EBCellFlag>& w_cflag,
542  const amrex::Array4<const amrex::Real>& w_afrac_x,
543  const amrex::Array4<const amrex::Real>& w_afrac_y,
544  const amrex::Array4<const amrex::Real>& w_afrac_z,
545  const amrex::Array4<const amrex::Real>& mf_ux_inv,
546  const amrex::Array4<const amrex::Real>& mf_vx_inv,
547  const amrex::Array4<const amrex::Real>& mf_uy_inv,
548  const amrex::Array4<const amrex::Real>& mf_vy_inv,
549  const amrex::Real upw_frac_h,
550  const amrex::Real upw_frac_v,
551  const AdvType vert_adv_type,
552  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_u_arr,
553  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_v_arr,
554  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_w_arr,
555  const int lo_z_face, const int hi_z_face)
556 {
557  if (vert_adv_type == AdvType::Centered_2nd) {
558  EBAdvectionSrcForMomWrapper<InterpType_H,CENTERED2,UPWINDALL>(
559  bxx_grown, bxy_grown, bxz_grown,
560  rho_u, rho_v, rho_w, u, v, w,
561  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
562  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
563  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
564  mf_ux_inv, mf_vx_inv,
565  mf_uy_inv, mf_vy_inv,
566  upw_frac_h, upw_frac_v, vert_adv_type,
567  flx_u_arr, flx_v_arr, flx_w_arr,
568  lo_z_face, hi_z_face);
569  } else if (vert_adv_type == AdvType::Upwind_3rd) {
570  EBAdvectionSrcForMomWrapper<InterpType_H,UPWIND3,UPWINDALL>(
571  bxx_grown, bxy_grown, bxz_grown,
572  rho_u, rho_v, rho_w, u, v, w,
573  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
574  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
575  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
576  mf_ux_inv, mf_vx_inv,
577  mf_uy_inv, mf_vy_inv,
578  upw_frac_h, upw_frac_v, vert_adv_type,
579  flx_u_arr, flx_v_arr, flx_w_arr,
580  lo_z_face, hi_z_face);
581  } else if (vert_adv_type == AdvType::Centered_4th) {
582  EBAdvectionSrcForMomWrapper<InterpType_H,CENTERED4,UPWINDALL>(
583  bxx_grown, bxy_grown, bxz_grown,
584  rho_u, rho_v, rho_w, u, v, w,
585  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
586  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
587  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
588  mf_ux_inv, mf_vx_inv,
589  mf_uy_inv, mf_vy_inv,
590  upw_frac_h, upw_frac_v, vert_adv_type,
591  flx_u_arr, flx_v_arr, flx_w_arr,
592  lo_z_face, hi_z_face);
593  } else if (vert_adv_type == AdvType::Upwind_5th) {
594  EBAdvectionSrcForMomWrapper<InterpType_H,UPWIND5,UPWINDALL>(
595  bxx_grown, bxy_grown, bxz_grown,
596  rho_u, rho_v, rho_w, u, v, w,
597  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
598  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
599  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
600  mf_ux_inv, mf_vx_inv,
601  mf_uy_inv, mf_vy_inv,
602  upw_frac_h, upw_frac_v, vert_adv_type,
603  flx_u_arr, flx_v_arr, flx_w_arr,
604  lo_z_face, hi_z_face);
605  } else if (vert_adv_type == AdvType::Centered_6th) {
606  EBAdvectionSrcForMomWrapper<InterpType_H,CENTERED6,UPWINDALL>(
607  bxx_grown, bxy_grown, bxz_grown,
608  rho_u, rho_v, rho_w, u, v, w,
609  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
610  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
611  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
612  mf_ux_inv, mf_vx_inv,
613  mf_uy_inv, mf_vy_inv,
614  upw_frac_h, upw_frac_v, vert_adv_type,
615  flx_u_arr, flx_v_arr, flx_w_arr,
616  lo_z_face, hi_z_face);
617  } else {
618  AMREX_ASSERT_WITH_MESSAGE(false, "Unknown advection scheme!");
619  }
620 }
void EBAdvectionSrcForMomWrapper(const amrex::Vector< amrex::Box > &bxx_grown, const amrex::Vector< amrex::Box > &bxy_grown, const amrex::Vector< amrex::Box > &bxz_grown, 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::Array4< const amrex::EBCellFlag > &u_cflag, const amrex::Array4< const amrex::Real > &u_afrac_x, const amrex::Array4< const amrex::Real > &u_afrac_y, const amrex::Array4< const amrex::Real > &u_afrac_z, const amrex::Array4< const amrex::EBCellFlag > &v_cflag, const amrex::Array4< const amrex::Real > &v_afrac_x, const amrex::Array4< const amrex::Real > &v_afrac_y, const amrex::Array4< const amrex::Real > &v_afrac_z, const amrex::Array4< const amrex::EBCellFlag > &w_cflag, const amrex::Array4< const amrex::Real > &w_afrac_x, const amrex::Array4< const amrex::Real > &w_afrac_y, const amrex::Array4< const amrex::Real > &w_afrac_z, 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_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, amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_u_arr, amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_v_arr, amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_w_arr, const int lo_z_face, const int hi_z_face)
Definition: ERF_EBAdvectionSrcForMom.H:9
void EBAdvectionSrcForMomVert(const amrex::Vector< amrex::Box > &bxx_grown, const amrex::Vector< amrex::Box > &bxy_grown, const amrex::Vector< amrex::Box > &bxz_grown, 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::Array4< const amrex::EBCellFlag > &u_cflag, const amrex::Array4< const amrex::Real > &u_afrac_x, const amrex::Array4< const amrex::Real > &u_afrac_y, const amrex::Array4< const amrex::Real > &u_afrac_z, const amrex::Array4< const amrex::EBCellFlag > &v_cflag, const amrex::Array4< const amrex::Real > &v_afrac_x, const amrex::Array4< const amrex::Real > &v_afrac_y, const amrex::Array4< const amrex::Real > &v_afrac_z, const amrex::Array4< const amrex::EBCellFlag > &w_cflag, const amrex::Array4< const amrex::Real > &w_afrac_x, const amrex::Array4< const amrex::Real > &w_afrac_y, const amrex::Array4< const amrex::Real > &w_afrac_z, 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_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, amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_u_arr, amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_v_arr, amrex::GpuArray< amrex::Array4< amrex::Real >, AMREX_SPACEDIM > &flx_w_arr, const int lo_z_face, const int hi_z_face)
Definition: ERF_EBAdvectionSrcForMom.H:524
AdvType
Definition: ERF_IndexDefines.H:221
@ Centered_4th
@ Centered_6th
@ Centered_2nd
Definition: ERF_Interpolation_UPW.H:10
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInY(const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real) const
Definition: ERF_Interpolation_UPW.H:36
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInZ(const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real) const
Definition: ERF_Interpolation_UPW.H:54
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInX(const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real) const
Definition: ERF_Interpolation_UPW.H:18
Definition: ERF_Interpolation_UPW.H:93
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInZ(const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real upw_lo) const
Definition: ERF_Interpolation_UPW.H:155
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInY(const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real upw_lo) const
Definition: ERF_Interpolation_UPW.H:129
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void InterpolateInX(const int &i, const int &j, const int &k, const int &qty_index, amrex::Real &val_lo, amrex::Real upw_lo) const
Definition: ERF_Interpolation_UPW.H:103