ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_PhysBCFunct.H
Go to the documentation of this file.
1 #ifndef ERF_PhysBCFunct_H_
2 #define ERF_PhysBCFunct_H_
3 
4 #include <AMReX_Config.H>
5 
6 #include <AMReX_BCRec.H>
7 #include <AMReX_Geometry.H>
8 #include <AMReX_MultiFab.H>
9 #include <AMReX_ArrayLim.H>
10 #include <AMReX_FilCC_C.H>
11 #include <AMReX_FilND_C.H>
12 #include <AMReX_FilFC_C.H>
13 #include "AMReX_TypeTraits.H"
14 #include "AMReX_Orientation.H"
15 
16 #include <ERF_ReadBndryPlanes.H>
18 #include <ERF_IndexDefines.H>
19 #include <ERF_DataStruct.H>
20 #include <ERF_EddyViscosity.H>
21 #include <ERF_TerrainMetrics.H>
22 #include <ERF_InflowProfile.H>
23 
24 /**
25  * Make the ghost cells below the bottom of the domain agree between boxes.
26  *
27  * On a terrain-fitted mesh the zero-gradient condition at the bottom is corrected
28  * by the slope of the terrain times the lateral gradient of the variable at the
29  * first cell (impose_vertical_*_bcs). Each box computes that for its own ghost
30  * cells, and in the outermost ring of its lateral ghost cells the gradient can
31  * only be one-sided, so the same ghost cell below the ground holds different
32  * values in different boxes. The fill of a finer level copies ghost cells of
33  * this level, taking whichever box's copy it meets, so the finer level then
34  * depends on the box decomposition.
35  *
36  * This replaces every ghost cell below the domain with the value computed by the
37  * box whose valid columns contain it (or, outside the domain laterally, the box
38  * at that boundary), where the lateral stencil is always centered. Values in the
39  * owning box are unchanged. The layout of the owning slabs is cached.
40  */
42 {
43  void operator() (amrex::MultiFab& mf, int icomp, int ncomp,
44  const amrex::IntVect& nghost, const amrex::Geometry& geom);
45 
46 private:
47  amrex::BoxArray m_src_ba;
48  amrex::DistributionMapping m_src_dm;
49  amrex::IntVect m_nghost;
50  amrex::BoxArray m_slab_ba;
51  amrex::DistributionMapping m_slab_dm;
52  amrex::Vector<int> m_src_index; // the box of mf each slab lies under
53 };
54 
56 {
57 public:
58  /**
59  * Construct the conserved-variable physical boundary-condition functor.
60  *
61  * @param[in] lev level index
62  * @param[in] geom geometry for the level
63  * @param[in] domain_bcs_type host boundary-condition records
64  * @param[in] domain_bcs_type_d device boundary-condition records
65  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
66  * @param[in] bc_neumann_vals Neumann values for boundary faces
67  * @param[in] terrain_type terrain type for the level
68  * @param[in] mapfac_lev map-factor MultiFabs for the level
69  * @param[in] z_phys_nd nodal physical height MultiFab
70  * @param[in] use_real_bcs whether real-data boundary conditions are active
71  * @param[in] th_bc_data optional theta boundary data (one profile in z)
72  * @param[in] th_file_face per face: 0 the face's theta is not th_bc_data, 1 th_bc_data
73  * holds rho*theta for that face, 2 it holds theta
74  */
75  ERFPhysBCFunct_cons (const int lev,
76  const amrex::Geometry& geom, const amrex::Vector<amrex::BCRec>& domain_bcs_type,
77  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
78  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
79  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
80  const TerrainType& terrain_type,
81  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& mapfac_lev,
82  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
83  const bool use_real_bcs,
84  amrex::Real* th_bc_data,
85  const amrex::Array<int,AMREX_SPACEDIM*2>& th_file_face)
86  : m_lev(lev), m_geom(geom),
87  m_domain_bcs_type(domain_bcs_type),
88  m_domain_bcs_type_d(domain_bcs_type_d),
89  m_bc_extdir_vals(bc_extdir_vals),
90  m_bc_neumann_vals(bc_neumann_vals),
91  m_terrain_type(terrain_type),
92  m_z_phys_nd(z_phys_nd.get()),
93  m_use_real_bcs(use_real_bcs),
94  m_th_bc_data(th_bc_data)
95  {
96  m_mapfac_x = mapfac_lev[MapFacType::m_x].get();
97  m_mapfac_y = mapfac_lev[MapFacType::m_y].get();
98  for (int ori = 0; ori < 2*AMREX_SPACEDIM; ++ori) { m_th_file_face[ori] = th_file_face[ori]; }
99  }
100 
101  /**
102  * Destroy the conserved-variable physical boundary-condition functor.
103  */
105 
106  /** Terrain-following inflow profiles per face (xlo.inflow_profile), owned by ERF */
107  void set_inflow_profiles (const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* profiles) { m_inflow_profiles = profiles; }
108 
109  /**
110  * The lateral faces of a pseudo-incompressible level that give a primitive inflow theta.
111  * There the constraint holds rho*theta at rho0*theta0, so the ghost cells where the flow
112  * enters take rho = (rho*theta)_interior / theta_in, and every given value is made
113  * conserved with that density (#5265).
114  *
115  * @param[in] face per face: 0 not such a face, 1 inflow, 2 inflow_outflow
116  * @param[in] theta per face: the given theta (<face>.theta), unless the face's theta comes
117  * from th_bc_data (th_file_face 2)
118  */
119  void set_pi_inflow_faces (const amrex::GpuArray<int,AMREX_SPACEDIM*2>& face,
120  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM*2>& theta)
121  {
122  m_pi_inflow_face = face;
124  }
125 
126  /** Overwrite the lateral ghost cells of profiled inflow faces (theta, tke) */
127  void impose_inflow_profile_cons (const amrex::Array4<amrex::Real>& dest_arr,
128  const amrex::Array4<amrex::Real const>& xvel_arr,
129  const amrex::Array4<amrex::Real const>& yvel_arr,
130  const amrex::Array4<amrex::Real const>& z_nd,
131  const amrex::Box& bx, const amrex::Box& domain,
132  int icomp, int ncomp);
133 
134  /**
135  * Impose physical boundary conditions at domain boundaries
136  *
137  * @param[in,out] mf conserved-variable MultiFab to be filled
138  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
139  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
140  * @param[in] icomp starting component for conserved variables
141  * @param[in] ncomp number of components for conserved variables
142  * @param[in] nghost number of ghost cells to be filled for conserved variables
143  * @param[in] time time at which the data should be filled
144  * @param[in] bccomp_cons index into m_domain_bcs_type for conserved variables
145  * @param[in] do_fb whether to fill periodic/interior ghost cells first
146  * @param[in] do_terrain_adjustment whether to apply terrain-aware Neumann adjustments
147  */
148  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
149  int icomp, int ncomp, amrex::IntVect const& nghost,
150  const double time, int bccomp_cons, bool do_fb = true, bool do_terrain_adjustment = true);
151 
152  /**
153  * Impose lateral boundary conditions on conserved variables.
154  *
155  * @param[in,out] dest_arr cell-centered data to be filled
156  * @param[in] xvel_arr x-velocity used to determine upwind inflow
157  * @param[in] yvel_arr y-velocity used to determine upwind inflow
158  * @param[in] bx box holding data to be filled
159  * @param[in] domain simulation domain
160  * @param[in] icomp starting component
161  * @param[in] ncomp number of components
162  * @param[in] ng number of ghost cells
163  * @param[in] time time at which data should be filled
164  */
165  void impose_lateral_cons_bcs (const amrex::Array4<amrex::Real>& dest_arr,
166  const amrex::Array4<amrex::Real const>& xvel_arr,
167  const amrex::Array4<amrex::Real const>& yvel_arr,
168  const amrex::Box& bx, const amrex::Box& domain,
169  int icomp, int ncomp, amrex::IntVect ng,
170  const double time);
171 
172  /**
173  * Impose vertical boundary conditions on conserved variables.
174  *
175  * @param[in,out] dest_arr cell-centered data to be filled
176  * @param[in] bx box holding data to be filled
177  * @param[in] domain simulation domain
178  * @param[in] z_nd nodal physical height
179  * @param[in] mf_x map factor m_x at the cell centers
180  * @param[in] mf_y map factor m_y at the cell centers
181  * @param[in] dxInv inverse cell size
182  * @param[in] icomp starting component
183  * @param[in] ncomp number of components
184  * @param[in] time time at which data should be filled
185  * @param[in] do_terrain_adjustment whether to apply terrain-aware Neumann adjustments
186  */
187  void impose_vertical_cons_bcs (const amrex::Array4<amrex::Real>& dest_arr,
188  const amrex::Box& bx, const amrex::Box& domain,
189  const amrex::Array4<amrex::Real const>& z_nd,
190  const amrex::Array4<amrex::Real const>& mf_x,
191  const amrex::Array4<amrex::Real const>& mf_y,
192  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
193  int icomp, int ncomp, const double time,
194  bool do_terrain_adjustment = true);
195 
196  /**
197  * True when the face prescribes the ghost density (<face>.density on an inflow or
198  * inflow_outflow face), so that a primitive value set there (a theta file, an inflow
199  * profile) is converted with that density rather than the interior one. On an
200  * inflow_outflow face it holds where the flow enters, which is the only place such a
201  * value is applied.
202  */
203  bool face_rho_is_extdir (const amrex::Orientation& ori) const {
204  const int dir = ori.coordDir();
205  const int t = ori.isLow() ? m_domain_bcs_type[BCVars::Rho_bc_comp].lo(dir)
208  && m_bc_extdir_vals[BCVars::Rho_bc_comp][ori] > amrex::Real(0.0);
209  }
210 
211 private:
212  int m_lev;
213  amrex::Geometry m_geom;
214  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
215  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
216  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
217  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
218  TerrainType m_terrain_type;
219  amrex::MultiFab* m_mapfac_x;
220  amrex::MultiFab* m_mapfac_y;
221  amrex::MultiFab* m_z_phys_nd;
223  amrex::Real* m_th_bc_data;
224  const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* m_inflow_profiles = nullptr;
225  amrex::GpuArray<int,AMREX_SPACEDIM*2> m_th_file_face;
226  amrex::GpuArray<int,AMREX_SPACEDIM*2> m_pi_inflow_face{};
227  amrex::GpuArray<amrex::Real,AMREX_SPACEDIM*2> m_pi_inflow_theta{};
229 };
230 
232 {
233 public:
234  /**
235  * Construct the x-velocity physical boundary-condition functor.
236  *
237  * @param[in] lev level index
238  * @param[in] geom geometry for the level
239  * @param[in] domain_bcs_type host boundary-condition records
240  * @param[in] domain_bcs_type_d device boundary-condition records
241  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
242  * @param[in] bc_neumann_vals Neumann values for boundary faces
243  * @param[in] terrain_type terrain type for the level
244  * @param[in] mapfac_lev map-factor MultiFabs for the level
245  * @param[in] z_phys_nd nodal physical height MultiFab
246  * @param[in] use_real_bcs whether real-data boundary conditions are active
247  * @param[in] u_bc_data optional x-velocity boundary data
248  */
249  ERFPhysBCFunct_u (const int lev, const amrex::Geometry& geom,
250  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
251  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
252  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
253  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
254  const TerrainType& terrain_type,
255  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& mapfac_lev,
256  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
257  const bool use_real_bcs,
258  amrex::Real* u_bc_data)
259  : m_lev(lev), m_geom(geom),
260  m_domain_bcs_type(domain_bcs_type),
261  m_domain_bcs_type_d(domain_bcs_type_d),
262  m_bc_extdir_vals(bc_extdir_vals),
263  m_bc_neumann_vals(bc_neumann_vals),
264  m_terrain_type(terrain_type),
265  m_z_phys_nd(z_phys_nd.get()),
266  m_use_real_bcs(use_real_bcs),
267  m_u_bc_data(u_bc_data)
268  {
269  m_mapfac_x = mapfac_lev[MapFacType::u_x].get();
270  m_mapfac_y = mapfac_lev[MapFacType::u_y].get();
271  }
272 
273  /**
274  * Destroy the x-velocity physical boundary-condition functor.
275  */
277 
278  /** Terrain-following inflow profiles per face (xlo.inflow_profile), owned by ERF */
279  void set_inflow_profiles (const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* profiles) { m_inflow_profiles = profiles; }
280 
281  /** Overwrite the boundary and ghost faces of profiled inflow faces */
282  void impose_inflow_profile_xvel (const amrex::Array4<amrex::Real>& dest_arr,
283  const amrex::Array4<amrex::Real const>& xvel_arr,
284  const amrex::Array4<amrex::Real const>& yvel_arr,
285  const amrex::Array4<amrex::Real const>& z_nd,
286  const amrex::Box& bx, const amrex::Box& domain,
287  int bccomp);
288 
289  /**
290  * Impose physical boundary conditions at domain boundaries
291  *
292  * @param[in,out] mf x-velocity MultiFab to be filled
293  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
294  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
295  * @param[in] nghost number of ghost cells to be filled for velocity components
296  * @param[in] time time at which the data should be filled
297  * @param[in] bccomp index into m_domain_bcs_type
298  * @param[in] do_fb whether to fill periodic/interior ghost cells first
299  */
300  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
301  amrex::IntVect const& nghost, const double time, int bccomp, bool do_fb);
302 
303  /**
304  * Impose lateral boundary conditions on x velocity.
305  *
306  * @param[in,out] dest_arr x-velocity data to be filled
307  * @param[in] xvel_arr x-velocity used to determine upwind inflow
308  * @param[in] yvel_arr y-velocity used to determine upwind inflow
309  * @param[in] bx box holding data to be filled
310  * @param[in] domain simulation domain
311  * @param[in] bccomp boundary-condition component
312  * @param[in] time time at which data should be filled
313  */
314  void impose_lateral_xvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
315  const amrex::Array4<amrex::Real const>& xvel_arr,
316  const amrex::Array4<amrex::Real const>& yvel_arr,
317  const amrex::Box& bx, const amrex::Box& domain,
318  int bccomp,
319  const double time);
320 
321  /**
322  * Impose vertical boundary conditions on x velocity.
323  *
324  * @param[in,out] dest_arr x-velocity data to be filled
325  * @param[in] bx box holding data to be filled
326  * @param[in] domain simulation domain
327  * @param[in] z_nd nodal physical height
328  * @param[in] mf_x map factor m_x at the x faces
329  * @param[in] mf_y map factor m_y at the x faces
330  * @param[in] dxInv inverse cell size
331  * @param[in] bccomp boundary-condition component
332  * @param[in] time time at which data should be filled
333  */
334  void impose_vertical_xvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
335  const amrex::Box& bx, const amrex::Box& domain,
336  const amrex::Array4<amrex::Real const>& z_nd,
337  const amrex::Array4<amrex::Real const>& mf_x,
338  const amrex::Array4<amrex::Real const>& mf_y,
339  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
340  int bccomp,
341  const double time);
342 
343 private:
344  int m_lev;
345  amrex::Geometry m_geom;
346  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
347  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
348  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
349  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
350  TerrainType m_terrain_type;
351  amrex::MultiFab* m_mapfac_x;
352  amrex::MultiFab* m_mapfac_y;
353  amrex::MultiFab* m_z_phys_nd;
355  amrex::Real* m_u_bc_data;
356  const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* m_inflow_profiles = nullptr;
358 };
359 
361 {
362 public:
363  /**
364  * Construct the y-velocity physical boundary-condition functor.
365  *
366  * @param[in] lev level index
367  * @param[in] geom geometry for the level
368  * @param[in] domain_bcs_type host boundary-condition records
369  * @param[in] domain_bcs_type_d device boundary-condition records
370  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
371  * @param[in] bc_neumann_vals Neumann values for boundary faces
372  * @param[in] terrain_type terrain type for the level
373  * @param[in] mapfac_lev map-factor MultiFabs for the level
374  * @param[in] z_phys_nd nodal physical height MultiFab
375  * @param[in] use_real_bcs whether real-data boundary conditions are active
376  * @param[in] v_bc_data optional y-velocity boundary data
377  */
378  ERFPhysBCFunct_v (const int lev, const amrex::Geometry& geom,
379  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
380  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
381  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
382  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
383  const TerrainType& terrain_type,
384  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& mapfac_lev,
385  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
386  const bool use_real_bcs,
387  amrex::Real* v_bc_data)
388  : m_lev(lev),
389  m_geom(geom), m_domain_bcs_type(domain_bcs_type),
390  m_domain_bcs_type_d(domain_bcs_type_d),
391  m_bc_extdir_vals(bc_extdir_vals),
392  m_bc_neumann_vals(bc_neumann_vals),
393  m_terrain_type(terrain_type),
394  m_z_phys_nd(z_phys_nd.get()),
395  m_use_real_bcs(use_real_bcs),
396  m_v_bc_data(v_bc_data)
397  {
398  m_mapfac_x = mapfac_lev[MapFacType::v_x].get();
399  m_mapfac_y = mapfac_lev[MapFacType::v_y].get();
400  }
401 
402  /**
403  * Destroy the y-velocity physical boundary-condition functor.
404  */
406 
407  /** Terrain-following inflow profiles per face (xlo.inflow_profile), owned by ERF */
408  void set_inflow_profiles (const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* profiles) { m_inflow_profiles = profiles; }
409 
410  /** Overwrite the boundary and ghost faces of profiled inflow faces */
411  void impose_inflow_profile_yvel (const amrex::Array4<amrex::Real>& dest_arr,
412  const amrex::Array4<amrex::Real const>& xvel_arr,
413  const amrex::Array4<amrex::Real const>& yvel_arr,
414  const amrex::Array4<amrex::Real const>& z_nd,
415  const amrex::Box& bx, const amrex::Box& domain,
416  int bccomp);
417 
418  /**
419  * Impose physical boundary conditions at domain boundaries
420  *
421  * @param[in,out] mf y-velocity MultiFab to be filled
422  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
423  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
424  * @param[in] nghost number of ghost cells to be filled for velocity components
425  * @param[in] time time at which the data should be filled
426  * @param[in] bccomp index into m_domain_bcs_type
427  * @param[in] do_fb whether to fill periodic/interior ghost cells first
428  */
429  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
430  amrex::IntVect const& nghost, const double time, int bccomp, bool do_fb);
431 
432  /**
433  * Impose lateral boundary conditions on y velocity.
434  *
435  * @param[in,out] dest_arr y-velocity data to be filled
436  * @param[in] xvel_arr x-velocity used to determine upwind inflow
437  * @param[in] yvel_arr y-velocity used to determine upwind inflow
438  * @param[in] bx box holding data to be filled
439  * @param[in] domain simulation domain
440  * @param[in] bccomp boundary-condition component
441  * @param[in] time time at which data should be filled
442  */
443  void impose_lateral_yvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
444  const amrex::Array4<amrex::Real const>& xvel_arr,
445  const amrex::Array4<amrex::Real const>& yvel_arr,
446  const amrex::Box& bx, const amrex::Box& domain,
447  int bccomp,
448  const double time);
449 
450  /**
451  * Impose vertical boundary conditions on y velocity.
452  *
453  * @param[in,out] dest_arr y-velocity data to be filled
454  * @param[in] bx box holding data to be filled
455  * @param[in] domain simulation domain
456  * @param[in] z_nd nodal physical height
457  * @param[in] mf_x map factor m_x at the y faces
458  * @param[in] mf_y map factor m_y at the y faces
459  * @param[in] dxInv inverse cell size
460  * @param[in] bccomp boundary-condition component
461  * @param[in] time time at which data should be filled
462  */
463  void impose_vertical_yvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
464  const amrex::Box& bx, const amrex::Box& domain,
465  const amrex::Array4<amrex::Real const>& z_nd,
466  const amrex::Array4<amrex::Real const>& mf_x,
467  const amrex::Array4<amrex::Real const>& mf_y,
468  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
469  int bccomp,
470  const double time);
471 
472 private:
473  int m_lev;
474  amrex::Geometry m_geom;
475  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
476  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
477  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
478  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
479  TerrainType m_terrain_type;
480  amrex::MultiFab* m_mapfac_x;
481  amrex::MultiFab* m_mapfac_y;
482  amrex::MultiFab* m_z_phys_nd;
484  amrex::Real* m_v_bc_data;
485  const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* m_inflow_profiles = nullptr;
487 };
488 
490 {
491 public:
492  /**
493  * Construct the z-velocity physical boundary-condition functor.
494  *
495  * @param[in] lev level index
496  * @param[in] geom geometry for the level
497  * @param[in] domain_bcs_type host boundary-condition records
498  * @param[in] domain_bcs_type_d device boundary-condition records
499  * @param[in] bc_extdir_vals external Dirichlet values for boundary faces
500  * @param[in] bc_neumann_vals Neumann values for boundary faces
501  * @param[in] terrain_type terrain type for the level
502  * @param[in] mapfac_lev map-factor MultiFabs for the level
503  * @param[in] z_phys_nd nodal physical height MultiFab
504  * @param[in] use_real_bcs whether real-data boundary conditions are active
505  * @param[in] w_bc_data optional z-velocity boundary data
506  */
507  ERFPhysBCFunct_w (const int lev, const amrex::Geometry& geom,
508  const amrex::Vector<amrex::BCRec>& domain_bcs_type,
509  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
510  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_extdir_vals,
511  amrex::Array<amrex::Array<amrex::Real,AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> bc_neumann_vals,
512  const TerrainType& terrain_type,
513  amrex::Vector<std::unique_ptr<amrex::MultiFab>>& mapfac_lev,
514  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
515  const bool use_real_bcs,
516  amrex::Real* w_bc_data)
517  : m_lev(lev),
518  m_geom(geom), m_domain_bcs_type(domain_bcs_type),
519  m_domain_bcs_type_d(domain_bcs_type_d),
520  m_bc_extdir_vals(bc_extdir_vals),
521  m_bc_neumann_vals(bc_neumann_vals),
522  m_terrain_type(terrain_type),
523  m_z_phys_nd(z_phys_nd.get()),
524  m_use_real_bcs(use_real_bcs),
525  m_w_bc_data(w_bc_data)
526  {
527  m_mapfac_u = mapfac_lev[MapFacType::u_x].get();
528  m_mapfac_v = mapfac_lev[MapFacType::v_y].get();
529  }
530 
531  /**
532  * Destroy the z-velocity physical boundary-condition functor.
533  */
535 
536  /**
537  * Impose physical boundary conditions at domain boundaries
538  *
539  * @param[in,out] mf z-velocity MultiFab to be filled
540  * @param[in] xvel x-velocity MultiFab used by upwind boundary conditions
541  * @param[in] yvel y-velocity MultiFab used by upwind boundary conditions
542  * @param[in] nghost number of ghost cells to be filled for velocity components
543  * @param[in] time time at which the data should be filled
544  * @param[in] bccomp index into m_domain_bcs_type for z velocity
545  * @param[in] do_fb whether to fill periodic/interior ghost cells first
546  */
547  void operator() (amrex::MultiFab& mf, amrex::MultiFab& xvel, amrex::MultiFab& yvel,
548  amrex::IntVect const& nghost, const double time, int bccomp,
549  bool do_fb);
550 
551  /**
552  * Impose lateral boundary conditions on z velocity.
553  *
554  * @param[in,out] dest_arr z-velocity data to be filled
555  * @param[in] xvel_arr x-velocity used to determine upwind inflow
556  * @param[in] yvel_arr y-velocity used to determine upwind inflow
557  * @param[in] bx box holding data to be filled
558  * @param[in] domain simulation domain
559  * @param[in] mf_u x map-factor field
560  * @param[in] mf_v y map-factor field
561  * @param[in] z_nd nodal physical height
562  * @param[in] dxInv inverse cell size
563  * @param[in] terrain_type terrain representation
564  * @param[in] bccomp boundary-condition component
565  * @param[in] time time at which data should be filled
566  */
567  void impose_lateral_zvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
568  const amrex::Array4<amrex::Real const>& xvel_arr,
569  const amrex::Array4<amrex::Real const>& yvel_arr,
570  const amrex::Box& bx, const amrex::Box& domain,
571  const amrex::Array4<amrex::Real const>& mf_u,
572  const amrex::Array4<amrex::Real const>& mf_v,
573  const amrex::Array4<amrex::Real const>& z_nd,
574  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
575  TerrainType terrain_type, int bccomp,
576  const double time);
577 
578  /**
579  * Impose vertical boundary conditions on z velocity.
580  *
581  * @param[in,out] dest_arr z-velocity data to be filled
582  * @param[in] xvel_arr x-velocity used by terrain-aware vertical BCs
583  * @param[in] yvel_arr y-velocity used by terrain-aware vertical BCs
584  * @param[in] bx box holding data to be filled
585  * @param[in] domain simulation domain
586  * @param[in] mf_u x map-factor field
587  * @param[in] mf_v y map-factor field
588  * @param[in] z_nd nodal physical height
589  * @param[in] dxInv inverse cell size
590  * @param[in] bccomp_u x-velocity boundary-condition component
591  * @param[in] bccomp_v y-velocity boundary-condition component
592  * @param[in] bccomp_w z-velocity boundary-condition component
593  * @param[in] terrain_type terrain representation
594  * @param[in] time time at which data should be filled
595  */
596  void impose_vertical_zvel_bcs (const amrex::Array4<amrex::Real>& dest_arr,
597  const amrex::Array4<amrex::Real const>& xvel_arr,
598  const amrex::Array4<amrex::Real const>& yvel_arr,
599  const amrex::Box& bx, const amrex::Box& domain,
600  const amrex::Array4<amrex::Real const>& mf_u,
601  const amrex::Array4<amrex::Real const>& mf_v,
602  const amrex::Array4<amrex::Real const>& z_nd,
603  const amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> dxInv,
604  int bccomp_u, int bccomp_v, int bccomp_w,
605  TerrainType terrain_type,
606  const double time);
607 
608 private:
609  int m_lev;
610  amrex::Geometry m_geom;
611  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
612  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
613  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_extdir_vals;
614  amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> m_bc_neumann_vals;
615  TerrainType m_terrain_type;
616  amrex::MultiFab* m_mapfac_u;
617  amrex::MultiFab* m_mapfac_v;
618  amrex::MultiFab* m_z_phys_nd;
620  amrex::Real* m_w_bc_data;
621 };
622 
624 {
625 public:
626  /**
627  * Construct the base-state physical boundary-condition functor.
628  *
629  * @param[in] lev level index
630  * @param[in] geom geometry for the level
631  * @param[in] domain_bcs_type host boundary-condition records
632  * @param[in] domain_bcs_type_d device boundary-condition records
633  * @param[in] z_phys_nd nodal physical height MultiFab
634  * @param[in] moving_terrain whether moving terrain is active
635  * @param[in] use_terrain whether the mesh is terrain-fitted, so that the cell-centered
636  * height of a lateral ghost cell differs from that of the cell it copies from
637  * @param[in] rdOcp ratio of R_d to c_p, used to close the EOS in the ghost cells
638  * @param[in] gravity magnitude of gravity, used to transfer the base state in height
639  */
640  ERFPhysBCFunct_base (const int lev,
641  const amrex::Geometry& geom, const amrex::Vector<amrex::BCRec>& domain_bcs_type,
642  const amrex::Gpu::DeviceVector<amrex::BCRec>& domain_bcs_type_d,
643  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
644  bool moving_terrain,
645  bool use_terrain,
646  amrex::Real rdOcp,
647  amrex::Real gravity)
648  : m_lev(lev), m_geom(geom),
649  m_moving_terrain(moving_terrain),
651  m_rdOcp(rdOcp),
652  m_gravity(gravity),
653  m_domain_bcs_type(domain_bcs_type),
654  m_domain_bcs_type_d(domain_bcs_type_d),
655  m_z_phys_nd(z_phys_nd.get())
656  {}
657 
658  /**
659  * Destroy the base-state physical boundary-condition functor.
660  */
662 
663  /**
664  * Impose physical boundary conditions at domain boundaries
665  *
666  * @param[in,out] mf base-state MultiFab to be filled
667  * @param[in] icomp starting component for base-state variables
668  * @param[in] ncomp number of components for base-state variables
669  * @param[in] nghost number of ghost cells to be filled
670  */
671  void operator() (amrex::MultiFab& mf, int icomp, int ncomp, amrex::IntVect const& nghost);
672 
673  /**
674  * Impose lateral boundary conditions on base-state variables.
675  *
676  * @param[in,out] dest_arr base-state data to be filled
677  * @param[in] z_nd nodal physical height
678  * @param[in] bx box holding data to be filled
679  * @param[in] domain simulation domain
680  * @param[in] ncomp number of components
681  * @param[in] nghost number of ghost cells to be filled
682  */
683  void impose_lateral_basestate_bcs (const amrex::Array4<amrex::Real>& dest_arr,
684  const amrex::Array4<amrex::Real const>& z_nd,
685  const amrex::Box& bx, const amrex::Box& domain,
686  int ncomp, const amrex::IntVect& nghost);
687 
688  /**
689  * Impose vertical boundary conditions on base-state variables.
690  *
691  * @param[in,out] dest_arr base-state data to be filled
692  * @param[in] z_nd nodal physical height
693  * @param[in] bx box holding data to be filled
694  * @param[in] domain simulation domain
695  * @param[in] ncomp number of components
696  * @param[in] nghost number of ghost cells to be filled
697  */
698  void impose_vertical_basestate_bcs (const amrex::Array4<amrex::Real>& dest_arr,
699  const amrex::Array4<amrex::Real const>& z_nd,
700  const amrex::Box& bx, const amrex::Box& domain,
701  int ncomp, const amrex::IntVect& nghost);
702 
703 private:
704  int m_lev;
705  amrex::Geometry m_geom;
708  amrex::Real m_rdOcp;
709  amrex::Real m_gravity;
710  amrex::Vector<amrex::BCRec> m_domain_bcs_type;
711  amrex::Gpu::DeviceVector<amrex::BCRec> m_domain_bcs_type_d;
712  amrex::MultiFab* m_z_phys_nd;
713 };
714 
715 #endif
@ v_x
Definition: ERF_DataStruct.H:40
@ u_y
Definition: ERF_DataStruct.H:41
@ v_y
Definition: ERF_DataStruct.H:41
@ m_y
Definition: ERF_DataStruct.H:41
@ u_x
Definition: ERF_DataStruct.H:40
@ m_x
Definition: ERF_DataStruct.H:40
#define NBCVAR_max
Definition: ERF_IndexDefines.H:50
pp_for_pert_vels get("prob_type", prob_type)
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:16
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:128
const bool use_terrain
Definition: ERF_InitCustomPert_SLM.H:19
Definition: ERF_PhysBCFunct.H:624
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:711
amrex::Real m_rdOcp
Definition: ERF_PhysBCFunct.H:708
bool m_use_terrain
Definition: ERF_PhysBCFunct.H:707
void impose_vertical_basestate_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Box &bx, const amrex::Box &domain, int ncomp, const amrex::IntVect &nghost)
Definition: ERF_BoundaryConditionsBaseState.cpp:392
int m_lev
Definition: ERF_PhysBCFunct.H:704
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:712
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:705
ERFPhysBCFunct_base(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, std::unique_ptr< amrex::MultiFab > &z_phys_nd, bool moving_terrain, bool use_terrain, amrex::Real rdOcp, amrex::Real gravity)
Definition: ERF_PhysBCFunct.H:640
bool m_moving_terrain
Definition: ERF_PhysBCFunct.H:706
amrex::Real m_gravity
Definition: ERF_PhysBCFunct.H:709
void impose_lateral_basestate_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Box &bx, const amrex::Box &domain, int ncomp, const amrex::IntVect &nghost)
Definition: ERF_BoundaryConditionsBaseState.cpp:20
void operator()(amrex::MultiFab &mf, int icomp, int ncomp, amrex::IntVect const &nghost)
Definition: ERF_PhysBCFunct.cpp:508
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:710
~ERFPhysBCFunct_base()
Definition: ERF_PhysBCFunct.H:661
Definition: ERF_PhysBCFunct.H:56
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:222
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:213
amrex::MultiFab * m_mapfac_y
Definition: ERF_PhysBCFunct.H:220
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > m_pi_inflow_theta
Definition: ERF_PhysBCFunct.H:227
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:216
void impose_vertical_cons_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Array4< amrex::Real const > &mf_x, const amrex::Array4< amrex::Real const > &mf_y, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int icomp, int ncomp, const double time, bool do_terrain_adjustment=true)
Definition: ERF_BoundaryConditionsCons.cpp:463
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:217
void set_inflow_profiles(const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > *profiles)
Definition: ERF_PhysBCFunct.H:107
ERFPhysBCFunct_cons(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, const TerrainType &terrain_type, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac_lev, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *th_bc_data, const amrex::Array< int, AMREX_SPACEDIM *2 > &th_file_face)
Definition: ERF_PhysBCFunct.H:75
amrex::MultiFab * m_mapfac_x
Definition: ERF_PhysBCFunct.H:219
const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > * m_inflow_profiles
Definition: ERF_PhysBCFunct.H:224
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, int icomp, int ncomp, amrex::IntVect const &nghost, const double time, int bccomp_cons, bool do_fb=true, bool do_terrain_adjustment=true)
Definition: ERF_PhysBCFunct.cpp:87
void impose_lateral_cons_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, int icomp, int ncomp, amrex::IntVect ng, const double time)
Definition: ERF_BoundaryConditionsCons.cpp:22
bool face_rho_is_extdir(const amrex::Orientation &ori) const
Definition: ERF_PhysBCFunct.H:203
void set_pi_inflow_faces(const amrex::GpuArray< int, AMREX_SPACEDIM *2 > &face, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > &theta)
Definition: ERF_PhysBCFunct.H:119
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:215
BelowGroundGhostSync m_below_ground_sync
Definition: ERF_PhysBCFunct.H:228
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:214
~ERFPhysBCFunct_cons()
Definition: ERF_PhysBCFunct.H:104
TerrainType m_terrain_type
Definition: ERF_PhysBCFunct.H:218
amrex::Real * m_th_bc_data
Definition: ERF_PhysBCFunct.H:223
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:221
int m_lev
Definition: ERF_PhysBCFunct.H:212
amrex::GpuArray< int, AMREX_SPACEDIM *2 > m_th_file_face
Definition: ERF_PhysBCFunct.H:225
amrex::GpuArray< int, AMREX_SPACEDIM *2 > m_pi_inflow_face
Definition: ERF_PhysBCFunct.H:226
void impose_inflow_profile_cons(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Box &bx, const amrex::Box &domain, int icomp, int ncomp)
Definition: ERF_BoundaryConditionsInflowProfile.cpp:180
Definition: ERF_PhysBCFunct.H:232
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:345
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:348
amrex::MultiFab * m_mapfac_y
Definition: ERF_PhysBCFunct.H:352
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:347
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:354
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:349
amrex::Real * m_u_bc_data
Definition: ERF_PhysBCFunct.H:355
ERFPhysBCFunct_u(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, const TerrainType &terrain_type, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac_lev, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *u_bc_data)
Definition: ERF_PhysBCFunct.H:249
int m_lev
Definition: ERF_PhysBCFunct.H:344
void impose_lateral_xvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, int bccomp, const double time)
Definition: ERF_BoundaryConditionsXvel.cpp:18
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:346
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::IntVect const &nghost, const double time, int bccomp, bool do_fb)
Definition: ERF_PhysBCFunct.cpp:185
~ERFPhysBCFunct_u()
Definition: ERF_PhysBCFunct.H:276
const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > * m_inflow_profiles
Definition: ERF_PhysBCFunct.H:356
void impose_inflow_profile_xvel(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Box &bx, const amrex::Box &domain, int bccomp)
Definition: ERF_BoundaryConditionsInflowProfile.cpp:32
amrex::MultiFab * m_mapfac_x
Definition: ERF_PhysBCFunct.H:351
void set_inflow_profiles(const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > *profiles)
Definition: ERF_PhysBCFunct.H:279
BelowGroundGhostSync m_below_ground_sync
Definition: ERF_PhysBCFunct.H:357
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:353
void impose_vertical_xvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Array4< amrex::Real const > &mf_x, const amrex::Array4< amrex::Real const > &mf_y, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int bccomp, const double time)
Definition: ERF_BoundaryConditionsXvel.cpp:219
TerrainType m_terrain_type
Definition: ERF_PhysBCFunct.H:350
Definition: ERF_PhysBCFunct.H:361
void impose_lateral_yvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, int bccomp, const double time)
Definition: ERF_BoundaryConditionsYvel.cpp:17
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:474
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:476
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::IntVect const &nghost, const double time, int bccomp, bool do_fb)
Definition: ERF_PhysBCFunct.cpp:281
amrex::MultiFab * m_mapfac_x
Definition: ERF_PhysBCFunct.H:480
amrex::Real * m_v_bc_data
Definition: ERF_PhysBCFunct.H:484
int m_lev
Definition: ERF_PhysBCFunct.H:473
void impose_inflow_profile_yvel(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Box &bx, const amrex::Box &domain, int bccomp)
Definition: ERF_BoundaryConditionsInflowProfile.cpp:106
amrex::MultiFab * m_mapfac_y
Definition: ERF_PhysBCFunct.H:481
~ERFPhysBCFunct_v()
Definition: ERF_PhysBCFunct.H:405
ERFPhysBCFunct_v(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, const TerrainType &terrain_type, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac_lev, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *v_bc_data)
Definition: ERF_PhysBCFunct.H:378
TerrainType m_terrain_type
Definition: ERF_PhysBCFunct.H:479
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:478
void impose_vertical_yvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &z_nd, const amrex::Array4< amrex::Real const > &mf_x, const amrex::Array4< amrex::Real const > &mf_y, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int bccomp, const double time)
Definition: ERF_BoundaryConditionsYvel.cpp:219
const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > * m_inflow_profiles
Definition: ERF_PhysBCFunct.H:485
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:483
void set_inflow_profiles(const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > *profiles)
Definition: ERF_PhysBCFunct.H:408
BelowGroundGhostSync m_below_ground_sync
Definition: ERF_PhysBCFunct.H:486
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:475
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:477
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:482
Definition: ERF_PhysBCFunct.H:490
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:611
amrex::Geometry m_geom
Definition: ERF_PhysBCFunct.H:610
int m_lev
Definition: ERF_PhysBCFunct.H:609
amrex::Real * m_w_bc_data
Definition: ERF_PhysBCFunct.H:620
bool m_use_real_bcs
Definition: ERF_PhysBCFunct.H:619
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:612
amrex::MultiFab * m_mapfac_v
Definition: ERF_PhysBCFunct.H:617
TerrainType m_terrain_type
Definition: ERF_PhysBCFunct.H:615
amrex::MultiFab * m_z_phys_nd
Definition: ERF_PhysBCFunct.H:618
amrex::MultiFab * m_mapfac_u
Definition: ERF_PhysBCFunct.H:616
void operator()(amrex::MultiFab &mf, amrex::MultiFab &xvel, amrex::MultiFab &yvel, amrex::IntVect const &nghost, const double time, int bccomp, bool do_fb)
Definition: ERF_PhysBCFunct.cpp:378
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:614
ERFPhysBCFunct_w(const int lev, const amrex::Geometry &geom, const amrex::Vector< amrex::BCRec > &domain_bcs_type, const amrex::Gpu::DeviceVector< amrex::BCRec > &domain_bcs_type_d, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_extdir_vals, amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > bc_neumann_vals, const TerrainType &terrain_type, amrex::Vector< std::unique_ptr< amrex::MultiFab >> &mapfac_lev, std::unique_ptr< amrex::MultiFab > &z_phys_nd, const bool use_real_bcs, amrex::Real *w_bc_data)
Definition: ERF_PhysBCFunct.H:507
~ERFPhysBCFunct_w()
Definition: ERF_PhysBCFunct.H:534
void impose_vertical_zvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &mf_u, const amrex::Array4< amrex::Real const > &mf_v, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, int bccomp_u, int bccomp_v, int bccomp_w, TerrainType terrain_type, const double time)
Definition: ERF_BoundaryConditionsZvel.cpp:265
void impose_lateral_zvel_bcs(const amrex::Array4< amrex::Real > &dest_arr, const amrex::Array4< amrex::Real const > &xvel_arr, const amrex::Array4< amrex::Real const > &yvel_arr, const amrex::Box &bx, const amrex::Box &domain, const amrex::Array4< amrex::Real const > &mf_u, const amrex::Array4< amrex::Real const > &mf_v, const amrex::Array4< amrex::Real const > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxInv, TerrainType terrain_type, int bccomp, const double time)
Definition: ERF_BoundaryConditionsZvel.cpp:57
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:613
@ Rho_bc_comp
Definition: ERF_IndexDefines.H:123
@ ext_dir
Definition: ERF_IndexDefines.H:317
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:325
@ theta
Definition: ERF_Kessler.H:26
@ ng
Definition: ERF_Morrison.H:51
@ xvel
Definition: ERF_IndexDefines.H:232
@ yvel
Definition: ERF_IndexDefines.H:233
@ t
Definition: ERF_WSM6.H:295
Definition: ERF_PhysBCFunct.H:42
amrex::BoxArray m_slab_ba
Definition: ERF_PhysBCFunct.H:50
amrex::IntVect m_nghost
Definition: ERF_PhysBCFunct.H:49
void operator()(amrex::MultiFab &mf, int icomp, int ncomp, const amrex::IntVect &nghost, const amrex::Geometry &geom)
Definition: ERF_PhysBCFunct.cpp:19
amrex::DistributionMapping m_src_dm
Definition: ERF_PhysBCFunct.H:48
amrex::BoxArray m_src_ba
Definition: ERF_PhysBCFunct.H:47
amrex::DistributionMapping m_slab_dm
Definition: ERF_PhysBCFunct.H:51
amrex::Vector< int > m_src_index
Definition: ERF_PhysBCFunct.H:52