ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
donelan_flux Struct Reference

#include <ERF_MOSTStress.H>

Public Member Functions

 donelan_flux ()
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real compute_q_flux (const int &, const int &, const int &, 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< 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 > &umm_arr, const amrex::Array4< const amrex::Real > &tm_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &t_surf_arr) 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 > &umm_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &) 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 > &umm_arr, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &) const
 

Detailed Description

Donelan flux formulation

Constructor & Destructor Documentation

◆ donelan_flux()

donelan_flux::donelan_flux ( )
inline
1964 {}

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_flux::compute_q_flux ( const int &  ,
const int &  ,
const int &  ,
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< const amrex::Real > &   
) const
inline
1980  {
1981  // NOTE: this is rho*<q'w'> = -K dqdz
1982  amrex::Real moflux = zero;
1983 
1984  return moflux;
1985  }
constexpr amrex::Real zero
Definition: ERF_Constants.H:6
amrex::Real Real
Definition: ERF_ShocInterface.H:19

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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 > &  umm_arr,
const amrex::Array4< const amrex::Real > &  tm_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  t_surf_arr 
) const
inline
2001  {
2002  amrex::Real Ch = amrex::Real(0.0012);
2003  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2004 
2005  amrex::Real theta_surf = t_surf_arr(i,j,0);
2006  amrex::Real theta_mean = tm_arr(i,j,0);
2007  amrex::Real wsp_mean = umm_arr(i,j,0);
2008 
2009  // NOTE: this is rho*<T'w'> = -K dTdz
2010  amrex::Real moflux = -rho * Ch * wsp_mean * (theta_mean - theta_surf);
2011 
2012  return moflux;
2013  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
rho
Definition: ERF_InitCustomPert_Bubble.H:106

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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 > &  umm_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &   
) const
inline
2027  {
2028  amrex::Real velx = velx_arr(i,j,k);
2029  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2030  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2031  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2032 
2033  amrex::Real Cd = amrex::Real(0.001);
2034  const amrex::Real c = amrex::Real(7e-5);
2035  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2036  amrex::Real wsp_mean = myhalf * ( umm_arr(i-1,j,0) + umm_arr(i,j,0) );
2037  if (wsp_mean <= amrex::Real(5.0)) {
2038  Cd = amrex::Real(0.001);
2039  } else if (wsp_mean < amrex::Real(25.0) && wsp_mean > amrex::Real(5.0)) {
2040  Cd = amrex::Real(0.001) + c * (wsp_mean - amrex::Real(5.0));
2041  } else {
2042  Cd = amrex::Real(0.0024);
2043  }
2044 
2045  // NOTE: this is rho*<u'w'> = -K dudz
2046  amrex::Real stressx = -rho * Cd * velx * wsp;
2047 
2048  return stressx;
2049  }
constexpr amrex::Real fourth
Definition: ERF_Constants.H:12
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real donelan_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 > &  umm_arr,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &   
) const
inline
2063  {
2064  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2065  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2066  amrex::Real vely = vely_arr(i,j,k);
2067  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2068 
2069  amrex::Real Cd = amrex::Real(0.001);
2070  const amrex::Real c = amrex::Real(7e-5);
2071  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2072  amrex::Real wsp_mean = myhalf * ( umm_arr(i,j-1,0) + umm_arr(i,j,0) );
2073  if (wsp_mean <= amrex::Real(5.0)) {
2074  Cd = amrex::Real(0.001);
2075  } else if (wsp_mean < amrex::Real(25.0) && wsp_mean > amrex::Real(5.0)) {
2076  Cd = amrex::Real(0.001) + c * (wsp_mean - amrex::Real(5.0));
2077  } else {
2078  Cd = amrex::Real(0.0024);
2079  }
2080 
2081  // NOTE: this is rho*<v'w'> = -K dvdz
2082  amrex::Real stressy = -rho * Cd * vely * wsp;
2083 
2084  return stressy;
2085  }

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