ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPertVels_ParticleTests.H
Go to the documentation of this file.
1  ParmParse pp_for_pert_vels("prob");
2  Real U_0 = 0.0; pp_for_pert_vels.query("U_0",U_0);
3 
4  const int klo = geomdata.Domain().smallEnd()[2];
5  const int khi = geomdata.Domain().bigEnd()[2];
6 
7  // Set the x-velocity
8  ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
9  {
10  Real ztop = z_nd(i,j,khi+1);
11  Real zht = z_nd(i,j,klo);
12  x_vel_pert(i, j, k) = U_0 * ztop / (ztop - zht);
13  });
14 
15  const auto dx = geomdata.CellSize();
16  amrex::GpuArray<Real, AMREX_SPACEDIM> dxInv;
17  dxInv[0] = 1. / dx[0];
18  dxInv[1] = 1. / dx[1];
19  dxInv[2] = 1. / dx[2];
20 
21  // Set the z-velocity from impenetrable condition
22  ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
23  {
24  z_vel_pert(i, j, k) = WFromOmega(i, j, k, 0.0,
25  x_vel_pert, y_vel_pert,
26  mf_u, mf_v, z_nd, dxInv);
27  });
const int klo
Definition: ERF_InitCustomPertVels_ParticleTests.H:4
const int khi
Definition: ERF_InitCustomPertVels_ParticleTests.H:5
ParmParse pp_for_pert_vels("prob")
Real U_0
Definition: ERF_InitCustomPertVels_ParticleTests.H:2
ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { Real ztop=z_nd(i, j, khi+1);Real zht=z_nd(i, j, klo);x_vel_pert(i, j, k)=U_0 *ztop/(ztop - zht);})
const auto dx
Definition: ERF_InitCustomPertVels_ParticleTests.H:15
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:16
const Box zbx
Definition: ERF_SetupDiff.H:9
const Box xbx
Definition: ERF_SetupDiff.H:7
amrex::Real Real
Definition: ERF_ShocInterface.H:19
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WFromOmega(int &i, int &j, int &k, amrex::Real omega, const amrex::Array4< const amrex::Real > &u_arr, const amrex::Array4< const amrex::Real > &v_arr, const amrex::Array4< const amrex::Real > &mf_u, const amrex::Array4< const amrex::Real > &mf_v, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv)
Definition: ERF_TerrainMetrics.H:462