ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Utils.H
Go to the documentation of this file.
1 #ifndef ERF_UTILS_H_
2 #define ERF_UTILS_H_
3 
4 #include "AMReX.H"
5 #include "AMReX_MultiFab.H"
6 #include "AMReX_BCRec.H"
7 #include "ERF_DataStruct.H"
8 #include "ERF_IndexDefines.H"
9 #include "ERF_SurfaceLayer.H"
10 #include "ERF_FillPatcher.H"
11 
12 /*
13  * Create a new BoxArray in which every grid touches the bottom boundary
14  */
15 void ChopGrids2D (amrex::BoxArray& ba, const amrex::Box& domain, int target_size);
16 
17 /*
18  * Create a new BoxArray with exactly the number of boxes as MPI ranks.
19  * This is designed to work only on the base level which covers the entire domain.
20  */
21 amrex::BoxArray
22 ERFPostProcessBaseGrids (const amrex::Box& domain, bool decompose_in_z);
23 
24 /*
25  * Create the Jacobian for the metric transformation when use_terrain is true
26  */
27 void make_J (const amrex::Geometry& geom,
28  amrex::MultiFab& z_phys_nd,
29  amrex::MultiFab& detJ_cc);
30 
31 void make_areas (const amrex::Geometry& geom,
32  amrex::MultiFab& z_phys_nd,
33  amrex::MultiFab& ax,
34  amrex::MultiFab& ay,
35  amrex::MultiFab& az);
36 
37 /*
38  * Average z_phys_nd on nodes to cell centers
39  */
40 void make_zcc (const amrex::Geometry& geom,
41  amrex::MultiFab& z_phys_nd,
42  amrex::MultiFab& z_phys_cc);
43 
44 /*
45  * Convert momentum to velocity by dividing by density averaged onto faces
46  */
47 void MomentumToVelocity (amrex::MultiFab& xvel_out,
48  amrex::MultiFab& yvel_out,
49  amrex::MultiFab& zvel_out,
50  const amrex::MultiFab& cons_in,
51  const amrex::MultiFab& xmom_in,
52  const amrex::MultiFab& ymom_in,
53  const amrex::MultiFab& zmom_in,
54  const amrex::Box& domain,
55  const amrex::Vector<amrex::BCRec>& domain_bcs_type_h,
56  const amrex::MultiFab* c_vfrac = nullptr // optional
57  );
58 
59 /*
60  * Convert velocity to momentum by multiplying by density averaged onto faces
61  */
62 void VelocityToMomentum (const amrex::MultiFab& xvel_in,
63  const amrex::IntVect & xvel_ngrow,
64  const amrex::MultiFab& yvel_in,
65  const amrex::IntVect & yvel_ngrow,
66  const amrex::MultiFab& zvel_in,
67  const amrex::IntVect & zvel_ngrow,
68  const amrex::MultiFab& cons_in,
69  amrex::MultiFab& xmom_out,
70  amrex::MultiFab& ymom_out,
71  amrex::MultiFab& zmom_out,
72  const amrex::Box& domain,
73  const amrex::Vector<amrex::BCRec>& domain_bcs_type_h,
74  const amrex::MultiFab* c_vfrac = nullptr // optional
75  );
76 
77 /*
78  * Convert (den_div u) to (den_mlt u) by multiplying by (den_mlt/den_div)
79  */
80 void
81 ConvertForProjection (const amrex::MultiFab& den_div, const amrex::MultiFab& den_mlt,
82  amrex::MultiFab& xmom, amrex::MultiFab& ymom, amrex::MultiFab& zmom,
83  const amrex::Box& domain, const amrex::Vector<amrex::BCRec>& domain_bcs_type_h);
84 
85 /*
86  * Compute boxes for looping over interior/exterior ghost cells
87  * for use by fillpatch, erf_slow_rhs_pre, and erf_slow_rhs_post
88  */
89 void realbdy_interior_bxs_xy (const amrex::Box& bx,
90  const amrex::Box& domain,
91  const int& width,
92  amrex::Box& bx_xlo,
93  amrex::Box& bx_xhi,
94  amrex::Box& bx_ylo,
95  amrex::Box& bx_yhi,
96  const int& set_width=0,
97  const amrex::IntVect& ng_vect=amrex::IntVect(0,0,0),
98  const bool get_int_ng=false);
99 
100 /*
101  * Compute boxes for looping over set region cells
102  * for use by fillpatch, erf_slow_rhs_pre, and erf_slow_rhs_post
103  */
104 void realbdy_bc_bxs_xy (const amrex::Box& bx,
105  const amrex::Box& domain,
106  const int& set_width,
107  amrex::Box& bx_xlo,
108  amrex::Box& bx_xhi,
109  amrex::Box& bx_ylo,
110  amrex::Box& bx_yhi,
111  const amrex::IntVect& ng_vect=amrex::IntVect(0,0,0));
112 
113 /*
114  * Compute relaxation region RHS with wrfbdy
115  */
116 void realbdy_compute_interior_ghost_rhs (const amrex::Real& bdy_time_interval,
117  const amrex::Real& time,
118  const amrex::Real& delta_t,
119  const amrex::Real& stop_time_elapsed,
120  int width,
121  int set_width,
122  const amrex::Geometry& geom,
123  amrex::Vector<amrex::MultiFab>& S_rhs,
124  amrex::Vector<amrex::MultiFab>& S_old_data,
125  amrex::Vector<amrex::MultiFab>& S_cur_data,
126  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xlo,
127  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_xhi,
128  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_ylo,
129  amrex::Vector<amrex::Vector<amrex::FArrayBox>>& bdy_data_yhi);
130 
131 /*
132  * Compute relaxation region RHS at fine-crse interface
133  */
134 void
136  const amrex::Real& delta_t,
137  const int& width,
138  const int& set_width,
139  const amrex::Geometry& geom,
140  ERFFillPatcher* FPr_c,
141  ERFFillPatcher* FPr_u,
142  ERFFillPatcher* FPr_v,
143  ERFFillPatcher* FPr_w,
144  amrex::Vector<amrex::BCRec>& domain_bcs_type,
145  amrex::Vector<amrex::MultiFab>& S_rhs_f,
146  amrex::Vector<amrex::MultiFab>& S_data_f);
147 
148 /*
149  * Accumulate time averaged velocity fields
150  */
151 void
153  amrex::Real& t_avg_cnt,
154  amrex::MultiFab* vel_t_avg,
155  amrex::MultiFab& xvel,
156  amrex::MultiFab& yvel,
157  amrex::MultiFab& zvel);
158 
159 /**
160  * Zero RHS in the set region
161  *
162  * @param[in] icomp component offset
163  * @param[in] num_var number of variables to loop
164  * @param[in] bx_xlo box for low x relaxation
165  * @param[in] bx_xhi box for high x relaxation
166  * @param[in] bx_ylo box for low y relaxation
167  * @param[in] bx_yhi box for high y relaxation
168  * @param[out] rhs_arr RHS array
169  */
170 AMREX_GPU_HOST
171 AMREX_FORCE_INLINE
172 void
174  const int& icomp,
175  const int& num_var,
176  const int& width,
177  const int& set_width_x,
178  const int& set_width_y,
179  const amrex::Dim3& dom_lo,
180  const amrex::Dim3& dom_hi,
181  const amrex::Box& bx_xlo,
182  const amrex::Box& bx_xhi,
183  const amrex::Box& bx_ylo,
184  const amrex::Box& bx_yhi,
185  const amrex::Array4<const amrex::Real>& arr_xlo,
186  const amrex::Array4<const amrex::Real>& arr_xhi,
187  const amrex::Array4<const amrex::Real>& arr_ylo,
188  const amrex::Array4<const amrex::Real>& arr_yhi,
189  const amrex::Array4<const amrex::Real>& data_arr,
190  const amrex::Array4<amrex::Real>& rhs_arr)
191 {
192  int Spec_z_x = set_width_x;
193  int Spec_z_y = set_width_y;
194  amrex::ParallelFor(bx_xlo, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
195  {
196  // Corners with x boxes
197  int j_lo = std::min(j-dom_lo.y,width-1);
198  int j_hi = std::min(dom_hi.y-j,width-1);
199  int jj = std::min(j_lo,j_hi);
200  int n_ind_y = jj + 1;
201  int n_ind_x = i - dom_lo.x + 1;
202  if ((n_ind_x <= Spec_z_x) || (n_ind_y <= Spec_z_y)) {
203  amrex::Real tend = ( arr_xlo(i,j,k) - data_arr(i,j,k,n+icomp) ) / dt;
204  rhs_arr(i,j,k,n+icomp) = tend;
205  }
206  },
207  bx_xhi, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
208  {
209  // Corners with x boxes
210  int j_lo = std::min(j-dom_lo.y,width-1);
211  int j_hi = std::min(dom_hi.y-j,width-1);
212  int jj = std::min(j_lo,j_hi);
213  int n_ind_y = jj + 1;
214  int n_ind_x = dom_hi.x - i + 1;
215  if ((n_ind_x <= Spec_z_x) || (n_ind_y <= Spec_z_y)) {
216  amrex::Real tend = ( arr_xhi(i,j,k) - data_arr(i,j,k,n+icomp) ) / dt;
217  rhs_arr(i,j,k,n+icomp) = tend;
218  }
219  });
220 
221  amrex::ParallelFor(bx_ylo, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
222  {
223  // No corners for y boxes
224  int n_ind = j - dom_lo.y + 1;
225  if (n_ind <= Spec_z_y) {
226  amrex::Real tend = ( arr_ylo(i,j,k) - data_arr(i,j,k,n+icomp) ) / dt;
227  rhs_arr(i,j,k,n+icomp) = tend;
228  }
229  },
230  bx_yhi, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
231  {
232  // No corners for y boxes
233  int n_ind = dom_hi.y - j + 1;
234  if (n_ind <= Spec_z_y) {
235  amrex::Real tend = ( arr_yhi(i,j,k) - data_arr(i,j,k,n+icomp) ) / dt;
236  rhs_arr(i,j,k,n+icomp) = tend;
237  }
238  });
239 }
240 
241 /**
242  * Compute the Laplacian RHS in the relaxation zone
243  *
244  * @param[in] delta_t time step
245  * @param[in] icomp component offset
246  * @param[in] num_var number of variables to loop
247  * @param[in] width width of wrf bdy file
248  * @param[in] set_width width the set region
249  * @param[in] dom_lo low bound of domain
250  * @param[in] dom_hi high bound of domain
251  * @param[in] F1 drift relaxation parameter
252  * @param[in] F2 Laplacian relaxation parameter
253  * @param[in] bx_xlo box for low x relaxation
254  * @param[in] bx_xhi box for high x relaxation
255  * @param[in] bx_ylo box for low y relaxation
256  * @param[in] bx_yhi box for high y relaxation
257  * @param[in] arr_xlo array for low x relaxation
258  * @param[in] arr_xhi array for high x relaxation
259  * @param[in] arr_ylo array for low y relaxation
260  * @param[in] arr_yhi array for high y relaxation
261  * @param[in] data_arr data array
262  * @param[out] rhs_arr RHS array
263  */
264 AMREX_GPU_HOST
265 AMREX_FORCE_INLINE
266 void
268  const int& num_var,
269  const int& width,
270  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& dx,
271  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbLo,
272  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM>& ProbHi,
273  const amrex::Real& F1,
274  const amrex::Real& F2,
275  const amrex::Box& bx_xlo,
276  const amrex::Box& bx_xhi,
277  const amrex::Box& bx_ylo,
278  const amrex::Box& bx_yhi,
279  const amrex::Array4<const amrex::Real>& arr_xlo,
280  const amrex::Array4<const amrex::Real>& arr_xhi,
281  const amrex::Array4<const amrex::Real>& arr_ylo,
282  const amrex::Array4<const amrex::Real>& arr_yhi,
283  const amrex::Array4<const amrex::Real>& data_arr,
284  const amrex::Array4<amrex::Real>& rhs_arr)
285 {
286  // RHS computation
287  amrex::IntVect iv = bx_xlo.type();
288  amrex::Real ioff = (iv[0]==1) ? 0.0 : 0.5;
289  amrex::Real joff = (iv[1]==1) ? 0.0 : 0.5;
290  amrex::ParallelFor(bx_xlo, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
291  {
292  // Corners with x boxes
293  amrex::Real x = ProbLo[0] + (i + ioff) * dx[0];
294  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
295  amrex::Real x_end = ProbLo[0] + (width + ioff) * dx[0];
296  amrex::Real y_end = ProbLo[1] + (width + joff) * dx[1];
297  amrex::Real y_strt = ProbHi[1] - (width + joff) * dx[1];
298  amrex::Real xi = (x_end - x) / (x_end - ProbLo[0]);
299  amrex::Real eta_lo = (y < y_end ) ? (y_end - y) / (y_end - ProbLo[1]) : 0.0;
300  amrex::Real eta_hi = (y > y_strt) ? (y - y_strt) / (ProbHi[1] - y_strt) : 0.0;
301  amrex::Real eta = std::min(eta_lo,eta_hi);
302  amrex::Real Factor = std::max(xi*xi,eta*eta);
303 
304  amrex::Real d = data_arr(i ,j ,k ,n+icomp);
305  amrex::Real d_ip1 = data_arr(i+1,j ,k ,n+icomp);
306  amrex::Real d_im1 = data_arr(i-1,j ,k ,n+icomp);
307  amrex::Real d_jp1 = data_arr(i ,j+1,k ,n+icomp);
308  amrex::Real d_jm1 = data_arr(i ,j-1,k ,n+icomp);
309  amrex::Real delta = arr_xlo(i ,j ,k,n) - d;
310  amrex::Real delta_xp = arr_xlo(i+1,j ,k,n) - d_ip1;
311  amrex::Real delta_xm = arr_xlo(i-1,j ,k,n) - d_im1;
312  amrex::Real delta_yp = arr_xlo(i ,j+1,k,n) - d_jp1;
313  amrex::Real delta_ym = arr_xlo(i ,j-1,k,n) - d_jm1;
314  amrex::Real Laplacian = delta_xp + delta_xm + delta_yp + delta_ym - 4.0*delta;
315  amrex::Real Temp = (F1*delta - F2*Laplacian) * Factor;
316  rhs_arr(i,j,k,n+icomp) += Temp;
317  },
318  bx_xhi, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
319  {
320  // Corners with x boxes
321  amrex::Real x = ProbLo[0] + (i + ioff) * dx[0];
322  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
323  amrex::Real x_strt = ProbHi[0] - (width + ioff) * dx[0];
324  amrex::Real y_strt = ProbHi[1] - (width + joff) * dx[1];
325  amrex::Real y_end = ProbLo[1] + (width + joff) * dx[1];
326  amrex::Real xi = (x - x_strt) / (ProbHi[0] - x_strt);
327  amrex::Real eta_lo = (y < y_end ) ? (y_end - y) / (y_end - ProbLo[1]) : 0.0;
328  amrex::Real eta_hi = (y > y_strt) ? (y - y_strt) / (ProbHi[1] - y_strt) : 0.0;
329  amrex::Real eta = std::min(eta_lo,eta_hi);
330  amrex::Real Factor = std::max(xi*xi,eta*eta);
331 
332  amrex::Real d = data_arr(i ,j ,k ,n+icomp);
333  amrex::Real d_ip1 = data_arr(i+1,j ,k ,n+icomp);
334  amrex::Real d_im1 = data_arr(i-1,j ,k ,n+icomp);
335  amrex::Real d_jp1 = data_arr(i ,j+1,k ,n+icomp);
336  amrex::Real d_jm1 = data_arr(i ,j-1,k ,n+icomp);
337  amrex::Real delta = arr_xhi(i ,j ,k,n) - d;
338  amrex::Real delta_xp = arr_xhi(i+1,j ,k,n) - d_ip1;
339  amrex::Real delta_xm = arr_xhi(i-1,j ,k,n) - d_im1;
340  amrex::Real delta_yp = arr_xhi(i ,j+1,k,n) - d_jp1;
341  amrex::Real delta_ym = arr_xhi(i ,j-1,k,n) - d_jm1;
342  amrex::Real Laplacian = delta_xp + delta_xm + delta_yp + delta_ym - 4.0*delta;
343  amrex::Real Temp = (F1*delta - F2*Laplacian) * Factor;
344  rhs_arr(i,j,k,n+icomp) += Temp;
345  });
346 
347  amrex::ParallelFor(bx_ylo, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
348  {
349  // No corners for y boxes
350  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
351  amrex::Real y_end = ProbLo[1] + (width + joff) * dx[1];
352  amrex::Real eta = (y_end - y) / (y_end - ProbLo[1]);
353  amrex::Real Factor = eta*eta;
354 
355  amrex::Real d = data_arr(i ,j ,k ,n+icomp);
356  amrex::Real d_ip1 = data_arr(i+1,j ,k ,n+icomp);
357  amrex::Real d_im1 = data_arr(i-1,j ,k ,n+icomp);
358  amrex::Real d_jp1 = data_arr(i ,j+1,k ,n+icomp);
359  amrex::Real d_jm1 = data_arr(i ,j-1,k ,n+icomp);
360  amrex::Real delta = arr_ylo(i ,j ,k,n) - d;
361  amrex::Real delta_xp = arr_ylo(i+1,j ,k,n) - d_ip1;
362  amrex::Real delta_xm = arr_ylo(i-1,j ,k,n) - d_im1;
363  amrex::Real delta_yp = arr_ylo(i ,j+1,k,n) - d_jp1;
364  amrex::Real delta_ym = arr_ylo(i ,j-1,k,n) - d_jm1;
365  amrex::Real Laplacian = delta_xp + delta_xm + delta_yp + delta_ym - 4.0*delta;
366  amrex::Real Temp = (F1*delta - F2*Laplacian) * Factor;
367  rhs_arr(i,j,k,n+icomp) += Temp;
368  },
369  bx_yhi, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
370  {
371  // No corners for y boxes
372  amrex::Real y = ProbLo[1] + (j + joff) * dx[1];
373  amrex::Real y_strt = ProbHi[1] - (width + joff) * dx[1];
374  amrex::Real eta = (y - y_strt) / (ProbHi[1] - y_strt);
375  amrex::Real Factor = eta*eta;
376 
377  amrex::Real d = data_arr(i ,j ,k ,n+icomp);
378  amrex::Real d_ip1 = data_arr(i+1,j ,k ,n+icomp);
379  amrex::Real d_im1 = data_arr(i-1,j ,k ,n+icomp);
380  amrex::Real d_jp1 = data_arr(i ,j+1,k ,n+icomp);
381  amrex::Real d_jm1 = data_arr(i ,j-1,k ,n+icomp);
382  amrex::Real delta = arr_yhi(i ,j ,k,n) - d;
383  amrex::Real delta_xp = arr_yhi(i+1,j ,k,n) - d_ip1;
384  amrex::Real delta_xm = arr_yhi(i-1,j ,k,n) - d_im1;
385  amrex::Real delta_yp = arr_yhi(i ,j+1,k,n) - d_jp1;
386  amrex::Real delta_ym = arr_yhi(i ,j-1,k,n) - d_jm1;
387  amrex::Real Laplacian = delta_xp + delta_xm + delta_yp + delta_ym - 4.0*delta;
388  amrex::Real Temp = (F1*delta - F2*Laplacian) * Factor;
389  rhs_arr(i,j,k,n+icomp) += Temp;
390  });
391 }
392 
393 /*
394  * Effectively a Multiply for a MultiFab and an iMultiFab mask
395  */
396 AMREX_GPU_HOST
397 AMREX_FORCE_INLINE
398 void
399 ApplyMask (amrex::MultiFab& dst,
400  const amrex::iMultiFab& imask,
401  const int nghost = 0)
402 {
403  for (amrex::MFIter mfi(dst,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
404  {
405  const amrex::Box& bx = mfi.growntilebox(nghost);
406  if (bx.ok())
407  {
408  auto dstFab = dst.array(mfi);
409  const auto maskFab = imask.const_array(mfi);
410  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
411  {
412  dstFab(i,j,k) *= maskFab(i,j,k);
413  });
414  }
415  }
416 }
417 
418 AMREX_GPU_HOST
419 AMREX_FORCE_INLINE
420 void
421 ApplyInvertedMask (amrex::MultiFab& dst,
422  const amrex::iMultiFab& imask,
423  const int nghost = 0)
424 {
425  for (amrex::MFIter mfi(dst,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
426  {
427  const amrex::Box& bx = mfi.growntilebox(nghost);
428  if (bx.ok())
429  {
430  auto dstFab = dst.array(mfi);
431  const auto maskFab = imask.const_array(mfi);
432  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
433  {
434  dstFab(i,j,k) *= (1-maskFab(i,j,k));
435  });
436  }
437  }
438 }
439 
440 void
441 thinbody_wall_dist (std::unique_ptr<amrex::MultiFab>& wdist,
442  amrex::Vector<amrex::IntVect>& xfaces,
443  amrex::Vector<amrex::IntVect>& yfaces,
444  amrex::Vector<amrex::IntVect>& zfaces,
445  const amrex::Geometry& geomdata,
446  std::unique_ptr<amrex::MultiFab>& z_phys_cc);
447 
448 
450 
451 #endif
const auto & dom_hi
Definition: ERF_DiffSetup.H:10
const auto & dom_lo
Definition: ERF_DiffSetup.H:9
amrex::Real Real
Definition: ERF_ShocInterface.H:19
void MomentumToVelocity(amrex::MultiFab &xvel_out, amrex::MultiFab &yvel_out, amrex::MultiFab &zvel_out, const amrex::MultiFab &cons_in, const amrex::MultiFab &xmom_in, const amrex::MultiFab &ymom_in, const amrex::MultiFab &zmom_in, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h, const amrex::MultiFab *c_vfrac=nullptr)
AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_set_rhs_in_spec_region(const amrex::Real &dt, const int &icomp, const int &num_var, const int &width, const int &set_width_x, const int &set_width_y, const amrex::Dim3 &dom_lo, const amrex::Dim3 &dom_hi, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr)
Definition: ERF_Utils.H:173
void VelocityToMomentum(const amrex::MultiFab &xvel_in, const amrex::IntVect &xvel_ngrow, const amrex::MultiFab &yvel_in, const amrex::IntVect &yvel_ngrow, const amrex::MultiFab &zvel_in, const amrex::IntVect &zvel_ngrow, const amrex::MultiFab &cons_in, amrex::MultiFab &xmom_out, amrex::MultiFab &ymom_out, amrex::MultiFab &zmom_out, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h, const amrex::MultiFab *c_vfrac=nullptr)
void WeatherDataInterpolation(const amrex::Real time)
void fine_compute_interior_ghost_rhs(const amrex::Real &time, const amrex::Real &delta_t, const int &width, const int &set_width, const amrex::Geometry &geom, ERFFillPatcher *FPr_c, ERFFillPatcher *FPr_u, ERFFillPatcher *FPr_v, ERFFillPatcher *FPr_w, amrex::Vector< amrex::BCRec > &domain_bcs_type, amrex::Vector< amrex::MultiFab > &S_rhs_f, amrex::Vector< amrex::MultiFab > &S_data_f)
void thinbody_wall_dist(std::unique_ptr< amrex::MultiFab > &wdist, amrex::Vector< amrex::IntVect > &xfaces, amrex::Vector< amrex::IntVect > &yfaces, amrex::Vector< amrex::IntVect > &zfaces, const amrex::Geometry &geomdata, std::unique_ptr< amrex::MultiFab > &z_phys_cc)
void realbdy_interior_bxs_xy(const amrex::Box &bx, const amrex::Box &domain, const int &width, amrex::Box &bx_xlo, amrex::Box &bx_xhi, amrex::Box &bx_ylo, amrex::Box &bx_yhi, const int &set_width=0, const amrex::IntVect &ng_vect=amrex::IntVect(0, 0, 0), const bool get_int_ng=false)
amrex::BoxArray ERFPostProcessBaseGrids(const amrex::Box &domain, bool decompose_in_z)
void realbdy_compute_interior_ghost_rhs(const amrex::Real &bdy_time_interval, const amrex::Real &time, const amrex::Real &delta_t, const amrex::Real &stop_time_elapsed, int width, int set_width, const amrex::Geometry &geom, amrex::Vector< amrex::MultiFab > &S_rhs, amrex::Vector< amrex::MultiFab > &S_old_data, amrex::Vector< amrex::MultiFab > &S_cur_data, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_xlo, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_xhi, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_ylo, amrex::Vector< amrex::Vector< amrex::FArrayBox >> &bdy_data_yhi)
void make_zcc(const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &z_phys_cc)
void realbdy_bc_bxs_xy(const amrex::Box &bx, const amrex::Box &domain, const int &set_width, amrex::Box &bx_xlo, amrex::Box &bx_xhi, amrex::Box &bx_ylo, amrex::Box &bx_yhi, const amrex::IntVect &ng_vect=amrex::IntVect(0, 0, 0))
AMREX_GPU_HOST AMREX_FORCE_INLINE void realbdy_compute_laplacian_relaxation(const int &icomp, const int &num_var, const int &width, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dx, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbLo, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &ProbHi, const amrex::Real &F1, const amrex::Real &F2, const amrex::Box &bx_xlo, const amrex::Box &bx_xhi, const amrex::Box &bx_ylo, const amrex::Box &bx_yhi, const amrex::Array4< const amrex::Real > &arr_xlo, const amrex::Array4< const amrex::Real > &arr_xhi, const amrex::Array4< const amrex::Real > &arr_ylo, const amrex::Array4< const amrex::Real > &arr_yhi, const amrex::Array4< const amrex::Real > &data_arr, const amrex::Array4< amrex::Real > &rhs_arr)
Definition: ERF_Utils.H:267
void Time_Avg_Vel_atCC(const amrex::Real &dt, amrex::Real &t_avg_cnt, amrex::MultiFab *vel_t_avg, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::MultiFab &zvel)
AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyInvertedMask(amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0)
Definition: ERF_Utils.H:421
void make_J(const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &detJ_cc)
AMREX_GPU_HOST AMREX_FORCE_INLINE void ApplyMask(amrex::MultiFab &dst, const amrex::iMultiFab &imask, const int nghost=0)
Definition: ERF_Utils.H:399
void ConvertForProjection(const amrex::MultiFab &den_div, const amrex::MultiFab &den_mlt, amrex::MultiFab &xmom, amrex::MultiFab &ymom, amrex::MultiFab &zmom, const amrex::Box &domain, const amrex::Vector< amrex::BCRec > &domain_bcs_type_h)
void ChopGrids2D(amrex::BoxArray &ba, const amrex::Box &domain, int target_size)
void make_areas(const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::MultiFab &ax, amrex::MultiFab &ay, amrex::MultiFab &az)
Definition: ERF_FillPatcher.H:9
@ ymom
Definition: ERF_IndexDefines.H:160
@ zmom
Definition: ERF_IndexDefines.H:161
@ xmom
Definition: ERF_IndexDefines.H:159
@ xvel
Definition: ERF_IndexDefines.H:141
@ zvel
Definition: ERF_IndexDefines.H:143
@ yvel
Definition: ERF_IndexDefines.H:142