ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_GetRhoAlpha.H File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void getRhoAlpha (int i, int j, int k, amrex::Real &rhoAlpha_lo, amrex::Real &rhoAlpha_hi, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &mu_turb, const amrex::Real *d_alpha_eff, const int *d_eddy_diff_idz, int prim_index, int prim_scal_index, bool l_consA, bool l_turb)
 

Function Documentation

◆ getRhoAlpha()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void getRhoAlpha ( int  i,
int  j,
int  k,
amrex::Real rhoAlpha_lo,
amrex::Real rhoAlpha_hi,
const amrex::Array4< const amrex::Real > &  cell_data,
const amrex::Array4< const amrex::Real > &  mu_turb,
const amrex::Real d_alpha_eff,
const int *  d_eddy_diff_idz,
int  prim_index,
int  prim_scal_index,
bool  l_consA,
bool  l_turb 
)

Average rhoAlpha from cell centers to the lower and upper z-faces.

Parameters
[in]icell-centered i-index
[in]jcell-centered j-index
[in]kcell-centered k-index
[out]rhoAlpha_lorhoAlpha averaged to the lower z-face
[out]rhoAlpha_hirhoAlpha averaged to the upper z-face
[in]cell_dataconserved cell-centered state
[in]mu_turbturbulent diffusivity
[in]d_alpha_effeffective molecular diffusivity by primitive component
[in]d_eddy_diff_idzvertical eddy-diffusivity component map
[in]prim_indexprimitive component index
[in]prim_scal_indexscalar primitive component index
[in]l_consAflag for conservative constant-alpha diffusion
[in]l_turbflag for turbulent diffusion
28 {
29  if (l_consA && l_turb) {
30  rhoAlpha_lo = myhalf * ( cell_data(i,j,k,Rho_comp) + cell_data(i,j,k-1,Rho_comp) ) * d_alpha_eff[prim_scal_index]
31  + myhalf * ( mu_turb(i,j,k , d_eddy_diff_idz[prim_scal_index])
32  + mu_turb(i,j,k-1, d_eddy_diff_idz[prim_scal_index]) );
33  rhoAlpha_hi = myhalf * ( cell_data(i,j,k,Rho_comp) + cell_data(i,j,k+1,Rho_comp) ) * d_alpha_eff[prim_scal_index]
34  + myhalf * ( mu_turb(i,j,k , d_eddy_diff_idz[prim_scal_index])
35  + mu_turb(i,j,k+1, d_eddy_diff_idz[prim_scal_index]) );
36  }
37  else if (l_turb) // with MolecDiffType::Constant or None
38  {
39  rhoAlpha_lo = d_alpha_eff[prim_index]
40  + myhalf * ( mu_turb(i,j,k , d_eddy_diff_idz[prim_index])
41  + mu_turb(i,j,k-1, d_eddy_diff_idz[prim_index]) );
42  rhoAlpha_hi = d_alpha_eff[prim_index]
43  + myhalf * ( mu_turb(i,j,k , d_eddy_diff_idz[prim_index])
44  + mu_turb(i,j,k+1, d_eddy_diff_idz[prim_index]) );
45  }
46  else if (l_consA) // without an LES/PBL model
47  {
48  rhoAlpha_lo = myhalf * ( cell_data(i,j,k,Rho_comp) + cell_data(i,j,k-1,Rho_comp) ) * d_alpha_eff[prim_index];
49  rhoAlpha_hi = myhalf * ( cell_data(i,j,k,Rho_comp) + cell_data(i,j,k+1,Rho_comp) ) * d_alpha_eff[prim_index];
50  }
51  else // with MolecDiffType::Constant or None - without an LES/PBL model
52  {
53  rhoAlpha_lo = d_alpha_eff[prim_index];
54  rhoAlpha_hi = d_alpha_eff[prim_index];
55  }
56 }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
#define Rho_comp
Definition: ERF_IndexDefines.H:36

Referenced by ImplicitDiffForStateLU_N(), ImplicitDiffForStateLU_S(), and ImplicitDiffForStateLU_T().

Here is the caller graph for this function: