ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_GetRhoAlphaForFaces.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 getRhoAlphaForFaces (int i, int j, int k, int ioff, int joff, 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 mu_eff, bool l_consA, bool l_turb)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void getRhoAlphaForFaces (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 mu_eff, bool l_consA, bool l_turb)
 

Function Documentation

◆ getRhoAlphaForFaces() [1/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void getRhoAlphaForFaces ( 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  mu_eff,
bool  l_consA,
bool  l_turb 
)
55 {
56  if (l_consA && l_turb) {
57  rhoAlpha_lo = cell_data(i,j,k-1,Rho_comp) * mu_eff
58  + mu_turb(i,j,k-1,EddyDiff::Mom_v);
59  rhoAlpha_hi = cell_data(i,j,k ,Rho_comp) * mu_eff
60  + mu_turb(i,j,k ,EddyDiff::Mom_v);
61  }
62  else if (l_turb) // with MolecDiffType::Constant or None
63  {
64  rhoAlpha_lo = mu_eff + mu_turb(i,j,k-1,EddyDiff::Mom_v);
65  rhoAlpha_hi = mu_eff + mu_turb(i,j,k ,EddyDiff::Mom_v);
66  }
67  else if (l_consA) // without an LES/PBL model
68  {
69  rhoAlpha_lo = cell_data(i,j,k-1,Rho_comp) * mu_eff;
70  rhoAlpha_hi = cell_data(i,j,k ,Rho_comp) * mu_eff;
71  }
72  else // with MolecDiffType::Constant or None - without an LES/PBL model
73  {
74  rhoAlpha_lo = mu_eff;
75  rhoAlpha_hi = mu_eff;
76  }
77 }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
bool l_turb
Definition: ERF_SetupVertDiff.H:8
bool l_consA
Definition: ERF_SetupVertDiff.H:7
@ Mom_v
Definition: ERF_IndexDefines.H:175

◆ getRhoAlphaForFaces() [2/2]

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void getRhoAlphaForFaces ( int  i,
int  j,
int  k,
int  ioff,
int  joff,
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  mu_eff,
bool  l_consA,
bool  l_turb 
)
11 {
12  if (l_consA && l_turb) {
13  rhoAlpha_lo = 0.25 * ( cell_data(i,j,k ,Rho_comp ) + cell_data(i-ioff,j-joff,k ,Rho_comp )
14  + cell_data(i,j,k-1,Rho_comp ) + cell_data(i-ioff,j-joff,k-1,Rho_comp ) ) * mu_eff
15  + 0.25 * ( mu_turb(i,j,k ,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k ,EddyDiff::Mom_v)
16  + mu_turb(i,j,k-1,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k-1,EddyDiff::Mom_v) );
17  rhoAlpha_hi = 0.25 * ( cell_data(i,j,k ,Rho_comp ) + cell_data(i-ioff,j-joff,k ,Rho_comp )
18  + cell_data(i,j,k+1,Rho_comp ) + cell_data(i-ioff,j-joff,k+1,Rho_comp ) ) * mu_eff
19  + 0.25 * ( mu_turb(i,j,k ,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k ,EddyDiff::Mom_v)
20  + mu_turb(i,j,k+1,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k+1,EddyDiff::Mom_v) );
21  }
22  else if (l_turb) // with MolecDiffType::Constant or None
23  {
24  rhoAlpha_lo = mu_eff
25  + 0.25 * ( mu_turb(i,j,k ,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k ,EddyDiff::Mom_v)
26  + mu_turb(i,j,k-1,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k-1,EddyDiff::Mom_v) );
27  rhoAlpha_hi = mu_eff
28  + 0.25 * ( mu_turb(i,j,k ,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k ,EddyDiff::Mom_v)
29  + mu_turb(i,j,k+1,EddyDiff::Mom_v) + mu_turb(i-ioff,j-joff,k+1,EddyDiff::Mom_v) );
30  }
31  else if (l_consA) // without an LES/PBL model
32  {
33  rhoAlpha_lo = 0.25 * ( cell_data(i,j,k ,Rho_comp ) + cell_data(i-ioff,j-joff,k ,Rho_comp )
34  + cell_data(i,j,k-1,Rho_comp ) + cell_data(i-ioff,j-joff,k-1,Rho_comp ) ) * mu_eff;
35  rhoAlpha_hi = 0.25 * ( cell_data(i,j,k ,Rho_comp ) + cell_data(i-ioff,j-joff,k ,Rho_comp )
36  + cell_data(i,j,k+1,Rho_comp ) + cell_data(i-ioff,j-joff,k+1,Rho_comp ) ) * mu_eff;
37  }
38  else // with MolecDiffType::Constant or None - without an LES/PBL model
39  {
40  rhoAlpha_lo = mu_eff;
41  rhoAlpha_hi = mu_eff;
42  }
43 }

Referenced by ImplicitDiffForMom_N(), ImplicitDiffForMom_S(), and ImplicitDiffForMom_T().

Here is the caller graph for this function: