ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPertVels_WitchOfAgnesi.H
Go to the documentation of this file.
1 
2  amrex::Gpu::streamSynchronize();
3  Real U_0 = 0.0;
4  Real V_0 = 0.0;
5 
6  ParmParse pp_for_pert_vels("prob");
7  pp_for_pert_vels.query("U_0", U_0);
8  pp_for_pert_vels.query("V_0", V_0);
9 
10  // Set the x-velocity
11  ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
12  {
13  x_vel_pert(i, j, k) = U_0;
14  });
15 
16  // Set the y-velocity
17  ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
18  {
19  y_vel_pert(i, j, k) = V_0;
20  });
21 
22  const auto dx = geomdata.CellSize();
23  amrex::GpuArray<Real, AMREX_SPACEDIM> dxInv;
24  dxInv[0] = 1. / dx[0]; dxInv[1] = 1. / dx[1]; dxInv[2] = 1. / dx[2];
25 
26  // Set the z-velocity from impenetrable condition
27  if (sc.terrain_type == TerrainType::StaticFittedMesh) {
28  ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
29  {
30  z_vel_pert(i, j, k) = WFromOmega(i, j, k, 0.0,
31  x_vel_pert, y_vel_pert,
32  mf_u, mf_v, z_nd, dxInv);
33  });
34  }
ParmParse pp_for_pert_vels("prob")
Real U_0
Definition: ERF_InitCustomPertVels_WitchOfAgnesi.H:3
Real V_0
Definition: ERF_InitCustomPertVels_WitchOfAgnesi.H:4
const auto dx
Definition: ERF_InitCustomPertVels_WitchOfAgnesi.H:22
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_WitchOfAgnesi.H:23
ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { x_vel_pert(i, j, k)=U_0;})
const Box zbx
Definition: ERF_SetupDiff.H:9
const Box xbx
Definition: ERF_SetupDiff.H:7
const Box ybx
Definition: ERF_SetupDiff.H:8
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