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
2186  {
2187  mdata.Cd = m_Cd;
2188  mdata.Ch = m_Ch;
2189  mdata.Cq = m_Cq;
2190  }
most_data mdata
Definition: ERF_MOSTStress.H:2301
amrex::Real Ch
Definition: ERF_MOSTStress.H:30
amrex::Real Cd
Definition: ERF_MOSTStress.H:29
amrex::Real Cq
Definition: ERF_MOSTStress.H:31

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
2206  {
2207  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2208  amrex::Real qv = cons_arr(i,j,k,RhoQ1_comp)/cons_arr(i,j,k,Rho_comp);
2209  amrex::Real qvsurf = q_surf_arr(i,j,k);
2210  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2211  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2212  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2213 
2214  // NOTE: this is rho*<q'w'> = -K dqdz
2215  amrex::Real moflux = rho * mdata.Cq * wsp * (qvsurf - qv);
2216 
2217  return moflux;
2218  }
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ rho
Definition: ERF_Kessler.H:22
@ 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
2234  {
2235  amrex::Real rho = cons_arr(i,j,k,Rho_comp);
2236  amrex::Real th = cons_arr(i,j,k,RhoTheta_comp)/cons_arr(i,j,k,Rho_comp);
2237  amrex::Real thsurf = t_surf_arr(i,j,k);
2238  amrex::Real velx = 0.5 * ( velx_arr(i,j,k) + velx_arr(i+1,j ,k) );
2239  amrex::Real vely = 0.5 * ( vely_arr(i,j,k) + vely_arr(i ,j+1,k) );
2240  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2241 
2242  // NOTE: this is rho*<T'w'> = -K dTdz
2243  amrex::Real moflux = rho * mdata.Ch * wsp * (thsurf - th);
2244 
2245  return moflux;
2246  }
#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
2260  {
2261  amrex::Real rho = 0.5 * ( cons_arr(i-1,j,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2262  amrex::Real velx = velx_arr(i,j,k);
2263  amrex::Real vely = 0.25 * ( vely_arr(i ,j,k) + vely_arr(i ,j+1,k)
2264  + vely_arr(i-1,j,k) + vely_arr(i-1,j+1,k) );
2265  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2266 
2267  // NOTE: this is rho*<u'w'> = -K dudz
2268  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by u/wsp to get tau_13
2269  amrex::Real stressx = -rho * mdata.Cd * wsp * velx;
2270 
2271  return stressx;
2272  }

◆ 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
2286  {
2287  amrex::Real rho = 0.5 * ( cons_arr(i,j-1,k,Rho_comp) + cons_arr(i,j,k,Rho_comp) );
2288  amrex::Real velx = 0.25 * ( velx_arr(i,j ,k) + velx_arr(i+1,j ,k)
2289  + velx_arr(i,j-1,k) + velx_arr(i+1,j-1,k) );
2290  amrex::Real vely = vely_arr(i,j,k);
2291  amrex::Real wsp = sqrt(velx*velx+vely*vely);
2292 
2293  // NOTE: this is rho*<v'w'> = -K dvdz
2294  // NOTE: tau_tot = rho * Cd * wsp^2, multiply by v/wsp to get tau_13
2295  amrex::Real stressy = -rho * mdata.Cd * wsp * vely;
2296 
2297  return stressy;
2298  }

Member Data Documentation

◆ mdata

most_data bulk_coeff_flux::mdata
private

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