ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_InitCustomPertVels_TaylorGreenVortex.H
Go to the documentation of this file.
1 
2  ParmParse pp_for_pert_vels("prob");
3  Real V_0 = one; pp_for_pert_vels.query("V_0", V_0);
4 
5  // Set the x-velocity
6  ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
7  {
8  const Real* prob_lo = geomdata.ProbLo();
9  const Real* dx = geomdata.CellSize();
10  const Real x = prob_lo[0] + (i + zero) * dx[0];
11  const Real y = prob_lo[1] + (j + myhalf) * dx[1];
12  const Real z = prob_lo[2] + (k + myhalf) * dx[2];
13 
14  // Set the x-velocity
15  x_vel_pert(i, j, k) = V_0 * sin(x) * cos(y) * cos(z);
16  });
17 
18  // Set the y-velocity
19  ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
20  {
21  const Real* prob_lo = geomdata.ProbLo();
22  const Real* dx = geomdata.CellSize();
23  const Real x = prob_lo[0] + (i + myhalf) * dx[0];
24  const Real y = prob_lo[1] + (j + zero) * dx[1];
25  const Real z = prob_lo[2] + (k + myhalf) * dx[2];
26 
27  // Set the y-velocity
28  y_vel_pert(i, j, k) = - V_0 * cos(x) * sin(y) * cos(z);
29  });
constexpr amrex::Real one
Definition: ERF_Constants.H:7
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+zero) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=prob_lo[2]+(k+myhalf) *dx[2];x_vel_pert(i, j, k)=V_0 *sin(x) *cos(y) *cos(z);})
ParmParse pp_for_pert_vels("prob")
Real V_0
Definition: ERF_InitCustomPertVels_TaylorGreenVortex.H:3
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
const amrex::Real * prob_lo
Definition: ERF_InitCustomPert_IsentropicVortex.H:16
const Box xbx
Definition: ERF_SetupDiff.H:7
const Box ybx
Definition: ERF_SetupDiff.H:8
amrex::Real Real
Definition: ERF_ShocInterface.H:19