|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Go to the source code of this file.
Functions | |
| ParmParse | pp ("prob") |
| pp | query ("rho_0", rho_0) |
| pp | query ("A_0", A_0) |
| pp | query ("B_0", B_0) |
| pp | query ("rad_0", rad_0) |
| pp | query ("xc_frac", xc_frac) |
| pp | query ("yc_frac", yc_frac) |
| pp | query ("zc_frac", zc_frac) |
| pp | query ("prob_type", prob_type) |
| pp | query ("theta_pert_amp", theta_pert_amp) |
| if (prob_type==11||prob_type==12||prob_type==13) | |
| ParallelFor (bx, [=, one_d=one] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *prob_hi=geomdata.ProbHi();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=use_z_phys ? z_cc(i, j, k) :prob_lo[2]+(k+myhalf) *dx[2];const Real xc=prob_lo[0]+xc_frac *(prob_hi[0] - prob_lo[0]);const Real yc=prob_lo[1]+yc_frac *(prob_hi[1] - prob_lo[1]);const Real zc=phys_z_lo+zc_frac *(phys_z_hi - phys_z_lo);const Real r0=rad_0 *(prob_hi[0] - prob_lo[0]);const Real r3d=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));const Real r2d_xz=std::sqrt((x-xc) *(x-xc)+(z-zc) *(z-zc));if(prob_type==10) { state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(10.) *r3d *r3d)+B_0 *std::sin(x);} else if(prob_type==11) { state_pert(i, j, k, RhoScalar_comp)=A_0 *fourth *(one_d+std::cos(PI *std::min(r2d_xy, r0)/r0));} else if(prob_type==12) { state_pert(i, j, k, RhoScalar_comp)=A_0 *fourth *(one_d+std::cos(PI *std::min(r2d_xz, r0)/r0));} else if(prob_type==13) { const Real r0_z=rad_0 *(phys_z_hi - phys_z_lo);const Real r2d_xz_ell=std::sqrt((x-xc) *(x-xc)/(r0 *r0)+(z-zc) *(z-zc)/(r0_z *r0_z));state_pert(i, j, k, RhoScalar_comp)=A_0 *fourth *(one_d+std::cos(PI *std::min(r2d_xz_ell, one_d)));} else if(prob_type==14) { state_pert(i, j, k, RhoScalar_comp)=std::cos(PI *x);} else { if(r3d< r0) { state_pert(i, j, k, RhoScalar_comp)=A_0;} else { state_pert(i, j, k, RhoScalar_comp)=zero;} } state_pert(i, j, k, RhoScalar_comp) *=rho_0;state_pert(i, j, k, RhoTheta_comp)+=theta_pert_amp *state_pert(i, j, k, RhoScalar_comp);}) | |
Variables | |
| const bool | use_z_phys = use_physical_z() |
| const Real | phys_z_lo = phys_zlo(geomdata, lev) |
| const Real | phys_z_hi = phys_zhi(geomdata, lev) |
| Real | rho_0 = one |
| Real | A_0 = one |
| Real | B_0 = zero |
| Real | rad_0 = zero |
| Real | xc_frac = myhalf |
| Real | yc_frac = myhalf |
| Real | zc_frac = myhalf |
| int | prob_type = -1 |
| Real | theta_pert_amp = zero |

| ParallelFor | ( | bx | , |
| [=, one_d=one] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *prob_hi=geomdata.ProbHi();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=use_z_phys ? z_cc(i, j, k) :prob_lo[2]+(k+myhalf) *dx[2];const Real xc=prob_lo[0]+xc_frac *(prob_hi[0] - prob_lo[0]);const Real yc=prob_lo[1]+yc_frac *(prob_hi[1] - prob_lo[1]);const Real zc=phys_z_lo+zc_frac *(phys_z_hi - phys_z_lo);const Real r0=rad_0 *(prob_hi[0] - prob_lo[0]);const Real r3d=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const Real r2d_xy=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc));const Real r2d_xz=std::sqrt((x-xc) *(x-xc)+(z-zc) *(z-zc));if(prob_type==10) { state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(10.) *r3d *r3d)+B_0 *std::sin(x);} else if(prob_type==11) { state_pert(i, j, k, RhoScalar_comp)=A_0 *fourth *(one_d+std::cos(PI *std::min(r2d_xy, r0)/r0));} else if(prob_type==12) { state_pert(i, j, k, RhoScalar_comp)=A_0 *fourth *(one_d+std::cos(PI *std::min(r2d_xz, r0)/r0));} else if(prob_type==13) { const Real r0_z=rad_0 *(phys_z_hi - phys_z_lo);const Real r2d_xz_ell=std::sqrt((x-xc) *(x-xc)/(r0 *r0)+(z-zc) *(z-zc)/(r0_z *r0_z));state_pert(i, j, k, RhoScalar_comp)=A_0 *fourth *(one_d+std::cos(PI *std::min(r2d_xz_ell, one_d)));} else if(prob_type==14) { state_pert(i, j, k, RhoScalar_comp)=std::cos(PI *x);} else { if(r3d< r0) { state_pert(i, j, k, RhoScalar_comp)=A_0;} else { state_pert(i, j, k, RhoScalar_comp)=zero;} } state_pert(i, j, k, RhoScalar_comp) *=rho_0;state_pert(i, j, k, RhoTheta_comp)+=theta_pert_amp *state_pert(i, j, k, RhoScalar_comp);} | |||
| ) |
| ParmParse pp | ( | "prob" | ) |
| pp query | ( | "theta_pert_amp" | , |
| theta_pert_amp | |||
| ) |
Referenced by ParallelFor().
Referenced by ParallelFor().
| const Real phys_z_hi = phys_zhi(geomdata, lev) |
Referenced by ParallelFor().
| const Real phys_z_lo = phys_zlo(geomdata, lev) |
Referenced by ParallelFor().
| int prob_type = -1 |
Referenced by ParallelFor().
Referenced by if(), and ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().
| const bool use_z_phys = use_physical_z() |
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().