ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERFPhysBCFunct_cons Class Reference

#include <ERF_PhysBCFunct.H>

Collaboration diagram for ERFPhysBCFunct_cons:

Public Member Functions

 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)
 
 ~ERFPhysBCFunct_cons ()
 
void set_inflow_profiles (const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > *profiles)
 
void set_pi_inflow_faces (const amrex::GpuArray< int, AMREX_SPACEDIM *2 > &face, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > &theta)
 
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)
 
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)
 
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)
 
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)
 
bool face_rho_is_extdir (const amrex::Orientation &ori) const
 

Private Attributes

int m_lev
 
amrex::Geometry m_geom
 
amrex::Vector< amrex::BCRec > m_domain_bcs_type
 
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
 
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
 
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
 
TerrainType m_terrain_type
 
amrex::MultiFab * m_mapfac_x
 
amrex::MultiFab * m_mapfac_y
 
amrex::MultiFab * m_z_phys_nd
 
bool m_use_real_bcs
 
amrex::Real * m_th_bc_data
 
const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > * m_inflow_profiles = nullptr
 
amrex::GpuArray< int, AMREX_SPACEDIM *2 > m_th_file_face
 
amrex::GpuArray< int, AMREX_SPACEDIM *2 > m_pi_inflow_face {}
 
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > m_pi_inflow_theta {}
 
BelowGroundGhostSync m_below_ground_sync
 

Constructor & Destructor Documentation

◆ ERFPhysBCFunct_cons()

ERFPhysBCFunct_cons::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 
)
inline

Construct the conserved-variable physical boundary-condition functor.

Parameters
[in]levlevel index
[in]geomgeometry for the level
[in]domain_bcs_typehost boundary-condition records
[in]domain_bcs_type_ddevice boundary-condition records
[in]bc_extdir_valsexternal Dirichlet values for boundary faces
[in]bc_neumann_valsNeumann values for boundary faces
[in]terrain_typeterrain type for the level
[in]mapfac_levmap-factor MultiFabs for the level
[in]z_phys_ndnodal physical height MultiFab
[in]use_real_bcswhether real-data boundary conditions are active
[in]th_bc_dataoptional theta boundary data (one profile in z)
[in]th_file_faceper face: 0 the face's theta is not th_bc_data, 1 th_bc_data holds rho*theta for that face, 2 it holds theta
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  }
@ m_y
Definition: ERF_DataStruct.H:41
@ m_x
Definition: ERF_DataStruct.H:40
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::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_extdir_vals
Definition: ERF_PhysBCFunct.H:216
amrex::Array< amrex::Array< amrex::Real, AMREX_SPACEDIM *2 >, AMREX_SPACEDIM+NBCVAR_max > m_bc_neumann_vals
Definition: ERF_PhysBCFunct.H:217
amrex::MultiFab * m_mapfac_x
Definition: ERF_PhysBCFunct.H:219
amrex::Gpu::DeviceVector< amrex::BCRec > m_domain_bcs_type_d
Definition: ERF_PhysBCFunct.H:215
amrex::Vector< amrex::BCRec > m_domain_bcs_type
Definition: ERF_PhysBCFunct.H:214
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

◆ ~ERFPhysBCFunct_cons()

ERFPhysBCFunct_cons::~ERFPhysBCFunct_cons ( )
inline

Destroy the conserved-variable physical boundary-condition functor.

104 {}

Member Function Documentation

◆ face_rho_is_extdir()

bool ERFPhysBCFunct_cons::face_rho_is_extdir ( const amrex::Orientation &  ori) const
inline

True when the face prescribes the ghost density (<face>.density on an inflow or inflow_outflow face), so that a primitive value set there (a theta file, an inflow profile) is converted with that density rather than the interior one. On an inflow_outflow face it holds where the flow enters, which is the only place such a value is applied.

203  {
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  }
@ Rho_bc_comp
Definition: ERF_IndexDefines.H:123
@ ext_dir
Definition: ERF_IndexDefines.H:317
@ ext_dir_upwind
Definition: ERF_IndexDefines.H:325
@ t
Definition: ERF_WSM6.H:295

◆ impose_inflow_profile_cons()

void ERFPhysBCFunct_cons::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 
)

Overwrite the lateral ghost cells of profiled inflow faces (theta, tke)

186 {
187  if (m_inflow_profiles == nullptr) { return; }
188  BL_PROFILE("impose_inflow_profile_cons()");
189 
190  const auto dom_lo = lbound(domain);
191  const auto dom_hi = ubound(domain);
192  const bool terrain = static_cast<bool>(z_nd);
193  const Real dz = m_geom.CellSize(2);
194 
195  for (int dir = 0; dir < 2; ++dir) {
196  if (m_geom.isPeriodic(dir)) { continue; }
197  for (const auto side : {Orientation::low, Orientation::high}) {
198  const Orientation ori(dir, side);
199  const auto& prof = (*m_inflow_profiles)[ori];
200  if (!prof.active) { continue; }
201 
202  // The profile prescribes theta and tke where it has them, as rho times the
203  // tabulated value, with rho the density the ghost cell carries: <face>.density
204  // when it is given (the lateral fill has put it in the Rho ghosts), otherwise
205  // the adjacent interior cell's, from which density is then extrapolated
206  const bool rho_is_extdir = face_rho_is_extdir(ori);
207  const Real rho_val = m_bc_extdir_vals[BCVars::Rho_bc_comp][ori];
208  for (const int comp : {RhoTheta_comp, RhoKE_comp}) {
209  if (comp < icomp || comp >= icomp + ncomp) { continue; }
210  const bool is_ke = (comp == RhoKE_comp);
211  if (is_ke ? !prof.has_tke : !prof.has_theta) { continue; }
212  const int bcvar = is_ke ? BCVars::RhoKE_bc_comp : BCVars::RhoTheta_bc_comp;
213  const int bct = profile_bc_type(m_inflow_profiles, m_domain_bcs_type, bcvar, ori);
214  if (bct < 0) { continue; }
215 
216  const Real* zt = prof.z_d.data();
217  const Real* ft = is_ke ? prof.tke_d.data() : prof.theta_d.data();
218  const int nt = static_cast<int>(prof.z_d.size());
219  const bool upwind = (bct == ERFBCType::ext_dir_upwind);
220  const bool low = ori.isLow();
221 
222  Box b(bx);
223  if (dir == 0) {
224  if (low) { b.setBig(0, dom_lo.x-1); } else { b.setSmall(0, dom_hi.x+1); }
225  } else {
226  if (low) { b.setBig(1, dom_lo.y-1); } else { b.setSmall(1, dom_hi.y+1); }
227  }
228  if (!b.ok()) { continue; }
229 
230  const int icol = low ? dom_lo.x : dom_hi.x;
231  const int iface = low ? dom_lo.x : dom_hi.x+1;
232  const int jcol = low ? dom_lo.y : dom_hi.y;
233  const int jface = low ? dom_lo.y : dom_hi.y+1;
234  // clamp the upwind read to the velocity arrays (ii/jj/kk are clamped to the domain only)
235  const auto ulo = lbound(xvel_arr), uhi = ubound(xvel_arr);
236  const auto vlo = lbound(yvel_arr), vhi = ubound(yvel_arr);
237 
238  ParallelFor(b, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
239  {
240  const int kk = amrex::max(dom_lo.z, amrex::min(k, dom_hi.z));
241  const int ii = (dir == 0) ? icol : amrex::max(dom_lo.x, amrex::min(i, dom_hi.x));
242  const int jj = (dir == 1) ? jcol : amrex::max(dom_lo.y, amrex::min(j, dom_hi.y));
243  if (upwind) {
244  const Real un = (dir == 0) ? xvel_arr(iface, amrex::Clamp(jj,ulo.y,uhi.y), amrex::Clamp(kk,ulo.z,uhi.z))
245  : yvel_arr(amrex::Clamp(ii,vlo.x,vhi.x), jface, amrex::Clamp(kk,vlo.z,vhi.z));
246  if (low ? (un < Real(0.0)) : (un > Real(0.0))) { return; }
247  }
248  const Real zq = (terrain) ? height_above_ground(z_nd, ii, ii+1, jj, jj+1, kk, dom_lo.z)
249  : (static_cast<Real>(kk - dom_lo.z) + Real(0.5)) * dz;
250  const Real rho = rho_is_extdir ? rho_val : dest_arr(ii,jj,kk,Rho_comp);
251  dest_arr(i,j,k,comp) = rho * inflow_profile_value(zt, ft, nt, zq);
252  });
253  }
254  }
255  }
256 }
#define Rho_comp
Definition: ERF_IndexDefines.H:61
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:62
#define RhoKE_comp
Definition: ERF_IndexDefines.H:63
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real inflow_profile_value(const amrex::Real *z, const amrex::Real *f, const int n, const amrex::Real zq) noexcept
Definition: ERF_InflowProfile.H:64
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real height_above_ground(const amrex::Array4< const amrex::Real > &z_nd, int ilo, int ihi, int jlo, int jhi, const int k, const int klo) noexcept
Definition: ERF_InflowProfile.H:86
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > * m_inflow_profiles
Definition: ERF_PhysBCFunct.H:224
bool face_rho_is_extdir(const amrex::Orientation &ori) const
Definition: ERF_PhysBCFunct.H:203
@ RhoKE_bc_comp
Definition: ERF_IndexDefines.H:125
@ RhoTheta_bc_comp
Definition: ERF_IndexDefines.H:124
@ rho
Definition: ERF_Kessler.H:25
@ dz
Definition: ERF_AdvanceWDM6.cpp:273
Here is the call graph for this function:

◆ impose_lateral_cons_bcs()

void ERFPhysBCFunct_cons::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 
)

Impose lateral boundary conditions on conserved variables.

Parameters
[in,out]dest_arrcell-centered data to be filled
[in]xvel_arrx-velocity used to determine upwind inflow
[in]yvel_arry-velocity used to determine upwind inflow
[in]bxbox holding data to be filled
[in]domainsimulation domain
[in]icompstarting component
[in]ncompnumber of components
[in]ngnumber of ghost cells
[in]timetime at which data should be filled

Impose lateral boundary conditions on conserved scalars (at cell centers)

Parameters
[in,out]dest_arrcell-centered data to be filled
[in]xvel_arrx-velocity used to determine upwind Dirichlet inflow
[in]yvel_arry-velocity used to determine upwind Dirichlet inflow
[in]bxbox holding data to be filled
[in]domainsimulation domain
[in]icompindex into the MultiFab – this can be any value from 0 to NVAR-1
[in]ncompthe number of components – this can be any value from 1 to NVAR as long as icomp+ncomp <= NVAR-one
[in]ngnumber of ghost cells in each coordinate direction
[in]timetime at which the data should be filled
28 {
29  BL_PROFILE_VAR("impose_lateral_cons_bcs()",impose_lateral_cons_bcs);
30  const auto& dom_lo = lbound(domain);
31  const auto& dom_hi = ubound(domain);
32 
33  //
34  // An ext_dir_upwind face decides inflow against the face velocity, but the box we
35  // loop over does not always have a face velocity at every one of its cells: the
36  // state carries one more lateral ghost than the velocities do (ngrow_state =
37  // ComputeGhostCells()+1 against ngrow_vels = ComputeGhostCells()), and a velocity
38  // box is nodal in its own direction where the array being read is cell centered.
39  // Either way the outermost ghost cells have no velocity of their own, so sample
40  // the nearest one that exists. Cells already inside the velocity array are
41  // unaffected; only that outermost layer changes, and it previously read out of
42  // bounds.
43  //
44  const auto& xvel_lo = lbound(xvel_arr);
45  const auto& xvel_hi = ubound(xvel_arr);
46  const auto& yvel_lo = lbound(yvel_arr);
47  const auto& yvel_hi = ubound(yvel_arr);
48 
49  // xlo: ori = 0
50  // ylo: ori = 1
51  // zlo: ori = 2
52  // xhi: ori = 3
53  // yhi: ori = 4
54  // zhi: ori = 5
55 
56  // Based on BCRec for the domain, we need to make BCRec for this Box
57  // 0 is used as starting index for bcrs
58  Vector<BCRec> bcrs(ncomp);
59 
60  GpuArray<GpuArray<Real, AMREX_SPACEDIM*2>,NBCVAR_max> l_bc_extdir_vals_d;
61 
62  const int* bxlo = bx.loVect();
63  const int* bxhi = bx.hiVect();
64  const int* dlo = domain.loVect();
65  const int* dhi = domain.hiVect();
66 
67  for (int nc = 0; nc < ncomp; nc++)
68  {
69  int bc_comp = (icomp+nc >= RhoScalar_comp && icomp+nc < RhoScalar_comp+NSCALARS) ?
71  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
72  for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
73  {
74  bcrs[nc].setLo(dir, ( bxlo[dir]<=dlo[dir]
75  ? m_domain_bcs_type[bc_comp].lo(dir) : BCType::int_dir ));
76  bcrs[nc].setHi(dir, ( bxhi[dir]>=dhi[dir]
77  ? m_domain_bcs_type[bc_comp].hi(dir) : BCType::int_dir ));
78  }
79 
80  for (int ori = 0; ori < 2*AMREX_SPACEDIM; ori++) {
81  l_bc_extdir_vals_d[bc_comp][ori] = m_bc_extdir_vals[bc_comp][ori];
82  }
83  }
84 
85  Gpu::DeviceVector<BCRec> bcrs_d(ncomp);
86  Gpu::copyAsync(Gpu::hostToDevice, bcrs.begin(), bcrs.end(), bcrs_d.begin());
87  const BCRec* bc_ptr = bcrs_d.data();
88 
89  GeometryData const& geomdata = m_geom.data();
90  bool is_periodic_in_x = geomdata.isPeriodic(0);
91  bool is_periodic_in_y = geomdata.isPeriodic(1);
92 
93  // The density a ghost cell on each face carries after this fill: the prescribed inflow
94  // density where Rho itself is ext_dir or ext_dir_upwind on that face (<face>.density was
95  // given), otherwise
96  // the first interior cell's. A primitive Dirichlet value (ext_dir_prim, e.g. theta from a
97  // dirichlet_file) must be multiplied by that density, not by the interior density alone:
98  // otherwise the ghost holds rho_ghosterior * theta over a ghost density rho_in, and the
99  // primitive theta the scheme sees is scaled by rho_ghosterior / rho_in.
100  // Only the faces that read a theta file use th_bc_data, in the form they read it in
101  // (one profile in z, so the lateral faces only); see ERF::m_th_file_face
102  const GpuArray<int,AMREX_SPACEDIM*2> th_file = m_th_file_face;
103  GpuArray<int,6> rho_is_extdir;
104  GpuArray<Real,6> rho_extdir_val;
105  for (OrientationIter oit; oit; ++oit) {
106  const Orientation ori = oit();
107  rho_is_extdir[ori] = face_rho_is_extdir(ori) ? 1 : 0;
108  rho_extdir_val[ori] = m_bc_extdir_vals[BCVars::Rho_bc_comp][ori];
109  }
110  // A pseudo-incompressible face with a given primitive theta (see set_pi_inflow_faces):
111  // where the flow enters, the ghost density keeps rho*theta at the interior value,
112  // rho0*theta0, with that theta, and every given value is made conserved with it
113  const GpuArray<int,AMREX_SPACEDIM*2> pi_face = m_pi_inflow_face;
114  const GpuArray<Real,AMREX_SPACEDIM*2> pi_theta = m_pi_inflow_theta;
115  const bool has_rhotheta = (dest_arr.nComp() > RhoTheta_comp);
116 
117  // Not covered: a density ingested from boundary planes (Rho typed ext_dir_ingested) varies
118  // over the face, so a primitive theta file on that face is still converted with the first
119  // interior cell's density below; the planes then carry the matching theta in practice.
120 
121  // First do all ext_dir bcs
122  if (!is_periodic_in_x)
123  {
124  Real* th_bc_ptr = m_th_bc_data;
125  Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
126  Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1);
127  //
128  // If we are setting Dirichlet values, set them in all ghost cells on an inflow face
129  // "bx" is already grown in the x- and y-directions so here we just grow it in z
130  //
131  bx_xlo.grow(2,ng[2]);
132  bx_xhi.grow(2,ng[2]);
133  ParallelFor(
134  bx_xlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
135  {
136  int dest_comp = icomp+n;
137  int k_profile = amrex::min(amrex::max(k, dom_lo.z), dom_hi.z) - dom_lo.z;
138  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
139  BCVars::RhoScalar_bc_comp : dest_comp;
140  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
141  int l_bc_type = bc_ptr[n].lo(0);
142  // the ghost density: the pseudo-incompressible one, or the interior one
143  const Real rho_ghost = (pi_face[0] && has_rhotheta)
144  ? dest_arr(dom_lo.x,j,k,RhoTheta_comp) /
145  ((th_file[0] == 2 && th_bc_ptr) ? th_bc_ptr[k_profile] : pi_theta[0])
146  : dest_arr(dom_lo.x,j,k,Rho_comp);
147 
148  if ( (l_bc_type == ERFBCType::ext_dir) ||
149  (l_bc_type == ERFBCType::ext_dir_upwind && xvel_arr(dom_lo.x,Clamp(j,xvel_lo.y,xvel_hi.y),Clamp(k,xvel_lo.z,xvel_hi.z)) >= zero) )
150  {
151  if ((dest_comp == Rho_comp) && !rho_is_extdir[0]) {
152  // Rho typed ext_dir with no <face>.density: a pseudo-incompressible
153  // face with a given theta (rho_ghost), or the interior density
154  dest_arr(i,j,k,dest_comp) = rho_ghost;
155  } else if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[0] != 0) {
156  // a theta profile reaches ext_dir only as rho*theta (th_file 1) or on an
157  // ext_dir_upwind face, which has no primitive variant (th_file 2):
158  // convert the latter with the ghost density here
159  const Real rho_th = (th_file[0] == 2)
160  ? (rho_is_extdir[0] ? rho_extdir_val[0] : rho_ghost)
161  : Real(1.0);
162  dest_arr(i,j,k,dest_comp) = rho_th * th_bc_ptr[k_profile];
163  } else {
164  // an ext_dir_upwind face whose density is not prescribed (anelastic or pseudo-incompressible)
165  // holds primitive values: make them conserved with the interior density
166  const Real rho_v = (l_bc_type == ERFBCType::ext_dir_upwind && !rho_is_extdir[0])
167  ? rho_ghost : Real(1.0);
168  dest_arr(i,j,k,dest_comp) = rho_v * l_bc_extdir_vals_d[bc_comp][0];
169  }
170  } else if (l_bc_type == ERFBCType::ext_dir_prim) {
171  Real rho = rho_is_extdir[0] ? rho_extdir_val[0] : rho_ghost;
172  if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[0] == 2) {
173  dest_arr(i,j,k,dest_comp) = rho * th_bc_ptr[k_profile];
174  } else {
175  dest_arr(i,j,k,dest_comp) = rho * l_bc_extdir_vals_d[bc_comp][0];
176  }
177  } else if (l_bc_type == ERFBCType::ext_dir_upwind) {
178  // outflow part of an inflow_outflow face (inflow was taken above): foextrap
179  dest_arr(i,j,k,dest_comp) = dest_arr(dom_lo.x,j,k,dest_comp);
180  }
181  },
182  bx_xhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
183  {
184  int dest_comp = icomp+n;
185  int k_profile = amrex::min(amrex::max(k, dom_lo.z), dom_hi.z) - dom_lo.z;
186  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
187  BCVars::RhoScalar_bc_comp : dest_comp;
188  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
189  int h_bc_type = bc_ptr[n].hi(0);
190  // the ghost density: the pseudo-incompressible one, or the interior one
191  const Real rho_ghost = (pi_face[3] && has_rhotheta)
192  ? dest_arr(dom_hi.x,j,k,RhoTheta_comp) /
193  ((th_file[3] == 2 && th_bc_ptr) ? th_bc_ptr[k_profile] : pi_theta[3])
194  : dest_arr(dom_hi.x,j,k,Rho_comp);
195 
196  if ( (h_bc_type == ERFBCType::ext_dir) ||
197  (h_bc_type == ERFBCType::ext_dir_upwind && xvel_arr(dom_hi.x+1,Clamp(j,xvel_lo.y,xvel_hi.y),Clamp(k,xvel_lo.z,xvel_hi.z)) <= zero) )
198  {
199  if ((dest_comp == Rho_comp) && !rho_is_extdir[3]) {
200  // Rho typed ext_dir with no <face>.density: a pseudo-incompressible
201  // face with a given theta (rho_ghost), or the interior density
202  dest_arr(i,j,k,dest_comp) = rho_ghost;
203  } else if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[3] != 0) {
204  // a theta profile reaches ext_dir only as rho*theta (th_file 1) or on an
205  // ext_dir_upwind face, which has no primitive variant (th_file 2):
206  // convert the latter with the ghost density here
207  const Real rho_th = (th_file[3] == 2)
208  ? (rho_is_extdir[3] ? rho_extdir_val[3] : rho_ghost)
209  : Real(1.0);
210  dest_arr(i,j,k,dest_comp) = rho_th * th_bc_ptr[k_profile];
211  } else {
212  // an ext_dir_upwind face whose density is not prescribed (anelastic or pseudo-incompressible)
213  // holds primitive values: make them conserved with the interior density
214  const Real rho_v = (h_bc_type == ERFBCType::ext_dir_upwind && !rho_is_extdir[3])
215  ? rho_ghost : Real(1.0);
216  dest_arr(i,j,k,dest_comp) = rho_v * l_bc_extdir_vals_d[bc_comp][3];
217  }
218  } else if (h_bc_type == ERFBCType::ext_dir_prim) {
219  Real rho = rho_is_extdir[3] ? rho_extdir_val[3] : rho_ghost;
220  if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[3] == 2) {
221  dest_arr(i,j,k,dest_comp) = rho * th_bc_ptr[k_profile];
222  } else {
223  dest_arr(i,j,k,dest_comp) = rho * l_bc_extdir_vals_d[bc_comp][3];
224  }
225  } else if (h_bc_type == ERFBCType::ext_dir_upwind) {
226  // outflow part of an inflow_outflow face (inflow was taken above): foextrap
227  dest_arr(i,j,k,dest_comp) = dest_arr(dom_hi.x,j,k,dest_comp);
228  }
229  }
230  );
231  }
232 
233  if (!is_periodic_in_y)
234  {
235  Real* th_bc_ptr = m_th_bc_data;
236  Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
237  Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1);
238  //
239  // If we are setting Dirichlet values, set them in all ghost cells on an inflow face
240  // "bx" is already grown in the x- and y-directions so here we just grow it in z
241  //
242  bx_ylo.grow(2,ng[2]);
243  bx_yhi.grow(2,ng[2]);
244 
245  ParallelFor(
246  bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
247  {
248  int dest_comp = icomp+n;
249  int k_profile = amrex::min(amrex::max(k, dom_lo.z), dom_hi.z) - dom_lo.z;
250  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
251  BCVars::RhoScalar_bc_comp : dest_comp;
252  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
253  int l_bc_type = bc_ptr[n].lo(1);
254  // the ghost density: the pseudo-incompressible one, or the interior one
255  const Real rho_ghost = (pi_face[1] && has_rhotheta)
256  ? dest_arr(i,dom_lo.y,k,RhoTheta_comp) /
257  ((th_file[1] == 2 && th_bc_ptr) ? th_bc_ptr[k_profile] : pi_theta[1])
258  : dest_arr(i,dom_lo.y,k,Rho_comp);
259  if ( (l_bc_type == ERFBCType::ext_dir) ||
260  (l_bc_type == ERFBCType::ext_dir_upwind && yvel_arr(Clamp(i,yvel_lo.x,yvel_hi.x),dom_lo.y,Clamp(k,yvel_lo.z,yvel_hi.z)) >= zero) )
261  {
262  if ((dest_comp == Rho_comp) && !rho_is_extdir[1]) {
263  // Rho typed ext_dir with no <face>.density: a pseudo-incompressible
264  // face with a given theta (rho_ghost), or the interior density
265  dest_arr(i,j,k,dest_comp) = rho_ghost;
266  } else if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[1] != 0) {
267  // a theta profile reaches ext_dir only as rho*theta (th_file 1) or on an
268  // ext_dir_upwind face, which has no primitive variant (th_file 2):
269  // convert the latter with the ghost density here
270  const Real rho_th = (th_file[1] == 2)
271  ? (rho_is_extdir[1] ? rho_extdir_val[1] : rho_ghost)
272  : Real(1.0);
273  dest_arr(i,j,k,dest_comp) = rho_th * th_bc_ptr[k_profile];
274  } else {
275  // an ext_dir_upwind face whose density is not prescribed (anelastic or pseudo-incompressible)
276  // holds primitive values: make them conserved with the interior density
277  const Real rho_v = (l_bc_type == ERFBCType::ext_dir_upwind && !rho_is_extdir[1])
278  ? rho_ghost : Real(1.0);
279  dest_arr(i,j,k,dest_comp) = rho_v * l_bc_extdir_vals_d[bc_comp][1];
280  }
281  } else if (l_bc_type == ERFBCType::ext_dir_prim) {
282  Real rho = rho_is_extdir[1] ? rho_extdir_val[1] : rho_ghost;
283  if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[1] == 2) {
284  dest_arr(i,j,k,dest_comp) = rho * th_bc_ptr[k_profile];
285  } else {
286  dest_arr(i,j,k,dest_comp) = rho * l_bc_extdir_vals_d[bc_comp][1];
287  }
288  } else if (l_bc_type == ERFBCType::ext_dir_upwind) {
289  // outflow part of an inflow_outflow face (inflow was taken above): foextrap
290  dest_arr(i,j,k,dest_comp) = dest_arr(i,dom_lo.y,k,dest_comp);
291  }
292  },
293  bx_yhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
294  {
295  int dest_comp = icomp+n;
296  int k_profile = amrex::min(amrex::max(k, dom_lo.z), dom_hi.z) - dom_lo.z;
297  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
298  BCVars::RhoScalar_bc_comp : dest_comp;
299  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
300  int h_bc_type = bc_ptr[n].hi(1);
301  // the ghost density: the pseudo-incompressible one, or the interior one
302  const Real rho_ghost = (pi_face[4] && has_rhotheta)
303  ? dest_arr(i,dom_hi.y,k,RhoTheta_comp) /
304  ((th_file[4] == 2 && th_bc_ptr) ? th_bc_ptr[k_profile] : pi_theta[4])
305  : dest_arr(i,dom_hi.y,k,Rho_comp);
306  if ( (h_bc_type == ERFBCType::ext_dir) ||
307  (h_bc_type == ERFBCType::ext_dir_upwind && yvel_arr(Clamp(i,yvel_lo.x,yvel_hi.x),dom_hi.y+1,Clamp(k,yvel_lo.z,yvel_hi.z)) <= zero) )
308  {
309  if ((dest_comp == Rho_comp) && !rho_is_extdir[4]) {
310  // Rho typed ext_dir with no <face>.density: a pseudo-incompressible
311  // face with a given theta (rho_ghost), or the interior density
312  dest_arr(i,j,k,dest_comp) = rho_ghost;
313  } else if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[4] != 0) {
314  // a theta profile reaches ext_dir only as rho*theta (th_file 1) or on an
315  // ext_dir_upwind face, which has no primitive variant (th_file 2):
316  // convert the latter with the ghost density here
317  const Real rho_th = (th_file[4] == 2)
318  ? (rho_is_extdir[4] ? rho_extdir_val[4] : rho_ghost)
319  : Real(1.0);
320  dest_arr(i,j,k,dest_comp) = rho_th * th_bc_ptr[k_profile];
321  } else {
322  // an ext_dir_upwind face whose density is not prescribed (anelastic or pseudo-incompressible)
323  // holds primitive values: make them conserved with the interior density
324  const Real rho_v = (h_bc_type == ERFBCType::ext_dir_upwind && !rho_is_extdir[4])
325  ? rho_ghost : Real(1.0);
326  dest_arr(i,j,k,dest_comp) = rho_v * l_bc_extdir_vals_d[bc_comp][4];
327  }
328  } else if (h_bc_type == ERFBCType::ext_dir_prim) {
329  Real rho = rho_is_extdir[4] ? rho_extdir_val[4] : rho_ghost;
330  if ((dest_comp == RhoTheta_comp) && th_bc_ptr && th_file[4] == 2) {
331  dest_arr(i,j,k,dest_comp) = rho * th_bc_ptr[k_profile];
332  } else {
333  dest_arr(i,j,k,dest_comp) = rho * l_bc_extdir_vals_d[bc_comp][4];
334  }
335  } else if (h_bc_type == ERFBCType::ext_dir_upwind) {
336  // outflow part of an inflow_outflow face (inflow was taken above): foextrap
337  dest_arr(i,j,k,dest_comp) = dest_arr(i,dom_hi.y,k,dest_comp);
338  }
339  }
340  );
341  }
342 
343  // Next do ghost cells in x-direction but not reaching out in y
344  // The corners we miss here will be covered in the y-loop below or by periodicity
345  if (!is_periodic_in_x)
346  {
347  // Populate ghost cells on lo-x and hi-x domain boundaries
348  Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
349  Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1);
350  if (bx_xlo.smallEnd(2) != domain.smallEnd(2)) bx_xlo.growLo(2,ng[2]);
351  if (bx_xlo.bigEnd(2) != domain.bigEnd(2)) bx_xlo.growHi(2,ng[2]);
352  if (bx_xhi.smallEnd(2) != domain.smallEnd(2)) bx_xhi.growLo(2,ng[2]);
353  if (bx_xhi.bigEnd(2) != domain.bigEnd(2)) bx_xhi.growHi(2,ng[2]);
354  ParallelFor(
355  bx_xlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
356  {
357  int dest_comp = icomp+n;
358  int l_bc_type = bc_ptr[n].lo(0);
359  int iflip = 2*dom_lo.x - 1 - i;
360  if (l_bc_type == ERFBCType::foextrap) {
361  dest_arr(i,j,k,dest_comp) = dest_arr(dom_lo.x,j,k,dest_comp);
362  } else if (l_bc_type == ERFBCType::open) {
363  dest_arr(i,j,k,dest_comp) = dest_arr(dom_lo.x,j,k,dest_comp);
364  } else if (l_bc_type == ERFBCType::reflect_even) {
365  dest_arr(i,j,k,dest_comp) = dest_arr(iflip,j,k,dest_comp);
366  } else if (l_bc_type == ERFBCType::reflect_odd) {
367  dest_arr(i,j,k,dest_comp) = -dest_arr(iflip,j,k,dest_comp);
368  } else if (l_bc_type == ERFBCType::hoextrap) {
369  Real delta_i = static_cast<Real>(dom_lo.x - i);
370  dest_arr(i,j,k,dest_comp) = (one + delta_i)*dest_arr(dom_lo.x,j,k,dest_comp) - delta_i*dest_arr(dom_lo.x+1,j,k,dest_comp);
371  }
372  },
373  bx_xhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
374  {
375  int dest_comp = icomp+n;
376  int h_bc_type = bc_ptr[n].hi(0);
377  int iflip = 2*dom_hi.x + 1 - i;
378  if (h_bc_type == ERFBCType::foextrap) {
379  dest_arr(i,j,k,dest_comp) = dest_arr(dom_hi.x,j,k,dest_comp);
380  } else if (h_bc_type == ERFBCType::open) {
381  dest_arr(i,j,k,dest_comp) = dest_arr(dom_hi.x,j,k,dest_comp);
382  } else if (h_bc_type == ERFBCType::reflect_even) {
383  dest_arr(i,j,k,dest_comp) = dest_arr(iflip,j,k,dest_comp);
384  } else if (h_bc_type == ERFBCType::reflect_odd) {
385  dest_arr(i,j,k,dest_comp) = -dest_arr(iflip,j,k,dest_comp);
386  } else if (h_bc_type == ERFBCType::hoextrap) {
387  Real delta_i = static_cast<Real>(i - dom_hi.x);
388  dest_arr(i,j,k,dest_comp) = (one + delta_i)*dest_arr(dom_hi.x,j,k,dest_comp) - delta_i*dest_arr(dom_hi.x-1,j,k,dest_comp);
389  }
390  }
391  );
392  }
393 
394  if (!is_periodic_in_y)
395  {
396  // Populate ghost cells on lo-y and hi-y domain boundaries
397  Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
398  Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1);
399  if (bx_ylo.smallEnd(2) != domain.smallEnd(2)) bx_ylo.growLo(2,ng[2]);
400  if (bx_ylo.bigEnd(2) != domain.bigEnd(2)) bx_ylo.growHi(2,ng[2]);
401  if (bx_yhi.smallEnd(2) != domain.smallEnd(2)) bx_yhi.growLo(2,ng[2]);
402  if (bx_yhi.bigEnd(2) != domain.bigEnd(2)) bx_yhi.growHi(2,ng[2]);
403  ParallelFor(
404  bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
405  {
406  int dest_comp = icomp+n;
407  int l_bc_type = bc_ptr[n].lo(1);
408  int jflip = 2*dom_lo.y - 1 - j;
409  if (l_bc_type == ERFBCType::foextrap) {
410  dest_arr(i,j,k,dest_comp) = dest_arr(i,dom_lo.y,k,dest_comp);
411  } else if (l_bc_type == ERFBCType::open) {
412  dest_arr(i,j,k,dest_comp) = dest_arr(i,dom_lo.y,k,dest_comp);
413  } else if (l_bc_type == ERFBCType::reflect_even) {
414  dest_arr(i,j,k,dest_comp) = dest_arr(i,jflip,k,dest_comp);
415  } else if (l_bc_type == ERFBCType::reflect_odd) {
416  dest_arr(i,j,k,dest_comp) = -dest_arr(i,jflip,k,dest_comp);
417  } else if (l_bc_type == ERFBCType::hoextrap) {
418  Real delta_j = static_cast<Real>(dom_lo.y - j);
419  dest_arr(i,j,k,dest_comp) = (one + delta_j)*dest_arr(i,dom_lo.y,k,dest_comp) - delta_j*dest_arr(i,dom_lo.y+1,k,dest_comp);
420  }
421 
422  },
423  bx_yhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
424  {
425  int dest_comp = icomp+n;
426  int h_bc_type = bc_ptr[n].hi(1);
427  int jflip = 2*dom_hi.y + 1 - j;
428  if (h_bc_type == ERFBCType::foextrap) {
429  dest_arr(i,j,k,dest_comp) = dest_arr(i,dom_hi.y,k,dest_comp);
430  } else if (h_bc_type == ERFBCType::open) {
431  dest_arr(i,j,k,dest_comp) = dest_arr(i,dom_hi.y,k,dest_comp);
432  } else if (h_bc_type == ERFBCType::reflect_even) {
433  dest_arr(i,j,k,dest_comp) = dest_arr(i,jflip,k,dest_comp);
434  } else if (h_bc_type == ERFBCType::reflect_odd) {
435  dest_arr(i,j,k,dest_comp) = -dest_arr(i,jflip,k,dest_comp);
436  } else if (h_bc_type == ERFBCType::hoextrap) {
437  Real delta_j = static_cast<Real>(j - dom_hi.y);
438  dest_arr(i,j,k,dest_comp) = (one + delta_j)*dest_arr(i,dom_hi.y,k,dest_comp) - delta_j*dest_arr(i,dom_hi.y-1,k,dest_comp);
439  }
440  }
441  );
442  }
443  Gpu::streamSynchronize();
444 }
GpuArray< int, AMREX_SPACEDIM > dhi
Definition: ERF_ActuatorSpreading.cpp:132
GpuArray< int, AMREX_SPACEDIM > dlo
Definition: ERF_ActuatorSpreading.cpp:132
#define RhoScalar_comp
Definition: ERF_IndexDefines.H:65
#define NBCVAR_max
Definition: ERF_IndexDefines.H:50
#define NSCALARS
Definition: ERF_IndexDefines.H:34
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > m_pi_inflow_theta
Definition: ERF_PhysBCFunct.H:227
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
amrex::GpuArray< int, AMREX_SPACEDIM *2 > m_pi_inflow_face
Definition: ERF_PhysBCFunct.H:226
@ RhoScalar_bc_comp
Definition: ERF_IndexDefines.H:126
@ open
Definition: ERF_IndexDefines.H:324
@ reflect_odd
Definition: ERF_IndexDefines.H:313
@ hoextrap
Definition: ERF_IndexDefines.H:318
@ foextrap
Definition: ERF_IndexDefines.H:316
@ ext_dir_prim
Definition: ERF_IndexDefines.H:320
@ int_dir
Definition: ERF_IndexDefines.H:314
@ reflect_even
Definition: ERF_IndexDefines.H:315
@ ng
Definition: ERF_Morrison.H:51
@ nc
Definition: ERF_Morrison.H:47
Here is the call graph for this function:

◆ impose_vertical_cons_bcs()

void ERFPhysBCFunct_cons::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 
)

Impose vertical boundary conditions on conserved variables.

Parameters
[in,out]dest_arrcell-centered data to be filled
[in]bxbox holding data to be filled
[in]domainsimulation domain
[in]z_ndnodal physical height
[in]mf_xmap factor m_x at the cell centers
[in]mf_ymap factor m_y at the cell centers
[in]dxInvinverse cell size
[in]icompstarting component
[in]ncompnumber of components
[in]timetime at which data should be filled
[in]do_terrain_adjustmentwhether to apply terrain-aware Neumann adjustments

Impose vertical boundary conditions on conserved scalars (at cell centers)

Parameters
[in,out]dest_arrthe Array4 of the quantity to be filled
[in]bxthe box associated with this data
[in]domainthe computational domain
[in]z_phys_ndheight coordinate at nodes
[in]mf_xmap factor m_x at the cell centers
[in]mf_ymap factor m_y at the cell centers
[in]dxInvinverse cell size array
[in]icompthe index of the first component to be filled
[in]ncompthe number of components – this can be any value from 1 to NVAR as long as icomp+ncomp <= NVAR-one
[in]timetime at which the data should be filled
[in]do_terrain_adjustmentwhether to apply terrain-aware Neumann adjustments
471 {
472  BL_PROFILE_VAR("impose_vertical_cons_bcs()",impose_vertical_cons_bcs);
473  const auto& dom_lo = lbound(domain);
474  const auto& dom_hi = ubound(domain);
475 
476  Box per_grown_domain(domain);
477  int growx = (m_geom.isPeriodic(0)) ? 1 : 0;
478  int growy = (m_geom.isPeriodic(1)) ? 1 : 0;
479  per_grown_domain.grow(IntVect(growx,growy,0));
480  const auto& perdom_lo = lbound(per_grown_domain);
481  const auto& perdom_hi = ubound(per_grown_domain);
482 
483  GeometryData const& geomdata = m_geom.data();
484 
485  // xlo: ori = 0
486  // ylo: ori = 1
487  // zlo: ori = 2
488  // xhi: ori = 3
489  // yhi: ori = 4
490  // zhi: ori = 5
491 
492  // Based on BCRec for the domain, we need to make BCRec for this Box
493  // 0 is used as starting index for bcrs
494  Vector<BCRec> bcrs(ncomp);
495  GpuArray<GpuArray<Real, AMREX_SPACEDIM*2>,NBCVAR_max> l_bc_extdir_vals_d;
496  GpuArray<GpuArray<Real, AMREX_SPACEDIM*2>,NBCVAR_max> l_bc_neumann_vals_d;
497 
498  const int* bxlo = bx.loVect();
499  const int* bxhi = bx.hiVect();
500  const int* dlo = domain.loVect();
501  const int* dhi = domain.hiVect();
502 
503  for (int nc = 0; nc < ncomp; nc++)
504  {
505  int bc_comp = (icomp+nc >= RhoScalar_comp && icomp+nc < RhoScalar_comp+NSCALARS) ?
507  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
508  for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
509  {
510  bcrs[nc].setLo(dir, ( bxlo[dir]<=dlo[dir]
511  ? m_domain_bcs_type[bc_comp].lo(dir) : BCType::int_dir ));
512  bcrs[nc].setHi(dir, ( bxhi[dir]>=dhi[dir]
513  ? m_domain_bcs_type[bc_comp].hi(dir) : BCType::int_dir ));
514  }
515 
516  for (int ori = 0; ori < 2*AMREX_SPACEDIM; ori++) {
517  l_bc_extdir_vals_d[bc_comp][ori] = m_bc_extdir_vals[bc_comp][ori];
518  l_bc_neumann_vals_d[bc_comp][ori] = m_bc_neumann_vals[bc_comp][ori];
519  }
520  }
521 
522  Gpu::DeviceVector<BCRec> bcrs_d(icomp+ncomp);
523  Gpu::copyAsync(Gpu::hostToDevice, bcrs.begin(), bcrs.end(), bcrs_d.begin());
524  const BCRec* bc_ptr = bcrs_d.data();
525 
526  {
527  Box bx_zlo(bx); bx_zlo.setBig (2,dom_lo.z-1);
528  Box bx_zhi(bx); bx_zhi.setSmall(2,dom_hi.z+1);
529  ParallelFor(
530  bx_zlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
531  {
532  int dest_comp = icomp+n;
533  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
534  BCVars::RhoScalar_bc_comp : dest_comp;
535  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
536  int l_bc_type = bc_ptr[n].lo(2);
537  if (l_bc_type == ERFBCType::ext_dir) {
538  dest_arr(i,j,k,dest_comp) = l_bc_extdir_vals_d[bc_comp][2];
539  } else if (l_bc_type == ERFBCType::ext_dir_prim) {
540  Real rho = dest_arr(i,j,dom_lo.z,Rho_comp);
541  dest_arr(i,j,k,dest_comp) = rho * l_bc_extdir_vals_d[bc_comp][2];
542  }
543  },
544  bx_zhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
545  {
546  int dest_comp = icomp+n;
547  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
548  BCVars::RhoScalar_bc_comp : dest_comp;
549  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
550  int h_bc_type = bc_ptr[n].hi(2);
551  if (h_bc_type == ERFBCType::ext_dir) {
552  dest_arr(i,j,k,dest_comp) = l_bc_extdir_vals_d[bc_comp][5];
553  } else if (h_bc_type == ERFBCType::ext_dir_prim) {
554  Real rho = dest_arr(i,j,dom_hi.z,Rho_comp);
555  dest_arr(i,j,k,dest_comp) = rho * l_bc_extdir_vals_d[bc_comp][5];
556  }
557 
558  }
559  );
560  }
561 
562  {
563  Box bx_zlo(bx); bx_zlo.setBig (2,dom_lo.z-1);
564  Box bx_zhi(bx); bx_zhi.setSmall(2,dom_hi.z+1);
565  // Populate ghost cells on lo-z and hi-z domain boundaries
566  ParallelFor(
567  bx_zlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
568  {
569  int dest_comp = icomp+n;
570  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
571  BCVars::RhoScalar_bc_comp : dest_comp;
572  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
573  int l_bc_type = bc_ptr[n].lo(2);
574  int kflip = 2*dom_lo.z - 1 - k;
575  if (l_bc_type == ERFBCType::foextrap) {
576  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_lo.z,dest_comp);
577  } else if (l_bc_type == ERFBCType::open) {
578  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_lo.z,dest_comp);
579  } else if (l_bc_type == ERFBCType::reflect_even) {
580  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,kflip,dest_comp);
581  } else if (l_bc_type == ERFBCType::reflect_odd) {
582  dest_arr(i,j,k,dest_comp) = -dest_arr(i,j,kflip,dest_comp);
583  } else if (l_bc_type == ERFBCType::neumann) {
584  Real delta_z = Compute_Z_AtCellCenter(i,j,dom_lo.z,z_phys_nd)
585  - Compute_Z_AtCellCenter(i,j,k ,z_phys_nd);
586  if( (icomp+n) == Rho_comp ) {
587  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_lo.z,dest_comp) -
588  delta_z*l_bc_neumann_vals_d[bc_comp][2];
589  } else {
590  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_lo.z,dest_comp) -
591  delta_z*l_bc_neumann_vals_d[bc_comp][2]*dest_arr(i,j,dom_lo.z,Rho_comp);
592  }
593  } else if (l_bc_type == ERFBCType::hoextrap) {
594  Real delta_k = static_cast<Real>(dom_lo.z - k);
595  dest_arr(i,j,k,dest_comp) = (one + delta_k) * dest_arr(i,j,dom_lo.z ,dest_comp) -
596  delta_k * dest_arr(i,j,dom_lo.z+1,dest_comp);
597  }
598  },
599  bx_zhi, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
600  {
601  int dest_comp = icomp+n;
602  int bc_comp = (dest_comp >= RhoScalar_comp && dest_comp < RhoScalar_comp+NSCALARS) ?
603  BCVars::RhoScalar_bc_comp : dest_comp;
604  if (bc_comp > BCVars::RhoScalar_bc_comp) bc_comp -= (NSCALARS-1);
605  int h_bc_type = bc_ptr[n].hi(2);
606  int kflip = 2*dom_hi.z + 1 - k;
607  if (h_bc_type == ERFBCType::foextrap) {
608  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_hi.z,dest_comp);
609  } else if (h_bc_type == ERFBCType::open) {
610  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_hi.z,dest_comp);
611  } else if (h_bc_type == ERFBCType::reflect_even) {
612  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,kflip,dest_comp);
613  } else if (h_bc_type == ERFBCType::reflect_odd) {
614  dest_arr(i,j,k,dest_comp) = -dest_arr(i,j,kflip,dest_comp);
615  } else if (h_bc_type == ERFBCType::neumann) {
616  Real delta_z = Compute_Z_AtCellCenter(i,j,k ,z_phys_nd)
617  - Compute_Z_AtCellCenter(i,j,dom_hi.z,z_phys_nd);
618  if( (icomp+n) == Rho_comp ) {
619  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_hi.z,dest_comp) +
620  delta_z*l_bc_neumann_vals_d[bc_comp][5];
621  } else {
622  dest_arr(i,j,k,dest_comp) = dest_arr(i,j,dom_hi.z,dest_comp) +
623  delta_z*l_bc_neumann_vals_d[bc_comp][5]*dest_arr(i,j,dom_hi.z,Rho_comp);
624  }
625  } else if (h_bc_type == ERFBCType::hoextrap){
626  Real delta_k = static_cast<Real>(k - dom_hi.z);
627  dest_arr(i,j,k,dest_comp) = (one + delta_k)*dest_arr(i,j,dom_hi.z,dest_comp) - delta_k*dest_arr(i,j,dom_hi.z-1,dest_comp);
628  }
629  }
630  );
631  }
632 
633  if (do_terrain_adjustment && m_z_phys_nd) {
634  const auto& bx_lo = lbound(bx);
635  const auto& bx_hi = ubound(bx);
636  const BCRec* bc_ptr_h = bcrs.data();
637  const auto& mf_lo = lbound(Box(mf_x));
638  const auto& mf_hi = ubound(Box(mf_x));
639  // Neumann conditions (d<var>/dn = 0) must be aware of the surface normal with terrain.
640  // An additional source term arises from d<var>/dx & d<var>/dy & met_h_xi/eta/zeta.
641  //=====================================================================================
642  // Only modify scalars, U, or V
643  // Loop over each component
644  for (int n = 0; n < ncomp; n++) {
645  // Hit for Neumann condition at kmin
646  int dest_comp = icomp+n;
647  int l_bc_type = bc_ptr_h[n].lo(2);
648  if(l_bc_type == ERFBCType::foextrap)
649  {
650  // Loop over ghost cells in bottom XY-plane (valid box)
651  Box xybx = bx;
652 
653  int k0 = dom_lo.z;
654  if (xybx.smallEnd(2) < dom_lo.z)
655  {
656  xybx.setBig(2,dom_lo.z-1);
657  xybx.setSmall(2,bx.smallEnd(2));
658 
659  // Get the dz cell size
660  Real dz = geomdata.CellSize(2);
661 
662  // Fill all the Neumann srcs with terrain
663  ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
664  {
665  // Clip indices for ghost-cells
666  int ii = amrex::min(amrex::max(i,perdom_lo.x),perdom_hi.x);
667  int jj = amrex::min(amrex::max(j,perdom_lo.y),perdom_hi.y);
668 
669  // Get metrics
670  Real met_h_xi = Compute_h_xi_AtCellCenter (ii,jj,k0,dxInv,z_phys_nd);
671  Real met_h_eta = Compute_h_eta_AtCellCenter (ii,jj,k0,dxInv,z_phys_nd);
672  Real met_h_zeta = Compute_h_zeta_AtCellCenter(ii,jj,k0,dxInv,z_phys_nd);
673 
674  // Map factors at the cell center, clamped to the (2D) map-factor box
675  int im = amrex::min(amrex::max(ii,mf_lo.x),mf_hi.x);
676  int jm = amrex::min(amrex::max(jj,mf_lo.y),mf_hi.y);
677  Real mfx = (mf_x) ? mf_x(im,jm,0) : one;
678  Real mfy = (mf_y) ? mf_y(im,jm,0) : one;
679  Real slope_x = mfx * met_h_xi;
680  Real slope_y = mfy * met_h_eta;
681 
682  // GradX at IJK location inside domain -- this relies on the assumption that we have
683  // used foextrap for cell-centered quantities outside the domain to define the gradient as zero
684  Real GradVarx, GradVary;
685  if (i < dom_lo.x-1 || i > dom_hi.x+1 || (i+1 > bx_hi.x && i-1 < bx_lo.x) ) {
686  GradVarx = zero;
687  } else if (i+1 > bx_hi.x) {
688  GradVarx = dxInv[0] * (dest_arr(i ,j,k0,dest_comp) - dest_arr(i-1,j,k0,dest_comp));
689  } else if (i-1 < bx_lo.x) {
690  GradVarx = dxInv[0] * (dest_arr(i+1,j,k0,dest_comp) - dest_arr(i ,j,k0,dest_comp));
691  } else {
692  GradVarx = myhalf * dxInv[0] * (dest_arr(i+1,j,k0,dest_comp) - dest_arr(i-1,j,k0,dest_comp));
693  }
694 
695  // GradY at IJK location inside domain -- this relies on the assumption that we have
696  // used foextrap for cell-centered quantities outside the domain to define the gradient as zero
697  if (j < dom_lo.y-1 || j > dom_hi.y+1 || (j+1 > bx_hi.y && j-1 < bx_lo.y) ) {
698  GradVary = zero;
699  } else if (j+1 > bx_hi.y) {
700  GradVary = dxInv[1] * (dest_arr(i,j ,k0,dest_comp) - dest_arr(i,j-1,k0,dest_comp));
701  } else if (j-1 < bx_lo.y) {
702  GradVary = dxInv[1] * (dest_arr(i,j+1,k0,dest_comp) - dest_arr(i,j ,k0,dest_comp));
703  } else {
704  GradVary = myhalf * dxInv[1] * (dest_arr(i,j+1,k0,dest_comp) - dest_arr(i,j-1,k0,dest_comp));
705  }
706 
707  // Prefactor, with the physical slopes m_x h_xi and m_y h_eta
708  Real met_fac = met_h_zeta / ( slope_x*slope_x + slope_y*slope_y + one );
709 
710  // Accumulate in bottom ghost cell (EXTRAP already populated)
711  dest_arr(i,j,k,dest_comp) -= dz * met_fac * ( mfx * slope_x * GradVarx + mfy * slope_y * GradVary );
712  });
713  } // box includes k0
714  } // foextrap
715  } // ncomp
716  } // m_z_phys_nd
717  Gpu::streamSynchronize();
718 }
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:16
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_Z_AtCellCenter(const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:717
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:227
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:252
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:202
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
@ neumann
Definition: ERF_IndexDefines.H:322
Here is the call graph for this function:

◆ operator()()

void ERFPhysBCFunct_cons::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 
)

Impose physical boundary conditions at domain boundaries

Parameters
[in,out]mfconserved-variable MultiFab to be filled
[in]xvelx-velocity MultiFab used by upwind boundary conditions
[in]yvely-velocity MultiFab used by upwind boundary conditions
[in]icompstarting component for conserved variables
[in]ncompnumber of components for conserved variables
[in]nghostnumber of ghost cells to be filled for conserved variables
[in]timetime at which the data should be filled
[in]bccomp_consindex into m_domain_bcs_type for conserved variables
[in]do_fbwhether to fill periodic/interior ghost cells first
[in]do_terrain_adjustmentwhether to apply terrain-aware Neumann adjustments

Impose physical boundary conditions at domain boundaries

Parameters
[in,out]mfMultiFab of cell-centered quantities to be filled
[in]xvelx-velocity MultiFab used by upwind boundary conditions
[in]yvely-velocity MultiFab used by upwind boundary conditions
[in]icompstarting component
[in]ncompnumber of components
[in]nghostnumber of ghost cells to be filled
[in]timetime at which data should be filled
[in]bccompindex into m_domain_bcs_type, unused here
[in]do_fbwhether to fill periodic/interior ghost cells first
[in]do_terrain_adjustmentwhether to apply terrain-aware Neumann adjustments
91 {
92  BL_PROFILE("ERFPhysBCFunct_cons::()");
93 
94  //
95  // We fill all of the interior and periodic ghost cells first, so we can fill
96  // those directly inside the lateral and vertical calls.
97  // If triply periodic this is all we do
98  //
99  if (do_fb) {
100  mf.FillBoundary(icomp,ncomp,m_geom.periodicity());
101  }
102 
103  if (m_geom.isAllPeriodic()) return;
104 
105  const auto& domain = m_geom.Domain();
106  const auto dxInv = m_geom.InvCellSizeArray();
107 
108  // Create a grown domain box containing valid + periodic cells
109  Box gdomain = domain;
110  for (int i = 0; i < AMREX_SPACEDIM; ++i) {
111  if (m_geom.isPeriodic(i)) {
112  gdomain.grow(i, nghost[i]);
113  }
114  }
115 
116 #ifdef AMREX_USE_OMP
117 #pragma omp parallel if (Gpu::notInLaunchRegion())
118 #endif
119  {
120  for (MFIter mfi(mf,false); mfi.isValid(); ++mfi)
121  {
122  //
123  // This is the box we pass to the different routines
124  // NOTE -- this is the full grid box NOT the tile box
125  //
126  Box bx = mfi.validbox();
127 
128  //
129  // These are the boxes we use to test on relative to the domain
130  //
131  Box cbx1 = bx; cbx1.grow(IntVect(nghost[0],nghost[1],0));
132  Box cbx2 = bx; cbx2.grow(nghost);
133 
134  Array4<const Real> z_nd_arr;
135  Array4<const Real> mf_x_arr;
136  Array4<const Real> mf_y_arr;
137  if (m_z_phys_nd) {
138  z_nd_arr = m_z_phys_nd->const_array(mfi);
139  }
140  if (m_mapfac_x) {
141  mf_x_arr = m_mapfac_x->const_array(mfi);
142  }
143  if (m_mapfac_y) {
144  mf_y_arr = m_mapfac_y->const_array(mfi);
145  }
146 
147  if (!gdomain.contains(cbx2)) {
148  Array4< Real> const& cons_arr = mf.array(mfi);
149  Array4<const Real> const& velx_arr = xvel.const_array(mfi);
150  Array4<const Real> const& vely_arr = yvel.const_array(mfi);
151 
152  if (!m_use_real_bcs) {
153  // We send a box with ghost cells in the lateral directions only
154  impose_lateral_cons_bcs(cons_arr,velx_arr,vely_arr,cbx1,domain,icomp,ncomp,nghost,time);
155  impose_inflow_profile_cons(cons_arr,velx_arr,vely_arr,z_nd_arr,cbx1,domain,icomp,ncomp);
156  }
157 
158  // We send the full FAB box with ghost cells
159  impose_vertical_cons_bcs(cons_arr,cbx2,domain,z_nd_arr,mf_x_arr,mf_y_arr,dxInv,icomp,ncomp,time,do_terrain_adjustment);
160  }
161 
162  } // MFIter
163  } // OpenMP
164 
165  // The terrain correction below the ground is computed box by box; make the
166  // copies of each ghost cell agree. Only a terrain-fitted mesh has a
167  // non-zero correction -- z_phys_nd is allocated (and zeroed) for every
168  // terrain type, so testing it alone would pay for the sync on flat runs.
169  if (do_terrain_adjustment && m_z_phys_nd && terrain_is_fitted(m_terrain_type)) {
170  m_below_ground_sync(mf, icomp, ncomp, nghost, m_geom);
171  }
172 } // operator()
BelowGroundGhostSync m_below_ground_sync
Definition: ERF_PhysBCFunct.H:228
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
@ xvel
Definition: ERF_IndexDefines.H:232
@ yvel
Definition: ERF_IndexDefines.H:233

◆ set_inflow_profiles()

void ERFPhysBCFunct_cons::set_inflow_profiles ( const amrex::Array< InflowProfile, 2 *AMREX_SPACEDIM > *  profiles)
inline

Terrain-following inflow profiles per face (xlo.inflow_profile), owned by ERF

107 { m_inflow_profiles = profiles; }

◆ set_pi_inflow_faces()

void ERFPhysBCFunct_cons::set_pi_inflow_faces ( const amrex::GpuArray< int, AMREX_SPACEDIM *2 > &  face,
const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > &  theta 
)
inline

The lateral faces of a pseudo-incompressible level that give a primitive inflow theta. There the constraint holds rho*theta at rho0*theta0, so the ghost cells where the flow enters take rho = (rho*theta)_interior / theta_in, and every given value is made conserved with that density (#5265).

Parameters
[in]faceper face: 0 not such a face, 1 inflow, 2 inflow_outflow
[in]thetaper face: the given theta (<face>.theta), unless the face's theta comes from th_bc_data (th_file_face 2)
121  {
122  m_pi_inflow_face = face;
124  }
@ theta
Definition: ERF_Kessler.H:26

Member Data Documentation

◆ m_bc_extdir_vals

amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> ERFPhysBCFunct_cons::m_bc_extdir_vals
private

Referenced by face_rho_is_extdir().

◆ m_bc_neumann_vals

amrex::Array<amrex::Array<amrex::Real, AMREX_SPACEDIM*2>,AMREX_SPACEDIM+NBCVAR_max> ERFPhysBCFunct_cons::m_bc_neumann_vals
private

◆ m_below_ground_sync

BelowGroundGhostSync ERFPhysBCFunct_cons::m_below_ground_sync
private

◆ m_domain_bcs_type

amrex::Vector<amrex::BCRec> ERFPhysBCFunct_cons::m_domain_bcs_type
private

Referenced by face_rho_is_extdir().

◆ m_domain_bcs_type_d

amrex::Gpu::DeviceVector<amrex::BCRec> ERFPhysBCFunct_cons::m_domain_bcs_type_d
private

◆ m_geom

amrex::Geometry ERFPhysBCFunct_cons::m_geom
private

◆ m_inflow_profiles

const amrex::Array<InflowProfile,2*AMREX_SPACEDIM>* ERFPhysBCFunct_cons::m_inflow_profiles = nullptr
private

Referenced by set_inflow_profiles().

◆ m_lev

int ERFPhysBCFunct_cons::m_lev
private

◆ m_mapfac_x

amrex::MultiFab* ERFPhysBCFunct_cons::m_mapfac_x
private

Referenced by ERFPhysBCFunct_cons().

◆ m_mapfac_y

amrex::MultiFab* ERFPhysBCFunct_cons::m_mapfac_y
private

Referenced by ERFPhysBCFunct_cons().

◆ m_pi_inflow_face

amrex::GpuArray<int,AMREX_SPACEDIM*2> ERFPhysBCFunct_cons::m_pi_inflow_face {}
private

Referenced by set_pi_inflow_faces().

◆ m_pi_inflow_theta

amrex::GpuArray<amrex::Real,AMREX_SPACEDIM*2> ERFPhysBCFunct_cons::m_pi_inflow_theta {}
private

Referenced by set_pi_inflow_faces().

◆ m_terrain_type

TerrainType ERFPhysBCFunct_cons::m_terrain_type
private

◆ m_th_bc_data

amrex::Real* ERFPhysBCFunct_cons::m_th_bc_data
private

◆ m_th_file_face

amrex::GpuArray<int,AMREX_SPACEDIM*2> ERFPhysBCFunct_cons::m_th_file_face
private

Referenced by ERFPhysBCFunct_cons().

◆ m_use_real_bcs

bool ERFPhysBCFunct_cons::m_use_real_bcs
private

◆ m_z_phys_nd

amrex::MultiFab* ERFPhysBCFunct_cons::m_z_phys_nd
private

The documentation for this class was generated from the following files: