|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
#include <AMReX.H>#include <AMReX_EB_Slopes_K.H>#include <ERF_EB.H>#include <ERF_Diffusion.H>#include <ERF_IndexDefines.H>#include <ERF_EBSlopes.H>#include <ERF_DiffStruct.H>#include <ERF_EBStruct.H>
Namespaces | |
| erf_detail_DiffusionSrcForMom_EB | |
Functions | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | compute_tangent_vectors (Real nx, Real ny, Real nz, Real &tbx_x, Real &tbx_y, Real &tbx_z, Real &tby_x, Real &tby_y, Real &tby_z) |
| template<int MomDir, EBBoundaryType WallModel> | |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE Real | erf_detail_DiffusionSrcForMom_EB::eb_wall_correction (int i, int j, int k, const Array4< const Real > &u_arr, const Array4< const Real > &v_arr, const Array4< const Real > &w_arr, const Array4< const EBCellFlag > &u_cellflg, const Array4< const EBCellFlag > &v_cellflg, const Array4< const EBCellFlag > &w_cellflg, const Array4< const Real > &u_volcent, const Array4< const Real > &v_volcent, const Array4< const Real > &w_volcent, const Array4< const Real > &u_vfrac, const Array4< const Real > &v_vfrac, const Array4< const Real > &w_vfrac, const Array4< const Real > &mom_volfrac, const Array4< const Real > &mom_afrac_x, const Array4< const Real > &mom_afrac_y, const Array4< const Real > &mom_afrac_z, const Array4< const Real > &mom_bcent, const Array4< const Real > &mom_bnorm, const Array4< const Real > &mom_tau_eb13, const Array4< const Real > &mom_tau_eb23, Real dx, Real dy, Real dz, Real vol, Real mu_eff) noexcept |
| template<int MomDir, EBBoundaryType WallModel> | |
| void | erf_detail_DiffusionSrcForMom_EB::launch_eb_wall_correction (Box const &bx, [[maybe_unused]] eb_::CutCellList const &cut_cells, Array4< Real > const &mom_rhs, const Array4< const Real > &u_arr, const Array4< const Real > &v_arr, const Array4< const Real > &w_arr, const Array4< const EBCellFlag > &u_cellflg, const Array4< const EBCellFlag > &v_cellflg, const Array4< const EBCellFlag > &w_cellflg, const Array4< const Real > &u_volcent, const Array4< const Real > &v_volcent, const Array4< const Real > &w_volcent, const Array4< const Real > &u_vfrac, const Array4< const Real > &v_vfrac, const Array4< const Real > &w_vfrac, const Array4< const Real > &mom_volfrac, const Array4< const Real > &mom_afrac_x, const Array4< const Real > &mom_afrac_y, const Array4< const Real > &mom_afrac_z, const Array4< const Real > &mom_bcent, const Array4< const Real > &mom_bnorm, const Array4< const Real > &mom_tau_eb13, const Array4< const Real > &mom_tau_eb23, Real dx, Real dy, Real dz, Real vol, Real mu_eff) noexcept |
| void | DiffusionSrcForMom_EB (const MFIter &mfi, [[maybe_unused]] const Box &domain, const Box &bxx, const Box &bxy, const Box &bxz, const Array4< Real > &rho_u_rhs, const Array4< Real > &rho_v_rhs, const Array4< Real > &rho_w_rhs, const Array4< const Real > &u_arr, const Array4< const Real > &v_arr, const Array4< const Real > &w_arr, const Array4< const Real > &tau11, const Array4< const Real > &tau22, const Array4< const Real > &tau33, const Array4< const Real > &tau12, const Array4< const Real > &tau13, const Array4< const Real > &tau23, const Array4< const Real > &u_tau_eb13, const Array4< const Real > &u_tau_eb23, const Array4< const Real > &v_tau_eb13, const Array4< const Real > &v_tau_eb23, const Array4< const Real > &w_tau_eb13, const Array4< const Real > &w_tau_eb23, const Real *dx_arr, const GpuArray< Real, AMREX_SPACEDIM > &dxInv, const Array4< const Real > &mf_mx, const Array4< const Real > &mf_ux, const Array4< const Real > &mf_vx, const Array4< const Real > &mf_my, const Array4< const Real > &mf_uy, const Array4< const Real > &mf_vy, const SolverChoice &solverChoice, const eb_ &ebfact, [[maybe_unused]] const BCRec *d_bcrec_ptr) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void compute_tangent_vectors | ( | Real | nx, |
| Real | ny, | ||
| Real | nz, | ||
| Real & | tbx_x, | ||
| Real & | tbx_y, | ||
| Real & | tbx_z, | ||
| Real & | tby_x, | ||
| Real & | tby_y, | ||
| Real & | tby_z | ||
| ) |
Compute the tangent directions at an EB boundary given the unit normal vector.
t_bx and t_by are the unit vectors along the projections of e_x and e_y onto the tangent plane. They are the directions in which the stored EB surface stresses tau_eb13 and tau_eb23 act, since those are built from the x- and y-components of the tangential velocity (see ERF_EBMOSTStress.H). For a horizontal surface they are exactly e_x and e_y. Note that they are individually unit but are not orthogonal to each other unless nx*ny is zero – t_bx . t_by = -nx*ny.
e_x has no projection onto the tangent plane when n is parallel to e_x, and likewise for e_y, so one of the two is undefined for an axis-aligned normal such as (1,0,0) (issue #3533). That limit is genuinely two-sided – approaching n = (1,0,0) from nz > 0 and from nz < 0 gives t_bx of -e_z and +e_z – so there is no continuous choice, and the degenerate vector is returned as zero. That keeps the momentum RHS finite, and it keeps the component that does have a limit continuous: the x-component of t_bx is sqrt(1-nx*nx), which tends to zero here as well. It also avoids driving w-momentum with tau_eb13, an x-associated stress, along an arbitrarily signed direction. Only nx and ny can be degenerate, and never both at once.
| [in] | nx | x-component of the normal vector |
| [in] | ny | y-component of the normal vector |
| [in] | nz | z-component of the normal vector |
| [out] | tbx_x | x-component of first tangent vector |
| [out] | tbx_y | y-component of first tangent vector |
| [out] | tbx_z | z-component of first tangent vector |
| [out] | tby_x | x-component of second tangent vector |
| [out] | tby_y | y-component of second tangent vector |
| [out] | tby_z | z-component of second tangent vector |
Referenced by erf_detail_DiffusionSrcForMom_EB::eb_wall_correction().

| void DiffusionSrcForMom_EB | ( | const MFIter & | mfi, |
| [[maybe_unused] ] const Box & | domain, | ||
| const Box & | bxx, | ||
| const Box & | bxy, | ||
| const Box & | bxz, | ||
| const Array4< Real > & | rho_u_rhs, | ||
| const Array4< Real > & | rho_v_rhs, | ||
| const Array4< Real > & | rho_w_rhs, | ||
| const Array4< const Real > & | u_arr, | ||
| const Array4< const Real > & | v_arr, | ||
| const Array4< const Real > & | w_arr, | ||
| const Array4< const Real > & | tau11, | ||
| const Array4< const Real > & | tau22, | ||
| const Array4< const Real > & | tau33, | ||
| const Array4< const Real > & | tau12, | ||
| const Array4< const Real > & | tau13, | ||
| const Array4< const Real > & | tau23, | ||
| const Array4< const Real > & | u_tau_eb13, | ||
| const Array4< const Real > & | u_tau_eb23, | ||
| const Array4< const Real > & | v_tau_eb13, | ||
| const Array4< const Real > & | v_tau_eb23, | ||
| const Array4< const Real > & | w_tau_eb13, | ||
| const Array4< const Real > & | w_tau_eb23, | ||
| const Real * | dx_arr, | ||
| const GpuArray< Real, AMREX_SPACEDIM > & | dxInv, | ||
| const Array4< const Real > & | mf_mx, | ||
| const Array4< const Real > & | mf_ux, | ||
| const Array4< const Real > & | mf_vx, | ||
| const Array4< const Real > & | mf_my, | ||
| const Array4< const Real > & | mf_uy, | ||
| const Array4< const Real > & | mf_vy, | ||
| const SolverChoice & | solverChoice, | ||
| const eb_ & | ebfact, | ||
| [[maybe_unused] ] const BCRec * | d_bcrec_ptr | ||
| ) |
Function for computing the momentum RHS for diffusion operator without terrain.
| [in] | mfi | MultiFab Iterator |
| [in] | domain | computational domain |
| [in] | bxx | nodal x box for x-mom |
| [in] | bxy | nodal y box for y-mom |
| [in] | bxz | nodal z box for z-mom |
| [out] | rho_u_rhs | RHS for x-mom |
| [out] | rho_v_rhs | RHS for y-mom |
| [out] | rho_w_rhs | RHS for z-mom |
| [in] | u_arr | x-direction velocity |
| [in] | v_arr | y-direction velocity |
| [in] | w_arr | z-direction velocity |
| [in] | tau11 | 11 stress |
| [in] | tau22 | 22 stress |
| [in] | tau33 | 33 stress |
| [in] | tau12 | 12 stress |
| [in] | tau13 | 13 stress |
| [in] | tau23 | 23 stress |
| [in] | u_tau_eb13 | EB tangential stress for x-momentum on z-faces |
| [in] | u_tau_eb23 | EB tangential stress for x-momentum on y-faces |
| [in] | v_tau_eb13 | EB tangential stress for y-momentum on z-faces |
| [in] | v_tau_eb23 | EB tangential stress for y-momentum on x-faces |
| [in] | w_tau_eb13 | EB tangential stress for z-momentum on y-faces |
| [in] | w_tau_eb23 | EB tangential stress for z-momentum on x-faces |
| [in] | dx_arr | cell size array |
| [in] | dxInv | inverse cell size array |
| [in] | mf_mx | x map factor at cell centers |
| [in] | mf_ux | x map factor at x-faces |
| [in] | mf_vx | x map factor at y-faces |
| [in] | mf_my | y map factor at cell centers |
| [in] | mf_uy | y map factor at x-faces |
| [in] | mf_vy | y map factor at y-faces |
| [in] | solverChoice | container with diffusion parameters |
| [in] | ebfact | EB factories for cell- and face-centered variables |
| [in] | d_bcrec_ptr | boundary condition records on device |
