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
1948 {}

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
1964  {
1965  // NOTE: this is rho*<q'w'> = -K dqdz
1966  amrex::Real moflux = zero;
1967 
1968  return moflux;
1969  }
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
1985  {
1986  amrex::Real Ch = amrex::Real(0.0012);
1987  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
1988 
1989  amrex::Real theta_surf = t_surf_arr(i,j,0);
1990  amrex::Real theta_mean = tm_arr(i,j,0);
1991  amrex::Real wsp_mean = umm_arr(i,j,0);
1992 
1993  // NOTE: this is rho*<T'w'> = -K dTdz
1994  amrex::Real moflux = -rho * Ch * wsp_mean * (theta_mean - theta_surf);
1995 
1996  return moflux;
1997  }
#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
2011  {
2012  amrex::Real velx = velx_arr(i,j,k);
2013  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2014  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2015  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2016 
2017  amrex::Real Cd = amrex::Real(0.001);
2018  const amrex::Real c = amrex::Real(7e-5);
2019  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2020  amrex::Real wsp_mean = myhalf * ( umm_arr(i-1,j,0) + umm_arr(i,j,0) );
2021  if (wsp_mean <= amrex::Real(5.0)) {
2022  Cd = amrex::Real(0.001);
2023  } else if (wsp_mean < amrex::Real(25.0) && wsp_mean > amrex::Real(5.0)) {
2024  Cd = amrex::Real(0.001) + c * (wsp_mean - amrex::Real(5.0));
2025  } else {
2026  Cd = amrex::Real(0.0024);
2027  }
2028 
2029  // NOTE: this is rho*<u'w'> = -K dudz
2030  amrex::Real stressx = -rho * Cd * velx * wsp;
2031 
2032  return stressx;
2033  }
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
2047  {
2048  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2049  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2050  amrex::Real vely = vely_arr(i,j,k);
2051  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2052 
2053  amrex::Real Cd = amrex::Real(0.001);
2054  const amrex::Real c = amrex::Real(7e-5);
2055  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2056  amrex::Real wsp_mean = myhalf * ( umm_arr(i,j-1,0) + umm_arr(i,j,0) );
2057  if (wsp_mean <= amrex::Real(5.0)) {
2058  Cd = amrex::Real(0.001);
2059  } else if (wsp_mean < amrex::Real(25.0) && wsp_mean > amrex::Real(5.0)) {
2060  Cd = amrex::Real(0.001) + c * (wsp_mean - amrex::Real(5.0));
2061  } else {
2062  Cd = amrex::Real(0.0024);
2063  }
2064 
2065  // NOTE: this is rho*<v'w'> = -K dvdz
2066  amrex::Real stressy = -rho * Cd * vely * wsp;
2067 
2068  return stressy;
2069  }

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