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

#include <ERF_MOSTStress.H>

Collaboration diagram for custom_flux:

Public Member Functions

 custom_flux (bool specified_rho_surf)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_q_flux (const int &i, const int &j, const int &k, 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 > &q_star_arr, const amrex::Array4< const amrex::Real > &) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_t_flux (const int &i, const int &j, const int &k, 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 > &t_star_arr, const amrex::Array4< const amrex::Real > &) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_u_flux (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, 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 > &u_star_arr) const
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_v_flux (const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &cons_arr, const amrex::Array4< const amrex::Real > &velx_arr, 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 > &u_star_arr) const
 

Private Attributes

const amrex::Real eps = 1e-15
 
const bool fluxes_include_rho {false}
 

Detailed Description

Custom flux formulation

Constructor & Destructor Documentation

◆ custom_flux()

custom_flux::custom_flux ( bool  specified_rho_surf)
inline
2063  : fluxes_include_rho(specified_rho_surf)
2064  {}
const bool fluxes_include_rho
Definition: ERF_MOSTStress.H:2170

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real custom_flux::compute_q_flux ( const int &  i,
const int &  j,
const int &  k,
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 > &  q_star_arr,
const amrex::Array4< const amrex::Real > &   
) const
inline
2080  {
2081  amrex::Real rho = (fluxes_include_rho) ? 1.0 : cons_arr(i,j,k,Rho_comp);
2082  amrex::Real qstar = q_star_arr(i,j,k);
2083 
2084  // NOTE: this is rho*<q'w'> = -K dqdz
2085  amrex::Real moflux = (std::abs(qstar) > eps) ? rho * qstar : 0.0;
2086 
2087  return moflux;
2088  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
@ rho
Definition: ERF_Kessler.H:22
const amrex::Real eps
Definition: ERF_MOSTStress.H:2169

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real custom_flux::compute_t_flux ( const int &  i,
const int &  j,
const int &  k,
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 > &  t_star_arr,
const amrex::Array4< const amrex::Real > &   
) const
inline
2104  {
2105  amrex::Real rho = (fluxes_include_rho) ? 1.0 : cons_arr(i,j,k,Rho_comp);
2106  amrex::Real tstar = t_star_arr(i,j,k);
2107 
2108  // NOTE: this is rho*<T'w'> = -K dTdz
2109  amrex::Real moflux = (std::abs(tstar) > eps) ? rho * tstar : 0.0;
2110 
2111  return moflux;
2112  }

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real custom_flux::compute_u_flux ( const int &  i,
const int &  j,
const int &  k,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
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 > &  u_star_arr 
) const
inline
2126  {
2127  amrex::Real velx = velx_arr(i,j,k);
2128  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2129  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2130  amrex::Real rho = (fluxes_include_rho) ? 1.0 : 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2131 
2132  amrex::Real ustar = 0.5 * ( u_star_arr(i-1,j,k) + u_star_arr(i,j,k) );
2133  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2134 
2135  // NOTE: this is rho*<u'w'> = -K dudz
2136  amrex::Real stressx = -rho * ustar * ustar * velx / wsp;
2137 
2138  return stressx;
2139  }

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real custom_flux::compute_v_flux ( const int &  i,
const int &  j,
const int &  k,
const amrex::Array4< const amrex::Real > &  cons_arr,
const amrex::Array4< const amrex::Real > &  velx_arr,
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 > &  u_star_arr 
) const
inline
2153  {
2154  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2155  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2156  amrex::Real vely = vely_arr(i,j,k);
2157  amrex::Real rho = (fluxes_include_rho) ? 1.0 : 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2158 
2159  amrex::Real ustar = 0.5 * ( u_star_arr(i,j-1,k) + u_star_arr(i,j,k) );
2160  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2161 
2162  // NOTE: this is rho*<v'w'> = -K dvdz
2163  amrex::Real stressy = -rho * ustar * ustar * vely / wsp;
2164 
2165  return stressy;
2166  }

Member Data Documentation

◆ eps

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

Referenced by compute_q_flux(), and compute_t_flux().

◆ fluxes_include_rho

const bool custom_flux::fluxes_include_rho {false}
private

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