ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_AdvectionSrcForMom_EB.cpp File Reference
#include "AMReX_BCRec.H"
#include <ERF_Advection.H>
#include <ERF_AdvectionSrcForMom_N.H>
#include <ERF_AdvectionSrcForMom_T.H>
Include dependency graph for ERF_AdvectionSrcForMom_EB.cpp:

Functions

void AdvectionSrcForMom_EB (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 > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const GpuArray< Real, AMREX_SPACEDIM > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const AdvType, const AdvType, const Real, const Real, const int, const int, const Box &)
 

Function Documentation

◆ AdvectionSrcForMom_EB()

void AdvectionSrcForMom_EB ( 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 > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const GpuArray< Real, AMREX_SPACEDIM > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const Array4< const Real > &  ,
const  AdvType,
const  AdvType,
const  Real,
const  Real,
const int  ,
const int  ,
const Box &   
)

Function for computing the advective tendency for the momentum equations when using EB

Parameters
[in]bxxbox over which the x-momentum is updated
[in]bxybox over which the y-momentum is updated
[in]bxzbox over which the z-momentum is updated
[out]rho_u_rhstendency for the x-momentum equation
[out]rho_v_rhstendency for the y-momentum equation
[out]rho_w_rhstendency for the z-momentum equation
[in]ux-component of the velocity
[in]vy-component of the velocity
[in]wz-component of the velocity
[in]rho_ux-component of the momentum
[in]rho_vy-component of the momentum
[in]Omegacomponent of the momentum normal to the z-coordinate surface
[in]z_ndheight coordinate at nodes
[in]axArea fraction of x-faces
[in]ayArea fraction of y-faces
[in]azArea fraction of z-faces
[in]vfVolume fraction
[in]cellSizeInvinverse of the mesh spacing
[in]mf_mmap factor at cell centers
[in]mf_umap factor at x-faces
[in]mf_vmap factor at y-faces
[in]horiz_adv_typesets the spatial order to be used for lateral derivatives
[in]vert_adv_typesets the spatial order to be used for vertical derivatives
62 {
63  BL_PROFILE_VAR("AdvectionSrcForMom_EB", AdvectionSrcForMom_EB);
64 
65 // auto dxInv = cellSizeInv[0], dyInv = cellSizeInv[1], dzInv = cellSizeInv[2];
66 
67  AMREX_ALWAYS_ASSERT(bxz.smallEnd(2) > 0);
68 
69 #if 0
70  // compute mapfactor inverses
71  Box box2d_u(bxx); box2d_u.setRange(2,0); box2d_u.grow({3,3,0});
72  Box box2d_v(bxy); box2d_v.setRange(2,0); box2d_v.grow({3,3,0});
73 
74  FArrayBox mf_u_invFAB(box2d_u,1,The_Async_Arena());
75  FArrayBox mf_v_invFAB(box2d_v,1,The_Async_Arena());
76 
77  const Array4<Real>& mf_u_inv = mf_u_invFAB.array();
78  const Array4<Real>& mf_v_inv = mf_v_invFAB.array();
79 
80  ParallelFor(box2d_u, box2d_v,
81  [=] AMREX_GPU_DEVICE (int i, int j, int) noexcept
82  {
83  mf_u_inv(i,j,0) = 1. / mf_u(i,j,0);
84  },
85  [=] AMREX_GPU_DEVICE (int i, int j, int) noexcept
86  {
87  mf_v_inv(i,j,0) = 1. / mf_v(i,j,0);
88  });
89 #endif
90 
91  ParallelFor(bxx, bxy, bxz,
92  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
93  {
94  rho_u_rhs(i, j, k) = 0.0;
95  },
96  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
97  {
98  rho_v_rhs(i, j, k) = 0.0;
99  },
100  [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
101  {
102  rho_w_rhs(i, j, k) = 0.0;
103  });
104 }
void AdvectionSrcForMom_EB(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 > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const GpuArray< Real, AMREX_SPACEDIM > &, const Array4< const Real > &, const Array4< const Real > &, const Array4< const Real > &, const AdvType, const AdvType, const Real, const Real, const int, const int, const Box &)
Definition: ERF_AdvectionSrcForMom_EB.cpp:38