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

#include <ERF_MOSTStress.H>

Collaboration diagram for bulk_coeff_flux:

Public Member Functions

 bulk_coeff_flux (amrex::Real m_Cd, amrex::Real m_Ch, amrex::Real m_Cq)
 
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 > &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 > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &q_surf_arr) 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 > &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 > &, 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 > &, 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 > &, const amrex::Array4< const amrex::Real > &, const amrex::Array4< const amrex::Real > &) const
 

Private Attributes

most_data mdata
 

Detailed Description

Bulk coefficient flux formulation

Constructor & Destructor Documentation

◆ bulk_coeff_flux()

bulk_coeff_flux::bulk_coeff_flux ( amrex::Real  m_Cd,
amrex::Real  m_Ch,
amrex::Real  m_Cq 
)
inline
2205  {
2206  mdata.Cd = m_Cd;
2207  mdata.Ch = m_Ch;
2208  mdata.Cq = m_Cq;
2209  }
most_data mdata
Definition: ERF_MOSTStress.H:2320
amrex::Real Ch
Definition: ERF_MOSTStress.H:29
amrex::Real Cd
Definition: ERF_MOSTStress.H:28
amrex::Real Cq
Definition: ERF_MOSTStress.H:30

Member Function Documentation

◆ compute_q_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &  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 > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  q_surf_arr 
) const
inline
2225  {
2226  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2227  amrex::Real qv = cons_arr(i,j,k,RhoQ1_comp)/cons_arr(i,j,k,Rho_comp);
2228  amrex::Real qvsurf = q_surf_arr(i,j,0);
2229  amrex::Real velx = myhalf * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2230  amrex::Real vely = myhalf * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2231  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2232 
2233  // NOTE: this is rho*<q'w'> = -K dqdz
2234  amrex::Real moflux = rho * mdata.Cq * wsp * (qvsurf - qv);
2235 
2236  return moflux;
2237  }
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:11
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
rho
Definition: ERF_InitCustomPert_Bubble.H:106
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ qv
Definition: ERF_Kessler.H:28

◆ compute_t_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &  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 > &  ,
const amrex::Array4< const amrex::Real > &  ,
const amrex::Array4< const amrex::Real > &  t_surf_arr 
) const
inline
2253  {
2254  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2255  amrex::Real th = cons_arr(i,j,k,RhoTheta_comp)/cons_arr(i,j,k,Rho_comp);
2256  amrex::Real thsurf = t_surf_arr(i,j,0);
2257  amrex::Real velx = myhalf * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2258  amrex::Real vely = myhalf * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2259  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2260 
2261  // NOTE: this is rho*<T'w'> = -K dTdz
2262  amrex::Real moflux = rho * mdata.Ch * wsp * (thsurf - th);
2263 
2264  return moflux;
2265  }
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37

◆ compute_u_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &   
) const
inline
2279  {
2280  amrex::Real rho = myhalf * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2281  amrex::Real velx = velx_arr(i,j,k);
2282  amrex::Real vely = fourth * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2283  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2284  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2285 
2286  // NOTE: this is rho*<u'w'> = -K dudz
2287  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by u/wsp to get tau_13
2288  amrex::Real stressx = -rho * mdata.Cd * wsp * velx;
2289 
2290  return stressx;
2291  }
constexpr amrex::Real fourth
Definition: ERF_Constants.H:12

◆ compute_v_flux()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real bulk_coeff_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 > &   
) const
inline
2305  {
2306  amrex::Real rho = myhalf * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2307  amrex::Real velx = fourth * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2308  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2309  amrex::Real vely = vely_arr(i,j,k);
2310  amrex::Real wsp = std::sqrt(velx*velx+vely*vely);
2311 
2312  // NOTE: this is rho*<v'w'> = -K dvdz
2313  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by v/wsp to get tau_13
2314  amrex::Real stressy = -rho * mdata.Cd * wsp * vely;
2315 
2316  return stressy;
2317  }

Member Data Documentation

◆ mdata

most_data bulk_coeff_flux::mdata
private

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