ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rotate_flux Struct Reference

#include <ERF_MOSTStress.H>

Collaboration diagram for rotate_flux:

Public Member Functions

 rotate_flux (int l_zlo)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_q_flux (const int &i, const int &j, const int &k, const int &n, const int &icomp, const amrex::Real &dz, const amrex::Real &dz1, const bool &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< amrex::Real > &dest_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_t_flux (const int &i, const int &j, const int &k, const int &n, const int &icomp, const amrex::Real &dz, const amrex::Real &dz1, const bool &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &tm_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &t_star_arr, const amrex::Array4< const amrex::Real > &t_surf_arr, const amrex::Array4< amrex::Real > &dest_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_u_flux (const int &i, const int &j, const int &k, const int &icomp, const amrex::Real &dz, const amrex::Real &dz1, const bool &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &u_star_arr, const amrex::Array4< amrex::Real > &dest_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_v_flux (const int &i, const int &j, const int &k, const int &icomp, const amrex::Real &dz, const amrex::Real &dz1, const bool &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &vely_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< amrex::Real > &dest_arr) const
 

Private Attributes

int zlo
 
const amrex::Real eps = 1e-15
 

Detailed Description

Rotate flux formulation

Constructor & Destructor Documentation

◆ rotate_flux()

rotate_flux::rotate_flux ( int  l_zlo)
inline
2108  : zlo(l_zlo) {}
int zlo
Definition: ERF_MOSTStress.H:2267

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rotate_flux::compute_q_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  n,
const int &  icomp,
const amrex::Real &  dz,
const amrex::Real &  dz1,
const bool &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  dest_arr 
) const
inline
2132  {
2133  int ic, jc;
2134  ic = i < lbound(cons_arr).x ? lbound(cons_arr).x : i;
2135  jc = j < lbound(cons_arr).y ? lbound(cons_arr).y : j;
2136  ic = ic > ubound(cons_arr).x ? ubound(cons_arr).x : ic;
2137  jc = jc > ubound(cons_arr).y ? ubound(cons_arr).y : jc;
2138 
2139  // surface gradient equal to gradient at first zface
2140  amrex::Real deltaz = dz * (zlo - k);
2141  amrex::Real rqvgrad = ( cons_arr(ic,jc,zlo+1,RhoQ1_comp)
2142  - cons_arr(ic,jc,zlo ,RhoQ1_comp) ) / (0.5*(dz+dz1));
2143  dest_arr(i,j,k,icomp+n) = cons_arr(ic,jc,zlo,RhoQ1_comp) - rqvgrad * deltaz;
2144 
2145  // NOTE: this is the total stress
2146  amrex::Real rho = cons_arr(ic,jc,zlo,Rho_comp);
2147  amrex::Real qstar = 0.0; //q_star_arr(ic,jc,zlo);
2148  amrex::Real moflux = (std::abs(qstar) > eps) ? -rho * qstar : 0.0;
2149 
2150  return moflux;
2151  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
@ rho
Definition: ERF_Kessler.H:22
const amrex::Real eps
Definition: ERF_MOSTStress.H:2268

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rotate_flux::compute_t_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  n,
const int &  icomp,
const amrex::Real &  dz,
const amrex::Real &  dz1,
const bool &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  tm_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  t_star_arr,
const amrex::Array4< const amrex::Real > &  t_surf_arr,
const amrex::Array4< amrex::Real > &  dest_arr 
) const
inline
2174  {
2175  int ic, jc;
2176  ic = i < lbound(cons_arr).x ? lbound(cons_arr).x : i;
2177  jc = j < lbound(cons_arr).y ? lbound(cons_arr).y : j;
2178  ic = ic > ubound(cons_arr).x ? ubound(cons_arr).x : ic;
2179  jc = jc > ubound(cons_arr).y ? ubound(cons_arr).y : jc;
2180 
2181  // surface gradient equal to gradient at first zface
2182  amrex::Real deltaz = dz * (zlo - k);
2183  amrex::Real rthetagrad = ( cons_arr(ic,jc,zlo+1,RhoTheta_comp)
2184  - cons_arr(ic,jc,zlo ,RhoTheta_comp) ) / (0.5*(dz+dz1));
2185  dest_arr(i,j,k,icomp+n) = cons_arr(ic,jc,zlo,RhoTheta_comp) - rthetagrad * deltaz;
2186 
2187  // NOTE: this is the total stress
2188  amrex::Real theta_mean = tm_arr(ic,jc,zlo);
2189  amrex::Real theta_surf = t_surf_arr(ic,jc,zlo);
2190  amrex::Real rho = cons_arr(ic,jc,zlo,Rho_comp);
2191  amrex::Real tstar = t_star_arr(ic,jc,zlo);
2192  amrex::Real moflux = (std::abs(tstar) > eps) ? -rho * tstar * (theta_mean-theta_surf) : 0.0;
2193 
2194  return moflux;
2195  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rotate_flux::compute_u_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  icomp,
const amrex::Real &  dz,
const amrex::Real &  dz1,
const bool &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  u_star_arr,
const amrex::Array4< amrex::Real > &  dest_arr 
) const
inline
2215  {
2216  int ic, jc;
2217  ic = i < lbound(cons_arr).x+1 ? lbound(cons_arr).x+1 : i;
2218  jc = j < lbound(cons_arr).y ? lbound(cons_arr).y : j;
2219  ic = ic > ubound(cons_arr).x ? ubound(cons_arr).x : ic;
2220  jc = jc > ubound(cons_arr).y ? ubound(cons_arr).y : jc;
2221 
2222  // surface gradient equal to gradient at first zface
2223  amrex::Real deltaz = dz * (zlo - k);
2224  amrex::Real ugrad = (velx_arr(i,j,zlo+1) - velx_arr(i,j,zlo)) / (0.5*(dz+dz1));
2225  dest_arr(i,j,k,icomp) = velx_arr(i,j,zlo) - ugrad * deltaz;
2226 
2227  // NOTE: this is the total stress
2228  amrex::Real rho = 0.5 *( cons_arr(ic-1,jc,zlo,Rho_comp)
2229  + cons_arr(ic ,jc,zlo,Rho_comp) );
2230  amrex::Real ustar = 0.5 * ( u_star_arr(ic-1,jc,zlo) + u_star_arr(ic,jc,zlo) );
2231  amrex::Real stressx = -rho * ustar * ustar;
2232 
2233  return stressx;
2234  }

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real rotate_flux::compute_v_flux ( const int &  i,
const int &  j,
const int &  k,
const int &  icomp,
const amrex::Real &  dz,
const amrex::Real &  dz1,
const bool &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  vely_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< amrex::Real > &  dest_arr 
) const
inline
2254  {
2255  // surface gradient equal to gradient at first zface
2256  amrex::Real deltaz = dz * (zlo - k);
2257  amrex::Real vgrad = (vely_arr(i,j,zlo+1) - vely_arr(i,j,zlo)) / (0.5*(dz+dz1));
2258  dest_arr(i,j,k,icomp) = vely_arr(i,j,zlo) - vgrad * deltaz;
2259 
2260  // NOTE: this is the total stress
2261  amrex::Real stressy = 0.0;
2262 
2263  return stressy;
2264  }

Member Data Documentation

◆ eps

const amrex::Real rotate_flux::eps = 1e-15
private

Referenced by compute_q_flux(), and compute_t_flux().

◆ zlo

int rotate_flux::zlo
private

The documentation for this struct was generated from the following file: