ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
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  jcell++;
279  }
280  }
281  else if (rho_v_avg<0.)
282  {
283  for (int jj=0; jj<ncells_v_horz; ++jj) {
284  if (v_cflag(i,j+jj,k).isCovered()) {
285  break;
286  }
287  jcell++;
288  }
289  }
290 
291  // Interpolate v using the highest-order scheme
292 
293  amrex::Real interpy = 0.;
294  if (jcell==ncells_v_horz) {
295  interp_v_horz.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
296  } else {
297  if (jcell<=1) {
298  interp_v_CEN2.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
299  } else if (jcell==2) {
300  interp_v_UPW3.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
301  }
302  }
303  flx_v_arr[1](i,j,k) = rho_v_avg * interpy;
304  }
305  else
306  {
307  flx_v_arr[1](i,j,k) = 0.;
308  }
309  },
310  // y-momentum: z-face
311  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
312  {
313  if ( v_afrac_z(i,j,k) > 0. )
314  {
315  amrex::Real rho_w_avg = 0.5 * (rho_w(i,j,k) + rho_w(i,j-1,k));
316 
317  int kcell = 0;
318 
319  if (rho_w_avg>0.)
320  {
321  for (int kk=0; kk<ncells_v_vert; ++kk) {
322  if (v_cflag(i,j,k-kk-1).isCovered()) {
323  break;
324  }
325  kcell++;
326  }
327  }
328  else if (rho_w_avg<0.)
329  {
330  for (int kk=0; kk<ncells_v_vert; ++kk) {
331  if (v_cflag(i,j,k+kk).isCovered()) {
332  break;
333  }
334  kcell++;
335  }
336  }
337 
338  // Interpolate v using the highest-order scheme
339 
340  amrex::Real interpz = 0.;
341  if (kcell==ncells_v_vert) {
342  interp_v_vert.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
343  } else {
344  if (kcell<=1) {
345  interp_v_CEN2.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
346  } else if (kcell==2) {
347  interp_v_UPW3.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
348  }
349  }
350  flx_v_arr[2](i,j,k) = rho_w_avg * interpz;
351  }
352  else
353  {
354  flx_v_arr[2](i,j,k) = 0.;
355  }
356  });
357 
358  // ---------------------------------------------------- //
359  // z-momentum
360  // ---------------------------------------------------- //
361 
362  amrex::ParallelFor(bxz_grown[0], bxz_grown[1], bxz_grown[2],
363  // z-momentum: x-face
364  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
365  {
366  if ( w_afrac_x(i,j,k) > 0. )
367  {
368  amrex::Real rho_u_avg = 0.5 * (rho_u(i,j,k) + rho_u(i,j,k-1)) * mf_ux_inv(i,j,0);
369 
370  int icell = 0;
371 
372  if (rho_u_avg>0.)
373  {
374  for (int ii=0; ii<ncells_w_horz; ++ii) {
375  if (w_cflag(i-ii-1,j,k).isCovered()) {
376  break;
377  }
378  icell++;
379  }
380  }
381  else if (rho_u_avg<0.)
382  {
383  for (int ii=0; ii<ncells_w_horz; ++ii) {
384  if (w_cflag(i+ii,j,k).isCovered()) {
385  break;
386  }
387  icell++;
388  }
389  }
390 
391  // Interpolate w using the highest-order scheme
392 
393  amrex::Real interpx = 0.;
394  if (icell==ncells_w_horz) {
395  interp_w_horz.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
396  } else {
397  if (icell<=1) {
398  interp_w_CEN2.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
399  } else if (icell==2) {
400  interp_w_UPW3.InterpolateInX(i,j,k,0,interpx,rho_u_avg);
401  }
402  }
403  flx_w_arr[0](i,j,k) = rho_u_avg * interpx;
404  }
405  else
406  {
407  flx_w_arr[0](i,j,k) = 0.;
408  }
409  },
410  // z-momentum: y-face
411  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
412  {
413  if ( w_afrac_y(i,j,k) > 0. )
414  {
415  amrex::Real rho_v_avg = 0.5 * (rho_v(i,j,k) + rho_v(i,j,k-1)) * mf_vy_inv(i,j,0);
416 
417  int jcell = 0;
418 
419  if (rho_v_avg>0.)
420  {
421  for (int jj=0; jj<ncells_w_horz; ++jj) {
422  if (w_cflag(i,j-jj-1,k).isCovered()) {
423  break;
424  }
425  jcell++;
426  }
427  }
428  else if (rho_v_avg<0.)
429  {
430  for (int jj=0; jj<ncells_w_horz; ++jj) {
431  if (w_cflag(i,j+jj,k).isCovered()) {
432  break;
433  }
434  jcell++;
435  }
436  }
437 
438  // Interpolate w using the highest-order scheme
439 
440  amrex::Real interpy = 0.;
441  if (jcell==ncells_w_horz) {
442  interp_w_horz.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
443  } else {
444  if (jcell<=1) {
445  interp_w_CEN2.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
446  } else if (jcell==2) {
447  interp_w_UPW3.InterpolateInY(i,j,k,0,interpy,rho_v_avg);
448  }
449  }
450  flx_w_arr[1](i,j,k) = rho_v_avg * interpy;
451  }
452  else
453  {
454  flx_w_arr[1](i,j,k) = 0.;
455  }
456  },
457  // z-momentum: z-face
458  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
459  {
460  if ( w_afrac_z(i,j,k) > 0. )
461  {
462  if (k==lo_z_face || k==hi_z_face+1) {
463 
464  flx_w_arr[2](i,j,k) = rho_w(i,j,k) * w(i,j,k);
465 
466  } else {
467  amrex::Real rho_w_avg = 0.5 * (rho_w(i,j,k) + rho_w(i,j,k-1));
468 
469  int kcell = 0;
470 
471  if (rho_w_avg>0.)
472  {
473  for (int kk=0; kk<ncells_w_vert; ++kk) {
474  if (w_cflag(i,j,k-kk-1).isCovered()) {
475  break;
476  }
477  kcell++;
478  }
479  }
480  else if (rho_w_avg<0.)
481  {
482  for (int kk=0; kk<ncells_w_vert; ++kk) {
483  if (w_cflag(i,j,k+kk).isCovered()) {
484  break;
485  }
486  kcell++;
487  }
488  }
489 
490  // Adjust available cell numbers near the top and bottom boundaries
491 
492  if (k == hi_z_face || k == lo_z_face+1) {
493  kcell=std::min(kcell,1);
494  } else if (k == hi_z_face-1 || k == lo_z_face+2 ) {
495  kcell=std::min(kcell,2);
496  }
497 
498  // Interpolate w using the highest-order scheme
499 
500  amrex::Real interpz = 0.;
501  if (kcell==ncells_w_vert) {
502  interp_w_vert.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
503  } else {
504  if (kcell<=1) {
505  interp_w_CEN2.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
506  } else if (kcell==2) {
507  interp_w_UPW3.InterpolateInZ(i,j,k,0,interpz,rho_w_avg);
508  }
509  }
510  flx_w_arr[2](i,j,k) = rho_w_avg * interpz;
511  } // lo_z_face, hi_z_face
512  }
513  else
514  {
515  flx_w_arr[2](i,j,k) = 0.;
516  }
517  });
518 
519 }
520 
521 /**
522  * Wrapper function for computing the advective tendency w/ spatial order > 2.
523  */
524 template<typename InterpType_H>
525 void
526 EBAdvectionSrcForMomVert (const amrex::Vector<amrex::Box>& bxx_grown,
527  const amrex::Vector<amrex::Box>& bxy_grown,
528  const amrex::Vector<amrex::Box>& bxz_grown,
529  const amrex::Array4<const amrex::Real>& rho_u,
530  const amrex::Array4<const amrex::Real>& rho_v,
531  const amrex::Array4<const amrex::Real>& rho_w,
532  const amrex::Array4<const amrex::Real>& u,
533  const amrex::Array4<const amrex::Real>& v,
534  const amrex::Array4<const amrex::Real>& w,
535  const amrex::Array4<const amrex::EBCellFlag>& u_cflag,
536  const amrex::Array4<const amrex::Real>& u_afrac_x,
537  const amrex::Array4<const amrex::Real>& u_afrac_y,
538  const amrex::Array4<const amrex::Real>& u_afrac_z,
539  const amrex::Array4<const amrex::EBCellFlag>& v_cflag,
540  const amrex::Array4<const amrex::Real>& v_afrac_x,
541  const amrex::Array4<const amrex::Real>& v_afrac_y,
542  const amrex::Array4<const amrex::Real>& v_afrac_z,
543  const amrex::Array4<const amrex::EBCellFlag>& w_cflag,
544  const amrex::Array4<const amrex::Real>& w_afrac_x,
545  const amrex::Array4<const amrex::Real>& w_afrac_y,
546  const amrex::Array4<const amrex::Real>& w_afrac_z,
547  const amrex::Array4<const amrex::Real>& mf_ux_inv,
548  const amrex::Array4<const amrex::Real>& mf_vx_inv,
549  const amrex::Array4<const amrex::Real>& mf_uy_inv,
550  const amrex::Array4<const amrex::Real>& mf_vy_inv,
551  const amrex::Real upw_frac_h,
552  const amrex::Real upw_frac_v,
553  const AdvType vert_adv_type,
554  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_u_arr,
555  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_v_arr,
556  amrex::GpuArray<amrex::Array4<amrex::Real>, AMREX_SPACEDIM>& flx_w_arr,
557  const int lo_z_face, const int hi_z_face)
558 {
559  if (vert_adv_type == AdvType::Centered_2nd) {
560  EBAdvectionSrcForMomWrapper<InterpType_H,CENTERED2,UPWINDALL>(
561  bxx_grown, bxy_grown, bxz_grown,
562  rho_u, rho_v, rho_w, u, v, w,
563  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
564  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
565  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
566  mf_ux_inv, mf_vx_inv,
567  mf_uy_inv, mf_vy_inv,
568  upw_frac_h, upw_frac_v, vert_adv_type,
569  flx_u_arr, flx_v_arr, flx_w_arr,
570  lo_z_face, hi_z_face);
571  } else if (vert_adv_type == AdvType::Upwind_3rd) {
572  EBAdvectionSrcForMomWrapper<InterpType_H,UPWIND3,UPWINDALL>(
573  bxx_grown, bxy_grown, bxz_grown,
574  rho_u, rho_v, rho_w, u, v, w,
575  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
576  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
577  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
578  mf_ux_inv, mf_vx_inv,
579  mf_uy_inv, mf_vy_inv,
580  upw_frac_h, upw_frac_v, vert_adv_type,
581  flx_u_arr, flx_v_arr, flx_w_arr,
582  lo_z_face, hi_z_face);
583  } else if (vert_adv_type == AdvType::Centered_4th) {
584  EBAdvectionSrcForMomWrapper<InterpType_H,CENTERED4,UPWINDALL>(
585  bxx_grown, bxy_grown, bxz_grown,
586  rho_u, rho_v, rho_w, u, v, w,
587  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
588  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
589  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
590  mf_ux_inv, mf_vx_inv,
591  mf_uy_inv, mf_vy_inv,
592  upw_frac_h, upw_frac_v, vert_adv_type,
593  flx_u_arr, flx_v_arr, flx_w_arr,
594  lo_z_face, hi_z_face);
595  } else if (vert_adv_type == AdvType::Upwind_5th) {
596  EBAdvectionSrcForMomWrapper<InterpType_H,UPWIND5,UPWINDALL>(
597  bxx_grown, bxy_grown, bxz_grown,
598  rho_u, rho_v, rho_w, u, v, w,
599  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
600  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
601  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
602  mf_ux_inv, mf_vx_inv,
603  mf_uy_inv, mf_vy_inv,
604  upw_frac_h, upw_frac_v, vert_adv_type,
605  flx_u_arr, flx_v_arr, flx_w_arr,
606  lo_z_face, hi_z_face);
607  } else if (vert_adv_type == AdvType::Centered_6th) {
608  EBAdvectionSrcForMomWrapper<InterpType_H,CENTERED6,UPWINDALL>(
609  bxx_grown, bxy_grown, bxz_grown,
610  rho_u, rho_v, rho_w, u, v, w,
611  u_cflag, u_afrac_x, u_afrac_y, u_afrac_z,
612  v_cflag, v_afrac_x, v_afrac_y, v_afrac_z,
613  w_cflag, w_afrac_x, w_afrac_y, w_afrac_z,
614  mf_ux_inv, mf_vx_inv,
615  mf_uy_inv, mf_vy_inv,
616  upw_frac_h, upw_frac_v, vert_adv_type,
617  flx_u_arr, flx_v_arr, flx_w_arr,
618  lo_z_face, hi_z_face);
619  } else {
620  AMREX_ASSERT_WITH_MESSAGE(false, "Unknown advection scheme!");
621  }
622 }
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:526
AdvType
Definition: ERF_IndexDefines.H:221
@ Centered_4th
@ Centered_6th
@ Centered_2nd
amrex::Real Real
Definition: ERF_ShocInterface.H:19
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